-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ERC721 standard in both Linear and Pro contracts (#131)
* feat: ERC721 build: install "openzeppelin-contracts" lib feat: inherit "ERC721" in "SablierV2Linear" feat: inherit "ERC721" in "SablierV2Pro" feat: mint NFT in the "_create" function feat: add "isApprovedOrOwner" function feat: change the modifier to "isAuthorizedForStream" feat: add "tokenURI" function perf: remove the recipient address from the "Stream" struct refactor: swap the order of the checks in the "withdrawTo" function test: change the struct recipient with the "users.recipient" test: make recipient the default caller in the "cancel" function test: order correctly the branches in the "cancel" tree test: order correctly the branches in the "cancelAll" tree test: order correctly the branches in the "withdraw" tree test: when the caller is an approved third party in the "cancel" function test: when the caller is an approved third party in the "cancelAll" funtion test: when the caller is an approved third party in the "withdraw" function test: when the caller is an approved third party in the "withdrawAll" function test: when the caller is an approved third party in the "withdrawAllTo" function test: when the caller is an approved third party in the "withdtawTo" function test: when the recipient is no longer the owner of the stream in the "cancel" function test: when the recipient is no longer the owner of the stream in the "withdraw" function test: when the recipient is no longer the owner of the streams in the "cancelAll" function test: when the recipient is no longer the owner of the streams in the "withdrawAll" function test: when the recipient is no longer the owner of the streams in the "withdrawAllTo" function test: when the recipient is no longer the owner of the stream in the "withrawTo" function test: remove the local "withdrawAmount" variable from the test functions test: change the new owner of the streams to "eve" when using "safeTransferFrom" function test: "isApprovedOrOwner" function in the "SablierV2Linear" contract test: "isApprovedOrOwner" function in the "SablierV2Pro" contract test: correct comment about return value for the "isCancelable" function * refactor: inherit from "IERC721" in "ISablierV2" build: upgrade to latest "prb-math" lib chore: add ".solhintignore" file chore: improve wording in comments docs: improve wording in NatSpec refactor: change the ERC-721 name refactor: name return args in "isApprovedOrOwner" and "tokenURI" refactor: refer to "to" as "recipient" refactor: use OpenZeppelin's ERC721 implementation refactor: use "_isApprovedOrOwner" from OpenZeppelin test: add dummy function implementations in "AbstractSablierV2" test: delete "isApprovedOrOwner" tests * fix: use "_ownerOf" ERC721 function build: upgrade to "release-v4.8" of "openzeppelin-contracts" * test: improve wording in testing trees test: add new "operator" user test: add new testing branches for un/authorized test: delete superfluous warps in "withdraw" tests test: move assertions for recipients at the bottom test: refer to approved "third-party" as "operator" test: rename "withdrawAmountZero" to "withdrawAmount" test: refactor "CallerRecipient" to "OriginalRecipient" test: use the new operator user in the "approved operator" tests * refactor: isApprovedOrOwner chore: add visibility keyword in function separators refactor: inherit from ERC721 last test: simplify AbstractSablierV2 contract * chore: remove unnecessary imports * style: order imports chore: remove unnecessary imports * refactor: burn NFT when stream is ended test: update tests to check for burned NFT * refactor: use "safeMint" in the "create" function * test: correct explanatory comment Co-authored-by: Paul Razvan Berg <hello@paulrberg.com>
- Loading branch information
1 parent
3d8e153
commit 36680bb
Showing
39 changed files
with
1,185 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
[submodule "lib/forge-std"] | ||
path = "lib/forge-std" | ||
url = "https://github.com/foundry-rs/forge-std" | ||
[submodule "lib/openzeppelin-contracts"] | ||
branch = "release-v4.8" | ||
path = "lib/openzeppelin-contracts" | ||
url = "https://github.com/OpenZeppelin/openzeppelin-contracts" | ||
[submodule "lib/prb-math"] | ||
branch = "staging" | ||
path = "lib/prb-math" | ||
url = "https://github.com/paulrberg/prb-math" | ||
[submodule "lib/prb-contracts"] | ||
branch = "refactor/foundry" | ||
branch = "main" | ||
path = "lib/prb-contracts" | ||
url = "https://github.com/paulrberg/prb-contracts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# directories | ||
**/lib | ||
**/node_modules |
Submodule forge-std
updated
13 files
+1 −0 | .github/workflows/tests.yml | |
+1 −1 | LICENSE-APACHE | |
+1 −1 | LICENSE-MIT | |
+2 −0 | foundry.toml | |
+16 −0 | package.json | |
+6 −1 | src/Script.sol | |
+118 −0 | src/StdJson.sol | |
+372 −1 | src/Test.sol | |
+91 −4 | src/Vm.sol | |
+8 −0 | src/test/Script.t.sol | |
+19 −16 | src/test/StdAssertions.t.sol | |
+70 −1 | src/test/StdCheats.t.sol | |
+187 −0 | src/test/fixtures/broadcast.log.json |
Submodule openzeppelin-contracts
added at
014ce9
Submodule prb-contracts
updated
71 files
Submodule prb-math
updated
96 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@openzeppelin/contracts=lib/openzeppelin-contracts/contracts/ | ||
@prb/contracts/=lib/prb-contracts/src/ | ||
@prb/math/=lib/prb-math/contracts/ | ||
@prb/math/=lib/prb-math/src/ | ||
@sablier/v2-core/=src/ | ||
forge-std/=lib/forge-std/src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.