-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[r2r] update deps and solc version, add ERC721 and ERC1155 support #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review iteration, few comments/questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more notes 🙂
test/EtomicSwap.js
Outdated
assert.equal(tokenOwnerBeforeReceiverSpend, this.swap.address); | ||
|
||
// Attempt to spend with invalid secret - should fail | ||
await this.swap.receiverSpendErc721(id, zeroAddr, this.erc721token.address, tokenId, accounts[0], { from: accounts[1] }).should.be.rejectedWith(EVMThrow); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zeroAddr
is 20 bytes instead of 32, please use 32 bytes argument for 100% correctness 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added invalidSecretHex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 🔥
^0.5.0
to^0.8.20
Useful links
https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC1155
https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC721
Notes:
there are simple erc721 and erc1155 holders that can be inherited by the EtomicSwap contract, but I decided to keep
onERC1155Received
,onERC1155BatchReceived
,onERC721Received
functions external, as its more gas-efficient.to test changes please follow the setup dev env guide in readme
deps changes
"chai": "^4.1.2"
->"chai": "^4.3.10"
"ganache-cli": "^6.2.5"
->"ganache": "^7.9.1"
"openzeppelin-solidity": "https://github.com/OpenZeppelin/openzeppelin-solidity.git#release-v2.1.0-solc-0.5"
->"@openzeppelin/contracts": "^5.0.0"
"sol-merger": "^0.1.0"
->"sol-merger": "^4.4.0"
"web3": "^1.0.0-beta.27"
->"web3": "^4.2.2"