Skip to content

Commit

Permalink
feat: added tests to check permission
Browse files Browse the repository at this point in the history
  • Loading branch information
web3rover authored and chechu committed Oct 19, 2023
1 parent 5a1b251 commit a3d3317
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions simulations/vip-189/vip-189/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,16 @@ forking(32659660, () => {
let WBNB: ethers.Contract;
let proxyAdmin: ethers.Contract;
let riskFund: ethers.Contract;
let vBNBFallback: ethers.Contract;

before(async () => {
await impersonateAccount(RANDOM_ADDRESS);
await impersonateAccount(NORMAL_TIMELOCK);
const signer = await ethers.getSigner(RANDOM_ADDRESS);
const timelock = await ethers.getSigner(NORMAL_TIMELOCK);

vBNB = new ethers.Contract(vBNB_ADDRESS, vBNB_ABI, provider);
vBNBFallback = new ethers.Contract(VBNBAdmin_ADDRESS, vBNB_ABI, timelock);
psr = new ethers.Contract(PSR, PSR_ABI, signer);
vBNBAdmin = new ethers.Contract(VBNBAdmin_ADDRESS, vBNBAdmin_ABI, signer);
WBNB = new ethers.Contract(WBNB_ADDRESS, ERC20_ABI, provider);
Expand Down Expand Up @@ -167,5 +171,16 @@ forking(32659660, () => {

expect(await proxyAdmin.owner()).to.be.equal(NORMAL_TIMELOCK);
});

it("check permissions", async () => {
expect(await vBNB.reserveFactorMantissa()).to.be.equal("250000000000000000");
expect(await vBNB.pendingAdmin()).to.be.equal("0x0000000000000000000000000000000000000000");

await vBNBFallback._setReserveFactor(100);
await vBNBFallback._setPendingAdmin(NORMAL_TIMELOCK);

expect(await vBNB.reserveFactorMantissa()).to.be.equal(100);
expect(await vBNB.pendingAdmin()).to.be.equal(NORMAL_TIMELOCK);
});
});
});

0 comments on commit a3d3317

Please sign in to comment.