diff --git a/contract-examples/test/contract_deployer_allow_list.ts b/contract-examples/test/contract_deployer_allow_list.ts index 2a0dc400fa..aa5d6012da 100644 --- a/contract-examples/test/contract_deployer_allow_list.ts +++ b/contract-examples/test/contract_deployer_allow_list.ts @@ -42,11 +42,6 @@ describe("ExampleDeployerList", function () { }); - it("should add contract deployer as owner", async function () { - const contractOwnerAddr: string = await contract.owner() - expect(owner.address).to.equal(contractOwnerAddr) - }); - it("precompile should see owner address has admin role", async function () { // test precompile first const allowList = await ethers.getContractAt("IAllowList", ALLOWLIST_ADDRESS, owner); @@ -85,31 +80,6 @@ describe("ExampleDeployerList", function () { expect.fail("should have errored") }); - it("should not allow deployer to enable itself", async function () { - try { - await contract.connect(deployer).addDeployer(deployer.address); - } - catch (err) { - return - } - expect.fail("should have errored") - }); - - it("should not allow admin to enable deployer without enabling contract", async function () { - const allowList = await ethers.getContractAt("IAllowList", ALLOWLIST_ADDRESS, owner); - let role = await allowList.readAllowList(contract.address); - expect(role).to.be.equal(ROLES.NONE) - const result = await contract.isEnabled(contract.address); - expect(result).to.be.false - try { - await contract.addDeployer(deployer.address); - } - catch (err) { - return - } - expect.fail("should have errored") - }); - it("should allow admin to add contract as admin", async function () { const allowList = await ethers.getContractAt("IAllowList", ALLOWLIST_ADDRESS, owner); let role = await allowList.readAllowList(contract.address); @@ -137,39 +107,6 @@ describe("ExampleDeployerList", function () { expect(token.address).not.null }); - it("should not let deployer add another deployer", async function () { - try { - const signers: SignerWithAddress[] = await ethers.getSigners() - const testAddress = signers.slice(-2)[0] - await contract.connect(deployer).addDeployer(testAddress.address); - } - catch (err) { - return - } - expect.fail("should have errored") - }); - - it("should not let deployer to revoke admin", async function () { - try { - await contract.connect(deployer).revoke(owner.address); - } - catch (err) { - return - } - expect.fail("should have errored") - }); - - - it("should not let deployer to revoke itself", async function () { - try { - await contract.connect(deployer).revoke(deployer.address); - } - catch (err) { - return - } - expect.fail("should have errored") - }); - it("should let admin to revoke deployer", async function () { let tx = await contract.revoke(deployer.address); await tx.wait() @@ -177,15 +114,4 @@ describe("ExampleDeployerList", function () { let noRole = await allowList.readAllowList(deployer.address); expect(noRole).to.be.equal(ROLES.NONE) }); - - - it("should not let admin to revoke itself", async function () { - try { - await contract.revoke(owner.address); - } - catch (err) { - return - } - expect.fail("should have errored") - }); }) diff --git a/contract-examples/test/contract_native_minter.ts b/contract-examples/test/contract_native_minter.ts index 20fe3fb063..34767eb83c 100644 --- a/contract-examples/test/contract_native_minter.ts +++ b/contract-examples/test/contract_native_minter.ts @@ -53,11 +53,6 @@ describe("ERC20NativeMinter", function () { }) }); - it("should add contract deployer as owner", async function () { - const contractOwnerAddr: string = await contract.owner() - expect(owner.address).to.equal(contractOwnerAddr) - }); - // this contract is not given minter permission yet, so should not mintdraw it("contract should not be able to mintdraw", async function () { const minterList = await ethers.getContractAt("INativeMinter", MINT_PRECOMPILE_ADDRESS, owner); diff --git a/contract-examples/test/reward_manager.ts b/contract-examples/test/reward_manager.ts index d2d51d0967..eafb0a8532 100644 --- a/contract-examples/test/reward_manager.ts +++ b/contract-examples/test/reward_manager.ts @@ -50,11 +50,6 @@ describe("ExampleRewardManager", function () { await tx.wait() }); - it("should add contract deployer as owner", async function () { - const contractOwnerAddr: string = await contract.owner() - expect(owner.address).to.equal(contractOwnerAddr) - }); - // this contract is not selected as the reward address yet, so should not be able to receive fees it("should send fees to blackhole", async function () { let rewardAddress = await contract.currentRewardAddress(); @@ -119,28 +114,6 @@ describe("ExampleRewardManager", function () { expect(balance.gt(previousBalance)).to.be.true }) - it("signer1 should be appointed as reward address", async function () { - let tx = await contract.setRewardAddress(signer1.address); - await tx.wait() - let rewardAddress = await contract.currentRewardAddress(); - expect(rewardAddress).to.be.equal(signer1.address) - }); - - it("signer1 should be able to receive fees", async function () { - let previousBalance = await ethers.provider.getBalance(signer1.address) - - // Send a transaction to mine a new block - const tx = await owner.sendTransaction({ - to: signer2.address, - value: ethers.utils.parseEther("0.0001") - }) - await tx.wait() - - let balance = await ethers.provider.getBalance(signer1.address) - expect(balance.gt(previousBalance)).to.be.true - }) - - it("should return false for allowFeeRecipients check", async function () { let res = await contract.areFeeRecipientsAllowed(); expect(res).to.be.false diff --git a/contract-examples/test/tx_allow_list.ts b/contract-examples/test/tx_allow_list.ts index 4fdb5ad221..6206d7c9d3 100644 --- a/contract-examples/test/tx_allow_list.ts +++ b/contract-examples/test/tx_allow_list.ts @@ -92,16 +92,6 @@ describe("ExampleTxAllowList", function () { }) it("should not allow noRole to enable itself", async function () { - try { - await contract.connect(noRole).addDeployer(noRole.address) - } - catch (err) { - return - } - expect.fail("should have errored") - }) - - it("should not allow admin to enable noRole without enabling contract", async function () { const allowList = await ethers.getContractAt("IAllowList", TX_ALLOW_LIST_ADDRESS, admin) let role = await allowList.readAllowList(contract.address) expect(role).to.be.equal(ROLES.NONE) @@ -167,17 +157,6 @@ describe("ExampleTxAllowList", function () { expect.fail("should have errored") }) - - it("should not let allowed to revoke itself", async function () { - try { - await contract.connect(allowed).revoke(allowed.address) - } - catch (err) { - return - } - expect.fail("should have errored") - }) - it("should let admin to revoke allowed", async function () { let tx = await contract.revoke(allowed.address) await tx.wait() @@ -185,15 +164,4 @@ describe("ExampleTxAllowList", function () { let noRole = await allowList.readAllowList(allowed.address) expect(noRole).to.be.equal(ROLES.NONE) }) - - - it("should not let admin to revoke itself", async function () { - try { - await contract.revoke(admin.address) - } - catch (err) { - return - } - expect.fail("should have errored") - }) })