Skip to content

Commit

Permalink
Add support for SBTs(#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbrg authored Aug 20, 2023
1 parent 5ad6136 commit f735882
Showing 1 changed file with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions test/Gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe("Gov", function () {
const erc1155Mock = await ERC1155Mock.deploy();
await erc1155Mock.safeTransferFrom(deployer.address, gov.address, 1, 1, "0x")

return { gov, nft, deployer, alice, bob, francis, erc20Mock, erc721Mock, erc1155Mock, signers, amount, quorum }
return { gov, nft, deployer, alice, bob, francis, erc20Mock, erc721Mock, erc1155Mock, signers, amount, quorum, firstMembers }
}

describe("Deployment", function () {
Expand Down Expand Up @@ -711,40 +711,8 @@ describe("Gov", function () {

})
it("Should not transfer the membership NFT", async function () {
const { gov, nft, alice, francis, bob, erc721Mock } = await loadFixture(deployContracts);

expect (await nft.ownerOf(0)).to.be.equal(alice.address)
// await nft.connect(alice).transferFrom(alice.address, bob.address, 0)
// // expect (nft.connect(alice).transferFrom(alice.address, bob.address, 0)).to.be.revertedWith("Token not transferable")

// return
const erc721Transfer = erc721Mock.interface.encodeFunctionData('transferFrom', [gov.address, francis.address, 1])
const calldatas = [erc721Transfer.toString()]


const PROPOSAL_DESCRIPTION = ""
const targets = [erc721Mock.address]
const values = ["0"]
const propose = await gov.connect(alice).propose(
targets,
values,
calldatas,
PROPOSAL_DESCRIPTION
)
const proposeReceipt = await propose.wait(1)
const proposalId = proposeReceipt.events![0].args!.proposalId.toString()
await moveBlocks(2)
await gov.connect(alice).castVote(proposalId,1)
await gov.connect(bob).castVote(proposalId,1)
await moveBlocks(300)
const desc = ethers.utils.id(PROPOSAL_DESCRIPTION)
await gov.execute(
targets,
values,
calldatas,
desc
)
expect(await erc721Mock.ownerOf(1)).to.equal(francis.address);
const { nft, alice, bob } = await loadFixture(deployContracts);
await expect(nft.transferFrom(bob.address, alice.address, 1)).to.be.revertedWith("ERC721: caller is not token owner or approved")
});
})
})

0 comments on commit f735882

Please sign in to comment.