Compare commits

...

1431 Commits

Author SHA1 Message Date
37991642dc nightly 2023-03-01 00:46:18 +01:00
1038b7f2c7 wip GovernorPreventLateQuorum 2023-02-28 23:33:12 +01:00
7dc201fce9 fix some specs 2023-02-28 22:57:43 +01:00
bf73fb4013 fix GovernorPreventLateQuorum.spec 2023-02-28 18:35:03 +01:00
6c4ffe783f cleanup accesscontrol specs 2023-02-28 17:12:15 +01:00
f21f86c3c1 fixing certora/specs/GovernorCountingSimple.spec 2023-02-28 16:09:35 +01:00
2e7bca424a cleanup GovernorBase.spec 2023-02-28 14:05:30 +01:00
d4e9d8d54d fix error in one of the governor rules 2023-02-28 12:18:04 +01:00
baf71582b9 improve helperFunctionsWithRevert 2023-02-28 11:10:36 +01:00
ecebc5688d add --optimistic_hashing to governor scripts 2023-02-28 09:55:41 +01:00
3c58e4e3d3 isOperationReady NOT envfree 2023-02-27 17:21:06 +01:00
4242fdace4 isOperationReady envfree 2023-02-27 16:19:18 +01:00
14b40eddcb add --optimistic_hashing 2023-02-27 15:25:04 +01:00
c8c8ca39d7 cleanup 2023-02-27 15:19:07 +01:00
150edce57b fix timelockcontroller 2023-02-27 15:13:25 +01:00
9f2d511d20 fix2 2023-02-27 14:01:59 +01:00
b50d9980be fix 2023-02-27 13:48:48 +01:00
423a808748 fix harness 2023-02-27 11:59:16 +01:00
5c859049e6 latest compiler 2023-02-27 11:18:16 +01:00
cad49af31e minimize diff 2023-02-27 11:02:36 +01:00
e0fa84a6b7 Merge branch 'master' into formal-verification 2023-02-27 11:00:16 +01:00
dad73159df Add AccessControlDefaultAdminRules (#4009)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <fg@frang.io>
2023-02-24 21:48:08 +00:00
2c69f9f9f5 Fix comment on ERC777._beforeTokenTransfer (#3982) 2023-02-24 18:31:54 -03:00
3f3774c5df Improve ERC1363 documentation (#3993)
Co-authored-by: Francisco <fg@frang.io>
2023-02-24 18:28:37 -03:00
8b47e96af1 Add SafeERC20.forceApprove() (#4067) 2023-02-24 20:29:49 +00:00
0fbd039554 Update lockfile (#4018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-24 17:14:21 -03:00
2c6ef8c875 Fix ERC1363 interfaceId (#4074) 2023-02-24 16:14:49 -03:00
eb38c059d8 Add comment on unchecked arithmetic (division by zero) in Math.sol (#4050)
Co-authored-by: Francisco <fg@frang.io>
2023-02-24 18:34:03 +00:00
8a43ebac28 Document "duplicate" proposal storing in GovernorCompatibilityBravo (#4073)
Co-authored-by: Francisco <fg@frang.io>
2023-02-24 13:48:55 -03:00
b4d765b130 Allow return data length >= 32 in SignatureChecker (#4038)
Co-authored-by: Francisco Giordano <fg@frang.io>
2023-02-24 15:05:46 +00:00
d5581531de Add a "fees" section to the ERC4626 guide (#4054)
Co-authored-by: Francisco Giordano <fg@frang.io>
2023-02-24 11:49:10 -03:00
62dbb1b06a Document clock modes for token and governor (#4058)
Co-authored-by: Francisco <fg@frang.io>
2023-02-24 11:48:30 -03:00
6e88df28cb Mark ERC777 and ERC1820 as deprecated (#4066) 2023-02-23 20:06:22 -03:00
a6b8366980 Improve ERC4626 event coverage (#4072) 2023-02-23 17:06:47 -03:00
9d06a1b64b Remove unused Solhint overrides (#4069) 2023-02-23 12:52:10 +01:00
7b3e7b7055 Re-enable ERC4626 property test on empty vaults (#4068) 2023-02-22 15:23:06 -03:00
53235263a3 Implement 0x00 version of EIP-191 in ECDSA Library (#4063) 2023-02-22 15:22:50 +01:00
adb861fb3b Change Governor.cancel to receive all parameters (#4056) 2023-02-22 10:00:41 +01:00
227473e88c Fix comment in ERC4626 on decimals default (#4060)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2023-02-21 19:27:34 -03:00
df814dd374 Update crytic/slither-action action to v0.3.0 (#4064)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-21 19:26:14 -03:00
1e245aa54b Add isValidERC1271SignatureNow to SignatureChecker library (#3932)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <fg@frang.io>
2023-02-21 15:16:44 +00:00
815bfbf383 Deprecate the timers library (#4062)
Co-authored-by: Francisco <fg@frang.io>
2023-02-21 11:18:50 -03:00
7ac4349710 Delete no longer needed .gitattributes file 2023-02-17 21:55:42 -03:00
08d085f2c9 Fix ERC4906 compliance of ERC721URIStorage (#4055)
Co-authored-by: Francisco <fg@frang.io>
2023-02-17 13:43:23 -03:00
96a2297e15 Add IERC4906 interface and use in ERC721 (#4012)
Co-authored-by: Francisco Giordano <fg@frang.io>
2023-02-17 09:26:10 +00:00
d64d7aa5d1 ERC4626 inflation attack mitigation (#3979)
Co-authored-by: Francisco <fg@frang.io>
2023-02-17 10:08:31 +01:00
d5d9d4bd3d Simplify ERC721Wrapper.depositFor to save gas (#4048) 2023-02-16 23:35:43 -03:00
5e76b26225 Add Subgraphs to docs sidebar 2023-02-16 14:34:17 -03:00
4ff538af58 Fix flaky timestamp tests (#4046) 2023-02-15 19:16:22 -03:00
4e8aa43a90 Add publishing integrity check after releasing (#4045)
Co-authored-by: Francisco <fg@frang.io>
2023-02-15 18:21:29 -03:00
6d18435098 Add RELEASING.md docs (#3981)
Co-authored-by: Francisco Giordano <fg@frang.io>
2023-02-14 20:03:37 -03:00
2c711d0b05 Restrict ERC721Wrapper wrap by direct transfer (#4043)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2023-02-14 17:47:07 -03:00
5a00628ed3 Update getsentry/action-github-app-token action to v2 (#4036)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-10 15:21:45 -03:00
dfcc1d16c5 Bump http-cache-semantics from 4.1.0 to 4.1.1 (#4024)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-09 18:42:08 -03:00
6259e13a0c Improve ERC721 Wrapper tests (#4039) 2023-02-09 22:36:14 +01:00
790cc5b65a Add timestamp based governor with EIP-6372 and EIP-5805 (#3934)
Co-authored-by: Francisco Giordano <fg@frang.io>
Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
2023-02-09 22:33:55 +01:00
94cd8ef12e Add ERC721 Wrapper (#3863)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2023-02-09 13:43:34 -06:00
5b027e517e Add missing await in tests (#4037) 2023-02-08 21:03:27 +00:00
d625cb45ea Include EIP-5267 discovery in EIP-712 (#3969)
Co-authored-by: Francisco <frangio.1@gmail.com>
Co-authored-by: Francisco <fg@frang.io>
2023-02-08 15:53:57 +01:00
8177c4620e Improve gas efficiency in ECDSA (#3853)
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Pascal Marco Caversaccio <pcaversaccio@users.noreply.github.com>
2023-02-07 22:18:33 -03:00
4d3e423443 Make ERC20Wrapper.underlying variable private (#4029)
Co-authored-by: Kimani Kelly <kimanikelly@Kimanis-MacBook-Pro.local>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2023-02-07 22:16:36 -03:00
95027565c4 Improve release-cycle.yml error reporting (#4034) 2023-02-07 22:15:24 -03:00
1575cc6908 Update Tally screenshots (#4030) 2023-02-06 12:20:12 -03:00
260e082ed1 Add a library for handling short strings in a gas efficient way (#4023)
Co-authored-by: Francisco <frangio.1@gmail.com>
2023-02-06 09:59:25 +01:00
3b591a48ac Add storageLayout to outputSelection 2023-02-03 21:15:59 -03:00
d13ec90f37 Add warning for supportsERC165InterfaceUnchecked edge case (#4017) 2023-02-03 16:15:41 -03:00
132e5aa97b Add IERC5313.sol (#4013)
Co-authored-by: Ernesto García <ernestognw@gmail.com>
2023-02-03 15:57:47 -03:00
740ce2d440 Update renovate.json 2023-02-02 21:08:41 -03:00
91e8d0ba3c Add string and bytes support to the StorageSlots library (#4008)
Co-authored-by: Francisco <frangio.1@gmail.com>
2023-02-01 18:46:05 -03:00
a70ee4e3bb Check storage layout consistency in PRs (#3967)
Co-authored-by: Francisco <frangio.1@gmail.com>
2023-01-31 17:45:24 -03:00
Mio
501a78e134 Fix typos (#4015) 2023-01-31 14:11:37 +01:00
591c12d22d Remove outdated note about virtual view functions (#4014) 2023-01-30 21:00:56 -03:00
1684c57922 Add ERC*Pausable warning for public pausing mechanism (#4007)
Co-authored-by: Francisco <fg@frang.io>
2023-01-28 20:21:07 -03:00
bc6de21fe2 Create ProposalSalt event for TimelockController (#4001)
Co-authored-by: Francisco <frangio.1@gmail.com>
2023-01-27 15:47:43 -03:00
5e28952cbd Add a public Governor.cancel function (#3983) 2023-01-26 20:46:11 +01:00
0320a718e8 Fix Governance docs reference to blocktime (#3994) 2023-01-26 14:38:34 -03:00
d6fb3d645f Add guidelines for pull requests (#4002) 2023-01-26 14:17:18 -03:00
69c8d1010e Make upgradeTo and upgradeToAndCall public (#3959)
Co-authored-by: Francisco <fg@frang.io>
2023-01-25 16:46:34 -03:00
a284569a7c Rename ERC20ReturnFalseMock copy.sol to ERC20ReturnFalseMock.sol (#4000) 2023-01-25 14:54:51 +01:00
a34dd8bb1b Add solidity language to missing code snippets (#3992) 2023-01-24 18:00:03 -03:00
b1c2c43d6a Lint should not override files (#3988) 2023-01-23 11:30:11 +01:00
c404862cba Use oz-upgrades-unsafe-allow-reachable in ERC1967Upgrade (#3971)
Co-authored-by: Francisco <fg@frang.io>
2023-01-19 22:00:53 +00:00
2a62fb4a2d Improve TransparentUpgradeableProxy's transparency (#3977)
Co-authored-by: Francisco <fg@frang.io>
2023-01-19 18:34:15 -03:00
afcdc58419 Delete tag next once latest is published (#3973)
Co-authored-by: Ernesto García <ernestognw@gmail.com>
2023-01-19 17:21:17 -03:00
dc1ffa79e7 Fix changeset action access to ref branch (#3978)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2023-01-19 16:36:54 -03:00
c8b466b7b5 Disable Foundry for slither-action
(cherry picked from commit 4072e853fe)
2023-01-18 23:31:59 -03:00
5a0863ccf0 Change job titles in release-cycle.yml (#3972) 2023-01-18 23:14:40 -03:00
0c89a8b771 Automate release process via Changesets (#3915)
Co-authored-by: Francisco <fg@frang.io>
2023-01-18 20:34:32 -03:00
f81e5f51c1 Use allow-reachable delegatecall in Multicall (#3970) 2023-01-18 18:07:13 -03:00
74b8ae9372 Annotate Multicall contract (#3961)
Co-authored-by: Francisco <fg@frang.io>
2023-01-18 19:40:35 +00:00
c9bc4f8203 Make Ownable2Step.acceptOwnership virtual (#3960) 2023-01-17 23:57:14 -03:00
88a64a802e Update guidelines and project documentation (#3966)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2023-01-17 23:44:56 -03:00
18691d1a6f Show if event parameter is indexed in docs (#3958)
Co-authored-by: Francisco <frangio.1@gmail.com>
2023-01-16 16:04:03 -03:00
785f65183c Fix wrong PR CHANGELOG link (#3957) 2023-01-13 17:23:05 -03:00
a5af0adce4 Ignore reentrancy inexecuteBatch and update Slither config (#3955)
Co-authored-by: Francisco <fg@frang.io>
2023-01-13 17:29:53 +00:00
d89e51ac42 Use actionlint on GitHub Actions workflows (#3953) 2023-01-13 11:05:13 -03:00
717fbc45cb Add docs on non-stability of internal function use (#3952) 2023-01-13 11:17:38 +01:00
ac30219a6a Add explicit permissions to docs workflow 2023-01-12 20:55:53 -03:00
42fab12584 Remove unnecessary CI cache 2023-01-12 17:43:54 -03:00
6b17b33430 Use a staticcall to fetch ERC20.decimals in ERC4626 (#3943)
Co-authored-by: Francisco <frangio.1@gmail.com>
2023-01-12 12:33:15 -03:00
5dbde1a5c9 Fix governance tutorial contract (#3948)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2023-01-12 10:43:29 -03:00
86de1e8b6c Pin Slither to 0.9.1 (#3949) 2023-01-12 09:50:06 +01:00
d59306bd06 Improve ERC20.decimals documentation (#3933) 2023-01-06 14:09:02 +01:00
a28aafdc85 Use Prettier for JS files (#3913)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2023-01-04 15:03:40 +01:00
88754d0b36 Add keys() accessor to EnumerableMaps (#3920)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2023-01-03 22:25:37 +01:00
2fc24fc8d4 Rename param to match the interface (#3917) 2023-01-03 12:30:51 -03:00
3a3c87b1a6 Fix docs for Math.log256 (#3916) 2023-01-03 11:52:53 -03:00
c1d9da4052 Use hardhat-exposed to reduce the need for mocks (#3666)
Co-authored-by: Francisco <fg@frang.io>
2023-01-03 14:38:13 +00:00
a81b0d0b21 Use unchecked in MerkleProof.processMultiProof (#3869)
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Co-authored-by: Francisco <fg@frang.io>
2023-01-02 22:04:49 -03:00
276b32a5ec Update lockfile (#3909)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-02 21:42:08 +00:00
4fc19ddb8d Add label to Renovate PRs 2023-01-02 18:03:24 -03:00
0892f877b8 Fix base for Renovate config 2023-01-02 17:45:42 -03:00
a4596cab05 Add warning on SELFDESTRUCT usage with isContract (#3875)
Co-authored-by: Francisco <fg@frang.io>
2022-12-30 22:00:53 +00:00
ccc175a9ed Add /out to .gitignore (#3908) 2022-12-30 16:51:22 -03:00
2336bd3e8e Simplify ESLint config (#3903) 2022-12-29 17:08:12 -03:00
cc27aed391 Improve Strings equal tests (#3902)
Co-authored-by: Francisco <fg@frang.io>
2022-12-29 19:11:15 +00:00
bc50d373e3 Rename approved parameter in IERC721 (#3900)
Co-authored-by: Francisco <fg@frang.io>
2022-12-28 23:32:50 +00:00
b0db207e4e Fix typos in testing files (#3899) 2022-12-28 20:16:56 -03:00
cafe5eb985 Update blurb on GovernorVotes compatibility (#3764) 2022-12-28 20:07:29 -03:00
8335676b0e Add Strings.toString for signed integers (#3773)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Gbolahan <89295500+GbolahanAnon@users.noreply.github.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-12-28 22:46:52 +00:00
96ff934ad0 Update forge-std submodule to v1.2.0 (#3885)
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
2022-12-28 19:34:44 -03:00
7a6a9d1516 Add Strings.equal (#3774)
Co-authored-by: Francisco <fg@frang.io>
2022-12-28 18:23:24 -03:00
f799475d93 Fix links to Wizard (#3901) 2022-12-28 17:02:40 -03:00
446cd9f5fb Update lockfile (#3788)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-23 22:56:03 -03:00
b709eae01d Update Prettier Solidity (#3898) 2022-12-23 22:28:05 -03:00
4072e853fe Disable Foundry for slither-action 2022-12-23 17:43:10 -03:00
a3b9fac30e Update lockfileVersion to 2 (#3897) 2022-12-22 21:49:32 -03:00
3f16692dad Update dependency got to 11.8.5 [SECURITY] (#3894)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-22 21:08:26 -03:00
6b0c9f4e77 Revert "Disable Foundry for slither-action" (#3889) 2022-12-19 18:21:00 -03:00
3d7a93876a Improve documentation of Initializable getters (#3861)
Co-authored-by: Ernesto García <ernestognw@gmail.com>
2022-12-07 00:49:15 +00:00
98967feeb2 Disable Foundry for slither-action (#3860) 2022-12-06 11:55:49 -03:00
206a239448 Remove unused variables in tests (#3852) 2022-12-05 17:25:53 -03:00
93cd2ecb73 Improve readability of processMultiProof (#3854)
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
2022-12-05 10:41:44 -03:00
c30fad9955 Add ERC-4626 Upgrade Note (#3849) 2022-12-02 17:10:43 -03:00
88fa71ecd5 Update dependency decode-uri-component to 0.2.1 [SECURITY] (#3845)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-02 12:51:09 -03:00
24d1bb668a Add Ownable2Step to the docs (#3836)
Co-authored-by: Francisco <fg@frang.io>
2022-12-01 10:34:58 -03:00
4e8b2fa659 Add additional conditions when testing ERC4626 roundtrip (#3839) 2022-11-30 15:44:38 -03:00
e04f7ded94 Fixed GPLQ spec, all rules passing (#3822)
Co-authored-by: Michael George <michael@certora.com>
Co-authored-by: Nick Armstrong <nick@certora.com>
Co-authored-by: Michael George <mdgeorge@cs.cornell.edu>
Co-authored-by: Aleksander Kryukov <firealexkryukov@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-11-27 20:41:50 -03:00
8f8fd84f1e Improve some NatSpec and revert reasons (#3809)
Co-authored-by: JulissaDantes <julissadcj@gmail.com>
2022-11-25 12:55:16 -03:00
8c9a831596 Fix whitespace in docs (#3832)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-11-23 12:48:26 -03:00
99589794db Add forgotten await to ERC1155URIStorage beforeEach block. (#3807) 2022-11-16 11:15:58 -03:00
b2970b96e5 Update lockfile 2022-11-10 23:27:54 -03:00
7c5f6bc2c8 Merge branch 'release-v4.8' 2022-11-09 19:23:01 -03:00
49c0e4370d 4.8.0 2022-11-08 11:29:29 -03:00
e0137d4cbe Fix outdated docs about timelock admin (#3806)
(cherry picked from commit 47d4ebb734)
2022-11-07 20:00:49 -03:00
e708b096cf Remove outdated note about hooks from documentation (#3789)
Co-authored-by: Francisco <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
(cherry picked from commit 634710d795)
2022-11-07 20:00:48 -03:00
47d4ebb734 Fix outdated docs about timelock admin (#3806) 2022-11-07 20:00:19 -03:00
634710d795 Remove outdated note about hooks from documentation (#3789)
Co-authored-by: Francisco <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-11-05 15:13:49 -03:00
2c5194f3f1 Clean and fix formal verification (#3798)
Co-authored-by: Michael George <michael@certora.com>
Co-authored-by: Nick Armstrong <nick@certora.com>
Co-authored-by: Michael George <mdgeorge@cs.cornell.edu>
Co-authored-by: Aleksander Kryukov <firealexkryukov@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-11-04 18:07:39 +01:00
c7315e8779 Add ERC4626 standard property tests (#3792)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-11-04 17:56:32 +01:00
0b6becd49f Remove the draft prefix to ERC20Permit (#3793)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-11-04 12:55:55 -03:00
88a3f95715 Optimize condition in _disableInitializers (#3787) 2022-11-03 20:57:56 -03:00
07ac1030e7 chmod -x certora/scripts/**/*.sh 2022-11-03 12:07:39 +01:00
d5ca39e9a2 Rename _isVaultCollateralized to _isVaultHealthy for clarity (#3796) 2022-11-02 11:46:08 -03:00
16fa1834e5 Fix MerkleProof natspec
(cherry picked from commit 7d01facdb8)
2022-11-01 15:22:56 -03:00
7d01facdb8 Fix MerkleProof natspec 2022-11-01 15:22:47 -03:00
8bfcb65924 Update recommendation of JS library for merkle trees
(cherry picked from commit 8d105825e9)
2022-11-01 15:14:20 -03:00
8d105825e9 Update recommendation of JS library for merkle trees 2022-11-01 15:13:50 -03:00
36951d5838 few typo fixes (#3779) 2022-10-26 17:02:57 +02:00
f99bc4e0cf grammar fix (#3782) 2022-10-26 17:02:06 +02:00
25fe191202 Fix comment in ERC721Consecutive (#3778)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-10-25 01:46:51 +00:00
014ce9c6e6 ERC721ConsecutiveEnumerable is no longer unreachable
(cherry picked from commit a1948250ab)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-10-18 14:20:25 +02:00
a1948250ab ERC721ConsecutiveEnumerable is no longer unreachable 2022-10-18 14:13:05 +02:00
1f18fea1de 4.8.0-rc.2 2022-10-17 18:53:40 +02:00
1a41a503e0 Skip deleted file when updating release version in comments
(cherry picked from commit a71caa28e7)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-10-17 18:53:31 +02:00
a71caa28e7 Skip deleted file when updating release version in comments 2022-10-17 18:52:38 +02:00
3742c16948 Refactor consecutive transfer hooks (#3753)
(cherry picked from commit 08d5e4a9b0)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-10-17 18:42:01 +02:00
08d5e4a9b0 Refactor consecutive transfer hooks (#3753) 2022-10-17 17:09:23 +02:00
02722fcc03 Use unchecked in ERC20Votes and fix typo (#3748)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-10-17 17:00:47 +02:00
eb03304b70 Add ReentrancyGuard status getter (#3714)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-10-17 14:43:45 +02:00
c463b8a67e Fix typo in comment (#3765) 2022-10-17 14:42:18 +02:00
4e18cdc186 Update merkle multiproof docs with a caution note
(cherry picked from commit 8d908fe2c2)
2022-10-06 19:13:26 -03:00
8d908fe2c2 Update merkle multiproof docs with a caution note 2022-10-06 19:12:29 -03:00
47003aebec typo fix (#3752) 2022-10-05 17:47:39 -03:00
34e5863cd5 Reduce gas in log256 (#3745) 2022-10-05 17:19:28 -03:00
b7aff6363f Update lockfile (#3746)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-05 16:26:04 -03:00
9a11de924d Update crytic/slither-action action to v0.2.0 (#3751)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-05 16:24:21 -03:00
a73d7ab57b get rid of certora/helpers 2022-10-05 15:30:03 +02:00
89962af163 Fix ERC20Wrapper.spec 2022-10-05 15:23:26 +02:00
7201e6707f Fix typo in a comment (#3747) 2022-10-03 10:06:44 +02:00
561d1061fc Fix typos, improve wording and punctuation. (#3741) 2022-09-30 20:13:19 -03:00
50501a751e Update docs pipeline to solidity-docgen@0.6 (#3707)
(cherry picked from commit c52625018b)
2022-09-30 12:55:21 -03:00
f0de978a9e Improve handling and docs for ERC4626.decimals (#3733)
(cherry picked from commit 14f98dbb58)
2022-09-30 12:55:06 -03:00
16408a1dcf Update Arbitrum's vendored contracts to Nitro (#3692)
Co-authored-by: Francisco <frangio.1@gmail.com>
(cherry picked from commit 9938a85558)
2022-09-30 12:55:01 -03:00
0b3acb286a Recommended improvement to ERC721Consecutive (#3712)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit c22db8104e)
2022-09-30 12:54:56 -03:00
c52625018b Update docs pipeline to solidity-docgen@0.6 (#3707) 2022-09-30 12:52:45 -03:00
c7a544d568 move passing scripts out of noCI 2022-09-29 18:40:14 +02:00
26dddee1c0 Fix typo (#3738) 2022-09-29 00:05:54 +02:00
634c37becf enable ci test for some (passing) rules 2022-09-28 23:49:03 +02:00
14f98dbb58 Improve handling and docs for ERC4626.decimals (#3733) 2022-09-28 15:42:55 -03:00
9938a85558 Update Arbitrum's vendored contracts to Nitro (#3692)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-09-28 14:46:48 -03:00
d986bbc8e0 filter noCI on script listing 2022-09-28 11:02:50 +02:00
fed8d5c856 refactor & improve ERC20 specs 2022-09-28 10:55:39 +02:00
597202d904 finish ERC20 base specs + move all other specs to noCI for the time being 2022-09-27 23:36:58 +02:00
8f6a03204e Start working on ERC20 specs 2022-09-27 21:42:18 +02:00
c22db8104e Recommended improvement to ERC721Consecutive (#3712)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-09-27 16:13:15 -03:00
2a45f99fc4 Bump yargs-parser from 2.4.1 to 20.2.4 (#3726)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-27 12:08:57 -03:00
fb9345814b Remove unnecessary Address library import in SignatureChecker (#3731) 2022-09-27 10:26:17 +02:00
72bbe63ec7 Fix incorrect issue number in CHANGELOG (#3732) 2022-09-27 10:23:23 +02:00
ec88e9d6aa Add support for EOA target in Governor.relay (#3730)
(cherry picked from commit ed12acfb0a)
2022-09-26 15:28:14 -03:00
ed12acfb0a Add support for EOA target in Governor.relay (#3730) 2022-09-26 15:27:33 -03:00
5e8e8bb9f0 Fixes broken link (#3728) 2022-09-25 00:58:09 +02:00
561d0eead3 Add comments to unsafeAccess functions of Arrays library (#3718) 2022-09-23 19:23:32 -03:00
e2362ce74f Add documentation about the security of overrides (#3725) 2022-09-24 00:06:20 +02:00
c08c6e1b84 Add fuzz testing of mulDiv (#3717)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-09-23 18:45:20 -03:00
16791134c1 4.8.0-rc.1 2022-09-23 18:59:29 +02:00
76273ecd8e Change admin role allocation in TimelockControler constructor (#3722)
Co-authored-by: Francisco <frangio.1@gmail.com>
(cherry picked from commit 408055dfab)
2022-09-23 12:28:39 -03:00
d89a62e0a6 Improve ERC20FlashMint documentation (#3719)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
(cherry picked from commit aa4b901788)
2022-09-23 12:28:34 -03:00
089f9b95af Ignore specific warnings and make the rest into errors (#3695)
(cherry picked from commit 046121e080)
2022-09-23 12:28:19 -03:00
8740d8f7f3 Update ReentrancyGuard documentation (#3715)
(cherry picked from commit 06e678d6ef)
2022-09-23 12:28:14 -03:00
09369d265c Improve Initializable docstrings (#3704)
Co-authored-by: tincho <tinchoabbate@noreply.users.github.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit a549ec673e)
2022-09-23 12:28:02 -03:00
1bbdf2005d Update the informational link (#3703)
(cherry picked from commit 76b538c226)
2022-09-23 12:27:56 -03:00
c8a0639afe Update dependency solidity-coverage to ^0.8.0 (#3681)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
(cherry picked from commit d6975f8e07)
2022-09-23 12:27:45 -03:00
3f6c8245aa Update lockfile (#3698)
(cherry picked from commit fac768cd2c)
2022-09-23 12:27:39 -03:00
408055dfab Change admin role allocation in TimelockControler constructor (#3722)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-09-23 16:58:56 +02:00
d916e2edf4 further script cleanup 2022-09-23 12:47:45 +02:00
3075181276 use bash 2022-09-23 11:54:11 +02:00
aa4b901788 Improve ERC20FlashMint documentation (#3719)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-09-23 11:48:39 +02:00
8b1042371a remove some scripts from CI run 2022-09-23 11:43:33 +02:00
8f0d4d4a41 Fix fuzzing coverage (#3716) 2022-09-22 23:13:09 +02:00
046121e080 Ignore specific warnings and make the rest into errors (#3695) 2022-09-22 22:33:13 +02:00
06e678d6ef Update ReentrancyGuard documentation (#3715) 2022-09-22 21:42:52 +02:00
38d21cab86 update scripts 2022-09-22 18:56:59 +02:00
bfbf4d8398 clean applyHarness 2022-09-22 10:47:06 +02:00
49333bcc24 clean applyHarness 2022-09-22 10:44:48 +02:00
3252e54f2b use solc without version & remove send_only 2022-09-21 17:41:13 +02:00
cc7837fb46 cleanup scripts/*.sh 2022-09-21 17:30:34 +02:00
9dd0eb5e5c better wildcard 2022-09-21 17:21:26 +02:00
9ce8455ae0 run certora scripts 2022-09-21 17:12:20 +02:00
dfa0505c40 fix formal verification workflow 2022-09-21 09:18:00 +02:00
e7f770591b update harness and matrix 2022-09-20 20:12:05 +02:00
b9c7899e6c no debug 2022-09-20 16:50:37 +02:00
0f20d57771 touch to force make 2022-09-20 16:46:24 +02:00
797ef26bb6 refactor 2022-09-20 16:42:18 +02:00
9aa745e4fe try using python 3.8 2022-09-20 16:40:45 +02:00
d7c3cc758b try using python 3.10 2022-09-20 16:39:12 +02:00
3c0d926908 --debug 2022-09-20 16:28:09 +02:00
28367f8989 fix action 2022-09-20 16:23:25 +02:00
61817e055f enable formal verification by matrix 2022-09-20 16:18:56 +02:00
94f9f7ac58 test matrix 2022-09-20 16:15:33 +02:00
b2ec06aaf2 test matrix 2022-09-20 16:11:32 +02:00
0fa6aad5e5 Update certora harness 2022-09-20 15:12:26 +02:00
8d3d181207 Fix issue number in CHANGELOG (#3710)
(cherry picked from commit 8769b19860)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-09-20 11:00:49 +02:00
8769b19860 Fix issue number in CHANGELOG (#3710) 2022-09-20 11:00:13 +02:00
a615329423 Make ERC721Votes no longer a Draft (#3699)
(cherry picked from commit 7a14f6c595)
2022-09-17 13:04:59 -03:00
7a14f6c595 Make ERC721Votes no longer a Draft (#3699) 2022-09-17 18:03:03 +02:00
a549ec673e Improve Initializable docstrings (#3704)
Co-authored-by: tincho <tinchoabbate@noreply.users.github.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-09-16 18:16:37 +00:00
76b538c226 Update the informational link (#3703) 2022-09-15 19:41:12 -03:00
7deed7a769 Disable fuzzing on upgradeable contracts
(cherry picked from commit 9416743a10)
2022-09-13 19:20:50 -03:00
9416743a10 Disable fuzzing on upgradeable contracts 2022-09-13 19:20:29 -03:00
d6975f8e07 Update dependency solidity-coverage to ^0.8.0 (#3681)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-13 14:45:11 -03:00
fac768cd2c Update lockfile (#3698) 2022-09-13 11:43:30 -03:00
0c2453ba17 Automatically generate test matrix 2022-09-09 22:54:56 +02:00
0d1e919742 run check on the formal-verification branch 2022-09-09 15:47:00 +02:00
75ce9ef8e9 name 2022-09-09 13:52:59 +02:00
56c355ea8b fix 2022-09-09 13:47:16 +02:00
e9f53ebc02 run prettier --write 2022-09-09 13:33:55 +02:00
3aa0a015d1 workflow trigger 2022-09-09 13:28:49 +02:00
d98d9c03f3 Merge remote-tracking branch 'Certora/master' into formal-verification 2022-09-09 13:19:12 +02:00
5e6fd491f3 4.8.0-rc.0 2022-09-07 18:08:32 -03:00
6a8d977d22 Skip changelog check if label is present (#3687) 2022-09-07 20:13:18 +00:00
3c552e6e03 Fix relevant warnings (#3685) 2022-09-07 15:56:18 -03:00
5d31ad0eb9 Fix: typo & grammar (#3684) 2022-09-07 20:45:09 +02:00
80ae402387 Add fuzz tests for Math.sqrt & Math.logX using Foundry (#3676)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-09-07 14:25:29 -03:00
c1d6e39aab Add log2, log10 and log256 functions (#3670) 2022-09-07 08:29:48 +00:00
d857ab5702 Fix EnumerableMap and EnumerableSet generation 2022-09-06 23:12:22 +02:00
42fe56031f Fix EnumerableMap and EnumerableSet warning format 2022-09-06 15:41:47 -03:00
171fa40bc8 ERC721 extension for efficient batch minting (#3311)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-09-05 23:09:30 +02:00
005a35b02a Optimize Math.max and SignedMath.max (#3679)
Co-authored-by: Daniel Liu <liudaniel@qq.com>
2022-09-05 11:37:43 -03:00
84fafa7832 Fix typos (#3677) 2022-09-05 09:34:42 +02:00
e09ccd1449 Optimize votes lookups for recent checkpoints (#3673) 2022-09-04 22:48:26 +02:00
a60ae0f18b Remove unused migrations directory 2022-09-02 20:48:21 -03:00
66ec91bc45 Update lockfile (#3669)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-01 17:04:36 -03:00
1c3410aa75 Fix grammar, wording, and typos in changelog (#3668) 2022-09-01 19:26:06 +02:00
1f0e7cdf04 Add Ownable2Step extension with 2-step transfer (#3620)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-09-01 15:46:44 +00:00
160bf1a6eb Optimize toString (#3573)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-08-31 23:08:35 +00:00
1eb55e2864 Remove unnecessary virtual (#3650) 2022-08-31 17:25:54 -03:00
4b8b92c8bf Make VestingWallet payable to allow funding at construction (#3665) 2022-08-31 20:18:57 +02:00
affe2456ea Search the whole checkpoint trace if offset overflows during initial exponential search. (#3662) 2022-08-30 22:59:23 +02:00
71aaca2d9d Extend Checkpoints with new sizes and lookup mechanisms (#3589) 2022-08-30 21:32:12 +02:00
4b16e88747 Improve recommendation on ERC721 transferFrom vs safeTransferFrom (#3647)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-08-29 17:40:21 -03:00
93bc3b657b Remove Codecov Patch status outside PRs 2022-08-26 14:03:47 -03:00
141130db27 Inherit asset decimals in ERC4626 (#3639) 2022-08-26 09:53:53 +02:00
e45b49eab8 Change 'caller' to 'sender' to more closely match EIP-4626 specs. (#3649) 2022-08-26 09:52:41 +02:00
62bab225c1 Fix wording and grammar in docs (#3645)
Fix wording and grammar
2022-08-25 10:52:41 -03:00
dc14c72e53 Update comment for _beforeTokenTransfer (#3586) 2022-08-24 12:07:35 -03:00
6b9bda872d Optimize Clones assembly (#3640) 2022-08-24 09:25:52 +00:00
6d8017d07e Optimize Create2.computeAddress (#3600)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-08-23 17:38:13 -03:00
24fc709533 Set up codespell (#3643) 2022-08-23 12:43:03 -03:00
f491e98d37 Use unchecked for ERC721 balance updates (#3524)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-08-23 02:48:09 +00:00
98c3a79b57 Change execution order to avoid reentry through the _beforeTokenTransfer hook (#3611)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-08-19 10:33:19 -03:00
17bc2dabe0 Procedurally generate EnumerableSet and EnumerableMap (#3429) 2022-08-19 14:12:18 +02:00
c797195f1d Add getter for number of releasable tokens in VestingWallet (#3580)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-08-19 02:05:18 +00:00
27d4293db6 Remove redundant changelog entry 2022-08-18 22:54:43 -03:00
26cf47a2be Add internal functions _getInitializedVersion and _isInitializing (#3598) 2022-08-18 20:42:31 -03:00
397c946141 Remove the draft prefix for EIP712 as it is now final (#3621)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-08-18 20:40:45 -03:00
2d4fb93087 Bump undici from 5.8.0 to 5.9.1 (#3632)
Bumps [undici](https://github.com/nodejs/undici) from 5.8.0 to 5.9.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.8.0...v5.9.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-18 18:47:26 -03:00
54dec0cad5 Fix typo in CHANGELOG (#3630) 2022-08-18 10:04:30 +02:00
bbb9a17872 Fix links in Utilities 2022-08-17 15:40:28 -03:00
6729fec74a Add warning about issue with Arbitrum cross-chain utilities (#3626) 2022-08-17 18:07:36 +02:00
4ae655c368 Update link to Consensys best practices (#3597)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-08-16 22:37:01 -03:00
324eda228c Remove redundant ECDSA constraint (#3591)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-08-16 18:08:07 +00:00
2dc086563f Fix misspelling in comment (#3613) 2022-08-12 10:44:20 +02:00
2627753bfe votes solvency passing again 2022-08-12 00:32:35 -07:00
4820ed4ea8 missing erc20votes harnessing 2022-08-11 21:27:17 -07:00
4a3b0bb875 filters for skipped functions 2022-08-11 21:11:01 -07:00
3e6045155e reorganized scripts 2022-08-11 20:40:13 -07:00
386848174b Fix preset links in docs 2022-08-11 11:16:41 -03:00
d693d89d99 Fix ECDSA signature malleability (#3610) 2022-08-10 15:40:03 -03:00
ff16696c9c Update ERC777 event documentation (#3594) 2022-08-10 14:21:23 +02:00
ca6f95a7da Improve documentation in UUPSUpgradeable (#3606) 2022-08-10 11:15:08 +02:00
d514cdd26e Preserve camelCase in GovernorCountingSimple (#3608) 2022-08-10 10:50:23 +02:00
85a9bed49e Remove unsued imported library "Math.sol" (#3605) 2022-08-10 10:39:47 +02:00
ec825d8999 Update lockfile (#3592)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-02 15:50:51 -03:00
ce0068c21e Fix lint error in scripts/checks/compareGasReports.js 2022-07-29 09:38:10 +02:00
bc14f8dc89 Fix contract bytecode length comparaison 2022-07-29 09:31:02 +02:00
7b5ef46371 Add a GH action that checks changelog (#3588) 2022-07-27 23:10:59 +02:00
c11acfd9d3 Fix compiler warning 2022-07-27 16:47:36 -03:00
ffb0ae76e3 Update changelog 2022-07-27 16:44:34 -03:00
dc4869eb23 Avoid returnbomb in ERC165Checker (#3587)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-07-27 16:41:05 +00:00
8ea1fc87c9 Keep track of historical quorum values (#3561)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-07-27 13:23:10 -03:00
0d91b620b7 Report changes to contract construction cost in CI (#3579) 2022-07-26 11:42:42 +02:00
81336aefb5 Fix arbitrum L1 to L2 crosschain call detection (#3578)
* Fix arbitrum L1 to L2 crosschain call detection

* fix BridgeArbitrumL2Mock

* update changelog

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-07-25 22:42:37 +02:00
7ddbfe181e Add access control comment for ERC721 _burn function (#3576)
* Added access control comment for ERC721 _burn function

* Update contracts/token/ERC721/ERC721.sol

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>

* Update contracts/token/ERC721/ERC721.sol

Co-authored-by: Francisco <frangio.1@gmail.com>

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-07-25 22:42:13 +02:00
48dd186870 Improve readme style (#3577)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-07-25 17:17:35 -03:00
fbf235661e Improve grammar in transfer error messages (#3542) 2022-07-25 17:01:14 -03:00
d1b1e17d23 Add internal overrideable _flashFee in ERC20FlashMint (#3551)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-07-22 14:44:58 -03:00
6e8d885ca7 Bump undici from 5.5.1 to 5.8.0 (#3569)
Bumps [undici](https://github.com/nodejs/undici) from 5.5.1 to 5.8.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.5.1...v5.8.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-21 20:01:10 -03:00
0ccfd2dbd3 Fix error in documentation and typo (#3567) 2022-07-21 12:55:10 -03:00
580b7ab816 Optimize safe casting of signed numbers (#3565) 2022-07-20 12:55:05 -03:00
d3ff81b37f Remove line length configuration for markdown files 2022-07-19 18:33:27 -03:00
1b1dd0ca2c Update link to ERC721 preset in docs (#3553)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-07-19 10:19:59 -03:00
e0149921b8 Update solmate repo link (#3563) 2022-07-19 10:09:02 -03:00
628a6e2866 Fix issues caused by abi.decode reverting (#3552)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-07-18 21:01:20 +00:00
d50e608a4f Add GitPOAP badge to display number of minted GitPOAPs for contributors (#3545) 2022-07-15 12:00:56 +00:00
6ab8d6a67e Improve spelling in ERC1155 revert reasons (#3433) 2022-07-12 14:00:12 +00:00
3210a8653b Modify ReentrancyGuard to reduce contract size (#3515)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-07-11 21:01:44 +00:00
96163c87e3 Implicitly clear ERC721 approval on burn (#3538) 2022-07-09 10:25:45 +02:00
3a1c020b7d Skip pull_request actions when fetching ref in gas-compare action 2022-07-09 09:49:16 +02:00
cfc9f840a0 Generate comparative gas repports on PR (#3532)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-07-08 19:07:39 -03:00
5e7e9acfa4 Fix broken forum URL (#3537)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-07-08 19:03:39 -03:00
8b778fa20d Move adds on total earlier to enable the use of unchecked (#3527)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-07-05 14:49:24 -03:00
e7397844f8 Update lockfile (#3523)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-04 16:47:26 -03:00
e02c378745 Implicitly clear ERC721 approval on transfers (#3481)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-07-04 15:29:15 -03:00
597654db00 Fixed typos in Math: sqrt function. (#3522) 2022-07-04 15:19:17 -03:00
5fbf494511 Use unchecked arithmetic in "_transfer", "_mint" and "_burn" (#3513) 2022-07-01 22:40:30 +02:00
7a8f269457 Fix changelog (#3519)
fix changelog
2022-06-30 12:02:59 +02:00
4a194b3a1c Fix typo in ERC4626 comments (#3518) 2022-06-30 12:01:04 +02:00
3dac7bbed7 Merge v4.7 back into master (#3516) 2022-06-29 12:34:30 +02:00
b159b3fee2 Minor wording fixes ERC4626 contract (#3510) 2022-06-28 14:56:09 +02:00
e734b42fc2 Enable using ERC165 check for one supported interface directly (#3339)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-06-27 17:51:33 -03:00
40172c22d9 Refactor address-to-hex-string conversion in _checkRole function (#3509)
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-06-27 20:45:51 +00:00
6f88199db9 Optimize Address.functionCall removing redundant isContract check (#3469)
Co-authored-by: Francisco <frangio.1@gmail.com>
2022-06-27 17:02:33 -03:00
e8c60f92e3 Remove unused using statements in GovernorCompatibilityBravo (#3506) 2022-06-27 13:23:08 +02:00
2894059775 Support memory arrays in MerkleTree multiproof (#3493) 2022-06-27 13:15:52 +02:00
74738721dc Make ERC4626 _deposit and _withdraw internal virtual (#3504) 2022-06-24 14:55:20 -03:00
450c569d78 Add a caution note to ERC4626 about EOA access (#3503) 2022-06-24 10:22:10 +02:00
4bf9ab41f8 Clarify PaymentSplitter shares are static 2022-06-23 18:35:03 -03:00
83277ff916 Remove _setupRole docs usage in favor of _grantRole (#3489) 2022-06-17 15:27:00 -03:00
b90f4d285e Merge pull request #4 from Certora/certora/erc1155ext
fix erc1155supply vacuity, change CI solc version to 8.4
2022-06-16 11:25:14 -07:00
cb3f2ab900 Address.functionCall internal call stack simplification (#3468) 2022-06-16 15:17:09 +02:00
1701b0c7fd fix erc1155supply vacuity, change CI solc version to 8.4 2022-06-15 17:05:12 -07:00
154a151518 Update verify.yml, adding master branch 2022-06-15 14:31:28 -07:00
0b99b54327 Merge pull request #3 from Certora/certora/erc1155ext
Certora/erc1155ext
2022-06-15 14:18:59 -07:00
9708bc0397 undo script changes 2022-06-15 14:13:43 -07:00
8ec6b0f56f Merge branch 'OpenZeppelin:master' into certora/erc1155ext 2022-06-15 14:07:26 -07:00
962a5023e6 remove commented code, fix some old scripts 2022-06-14 16:52:57 -07:00
109778c17c Fix check for generated code when last updated is a release candidate 2022-06-14 15:38:04 -03:00
ed704d82b3 Output diff when test:generation fails 2022-06-14 15:31:26 -03:00
a55b7d1372 Rename ERC20TokenizedVault to ERC4626 (#3467) 2022-06-14 11:39:01 +02:00
5a0bff465d Enable the YUL IR pipeline when building with optimisations (#3279) 2022-06-13 12:16:37 -03:00
4135bf9707 Fix typos in timelock test (#3461)
fix typos
2022-06-11 09:31:30 +02:00
429b2242d8 Disable test for updated generated code on upgradeable contracts 2022-06-10 18:13:47 -03:00
c10a097fa8 Disable all checks but tests on upgradeable repository 2022-06-10 16:37:52 -03:00
cb7dbf8297 Disable coverage on upgradeable repository 2022-06-09 19:58:26 -03:00
6820ff8b9c Merge branch 'OpenZeppelin:master' into certora/erc1155ext 2022-06-08 16:39:13 -07:00
65ab8e9ac4 Changed rule transfersHaveSameLengthInputArrays (passing) to use _ instead of holder 2022-06-07 17:51:27 -07:00
9bbc7b7eb3 Moved three transfer rules from 1155Supply spec to base 1155 spec 2022-06-07 17:32:45 -07:00
e4492aed8a Cleaned up code for rule transfersHaveSameLengthInputArrays (passing) 2022-06-07 17:26:22 -07:00
9c45c52c4b Fix CI script name for GovernorPreventLateQuorum 2022-06-07 17:26:11 -07:00
ca034ab3df Deleted unused method from GovPreventLateQuorum 2022-06-07 17:20:50 -07:00
75a3602ba6 Modified rule transfersHaveSameLengthInputArrays (passing) to limit array size 2022-06-07 17:16:45 -07:00
7c75b8aa89 Add a SafeERC20:safePermit function (#3280) 2022-06-07 15:17:02 +00:00
08d109d877 Optimize Ownable and Pausable modifiers' size impact (#3347) 2022-06-07 15:21:58 +02:00
jjz
3ac4add548 Add sqrt for math (#3242) 2022-06-07 08:26:45 +02:00
7946806fb3 Commented out sanity rules for the purposes of CI 2022-06-06 17:34:11 -07:00
3aa7ff74b0 Update lockfile (#3442)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-06 21:31:16 +00:00
994cf9b34b Clarify role of MinimalForwarder (#3399)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-06-06 18:27:56 -03:00
f6cd8032ba Fix typo in crosschain.adoc (#3453) 2022-06-06 18:20:23 -03:00
84b371f92c Added rule transfersHaveSameLengthInputArrays (partially passing) 2022-06-06 13:54:53 -07:00
051cc9e446 Revert unwanted breaking change in the Clones library (#3456)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-06-06 20:41:48 +00:00
cccd90ec83 fix typo in CI 2022-06-06 13:06:28 -07:00
ee2f0ecb68 Improved multiple token transfer batch transfer equivalence rule 2022-06-06 13:02:41 -07:00
6a4fc6acb8 set up CI for round3 scripts 2022-06-06 12:57:50 -07:00
1aa8141b14 removed a assert failure message from an invariant in Initializable spec 2022-06-06 12:56:19 -07:00
866042d6fc Added two transfer batch transfer equivalence rules 2022-06-06 12:53:13 -07:00
234b843c36 commented out failing rules and added solc version to ERC1155 2022-06-06 15:44:07 -04:00
a373d25b01 updated CI to match moving scripts to old 2022-06-06 15:35:08 -04:00
f4b2aff79e added erc1155ext branch to CI 2022-06-06 15:33:29 -04:00
371818f792 Removed reference to _burn and _mint 2022-06-06 12:26:41 -07:00
3ccaf4f6d1 Updated and cleaned up rule descriptions 2022-06-06 11:50:05 -07:00
ffa3daa5d9 Modified verification scripts and Supply spec syntax 2022-06-06 11:42:42 -07:00
990fd18c21 make ERC1155Harness, set up script, and undo munging for ERC1155 2022-06-06 11:26:58 -07:00
5a7cc50974 Modified burnable verification script to follow script naming convention 2022-06-06 11:25:48 -07:00
e3341255b2 Added rule skeletons for equivalence rules 2022-06-06 11:24:50 -07:00
69d9ebfcdf Added modified scripts to run previous ERC1155 spec 2022-06-06 11:24:50 -07:00
54ce38c2e5 Remove runtime check of ERC1967 storage slots (#3455) 2022-06-06 15:22:51 -03:00
be18334b69 Merge branch 'OpenZeppelin:master' into certora/erc1155ext 2022-06-06 09:23:03 -07:00
5516589b88 final initializable spec modulo extra natspec style comments 2022-06-03 16:45:27 -07:00
6363deaedd Changed rule onlyHolderOrApprovedCanReduceBalance to include filtered block 2022-06-03 16:12:12 -07:00
b10a2b8cd3 Added burn and burnBatch to filtered block of unexpectedBalanceChange 2022-06-03 13:56:46 -07:00
d506e3b1a5 Simplify Initializable (#3450) 2022-06-03 19:30:50 +00:00
bdb49654c5 Deleted redundant rule burnBatchAmountProportionalToBalanceReduction 2022-06-03 12:27:08 -07:00
bab9528dc1 Added rule comments re burn method rules holding for burnBatch method 2022-06-03 12:24:03 -07:00
93928e3e19 Added rule burnBatchOnEmptyArraysChangesNothing (passing) 2022-06-03 12:13:10 -07:00
113443470c Reorder arguments for multiProof functions (#3447) 2022-06-03 09:36:14 +02:00
35090c1bf1 Add tests for improved coverage (#3448)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-06-02 23:01:55 +00:00
04204b8fb9 Improve GitHub Actions (#3451) 2022-06-02 19:42:49 -03:00
f3f26e3ff3 Modified verification scripts to include --send_only flag 2022-06-02 14:25:08 -07:00
3eb67081f3 Added TODO show equivalence between batch and non-batch methods 2022-06-02 14:15:20 -07:00
d02c2ccab3 Added comments throughout regarding reasoning 2022-06-02 14:08:29 -07:00
27fa53bba9 added init_state axiom for sum of balances 2022-06-02 14:37:40 -04:00
b90d195c6c Added rule re burnBatch (not implemented) 2022-06-02 11:30:58 -07:00
a6863a059c Changed invariant total_supply_is_sum_of_balances (partially passing) 2022-06-02 11:30:58 -07:00
5e00787199 ERC4626 (#3171) 2022-06-02 10:03:03 +02:00
669a22e0ff remove duplicate initalize script 2022-06-01 17:39:39 -07:00
cab8e489b2 initializable final draft, ready for review 2022-06-01 17:38:28 -07:00
62f2c0531b Simplify ERC721 revert reasons (#3438) 2022-06-01 18:22:13 -03:00
4fc9fd3efe Support more efficient merkle proofs through calldata (#3200)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-06-01 20:36:42 +00:00
6d00281593 Fix typo in README.adoc (#3445)
Fix typo and link
2022-06-01 22:26:39 +02:00
2b0b0bb186 Fix merkle multiProof for single leaf tree (#3446) 2022-06-01 20:21:56 +00:00
0119a187c1 Added rule multipleTokenBurnBurnBatchEquivalence (passing) 2022-06-01 10:34:03 -07:00
15e847c835 Added invariant balanceOfZeroAddressIsZero (partially passing) 2022-05-31 18:34:22 -07:00
8e283704c3 Modified 1155 Burnable scripts 2022-05-31 16:29:46 -07:00
38495a5026 Added rule singleTokenBurnBurnBatchEquivalence (passing) 2022-05-31 16:02:23 -07:00
f74e316422 Added rule sequentialBurnsEquivalentToSingleBurnOfSum (passing) 2022-05-31 15:12:48 -07:00
2a73da9f67 Added rule burnBatchAmountProportionalToBalanceReduction (unimplemented) 2022-05-31 14:13:44 -07:00
018c58219f Updated 1155 Pausable and Supply scripts to first run make munged 2022-05-31 13:59:46 -07:00
bd3427d5ff Included rule burnAmountProportionalToBalanceReduction (passing) 2022-05-31 13:57:19 -07:00
10f5d8d942 Updated verifyERC1155Burnable.sh to first run make munged 2022-05-31 13:57:19 -07:00
6766b2de3b Add getters for number of unclaimed tokens in PaymentSplitter (#3350) 2022-05-31 19:26:18 +00:00
4942bd19e2 Update lockfile (#3430) 2022-05-30 17:27:50 -03:00
b2cdcc38d4 final govPreventLateQ 2022-05-28 11:01:25 -07:00
ca0d3363b8 Revised rule description to be more accurate 2022-05-27 13:34:24 -07:00
82a63f6389 Remove redundant require in ERC721 (#3434)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-05-26 22:22:35 -03:00
488dd562fb Improve error messages for ERC721 and 1155 (#3254)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-05-27 00:52:43 +00:00
78263e2a9a Changed rule description to match phrasing of assert comment 2022-05-26 14:39:10 -07:00
4dc0ff9fe3 Added assert message 2022-05-26 14:35:27 -07:00
1dd3b7a307 Made comment changes to Burnable and Pausable spec files 2022-05-26 14:10:49 -07:00
657a051062 replaced burn with generic function 2022-05-26 14:46:14 -04:00
da1cda69bf Merge branch 'certora/erc1155ext' of github.com:Certora/openzeppelin-contracts into certora/erc1155ext 2022-05-26 11:21:55 -07:00
428197be69 Added tester rule for only burn 2022-05-26 11:20:46 -07:00
5e69b54af1 added solc version 2022-05-25 16:20:45 -04:00
04382cd1d3 fixed a munging merge problem 2022-05-25 16:20:28 -04:00
d01f3ba925 unclobbered gitignore file 2022-05-25 16:07:55 -04:00
94eba74016 removed some patch cruft 2022-05-25 16:06:34 -04:00
8ec6785cb8 Merge branch 'master' into certora/erc1155ext. Resolved conflicts in
applyHarness by manually merging.
2022-05-25 16:04:16 -04:00
61294a62af Restore previous behavior of initializer during construction (#3344) 2022-05-25 15:01:45 -03:00
f8157ac854 Add multiProofVerify (#3276) 2022-05-25 09:39:15 +02:00
0321f38054 Added remaining rules, unclear if rules_sanity is passing 2022-05-24 16:11:18 -07:00
65b45726b3 Add memory safe assembly annotations (#3384)
Co-authored-by: Nate <nate@Nates-MacBook-Pro.local>
2022-05-23 15:37:08 -03:00
c019e7c5bb Fix typo causing broken URL in ERC20Snapshot comment (#3428) 2022-05-23 14:57:57 -03:00
36327ce8c5 Added script to verify ERC1155Burnable 2022-05-23 10:00:09 -07:00
39f29ec3fd Added spec for ERC1155Burnable with rule sanity 2022-05-23 09:52:25 -07:00
7a2b502b9c Added harness for ERC1155Burnable 2022-05-23 09:32:50 -07:00
de74c8c62c Add bytes32 to uint enumerable map (#3416) 2022-05-23 08:02:27 +00:00
b61faf8368 Procedural SafeCast.sol generation (#3245) 2022-05-21 14:38:31 +02:00
46cb74f3cf held tokens should exist passing 2022-05-20 16:27:09 -04:00
c4f76cfa15 Add uint to uint enumerable map (#3338) 2022-05-20 13:31:53 +00:00
fa89068f2b 8.5/10 rules finished 2022-05-19 15:37:58 -07:00
6339027a7a Add mention of events possibly emitted (#3421) 2022-05-19 13:35:42 -03:00
46db8a98b0 Rename return parameter (#3413) 2022-05-19 15:52:54 +02:00
c2077f0034 Add warning about use of delete (#3412) 2022-05-18 21:27:33 +02:00
ee4d8380d3 Fix minor typo in IERC1155 and IERC721 docs (#3419) 2022-05-18 15:19:41 +02:00
793b88efd8 finalize fist 3 rules; fix old governor spec 2022-05-16 14:26:31 -07:00
5772512058 Add address to string conversion (#3403)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-05-13 18:46:26 +00:00
cd2da98d4d Refactor magic constant in TimelocController test (#3397) 2022-05-12 22:23:56 +00:00
e633ee9ed3 Fix spelling and grammar in comments (#3408) 2022-05-11 18:10:00 -03:00
c45f34adc8 fix typos 2022-05-11 12:28:28 -07:00
6add1e7718 setup GovLateQuorum and add 3 rules for deadlines 2022-05-11 11:35:24 -07:00
0deaee1217 Added unfinished invariant regarding user token sums and totalSupply 2022-05-10 17:36:19 -07:00
2fc3a5d4b8 implemented independence rule 2022-05-09 17:54:01 -04:00
da0fdc1aa0 harness setup for ERC1155Supply 2022-05-09 17:30:57 -04:00
3bdf4bfd29 Annotate Memory-Safe Assembly (#3392) 2022-05-06 19:49:02 -03:00
3b9381dfb1 Add customizable fee receiver to ERC20FlashMint (#3327)
Co-authored-by: Mazen Khalil <mazen@immunityledger.org>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-05-06 18:46:23 -03:00
aafb14461b made the spec run 2022-05-06 14:12:32 -04:00
70cbfffc74 created harness and script 2022-05-06 13:23:52 -04:00
4a3cddc529 temporarily moved old projects into old directory 2022-05-06 13:21:36 -04:00
07b1b472c0 Improve wording consistency in code/doc (#3365) 2022-05-04 18:20:59 -03:00
4574ce45b6 Add a cross-chain guide for the documentation (#3325) 2022-05-04 21:19:04 +00:00
5ed20f32cf Update lockfile (#3386)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-04 18:04:52 -03:00
14ca3aeb79 Fix links in documentation (#3387) 2022-05-02 18:06:52 -03:00
1d2ab4f41c Add 4.6 upgradeability notice 2022-05-02 18:05:40 -03:00
be3cfa0f90 Add custom error to CrossChainEnabledPolygonChild (#3380) 2022-04-29 16:14:18 +02:00
fcf35e5722 Fix changelog merge issue (#3364) 2022-04-27 09:40:13 +02:00
a035b235b4 Release v4.6 (#3358)
* 4.6.0-rc.0

* Fix release script to only release @openzeppelin/contracts

(cherry picked from commit 2bd75a44bb)

* make ERC2981:royaltyInfo public (#3305)

(cherry picked from commit d2832ca7a9)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>

* add transpilation guards to the crosschain mocks (#3306)

(cherry picked from commit 9af5af8fff)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>

* Fix tests on upgradeable contracts after transpilation

(cherry picked from commit 0762479dd5)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>

* Remove unused constructor argument

(cherry picked from commit 69c3781043)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>

* Bump minimum Solidity version for Initializable.sol to 0.8.2 (#3328)

(cherry picked from commit cb14ea3c5c)

* Fix update-comment script to ignore invalid tags

(cherry picked from commit 848fef5b6c)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>

* 4.6.0

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-04-27 09:34:09 +02:00
848fef5b6c Fix update-comment script to ignore invalid tags 2022-04-26 18:48:34 +02:00
85627ffa91 Update links in docs (#3356)
* Update links in Access Control section

* Update Tally url

* Update web3 url to the freshest version
2022-04-26 11:34:51 +02:00
c12076fb7e Fix ERC777 link (#3351) 2022-04-23 16:35:04 +02:00
d4e6236b2b Fix deprecated expectEvent.inLogs #3332 (#3333) 2022-04-23 10:20:55 -03:00
5a75065659 Fix typo in CHANGELOG (#3341) 2022-04-14 02:08:36 -03:00
cb14ea3c5c Bump minimum Solidity version for Initializable.sol to 0.8.2 (#3328) 2022-04-14 00:21:52 +02:00
cca337f5ae Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-04-11 13:56:37 -07:00
02de598056 removed sanity 2022-04-11 13:56:34 -07:00
8fc90f6779 fix in script 2022-04-11 16:55:54 -04:00
f15308f763 added python requirements file 2022-04-11 16:37:21 -04:00
f242abbf93 starting CI integration 2022-04-11 16:35:52 -04:00
135e21f35d comment cleanup 2022-04-11 13:26:46 -07:00
6662d0556f verify all - rules passing 2022-04-11 12:46:56 -07:00
7392d83738 Bump minimist from 1.2.5 to 1.2.6 (#3303)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 10:05:45 -03:00
d1454932b2 Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-04-10 19:55:27 -07:00
cab9b09b7b rough contracts all finished 2022-04-10 19:55:23 -07:00
28dd490726 Optimize ERC1167 proxy creation code by 1 opcode (#3329) 2022-04-08 19:27:11 -03:00
bc810db320 Use a customizable _execute function in TimelockController (#3317)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-04-08 17:05:57 -03:00
741e9a8b6d timelock function moved 2022-04-08 20:57:53 +01:00
66c72f2b5d CI preparations 2022-04-08 20:52:38 +01:00
163a76f436 Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into certora/erc20 2022-04-08 15:38:32 +01:00
75417fbf9f finilized rules 2022-04-08 15:38:26 +01:00
dd01889434 Remove outdated documentation in ERC2981._setTokenRoyalty 2022-04-07 20:34:04 -03:00
731e199038 Improve docs for ERC721URIStorage._burn (#3324) 2022-04-07 20:28:18 -03:00
ec8f03ee96 Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-04-07 15:50:14 -07:00
140df5b7ce everything except Alex fix for totalVotes_sums_accounts 2022-04-07 15:49:37 -07:00
d4d8d2ed97 Fix burn documentation (#3246)
Co-authored-by: xombxomb <dmfinn@wustl.edu>
2022-04-05 19:44:20 -03:00
f81b80fb39 Update lockfile (#3309)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-05 18:07:25 -03:00
3fb25b604b Update codecov/codecov-action action to v3 (#3320)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-05 16:56:57 -03:00
da674eced1 typos and cleaning 2022-04-04 22:34:51 +01:00
479118fcd1 push to report issues 2022-04-04 21:33:31 +01:00
8c86b250bc fixed rule description 2022-04-04 21:19:54 +01:00
a0b58c3071 flashMint finished 2022-04-04 21:16:15 +01:00
742e85be7c Change zero address revert message in the balanceOf function of ERC721 and ERC1155 (#3314) 2022-04-02 12:13:33 +02:00
fe7d42dedd Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into certora/erc20 2022-04-01 17:58:48 +01:00
44fba3e2eb ERC1155 finished 2022-04-01 17:58:41 +01:00
69c3781043 Remove unused constructor argument 2022-04-01 00:16:32 -03:00
0762479dd5 Fix tests on upgradeable contracts after transpilation 2022-03-31 23:41:31 -03:00
049701eacd Update crytic/slither-action action to v0.1.1 (#3307)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-31 18:42:01 -03:00
b2b72e7783 Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-03-31 14:40:36 -07:00
22827223c0 more passing 2022-03-31 14:40:20 -07:00
f85eb5b725 Use slither action (#3278)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-31 18:28:47 -03:00
033f08972f Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into certora/erc20 2022-03-31 21:08:21 +01:00
ec4e77397f AccessControl verification 2022-03-31 21:08:14 +01:00
50cf82823e one more TC cleaning 2022-03-31 21:08:00 +01:00
53b6ed80bb ERC1155 verification (not finished) 2022-03-31 21:07:28 +01:00
a982bee235 TC cleaning 2022-03-31 21:07:01 +01:00
9af5af8fff add transpilation guards to the crosschain mocks (#3306) 2022-03-31 20:04:04 +02:00
d2832ca7a9 make ERC2981:royaltyInfo public (#3305) 2022-03-31 20:01:22 +02:00
2bd75a44bb Fix release script to only release @openzeppelin/contracts 2022-03-30 23:15:27 -03:00
2a4ca65404 Update release script to stop publishing old openzeppelin-solidity package 2022-03-30 22:29:53 -03:00
92f07bae1b typechecker error and skipped require bug 2022-03-30 17:12:30 -07:00
3f49408fb6 Move event definition at the top of IERC20, IERC777 and IERC1820 (#3228) 2022-03-30 12:36:37 -03:00
e7719ded56 Match IERC721 function order with EIP spec (#3287) 2022-03-30 12:34:17 -03:00
668a648bc6 Add utilities for CrossChain messaging (#3183)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-30 11:41:04 -03:00
02fcc75bb7 Add ERC1155URIStorage (#3210)
* Add ERC721URIStorage-like extension for ERC1155

* Add tests for ERC1155URIStorage extension

* add changelog entry for ERC721URIStorage

* Fix linting errors

* Emit URI event in ERC1155URIStorage

* Remove exists check and ERC1155Supply dependency

* Fix lint error

* Overwrite ERC1155 uri method

* Update ERC1155URIStorage specs

* Fix ERC1155URIStorageMock

* Rename _setTokenURI => _setURI in ERC1155URIStorage

* Add baseURI to ERC1155URIStorage

* Move super.uri call in ERC1155URIStorage

* Clearify ERC1155URIStorage description in change log

* reorder changelog & add documentation

* improve documentation

* fix typo

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-03-29 09:15:43 +00:00
ae270b0d89 Align data location of interface with implementation (#3295)
Co-authored-by: chriseth <chris@ethereum.org>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-28 17:48:28 -03:00
4c74b2951d Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into
remotes/origin/certora/erc20
2022-03-28 12:07:21 -07:00
3f1ee39910 call trace error 2022-03-28 12:05:33 -07:00
e029096ca4 Add Initialized event (#3294)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-28 15:36:30 -03:00
4b9500cf25 Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into certora/erc20 2022-03-27 16:06:49 +01:00
a35ad6dfc3 wrapper and timelockController cleaning 2022-03-27 16:04:31 +01:00
140f019155 Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-03-25 12:57:21 -07:00
6895946f41 updated rules 2022-03-25 12:57:16 -07:00
76eee35971 Improve revert message in Governor (#3275)
* Fixed typo

* fix testing and adding changelog

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-03-25 11:02:15 +01:00
bfff03c0d2 add missing PR link in Changelog 2022-03-25 10:36:08 +01:00
76fca3aec8 Add ERC721 and ERC1155 receiver support in Governor, Timelock (#3230)
* add ERC721 and ERC1155 receiver support in Governor, Timelock and MinimalForwarder (#3174)

* revert the nft receiver hooks from MinimalForwarder and linting updates

* add ERC165 support & simplify test

* add changelog entry

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-03-24 01:25:00 +01:00
5153c462d5 wrapper counterexample to check 2022-03-23 19:42:14 +00:00
8318470cca flashMint cleaning 2022-03-23 19:12:16 +00:00
74c9130a59 typo fixed (#3264) 2022-03-23 15:31:25 +01:00
15d5174139 Fix minor typo in CONTRIBUTING.md. (#3284) 2022-03-23 09:21:33 +01:00
05077f70f1 Update actions/cache action to v3 (#3277)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-22 18:47:06 -03:00
faf5820f03 Fix many spelling errors (#3274) 2022-03-22 18:16:20 -03:00
0eba5112c8 Allow the re-initialization of contracts (#3232)
* allow re-initialization of contracts

* fix lint

* use a private function to avoid code duplication

* use oz-retyped-from syntax

* add documentation

* rephrase

* documentation

* Update contracts/proxy/utils/Initializable.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* reinitialize test

* lint

* typos and style

* add note about relation between initializer and reinitializer

* lint

* set _initializing in the modifier

* remove unnecessary variable set

* rename _preventInitialize -> _disableInitializers

* rename preventInitialize -> disableInitializers

* test nested reinitializers in reverse order

* docs typos and style

* edit docs for consistency between initializer and reinitializer

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-22 18:06:29 +00:00
b13bdb0249 Add bytes32 to bytes32 enumerable map (#3192)
* feat(enumerablemap): add bytes32 to bytes32 map

* chore(changelog): edit CHANGELOG

* feat(enumerable map): edit struct visibility
2022-03-22 16:36:29 +01:00
c028c56965 Add changelog entry for #3259 (#3281)
* improve wrapper decimal support

* Update test/token/ERC20/extensions/ERC20Wrapper.test.js

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* add changelog entry

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-22 16:11:20 +01:00
98716177ae Inherit ERC20Wrapper decimals from the underlying (#3259) 2022-03-22 09:55:49 +01:00
89f9878ba2 Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-03-21 11:13:36 -07:00
6c5d33ba22 run scripts 2022-03-21 11:13:24 -07:00
8d9ab176d7 Timelock hash bug, example for Alex 2022-03-21 17:58:21 +00:00
62d60a5890 Timelock, erc20Wrapper and erc20FlashMint verification 2022-03-20 22:36:48 +00:00
52eeebecda spelling fix 2022-03-14 12:54:08 +01:00
6a5bbfc4cb Refactor governor testing (#3194)
* starting a governor test refactor

* improve governor tests

* refactor compatibility tests using the governor helper

* improve governor helper

* improve governor helper

* refactor governor tests

* refactor testing

* fix testing (still TODO)

* fix tests

* fix tests

* fix spelling

* use different instances of GovernorHelper

* add vote with params support

* coverage

* simplify ERC165 helper

* remove unused proposal argument

* refactor setProposal

* lint

* refactor setProposal return values

* add a data default value

* improve proposal reconstruction and storage in helper

* proposal object refactoring

* lint

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-11 09:30:30 +01:00
7caa9bbb2c TimelockController wating for hash fix 2022-03-11 00:29:03 +00:00
8372b4f923 Update Hardhat to latest (#3260) 2022-03-10 18:40:50 -03:00
cc1c18098c Replace immutable with constant for _PERMIT_TYPEHASH (#3196)
* replace `immutable` with `constant` for _PERMIT_TYPEHASH

This commit is related to the following issue discussion: https://github.com/OpenZeppelin/contracts-wizard/issues/89#issuecomment-1042391318

Since Solidity version `0.6.12` the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. Since the OpenZeppelin Wizard also uses `constant` for OpenZeppelin's AccessControl's roles declarations, it's good practice to make this consistent.

* Update CHANGELOG

* fix: ensure transpiler compatibility

* fix: fixing var-name-mixedcase

* prettier & lint check

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-03-09 17:38:29 +01:00
c72281ea45 docs(erc1155): correct ERC1155Holder.sol import (#3250) 2022-03-09 09:32:46 +01:00
2be84e627b Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-03-08 18:23:38 -08:00
f2a311dc4a Make Votes._getVotingUnits view (#3225)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-08 21:39:53 +00:00
8b162e39b5 Add a canceller role to the TimelockController (#3165)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-08 18:28:20 -03:00
62eb4568be Optimize ERC721 _isApprovedOrOwner function (#3248) 2022-03-08 18:18:56 -03:00
1900c86c99 removed unnecessary harness from the first iteration 2022-03-08 19:58:23 +00:00
f8bfa560e9 Use _spendAllowance in ERC20FlashMint (#3226)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-03-08 19:34:24 +00:00
56e4ae9f4a Merge branch 'certora/erc20' of github.com:Certora/openzeppelin-contracts into remotes/origin/certora/erc20 2022-03-08 11:29:12 -08:00
212221d6ff Add mention of OpenZeppelin Defender in readme 2022-03-08 16:24:50 -03:00
3cb87abec1 removed flags for erc20Votes script 2022-03-08 19:20:55 +00:00
b3845e43d8 Merge branch 'master' of github.com:Certora/openzeppelin-contracts 2022-03-08 11:16:41 -08:00
61fa061ecf erc20votes pointers workaround and preset 2022-03-08 16:38:11 +00:00
Ben
c239e1af8d Fix typo (#3241)
Fix camelcase of 'lastvalue' to 'lastValue'
2022-03-04 15:36:19 -03:00
f590fcdfe9 Fix typo in Proxy.sol 2022-03-04 10:40:20 -03:00
ef8013ef79 sanity for TimelockController and Votes 2022-03-03 12:42:16 -08:00
9bded169e8 Update lockfile (#3229)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-02 16:47:58 -03:00
7ab95baab8 Merge branch 'OpenZeppelin:master' into certora/erc20 2022-03-02 12:53:03 -05:00
dc739dcbe3 Update actions/checkout action to v3 (#3234)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-01 20:02:06 -03:00
fd07cc6290 Extend Governor with parameterized votes (#3043)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-03-01 17:55:20 -03:00
99864fd2da Merge branch 'OpenZeppelin:master' into certora/erc20 2022-03-01 14:23:25 -05:00
1c3b17826e Merge branch 'OpenZeppelin:master' into master 2022-03-01 14:21:32 -05:00
f9d9279320 Update actions/setup-node action to v3 (#3220)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-01 12:54:10 -03:00
abdb20a6bd Change dependency source to work around Truffle limitation (#3218) 2022-02-25 14:49:58 +00:00
3e74681e77 Read allowance from overridable function in increase/decrease (#3213) 2022-02-23 11:28:44 -03:00
f6b614a7c5 Perform ERC1155.afterTokenTransfer hooks before acceptance check (#3215) 2022-02-22 18:24:03 -03:00
458697be32 Fix typos (#3207)
Fix misspelling in ERC20 contract comments.
2022-02-22 18:26:18 +01:00
af7ec04b78 Improve security of the onlyGovernance modifier (#3147)
* add a protection mechanism to prevent relaying transaction that are not
part of an execute operation

* more accurate relay authorization

* force reset the relay authorizations after executions

* refactor of the onlyGovernor modifier

* only whitelist when executor is not governor itself

* fix lint

* add private function for call permission management

* use deque

* fix lint

* remove unecessary dependency

* remove unecessary dependency

* comment rephrasing

* Update contracts/governance/Governor.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* cache keccak256(_msgData())

* use Context

* lint

* conditionnal clear

* add test to cover queue.clear()

* lint

* write more extended docs for onlyGovernance

* add changelog entry

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-02-18 21:03:03 +01:00
eae2384178 Add git paragraph to installation section (#3197) 2022-02-18 10:09:07 +01:00
6db2d0ea39 Update dependency yargs to v17 (#3101)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-17 23:13:19 -03:00
3fe65ef467 Fix docs navigation 2022-02-16 18:50:54 -03:00
525a672862 Add missing docs about reverts in DoubleEndedQueue 2022-02-16 16:42:33 -03:00
aace774961 Add a double ended queue (#3153)
* add vector, lifo and fifo structures

* fix lint

* need more memory for coverage

* remove Vector wrappers and gas optimization

* refactor Vector testing

* revert package.json changes

* rename to DoubleEndedQueue

* rename and refactor

* refactor tests and expand coverage

* test for custom errors

* add changelog entry

* add docs

* add sample code and note about storage vs. memory

* add available since

* lint

* use underscore for struct members

* add struct documentation

* remove SafeCast in length

* rename i -> index and improve docs

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-02-16 09:32:16 +01:00
6fec54f17f Update lockfile (#3193) 2022-02-15 23:03:33 -03:00
58f635312a Fix typo in CHANGELOG (#3191) 2022-02-15 11:27:08 +01:00
3dfc0a44f8 ERC1155 after token transfer hook (#3166)
* add Hooks _afterTokenTransfer

* avoid duplicate call to _asSingleton

* add changelog entry

* update changelog link to PR

* Update CHANGELOG.md

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

Co-authored-by: CryptoV8 <91189073+CryptoV8@users.noreply.github.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-02-14 16:55:43 +01:00
be3c5ca504 clarify _spendAllowance natspec (#3188) 2022-02-13 14:48:45 +01:00
4cb0926f11 Fix grammar typo in doc (#3186)
Add missing verb "are".
2022-02-11 15:41:22 +01:00
5b6112000c Update lockfile (#3067)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-09 18:26:27 -03:00
afb20119b3 Release v4.5 2022-02-09 18:16:53 -03:00
718d0ba2a1 Update dependency simple-get to 2.8.2 [SECURITY] (#3181)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-09 13:28:01 -03:00
591e30b7b6 Update dependency node-fetch to 2.6.7 [SECURITY] (#3176)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-09 12:38:52 -03:00
24f561a9a1 Update dependency shelljs to 0.8.5 [SECURITY] (#3177)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-09 12:38:39 -03:00
32b4eee9a3 Update dependency follow-redirects to 1.14.7 [SECURITY] (#3175)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-09 12:30:55 -03:00
c5a6cae898 Add a _spendAllowance function to ERC20 & ERC777 (#3170) 2022-02-09 12:26:53 -03:00
63b466901f Rename some ERC20 parameters to match the standard document. (#3167)
* Renames `sender` to `source`.

The naming variable was incorrect.  The source of the funds is *not* necessarily (and in most cases isn't) the sender of the transaction.  Also, this code has a `msgSender` which further adds confusion.

* Changes to `from/to` instead of `source`.

* Function documentation matches new names

* Changed other instances of sender/recipient to from/to.

Also changed `msgSender` to `owner` in the approval related methods.

* apply changes to IERC20.sol + minor renaming in ERC20.sol

Co-authored-by: Daniel Von Fange <daniel@leancoder.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-02-08 00:05:29 +01:00
defcf20042 Simplify ERC721 example (#3115) 2022-02-04 18:47:06 -03:00
b119b564df Improve wording for forum link in new issue templates 2022-02-04 12:17:36 -03:00
28986d2f2e Start tokenId at zero in docs (#3162)
- Fixes #3123
2022-02-03 11:45:06 -03:00
85566faeb2 Improve documentation of various governance aspects (#3161)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-02-02 13:36:45 -03:00
bfd05d9646 Add "available since" on Base64.sol 2022-02-01 20:04:28 -03:00
574f3b89e1 Add proper revert message on overflow of totalSupply during burn (#3144) 2022-02-01 19:10:11 -03:00
ca755ce799 Add AddressToUintMap (#3150)
* add AddressToUintMap

* Update contracts/utils/structs/EnumerableMap.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* address comments

* lint code

* merge mocks into a single file

* add PR link to changelog entry

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-02-01 17:37:32 +01:00
fc01c51c13 Simplify inheritance to avoid overrides 2022-01-31 22:05:20 -03:00
21c5d623d6 Update Copyright notice and include contributors 2022-01-31 17:33:42 -03:00
4f8af2dceb Add test and docs describing a misuse of MerkleProof (#3090)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-31 12:10:13 -03:00
a81b07ce91 Fix typo in retrieval of onERC721Received selector (#3151) 2022-01-31 10:47:56 +01:00
f55d2716a8 Add function documentation for SignatureChecker. 2022-01-28 22:44:32 -03:00
ae54e6de1d Fix typo in CHANGELOG (#3138)
Remove repeated word "the".
2022-01-27 09:59:11 +01:00
fb950c6166 Add a virtual _checkRole(bytes32) internal function to AccessControl (#3137)
* add a virtual _onlyRole(bytes32) modifier

* _onlyRole(role) → _checkRole(role)

* update doc
2022-01-26 21:36:10 +01:00
6fb1e843cf Make royaltyInfo(uint256 _tokenId, uint256 _salePrice) virtual (#3133)
* Make royaltyInfo(uint256 _tokenId, uint256 _salePrice) virtual

Should be cherrypicked in release 4.5

* fix lint
2022-01-26 17:35:05 +01:00
78deae5a76 Fix typo in CHANGELOG (#3135)
Change `ERC2891` > `ERC2981`.
2022-01-26 09:30:53 +01:00
e298476a90 Simplification of ERC777's transfer & transferFrom by using _send (#3128)
* Update ERC777.sol

* Update ERC777.sol

* Update ERC777.sol

* Update ERC777.sol

* fix revert reasons

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-01-25 14:56:13 +01:00
a5e042cedf Fix use of ^ (xor) instead of ** (power) (#3130) 2022-01-24 18:55:12 -03:00
d57593c148 Lint 2022-01-24 00:42:17 -03:00
7c47ac7193 Add workflow to generate and update docs branches 2022-01-23 19:19:38 -03:00
8f70c8867e Fix typo in ERC721.sol (#3127) 2022-01-23 11:05:41 +01:00
b3b83b558e Add Slither reentrancy check in CI (#3047)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-21 00:15:54 +00:00
783ac759a9 upgrade solidity-coverage to 0.7.18 to support ERC165 coverage (#3117) 2022-01-18 00:05:17 -03:00
25eeb80b18 Fix broken pull request links in change log (#3114)
Co-authored-by: Han Lin Yap <codler@users.noreply.github.com>
2022-01-16 01:02:27 +01:00
3eb2d43b06 Move abs(int256) from Math to SafeMath (#3110)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-14 22:27:04 +00:00
ecae978cb5 Make more functions virtual (#3078)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-13 18:56:36 +00:00
e192fac276 Simplify UUPSUpgradeable along the lines of ERC1822 (#3021)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-13 15:46:55 -03:00
3458c1e854 Add SignedMath with math utilities for signed integers (#2686)
* add contract and tests

* avoid implicit cast

* add test cases

* fix test names

* modify avarage and add tests

* improve signed average formula

* fix lint

* better average formula

* refactor signed average testing

* add doc and changelog entry

* Update contracts/utils/math/SignedMath.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* remove ceilDiv

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-12 20:08:59 +01:00
dee772a55f Add documentation to TokenTimelock 2022-01-12 11:51:09 -03:00
1051db3802 Use abi.encodePacked instead of bytes.concat 2022-01-11 16:51:55 -03:00
a8f35b6c25 Make script executable 2022-01-11 16:41:59 -03:00
c366de3626 Fix encoding of signature+calldata in GovernorCompatibilityBravo (#3100)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-11 15:45:06 -03:00
80d8da0564 Do not reduce approval on transferFrom if current allowance is type(uint256).max (#3085)
* add feature request #3084

* Update contracts/token/ERC20/ERC20.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* Add changelog note

* add documentation

* test unlimitted allowance and add ERC777 unlimitted allowance

* reference PR in changelog

* documentation IERC20 -> ERC20

* use asciidoc note syntax

* use asciidoc note syntax

* typo

* typos

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2022-01-11 00:08:33 +01:00
fd7c4ba8f0 Update pragma in utils/Address.sol to 0.8.1 (#3098) 2022-01-10 19:47:43 -03:00
8dd744fc18 Add missing reference to PR in changelog 2022-01-09 17:50:05 +01:00
828fe365ee Normalize return variable names in IERC721Enumerable (#3079)
* Name missing return variable in IERC721Enumerable

For consistency among all functions.

* remove return variable names
2022-01-07 15:39:46 +01:00
a65c03bc0d Implement Non Fungible Token Royalty (EIP2981) (#3012)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2022-01-06 19:34:57 -03:00
1e815f3308 Restructure intro to ERC721 contract docs 2022-01-06 17:45:21 -03:00
d74605641c Fix typos (#3075)
Correct a couple of misspellings.
2022-01-05 10:13:30 +01:00
a9f994f063 Reduce ERC20 allowance before triggering transfer (#3056)
* Reduce ERC20 allowance before triggering transfer

* adapt ERC777 to reduce allowance before transfer

* fix test for ERC777

* use smaller number to reduce balance

* simplify test description

* don't use deprecated expectEvents.inLogs

* fix test

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-12-31 09:17:12 +00:00
ef0273fde1 Add Base64 library to utils (#2884)
* Add Base64 library to utils

* Fix typo on Base64 padding

* Added documentation for Base64 and references from ERC1155 and ERC721

* Updated Changelog

* Fix typo in utilities doc

* use mstore8 to improve memory accesses

* use shorter strings with encodePacked

* do not use using-for syntax, for clarity

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-12-29 20:41:20 +01:00
da3a9ae18b Avoid assembly in signature V and S decomposition (#3060)
* Avoid assembly in signature V and S decomposition

* Update ECDSA.sol
2021-12-29 16:22:39 +01:00
e3391cd65f Fix typo (#3058) 2021-12-28 21:52:00 -03:00
e9e177f53b Fix ERC2771ContextMock for upgradeable contracts 2021-12-27 21:26:47 -03:00
fe38eae6cd Re-enable immutable forwarder in ERC2771Context (#2917)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-12-27 21:21:56 -03:00
915ca181ba Add Certora's Governance verification rules (#2997)
Co-authored-by: Shelly Grossman <shelly@certora.com>
Co-authored-by: Aleksander Kryukov <58052996+RedLikeRosesss@users.noreply.github.com>
Co-authored-by: Michael M <91594326+MichaelMorami@users.noreply.github.com>
Co-authored-by: Aleksander Kryukov <firealexkryukov@gmail.com>
2021-12-27 19:11:59 -03:00
a0a8bbb57f Remove note about enabling self-delegation 2021-12-27 12:24:37 -03:00
1ffcb10bd2 Change release script to only update version comment for changed files (#3033)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-12-22 19:21:45 -03:00
10c8fcd3b8 Use invalid opcode to consume all gas in MinimalForwarder (#3035) 2021-12-22 19:01:24 -03:00
cafd900ad6 Fix memory leak in merkle verification (#3039) 2021-12-21 17:01:28 -03:00
e667ec9533 Add Governor Timelock Control Warning (#3032)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-12-20 17:00:13 -03:00
5ac4d93ae3 Add missing letter (#3034) 2021-12-17 15:46:45 +00:00
97b2e1b12a sanity passes 2021-12-17 09:43:47 -05:00
2304dd7bb1 added script for checking token sanity 2021-12-17 09:36:01 -05:00
44cedd5ea2 made scripts executable 2021-12-17 09:30:30 -05:00
7ffbf6a3c8 renamed governor sanity script 2021-12-17 09:30:04 -05:00
b5980a569c reorganized governance verification in preparation for erc20 verification 2021-12-17 09:22:06 -05:00
0550d13aee Add ERC721 import in tutorial 2021-12-16 18:29:31 -03:00
7912b1af7d filtered out relay, since it is havocing 2021-12-16 14:58:55 -05:00
d95cdaae8e Replace excodesize assembly with address.code.length (https://github.com/ethereum/solidity/releases/tag/v0.8.1) (#3025) 2021-12-15 18:54:10 +01:00
4a9cc8b491 Merge branch 'release-v4.4' 2021-12-14 13:34:03 -03:00
6bd6b76d11 4.4.1 2021-12-14 13:14:39 -03:00
13a6ec753a Remove bad date from changelog 2021-12-14 13:14:21 -03:00
bda61cd5e5 Fix typo (#3016) 2021-12-12 22:55:19 +01:00
b42b05311b Add ERC721Votes for NFT-based governance (#2944)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien@openzeppelin.com>
2021-12-10 18:58:45 -03:00
553c8fdec7 Update initializer modifier to prevent reentrancy during initialization (#3006)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit 08840b9f8c)
2021-12-10 13:10:17 -03:00
9a7e4a0112 Remove trailing whitespace 2021-12-10 13:09:46 -03:00
e141d8917a Create v4.4.1 section in changelog 2021-12-10 13:04:03 -03:00
08840b9f8c Update initializer modifier to prevent reentrancy during initialization (#3006)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-12-10 13:02:35 -03:00
0c858e2071 Improve revert reason in ERC721 (#2975)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-12-09 23:42:18 +00:00
4625192940 Fix changelog entry for GovernorPreventLateQuorum 2021-12-09 20:32:53 -03:00
2a75aa19bd added munging to scripts 2021-12-09 17:17:49 -05:00
d95c3eeee1 removed some spurious comments 2021-12-09 14:47:57 -05:00
22de642692 simplified README somewhat, included additional information about munging 2021-12-09 14:43:40 -05:00
2a09e50d09 Update lockfile (#2993)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-08 20:17:11 -03:00
04109f8bee Address: explain dangers of isContract (#2994)
Co-authored-by: Ivo Georgiev <ivo@strem.io>
2021-12-08 20:10:40 -03:00
8ef7655e7b Fix a typo in erc20-supply.adoc (#3005)
Fix a typo
2021-12-07 13:41:21 +01:00
6bd525fd67 Merge branch 'master' into certora/governor
Rerunning verification against current master to ensure clean PR
2021-12-03 15:24:56 -05:00
8c0684ad13 Merge branch 'OpenZeppelin:master' into master 2021-12-03 15:22:52 -05:00
3c150953ed harnessing fix 2021-12-03 14:52:53 -05:00
d64869545d did some harnessing 2021-12-02 16:47:18 -05:00
5888bee853 fixed executeOnly rule 2021-12-02 15:16:26 -05:00
ec5d501791 filtered out timeouts 2021-12-02 15:06:29 -05:00
760edf9b87 tweaked script to run quickly 2021-12-02 14:01:44 -05:00
a05312f1b7 fix changelog structure 2021-12-01 18:20:42 +01:00
abf6024faf Add a governor module to protect against late quorum (#2973)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-12-01 13:56:31 -03:00
380b87dc0c switched harnesses to use munged contracts 2021-12-01 10:13:42 -05:00
f3087407c6 created applyHarness 2021-12-01 10:08:06 -05:00
749738f2aa moved contract modifications into munged directory 2021-12-01 10:03:21 -05:00
7d0eeab6f7 HarnessCleaning 2021-12-01 12:02:15 +02:00
dae72a7e1b FixingScriptsToWorkWithNewChanges 2021-12-01 11:59:59 +02:00
96c6120609 NewFileForRulesInProgress 2021-12-01 11:59:30 +02:00
6089f11c2f Add a relay mechanism in the governor (#2926)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-11-30 17:19:20 -03:00
3536587665 Fix typo (#2992) 2021-11-30 17:15:29 +01:00
de594921cc fix script 2021-11-30 18:10:20 +02:00
f40c48a83d madeVeryfyAllMoreFlexible 2021-11-27 20:22:25 +02:00
7d17acfb2f Merge branch 'release-v4.4' 2021-11-25 16:56:07 -03:00
4961a51cc7 4.4.0 2021-11-25 16:35:37 -03:00
94a0b8f573 Make VestingWallet token event argument indexed (#2988)
(cherry picked from commit 0859c70936)
2021-11-25 16:03:00 -03:00
0859c70936 Make VestingWallet token event argument indexed (#2988) 2021-11-25 14:38:18 -03:00
6481b05e4f Add changelog entry for deprecation of presets 2021-11-25 14:23:30 -03:00
43e37f0184 executedImplyStartAndEndDateNonZero inv fix 2021-11-25 16:25:40 +02:00
c739d1976b Update security email domain and Immunefi text 2021-11-25 11:05:11 -03:00
1d25a22201 runAllwithoutTypeCheckAndPolishingIt 2021-11-25 13:33:36 +02:00
73080c79d0 cleaning in process 2021-11-25 13:30:09 +02:00
37725a0f2c CleaningAndScriptForAllAndReadme 2021-11-24 19:48:39 +02:00
b3dd1e0386 RulesCleaning 2021-11-24 17:53:01 +02:00
108be781a4 RemovedUnnecessaryHarnesses 2021-11-24 17:52:25 +02:00
f6db5c1f30 A function which returns the absolute value of a signed value (#2984)
* Add a function which returns the absolute (and obviously unsigned) value of a signed value.

* add changelog entry and fix lint

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-11-24 14:09:05 +01:00
2f2604d673 Deprecate presets in favor of Wizard (#2986) 2021-11-24 10:14:14 +01:00
0894724496 all rules checked no structure organization 2021-11-23 16:57:14 +02:00
9344f697f9 removed oneUserVotesInCast 2021-11-23 16:33:28 +02:00
4c3ad9c95a GovernorCountingSimple cleaning 2021-11-23 15:27:22 +02:00
38e42f92c2 helperFunctionArgumentEnv 2021-11-23 12:52:51 +02:00
c38babecd9 helper function name change 2021-11-23 12:47:21 +02:00
e01b285780 helper function fix plus reviewing up to noExecuteOrCancelBeforeDeadline including 2021-11-23 11:48:58 +02:00
1b4fb6c758 callPropose and castVoteWithReason removed 2021-11-23 11:48:07 +02:00
95321a3516 done up to noStartBeforeCreation including 2021-11-22 17:35:13 +02:00
0413d58860 add bug bounty info
(cherry picked from commit 86bd4d7389)
2021-11-22 15:06:10 +01:00
86bd4d7389 add bug bounty info 2021-11-22 15:05:21 +01:00
ff8e17ec2f removedHarnessesAnsSummariesAddedComments 2021-11-22 12:17:41 +02:00
37fe8c292a FixinigTimeoutsAndTotalVotes 2021-11-22 09:51:11 +02:00
cd703a5ee0 cleaned up to doubleVoting (not included) 2021-11-21 18:03:11 +02:00
167f175f3a harness _execute() 2021-11-21 18:02:26 +02:00
a14abd0276 hashProposal summarization removed 2021-11-20 02:06:01 +02:00
0fbf745efe noVoteForSomeoneElse fix 2021-11-20 01:52:06 +02:00
92f5f0dfbb TryingToFixRules 2021-11-19 20:13:06 +02:00
52d42d6e03 Improve docs wording on constructors and proxies (#2935) 2021-11-19 15:08:56 -03:00
0cbb98b92c uncommenting hook for oneUserVotesInCast 2021-11-18 16:42:32 +02:00
4c8642b70a Update lockfile (#2932)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-18 11:29:08 -03:00
9f2a672240 moving updateQuorumNumerator to GovernorBase 2021-11-18 15:46:56 +02:00
0ecb5fce78 fix for oneUserVotesInCast 2021-11-18 15:43:21 +02:00
65af47d90d added filters to revert if exec and revert if canceled 2021-11-18 15:39:18 +02:00
a57e638f57 Improve GovernorTimelockControl.state() to detect direct cancel (#2977) 2021-11-18 09:53:05 -03:00
a4cee9ed37 make setters in GovernorSettings virtual
(cherry picked from commit 6e5bf05211)
2021-11-18 10:17:31 +01:00
6e5bf05211 make setters in GovernorSettings virtual 2021-11-18 10:15:48 +01:00
f7049de567 envfreeViolationFix 2021-11-18 10:12:13 +02:00
61b011869c AddedLinkAndFixingGhost 2021-11-17 16:00:16 +02:00
a33b9b2bb0 FixedERC20VotesIssue 2021-11-17 13:33:43 +02:00
44113d58f5 NewWizardHarness 2021-11-17 11:56:24 +02:00
eb27bdd282 MoreRulesAndFixesOfExistedRules 2021-11-16 19:53:07 +02:00
daad23b3a7 comment noVoteForSomeoneElse 2021-11-16 18:35:09 +02:00
1da0a4ae7d allFunctionsRevertIfExecuted, allFunctionsRevertIfCanceled, executedOnlyAfterExecuteFunc passing as intended 2021-11-16 18:33:49 +02:00
5833f52879 Harness of castVoteWithReason to be able to impose requirement on the proposal ID 2021-11-16 18:32:38 +02:00
65ef662a2b 4.4.0-rc.1 2021-11-16 10:23:53 -03:00
8b8ee57a1a Make quorum behavior match GovernorBravo (#2974)
* Make quorum inclusive minimum in GovernorCompatibilityBravo

* add PR link

(cherry picked from commit a94cf0509f)
2021-11-16 10:08:08 -03:00
a94cf0509f Make quorum behavior match GovernorBravo (#2974)
* Make quorum inclusive minimum in GovernorCompatibilityBravo

* add PR link
2021-11-16 13:24:22 +01:00
cf6e32fc54 Fix Timelock Controller description typo (#2960)
(cherry picked from commit e63b09c9ad)
2021-11-15 18:08:07 -03:00
3a3e643eb9 Fix typo and reframed a sentence (#2951)
Corrected spelling for a word on line number 3 and sentence reframed on line number 309

(cherry picked from commit 2b4e023180)
2021-11-15 18:08:07 -03:00
462d6fa2b2 Grammar correction in utilities doc (#2952)
Fix grammar in a sentence

(cherry picked from commit b5daea6d5f)
2021-11-15 18:08:07 -03:00
70138680cf Fix ERC1155 supply tracking (#2956)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit 4088540aef)
2021-11-15 18:07:21 -03:00
a16eaebb25 ManyNonWorkingRules 2021-11-15 18:22:36 +02:00
d297280617 oneUserVoteInCast, noVotesForSomeoneElse 2021-11-15 18:00:04 +02:00
eee306acda commenting helper function, executed only after exec, func revert if canceled or executed 2021-11-15 17:58:36 +02:00
c0a257fa0c overriding castVoteWithReason 2021-11-15 17:56:30 +02:00
c6365ef868 creating new ghost for 26 b 2021-11-14 15:44:29 +02:00
54fa59f879 proposeInitialized done 2021-11-14 15:33:30 +02:00
2baa9bd801 Merge branch 'certora/governor' of https://github.com/Certora/openzeppelin-contracts into certora/governor 2021-11-12 16:42:55 +02:00
a858ed7a2a codeCleaningNumberIDontKnow 2021-11-12 16:42:22 +02:00
921c668a59 reorganization + violated rules 2021-11-12 16:42:22 +02:00
0598a3ac43 CountingSimpleMoreCleanAndAddedMoreRules 2021-11-12 16:42:22 +02:00
0d724ca892 Cleaned harness + callPropose 2021-11-12 16:42:22 +02:00
b948e70258 aesthetic 2021-11-12 16:42:22 +02:00
5267eaac81 Changed deltaWeight type from uint to uin256 2021-11-12 16:42:22 +02:00
9b4634bebe FixedTypoInEnvfreeWord 2021-11-12 16:42:22 +02:00
f8a54d2ae2 RemovedInsertedBugForSumRule 2021-11-12 16:42:21 +02:00
92744a195a specificSpecForSumRule 2021-11-12 16:42:21 +02:00
bc9bbc2431 FirstWizardHarness 2021-11-12 16:42:21 +02:00
16e101bba9 cannot set if executed and canceled as rules (not working) 2021-11-12 16:42:21 +02:00
861fab8589 ghosts and invariant unfinished 2021-11-12 16:42:21 +02:00
8ed7f965bb added ghost and counter implementation for castWithReason and castBySig 2021-11-12 16:42:21 +02:00
53d4006806 fixed function revert if executed 2021-11-12 16:42:20 +02:00
2761ec0b66 MoreRulesToTheGodOfRules 2021-11-12 16:42:20 +02:00
d5c6520e4d idea for sum of votes 2021-11-12 16:42:20 +02:00
5ea1cc7a8a added invariants if executed or canceled always revert 2021-11-12 16:42:20 +02:00
c50cb000dd fix simple vote end before start 2021-11-12 16:42:20 +02:00
d4b9e9ab80 someCleaning 2021-11-12 16:42:20 +02:00
85b65befd5 WorkInProgress 2021-11-12 16:42:20 +02:00
77efd53f0c checkingInvariantsWithoutGhosts 2021-11-12 16:42:19 +02:00
364da56ab4 quotes on var in msg 2021-11-12 16:42:19 +02:00
9298482163 scripts settings added 2021-11-12 16:42:19 +02:00
91f8919876 hooks fixed 2021-11-12 16:42:19 +02:00
6323c9a73d slight changes in scripts + disableLocalTypeChecking 2021-11-12 16:42:19 +02:00
c08a73a6ca Harness private to public 2021-11-12 16:42:19 +02:00
547e7a8308 Harness private to public 2021-11-12 16:42:19 +02:00
6307b3bb64 slight changes change for convenience + disableLocalTypeChecking flag for the hooks 2021-11-12 16:42:18 +02:00
32ab301c9d Hooks fixed 2021-11-12 16:42:18 +02:00
788d4672d7 slight script changes and ghost fix 2021-11-12 16:42:18 +02:00
1c35a7dad0 multiple inheritance is tricky x2 2021-11-12 16:42:18 +02:00
2d33674870 multiple inheritance is tricky 2021-11-12 16:42:18 +02:00
e810379262 sanity rule preparations 2021-11-12 16:42:18 +02:00
d6036f9291 ignore certora's generated files 2021-11-12 16:42:17 +02:00
ea6baf2220 rule drafts 2021-11-12 16:42:17 +02:00
a0cb8cd446 fixes 2021-11-12 16:42:17 +02:00
8494fe20bc fixes 2021-11-12 16:42:17 +02:00
4a0077d685 Back to expected pattern? 2021-11-12 16:42:17 +02:00
9a194f24b8 start work on governor 2021-11-12 16:42:17 +02:00
4337957a6b codeCleaningNumberIDontKnow 2021-11-12 14:12:03 +02:00
2ecba5326b reorganization + violated rules 2021-11-12 09:02:51 +02:00
2a0532dacc CountingSimpleMoreCleanAndAddedMoreRules 2021-11-11 17:28:22 +02:00
e63b09c9ad Fix Timelock Controller description typo (#2960) 2021-11-11 14:49:53 +01:00
f2c352366a Merge pull request #1 from OpenZeppelin/master
Synced Forked Repo
2021-11-11 11:27:32 +02:00
b52832ca7f Cleaned harness + callPropose 2021-11-10 15:26:29 +02:00
eb87bb4822 aesthetic 2021-11-10 15:10:37 +02:00
52924aaec0 Changed deltaWeight type from uint to uin256 2021-11-10 15:07:34 +02:00
85855b8cc7 FixedTypoInEnvfreeWord 2021-11-09 21:09:54 +02:00
3db4393b58 Fix link to #2849 in changelog
(cherry picked from commit 57630d2a64)
2021-11-09 15:40:19 -03:00
57630d2a64 Fix link to #2849 in changelog 2021-11-09 15:39:58 -03:00
6ac85d8d15 RemovedInsertedBugForSumRule 2021-11-09 15:16:44 +02:00
96df9799c3 specificSpecForSumRule 2021-11-09 15:10:07 +02:00
07d637980c FirstWizardHarness 2021-11-09 11:18:23 +02:00
2b4e023180 Fix typo and reframed a sentence (#2951)
Corrected spelling for a word on line number 3 and sentence reframed on line number 309
2021-11-08 23:05:32 +01:00
b5daea6d5f Grammar correction in utilities doc (#2952)
Fix grammar in a sentence
2021-11-08 23:04:44 +01:00
4088540aef Fix ERC1155 supply tracking (#2956)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-11-08 18:47:21 -03:00
44a8fed410 cannot set if executed and canceled as rules (not working) 2021-11-08 20:16:53 +02:00
34cb4bdc9c ghosts and invariant unfinished 2021-11-08 19:00:22 +02:00
09e5888ca8 fix typos in GovernorSettings (#2957)
(cherry picked from commit ce51655c81)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-11-08 17:26:05 +01:00
ce51655c81 fix typos in GovernorSettings (#2957) 2021-11-08 17:23:23 +01:00
c819e0b063 added ghost and counter implementation for castWithReason and castBySig 2021-11-08 17:57:53 +02:00
37a4975544 fixed function revert if executed 2021-11-08 17:51:28 +02:00
6dab43c3a9 AccessControlEnumerable: Hook into the internal function (#2946)
* AccessControlEnumerable: Hook into the internal function

* add changelog entry

(cherry picked from commit 7579828180)
2021-11-08 12:23:37 -03:00
7579828180 AccessControlEnumerable: Hook into the internal function (#2946)
* AccessControlEnumerable: Hook into the internal function

* add changelog entry
2021-11-08 12:22:13 -03:00
751277a1ab MoreRulesToTheGodOfRules 2021-11-08 17:18:36 +02:00
ad7993d7d5 idea for sum of votes 2021-11-08 15:57:53 +02:00
7a5bd86ef4 added invariants if executed or canceled always revert 2021-11-08 15:57:19 +02:00
ac729e0ecf fix simple vote end before start 2021-11-08 14:57:51 +02:00
0ebc0d5844 someCleaning 2021-11-08 11:44:04 +02:00
b133fee376 WorkInProgress 2021-11-07 17:55:03 +02:00
342265d290 Update governance.adoc (#2948) 2021-11-06 22:29:51 +01:00
5cdf2a8fdf Fix markdown rendering in utilities.adoc (#2934) 2021-11-04 19:08:23 -03:00
f08ee568b9 checkingInvariantsWithoutGhosts 2021-11-04 17:54:26 +02:00
bfa1dd3756 quotes on var in msg 2021-11-04 15:03:28 +02:00
f7cc2548f3 scripts settings added 2021-11-04 12:54:23 +02:00
a2960e22b9 hooks fixed 2021-11-04 12:35:37 +02:00
21b84349d4 slight changes in scripts + disableLocalTypeChecking 2021-11-04 12:35:11 +02:00
d6e79f4366 Harness private to public 2021-11-04 12:29:04 +02:00
c00d951e06 Harness private to public 2021-11-04 11:51:14 +02:00
6876df00ae slight changes change for convenience + disableLocalTypeChecking flag for the hooks 2021-11-04 11:50:40 +02:00
e888ea4ccb Hooks fixed 2021-11-04 11:48:55 +02:00
69f87ad916 slight script changes and ghost fix 2021-11-04 11:27:44 +02:00
a710435535 multiple inheritance is tricky x2 2021-11-03 17:24:35 +02:00
72d4e9c29c multiple inheritance is tricky 2021-11-03 17:09:27 +02:00
cac49bfc2e sanity rule preparations 2021-11-03 17:05:06 +02:00
fbfe19d6db Improve documentation around ERC1155 2021-11-03 10:35:42 -03:00
6776cc6ee4 ignore certora's generated files 2021-11-02 14:01:48 +02:00
ee14987721 Improve formatting of docs for TimelockController roles 2021-11-01 17:32:00 -03:00
5a398018ee Add missing newline in docs 2021-11-01 17:26:37 -03:00
a73ad8cc8c Fix update-comment.js 2021-11-01 17:26:27 -03:00
46ce0cfa33 Update index.adoc (#2922)
Fixed typo
2021-10-28 17:44:07 -03:00
a51e181e3b Fix unbounded recursion in ERC20WithAutoMinerReward example 2021-10-28 13:14:21 -03:00
db58acead1 Fix changelog links
(cherry picked from commit 2b046d79e1)
2021-10-27 18:19:35 -03:00
2b046d79e1 Fix changelog links 2021-10-27 18:14:06 -03:00
a56258945a Add mention of Solidity policy in our own security policy 2021-10-27 11:19:54 -03:00
0a87a4e75b 4.4.0-rc.0 2021-10-20 17:21:04 -03:00
7dcc7b372f Fix update-comment.js 2021-10-20 17:20:49 -03:00
9e13852135 Fix typo (#2919) 2021-10-20 08:33:08 +02:00
c9bdb1f0ae Add a comment documenting the package version being used (#2918) 2021-10-19 19:18:19 -03:00
7fe5326c2d Add changelog entries for #2849 2021-10-19 15:37:11 -03:00
b12af48a7d Add Governor module for governance-settable parameters (#2904)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-10-19 15:33:02 -03:00
0db97c9681 updated docs for governor votes, 0 is against not for (#2915)
* updated docs for governor votes, 0 is against not for

* Revert unecessary changelog entry

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-10-18 18:41:02 +02:00
88e4b69bfb Add a VestingWallet (#2748)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-10-18 12:47:37 -03:00
e6f26b46fc Fix code sample in utilities.adoc 2021-10-14 23:31:24 -03:00
7006e4e3e6 Remove invalid parameters in MerkleProof tests (#2912) 2021-10-14 22:02:49 -03:00
d244b81972 Add a MerkleProof.processProof utility function (#2841)
* Add a MerkleProof.processProof utility function

* Add changelog entry

* fix lint

* return index when processingProof

* fix lint

* fix test

* Apply suggestions from code review

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* improve documentation

* Apply suggestions from code review

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* remove index - see discussion in the PR

* update changelog

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-10-14 11:50:35 +02:00
5b28259dac #890: Add ECDSA.toEthSignedMessageHash(bytes) for abritrary length message hashing (#2865)
* #890: Add ECDSA#toEthSignedMessage for bytes type

* refactor

* add test, refactor

* select overloaded function explicitly

* use short test message string

* add changelog entry

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-10-11 14:59:30 +02:00
efb5b0a28f Extend PaymentSplitter to support ERC20 tokens (#2858)
* Add MultiPaymentSplitter

with ERC20 support on top of the existing PaymentSplitter

* consistency and linting

* Add MultiPaymentSplitter tests

* fix lint

* add changelog entry

* add MultiPaymentSplitter to documentation

* rework PaymentSplitter to include ERC20 support by default

* remove test file for MultiPaymentSplitter

* fix lint

* completelly split erc20 and token tracking

* address some PR comments

* add notice about rebasing tokens

* fix minor error in tests

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-10-07 16:17:10 +02:00
22030f2fd3 rule drafts 2021-10-07 11:58:47 +03:00
abeb0fbf5c Delay the Pending state until strictly after proposal.voteStart (#2892)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-10-06 19:29:57 -03:00
caba6b93ef Add an internal _setApprovalForAll function (721 & 1155) (#2834)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-10-06 13:48:18 +00:00
e2fa301bfb Improve parameters naming and remove unecessary returns (#2891) 2021-10-06 10:34:27 -03:00
29eeb2828e Fix EIP712 for delegatecalls (#2852)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-10-06 10:24:46 -03:00
75d422feca Update lockfile (#2842)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-05 22:36:25 -03:00
6f23efa970 Review wording of SafeMath need in Solidity 0.8 (#2898) 2021-10-05 16:12:51 +02:00
4c1d5e01c6 fixes 2021-09-26 01:43:16 +03:00
fdc4b0cf23 fixes 2021-09-26 01:39:27 +03:00
f239fa56dd Back to expected pattern? 2021-09-26 00:25:59 +03:00
2c08f85744 start work on governor 2021-09-26 00:21:08 +03:00
1b27c13096 Fix typo in doc of SignatureChecker (#2881) 2021-09-24 13:27:53 +00:00
f77fd4667e fix typo in GovernorCountingSimple (#2879)
Co-authored-by: Joey Santoro <joseph.santoro@duke.edu>
2021-09-23 08:37:02 +00:00
6af4ed6169 revokeRole spec mismatch (#2872)
revokeRole emits {RoleRevoked} event if `account` has been revoked `role`

Greetings from ChainSecurity!
2021-09-21 10:16:14 +02:00
01f2ff1ba1 Allow Governor + CompoundTimelock to manage native tokens (eth) in and out of the timelock contract. (#2849)
* Change GovernorTimelockCompound to support ETH in Timelock

* refactor compound timelock module

* Allow governor to receive ETH is executor == address(this)
2021-09-17 16:57:00 +02:00
296223f876 Merge branch 'release-v4.3' 2021-09-15 10:41:50 -03:00
0c4de6721d 4.3.2 2021-09-14 18:06:39 -03:00
024cc50df4 Restrict upgrade to proxy context in UUPSUpgradeable
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit 6241995ad3)
2021-09-14 18:06:00 -03:00
6241995ad3 Restrict upgrade to proxy context in UUPSUpgradeable
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-09-14 17:33:17 -03:00
d02cc020e8 Remove deprecated prepublish script 2021-09-14 17:29:19 -03:00
bc5c8e2c9c Improve wording of recommendation in Initializable 2021-09-14 16:57:26 -03:00
7237b1672e Make some private functions internal to allow the developpement of "withSignature" functions (like permit) (#2568)
* add internal _setOwner in Ownable

* address issues raised in #2567

* updte changelog entry

* improve changelog and documentation

* rephrasing doc

* add cahngelog improvement lost in merge

* notify deprecation of _setupRole in changelog

* Demote caution to note

* Update CHANGELOG.md

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-09-14 09:03:47 +02:00
5e34a84d4a Fix ERC721URIStorage description in docs 2021-09-13 18:32:43 -03:00
38448c104a Add recommendation to initialize all contracts that use Initializable 2021-09-13 18:08:50 -03:00
8a5b67fb79 Add notice about location of funds in Governor+Timelock setup (#2855) 2021-09-13 17:43:49 -03:00
aefcb3e8aa Bump tar from 4.4.17 to 4.4.19 (#2843)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.17 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.17...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-01 14:28:28 +02:00
fb36326a58 Support london with coverage using initialBaseFee = 0 (#2838) 2021-08-30 16:42:22 -03:00
9b4326d91e Fixed a typo (#2835) 2021-08-30 15:20:35 +02:00
6edb6dd1ca 4.3.1 2021-08-26 17:59:03 -03:00
0ec7f4c25d Add additional isOperationReady check in TimelockController
(cherry picked from commit cec4f2ef57)
2021-08-24 16:23:37 -03:00
cec4f2ef57 Add additional isOperationReady check in TimelockController 2021-08-24 16:23:12 -03:00
52188a2127 Add changelog entry for 3.4.1 2021-08-24 16:09:25 -03:00
83644fdb6a Remove unused SafeMath.sol import (#2823) 2021-08-20 21:26:41 +00:00
56d4063e92 Add comment about optimizer in GovernorCompatibilityBravo 2021-08-20 12:38:44 -03:00
1baa009266 Merge branch 'release-v4.3' 2021-08-17 22:39:45 -03:00
1d2e15fbd7 4.3.0 2021-08-17 12:35:02 -03:00
e3cbfcd44b Improve Governor documentation
(cherry picked from commit 4ac1070cd3)
2021-08-17 11:20:50 -03:00
4ac1070cd3 Improve Governor documentation 2021-08-17 11:20:10 -03:00
bb2b687b46 Remove duplicate lines from changelog
(cherry picked from commit 38c1dd098c)
2021-08-16 16:55:23 -03:00
38c1dd098c Remove duplicate lines from changelog 2021-08-16 16:54:41 -03:00
494cc6d3a5 Fix typo casted -> cast
(cherry picked from commit b174f067df)
2021-08-13 18:45:15 -03:00
b174f067df Fix typo casted -> cast 2021-08-13 18:44:44 -03:00
7072b623af Fix typo casted -> cast
(cherry picked from commit 9253c614d2)
2021-08-13 18:17:22 -03:00
4a6d82acb9 add workflow to trigger transpilation to upgradeable contracts
(cherry picked from commit 049ff9a3c7)
2021-08-13 18:17:21 -03:00
9253c614d2 Fix typo casted -> cast 2021-08-13 18:16:38 -03:00
049ff9a3c7 add workflow to trigger transpilation to upgradeable contracts 2021-08-13 18:15:37 -03:00
73425c22d8 Update lockfile (#2787)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-12 14:35:20 +00:00
832ff3b9f9 Fix docs function for ECDSA (#2819) 2021-08-10 17:37:50 -03:00
635e36ff08 4.3.0-rc.0 2021-08-06 16:08:58 +02:00
6618f9f184 Fix documentation of functions in interfaces directory 2021-08-06 11:06:30 -03:00
7fcacb549b Fix name of interfaces directory in changelog 2021-08-06 11:04:40 -03:00
541e82144f Optimize EOA signature verification (#2661)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-08-06 10:47:52 -03:00
18668870fd Add an interface folder that lists common interfaces (#2517)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-08-06 10:36:34 -03:00
694f169832 Remove changelog entry for test changes 2021-08-06 10:14:00 -03:00
7279273ebb Fix inconsistencies in contract/test hierachy (#2814)
* Fix inconsistencies in contract/test hierachy

* changelog entry
2021-08-06 13:43:23 +02:00
d89f2a4ac6 Update ERC721.behavior.js (#2801) 2021-08-05 19:44:13 +02:00
48375aa908 Read optional compiler version from args/envvars (#2810) 2021-08-05 16:03:50 +02:00
29957d4a47 Add Governor guide (#2811) 2021-08-04 19:08:44 -03:00
4b152bd8ce Improve Governor (#2794)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-08-04 18:29:13 -03:00
f782943099 Move variable declaration to top of test file (#2806)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-08-03 14:19:21 +00:00
3da0cf698f Uncomment assertion in ERC2771Context.test.js (#2796) 2021-08-03 11:06:24 -03:00
e1c0f3eaef Update tests for RFC 2606 (#2802) 2021-08-02 23:41:13 +00:00
8bcf0ad7ab Use Hardhat recommended Mocha configuration (#2805) 2021-08-02 20:35:12 -03:00
56b3b7a487 Remove mention of 2.0.0 audit in docs 2021-08-02 20:06:30 -03:00
bbd68b721d Update security policy regarding past major releases 2021-08-02 19:57:04 -03:00
2d1e82c901 remove duplicated 'private-vars-leading-underscore' solhint rule (#2800) 2021-08-02 18:02:40 +02:00
9a385dcb45 fix typo 2021-08-02 12:14:20 +02:00
3dadd40034 Avoid safe math in BitMap (#2797) 2021-07-30 09:48:45 +02:00
566a774222 Update lockfile (#2774)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-20 10:49:34 -03:00
865dc9365c Update codecov/codecov-action action to v2 (#2779)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-20 13:48:26 +00:00
0500c9e53e Use "OpenZeppelin Contracts" where appropriate (#2778) 2021-07-20 10:35:58 -03:00
d3c5bdf4de Fix yellowpaper reference (#2775) 2021-07-19 09:45:04 -03:00
7e41bf2259 Remove ERC20FlashMint from drafts section in docs 2021-07-16 19:44:40 -03:00
6c1a634053 Add Governor contracts (#2672)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-07-16 12:44:01 -03:00
f88e555234 Add values() functions to EnumerableSets (#2768)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-07-16 12:06:47 -03:00
87826f807a Update lockfile 2021-07-16 11:58:22 -03:00
b8fdc620aa Downgrade yargs to v16 2021-07-16 11:49:12 -03:00
466cf05912 Deprecate openzeppelin-solidity on every release 2021-07-16 11:22:47 -03:00
8467143f2a Update lockfile (#2763)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-14 16:14:51 -03:00
c346c09b01 Clarify zero address usage in proposer and executor roles in Timelock (#2765)
* Clarify zero address usage in proposer and executor roles in access control

* Address zero only applies to executor

* Fix incorrect role
2021-07-14 16:39:08 +02:00
3935b907d4 Fix NatSpec comment syntax 2021-07-13 17:10:54 -03:00
4e2641a915 Simplify selector access (#2766) 2021-07-13 01:23:14 +02:00
973b0f883a fix typo in erc20 docs (#2764) 2021-07-12 16:45:39 +02:00
6d97f09195 Gas optimization on average function of Math.sol (#2757)
* change implementation to save gas

* add average test with two max uni256 number
2021-07-10 21:28:12 +02:00
1c1ebd765d Remove defer tag for Wizard embed script 2021-07-09 16:38:44 -03:00
9eba3ef29a fix two minor typos (#2755) 2021-07-08 17:23:13 +02:00
e4696f7315 Update lockfile (#2752)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-06 19:23:06 -03:00
23b3807ea7 Use private instead of immutable in ERC2771Context (#2754) 2021-07-06 14:41:03 -03:00
15b92e4097 Add missing "await" in tests (#2749)
* add missing await in tests

* fix test description
2021-07-06 17:20:08 +02:00
922058dbc8 Change comma to decimal point in comment (#2742) 2021-07-05 12:20:27 -03:00
b9e2c7896d Merge branch 'release-v4.2' 2021-06-30 14:31:57 -03:00
9fbc1d71c0 4.2.0 2021-06-30 14:29:37 -03:00
3ae911b442 Update lockfile (#2732)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-06-29 17:46:11 -03:00
eea376911b Reorder AccessControl event to emit after assignment (#2738) 2021-06-24 10:38:02 -03:00
1db3037808 Fix misleading comments (#2737)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-06-24 10:37:20 -03:00
556e366ce5 4.2.0-rc.0 2021-06-23 09:54:29 -03:00
6842518b1b Wrapper extension for ERC20 token (#2633)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-06-22 19:27:33 -03:00
8a775cd8d4 Emit DelegateVotesChanged events after Transfer (#2733) 2021-06-22 19:14:40 -03:00
4d0f8c1da8 Check inheritance tree consistency (#2727)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-06-18 15:08:13 +00:00
27e09007cc Reorder state changes and event emission for consistency (#2719)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-06-18 14:58:50 +00:00
00128bd260 Fix function ordering in ERC1967Upgrades (#2722) 2021-06-14 18:54:19 -03:00
f710bafae8 Fix typos (#2723) 2021-06-14 18:51:56 -03:00
788d338c9b Improve naming of internal variables (#2721) 2021-06-14 18:51:37 -03:00
6f50f6e1ef Remove repeated code from ERC1967Upgrade (#2720) 2021-06-14 18:50:51 -03:00
fd111df16d Remove unecessary code from Context (#2718) 2021-06-14 18:44:00 -03:00
17958adaca Uninstall unused mocha dependency 2021-06-14 17:41:34 -03:00
0a05f6fa45 Add a recover(bytes32,bytes32,bytes32) that follows EIP2098 (#2713) 2021-06-14 15:12:08 -03:00
78103f3137 Update lockfile (#2717)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-06-14 18:55:46 +02:00
f7da53cebd Add a BitMap struct (#2710)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-06-11 15:24:00 -03:00
75f6dbb86c Add import statements and GitHub link in API docs (#2714) 2021-06-11 15:09:32 -03:00
9d5f77db9d Update lockfile (#2702)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-06-07 19:45:26 +02:00
b0cf6fbb7a Add Prettier for linting and fix Solhint config (#2697)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-06-07 12:33:03 -03:00
e3661abe84 Split ERC20Votes and ERC20VotesComp (#2706)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-06-04 12:52:19 -03:00
1488d4f678 Improve ECDSA tests and docs (#2619) 2021-06-01 17:59:24 -03:00
adc50d465c Tweak ERC20Votes revert reasons and documentation (#2696)
* adapt revert reason convention

* add whitespace

* tweak documentation

* fix tests
2021-05-27 18:16:37 +02:00
f6efd8aced Add totalSupply checkpoints to ER20Votes (#2695)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-05-27 15:13:18 +00:00
ad3c18eb5f Fix the ERC721 link in the ERC1155 doc (#2694) 2021-05-26 19:11:08 +00:00
eabec630b9 Update lockfile (#2690)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-26 15:27:55 -03:00
406c83649b Introduce ERC1155 totalSupply() and exists() functions (#2593)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-05-20 21:46:21 +00:00
5f50b9f6e0 Update lockfile (#2675)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-20 11:45:43 -03:00
1b37c21da5 reserve unchecked for when guarded by explicit require (#2685) 2021-05-20 16:40:18 +02:00
7144ec8db4 Fix whitespace in ERC777 (#2667) 2021-05-20 11:01:20 -03:00
f31bb101ad Move ERC20Votes and ERC20FlashMint out of draft (#2673)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-05-20 11:00:22 -03:00
7c754d0665 Add ceiling division operation to the Math.sol library (#2681)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-05-20 13:53:31 +00:00
5f7eda1f98 Tokens: wrap safe substractions in uchecked block (#2669)
* Tokens: wrap definitely safe subs in unchecked

* Add change in changelog

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-05-20 10:33:28 +02:00
f8f6d56c58 Update README intro with link to Wizard 2021-05-19 20:58:29 -03:00
8ad458e955 Explain how baseURI is used for building the tokenURI (#2679) 2021-05-19 16:07:56 -03:00
8ea06b75aa Add a Counter.reset function (#2678) 2021-05-19 15:52:43 -03:00
c3ae4790c7 Fix Changelog structure 2021-05-14 15:42:18 +02:00
5cd86f740d Update lockfile (#2666)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-12 16:14:31 +00:00
aa06c9fbc1 Use Node 12 in CI 2021-05-12 13:06:07 -03:00
100ca0b8a2 ERC20 extension for governance tokens (vote delegation and snapshots) (#2632)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-05-12 10:13:59 -03:00
8669481309 Fix typo in comment (#2660) 2021-05-05 10:41:46 -03:00
1dc4a319ab Use shorter syntax for Escrow addition (#2646) 2021-05-04 20:04:51 +00:00
08ba72afa2 Fix ERC721._beforeTokenTransfer docs (#2653) 2021-05-04 11:10:24 -03:00
0a905d674b Fix typo in tokens.adoc (#2654) 2021-05-03 16:56:50 -03:00
319afebdc0 Fix typo in ERC20._mint docs (#2648) 2021-05-03 16:54:23 -03:00
f1e92dd184 Fix code comments (#2658) 2021-05-03 16:50:07 -03:00
9048e565d7 Update dependency yargs to v17 (#2655)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-03 16:43:57 -03:00
95dec684ad Update lockfile (#2656)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-03 16:42:54 -03:00
0d40f705a7 Add link to full list of upgrades resources 2021-04-29 22:58:59 -03:00
df8a0fe8dc Complete documentation of UUPSUpgradeable 2021-04-29 22:43:39 -03:00
50a9b4d1e7 Fix package-lock.json 2021-04-29 18:14:13 -03:00
2e30b9f382 Merge branch 'release-v4.1' 2021-04-29 18:06:52 -03:00
23869e5b2a 4.1.0 2021-04-29 18:04:21 -03:00
3ba2a1354f Update solidity-docgen 2021-04-27 09:40:20 -03:00
903df56837 Review structure of Proxies API docs (#2645)
(cherry picked from commit 4a53ee5a13)
2021-04-27 09:29:52 -03:00
4a53ee5a13 Review structure of Proxies API docs (#2645) 2021-04-27 09:29:13 -03:00
cfd6e7eab9 Fix documentation typos
(cherry picked from commit a98814b930)
2021-04-26 15:41:36 -03:00
a98814b930 Fix documentation typos 2021-04-26 15:41:17 -03:00
10c763da6f Fix whitespace in doc comments
(cherry picked from commit a020a55f9d)
2021-04-26 15:37:22 -03:00
a020a55f9d Fix whitespace in doc comments 2021-04-26 15:37:04 -03:00
6552adafb2 Merge ERC1967Storage into ERC1967Upgrade (#2644)
(cherry picked from commit 5756e31999)
2021-04-26 15:16:44 -03:00
5756e31999 Merge ERC1967Storage into ERC1967Upgrade (#2644) 2021-04-26 15:16:19 -03:00
8ae9f0914b Update lockfile (#2643)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-26 10:56:01 -03:00
3c4a18f0df Update Stability document with current practices 2021-04-22 11:51:17 -03:00
165e6f1948 EnumerableSet: Remove Boundary Check in _at (#2606)
* remove boundary check

* fix tests for EnumerableSet "index out of bound"

* Changelog

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-04-20 19:51:26 +00:00
750a17653d Optimize removal in EnumerableSet (#2605)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-04-20 18:08:34 +00:00
07b48484ff Fix ERC721 guide for 4.x 2021-04-20 12:37:15 -03:00
a664fb1e45 Improve code comments in ERC1967._upgradeToAndCallSecure
(cherry picked from commit 2e6ef74593)
2021-04-19 19:37:19 -03:00
2e6ef74593 Improve code comments in ERC1967._upgradeToAndCallSecure 2021-04-19 19:36:14 -03:00
440b65bf77 Refactor ERC1155 transfers to use internal functions (#2636)
* Refactor ERC1155 transfers to use internal functions #2622

* apply length check to all internal calls

Co-authored-by: Robert Kaiser <kairo@kairo.at>
2021-04-19 22:13:15 +02:00
df7996b671 add Available since 4.1 comments
(cherry picked from commit 9a698e6b7b)
2021-04-19 20:55:39 +02:00
9a698e6b7b add Available since 4.1 comments 2021-04-19 20:55:16 +02:00
915109b2c4 Move UUPSUpgradeable to proxy/utils
(cherry picked from commit b9125001f0)
2021-04-19 20:46:58 +02:00
2fa86736dd typo: remove duplicate word (#2631)
(cherry picked from commit f17624194b)
2021-04-19 20:46:55 +02:00
b9125001f0 Move UUPSUpgradeable to proxy/utils 2021-04-19 20:44:10 +02:00
f17624194b typo: remove duplicate word (#2631) 2021-04-16 20:07:09 -03:00
7360a2532d Add missing changelog entry
(cherry picked from commit 72eb905c58)
2021-04-16 20:38:45 +02:00
72eb905c58 Add missing changelog entry 2021-04-16 20:37:54 +02:00
ad90dbdaff 4.1.0-rc.0 2021-04-16 18:14:24 +02:00
e0a2b195e4 Add modifier & internal function with standard revert message in AccessControl (#2609)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-04-16 12:15:09 -03:00
1c676ac0ec Implement UUPS proxy (ERC1822) (#2542)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-04-16 11:41:47 -03:00
538b6d21b1 Update ERC721 guide for 4.0 (#2630) 2021-04-15 23:49:53 -03:00
3157aff844 Update docs for setting ERC20 decimals (#2629) 2021-04-14 16:00:22 +00:00
f4898a2e3a Update lockfile (#2627)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-12 19:17:28 -03:00
555be63c90 Add support for EIP2098 "short signatures" in the ECDSA library (#2582)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-04-09 22:58:03 +00:00
057efbfe95 Update lockfile (#2604)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-09 17:33:14 -03:00
585db1f667 Improve Hardhat config (#2612)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-04-09 11:09:16 -03:00
7f6a1666fa Add Multicall module (#2608) 2021-04-07 17:26:40 +00:00
0c621246d3 Add tooling to verify signatures with support for ERC1271 (#2532)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-04-07 13:09:17 +00:00
5bd798c6e1 Add ERC3156 extension of ERC20 (flash minting and lending) (#2543)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-04-06 03:13:10 +00:00
5ecd2b850c Add Contracts Wizard docs page (#2624) 2021-04-05 17:46:57 -03:00
243adff49c fix typo in ERC20's documentation 2021-03-26 14:06:58 +01:00
378531b709 Fix merge issue in CHANGELOG.md 2021-03-23 16:28:01 +01:00
9584c23594 Update package-lock.json 2021-03-23 12:19:17 -03:00
64f20ec624 Fix release.sh for npm 7 2021-03-23 12:15:21 -03:00
783e928ae8 Merge branch 'release-v4.0' 2021-03-23 12:13:57 -03:00
a673994de5 4.0.0 2021-03-23 12:06:54 -03:00
9b0e27c98c add missing rewrite rule in scripts/migrate-imports.js
(cherry picked from commit a3712a3288)
2021-03-22 18:08:36 +01:00
a3712a3288 add missing rewrite rule in scripts/migrate-imports.js 2021-03-22 18:07:02 +01:00
74e03de760 removes unused dependency (#2603) 2021-03-21 19:22:45 +01:00
09e302384a Update lockfile (#2592)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-03-16 16:07:24 -03:00
3dc374ddcf Make overide of ERC721.isApprovedForAll affect the ERC721 logic (#2597) 2021-03-16 15:32:22 -03:00
90a72f9acd Fix ERC721URIStorage in documentation
(cherry picked from commit 7c1625b0e0)
2021-03-15 16:48:43 -03:00
7c1625b0e0 Fix ERC721URIStorage in documentation 2021-03-15 16:47:39 -03:00
cd443f0d5b Add tests to extend code coverage (#2586) 2021-03-15 13:01:47 -03:00
d5194725b7 Add optimization for EnumerableSet (#2588)
Co-authored-by: Reason <Reason@Lee.com>
2021-03-13 10:19:29 +01:00
82e3ec3afe Fix MerkleProof generation in tests and add some documentation (#2585) 2021-03-12 21:41:54 +00:00
682def9f89 Typo in ERC20 constructor docstring (#2581) 2021-03-11 17:28:26 +01:00
96aece07f3 Fix docs formatting in IERC20Permit (#2579)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-03-10 19:48:22 -03:00
508a879ef0 Remove merkleTree.js in favor of merkletreejs dependency (#2578) 2021-03-10 18:30:16 +01:00
5171e46c47 Add an internal _useNonce(address) function in ERC20Permit (#2565) 2021-03-10 12:24:12 -03:00
1ee939e7c4 4.0.0-rc.0 2021-03-09 15:38:49 +01:00
59f33c1cc1 remove extra changelog entry 2021-03-09 15:32:54 +01:00
fb95a8b34b move changelog entry to the appropriate section 2021-03-09 15:31:34 +01:00
d104ced953 fix changelog format
(cherry picked from commit 2658e01baa)
2021-03-09 15:25:22 +01:00
1fd54698ff Update lockfile (#2573)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
(cherry picked from commit 9612b891c9)
2021-03-09 15:23:05 +01:00
2658e01baa fix changelog format 2021-03-09 15:21:58 +01:00
9612b891c9 Update lockfile (#2573)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-03-08 22:11:26 -03:00
27fc833550 Make ERC1155.uri public (#2576)
(cherry picked from commit 5dbbda5435)
2021-03-08 17:37:25 -03:00
0b3e0d74b0 Further reorganisation of the repo (#2575)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit f076ff5dbd)
2021-03-08 17:37:03 -03:00
d75b4cf613 Update changelog to list beta bugfix separately
(cherry picked from commit 5aab6ff81b)
2021-03-08 17:37:00 -03:00
5aab6ff81b Update changelog to list beta bugfix separately 2021-03-08 17:33:04 -03:00
f076ff5dbd Further reorganisation of the repo (#2575)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-03-08 17:06:54 -03:00
b8ab763581 Add IERC20Metadata with name, symbol and decimals (#2561)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-03-08 19:53:01 +00:00
78a9821129 Mint ERC777 without reception ack (#2552) 2021-03-08 19:44:31 +00:00
5dbbda5435 Make ERC1155.uri public (#2576) 2021-03-08 15:42:34 -03:00
b1e0aa487d Fix AccessControlEnumerable not tracking renounceRole (#2572)
* Fix AccessControlEnumerable not tracking renounceRole

* Updated changelog

(cherry picked from commit 7adf0d88a0)
2021-03-08 14:32:21 +01:00
6505e28c40 removes invalid character in comments (#2571)
(cherry picked from commit fc004c0ad2)
2021-03-08 14:32:09 +01:00
7adf0d88a0 Fix AccessControlEnumerable not tracking renounceRole (#2572)
* Fix AccessControlEnumerable not tracking renounceRole

* Updated changelog
2021-03-08 13:44:20 +01:00
fc004c0ad2 removes invalid character in comments (#2571) 2021-03-08 13:42:35 +01:00
f07c39be8a Add ERC165 interface detection to AccessControl (#2562)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
(cherry picked from commit 29ffe6f426)
2021-03-04 18:50:49 -03:00
29ffe6f426 Add ERC165 interface detection to AccessControl (#2562)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-03-04 18:50:12 -03:00
ec63c604ab Fix prepack script 2021-03-03 17:06:05 +01:00
69ca2ad676 Fix name of ERC721URIStorage contract in changelog
(cherry picked from commit 3d587f3043)
2021-03-03 12:50:05 -03:00
3d587f3043 Fix name of ERC721URIStorage contract in changelog 2021-03-03 12:49:22 -03:00
ae1e384a9a Fix prepack script
(cherry picked from commit 10c52439dd5118d4b671e12d691bfde42c987fb9)
2021-03-03 16:32:22 +01:00
954f6110d6 4.0.0-beta.1 2021-03-03 16:23:38 +01:00
4390b8df12 Add ERC721URIStorage extension (#2555)
(cherry picked from commit 1705067e65)
2021-03-03 16:15:51 +01:00
cb88e15b33 Enable optimizations when publishing package (#2557)
(cherry picked from commit 618a735816)
2021-03-03 16:15:26 +01:00
1705067e65 Add ERC721URIStorage extension (#2555) 2021-03-03 12:13:09 -03:00
618a735816 Enable optimizations when publishing package (#2557) 2021-03-03 12:01:54 -03:00
136de91049 Rename variable master to implementation #2 (#2553)
(cherry picked from commit 103ff8e23d)
2021-03-03 12:33:03 +01:00
103ff8e23d Rename variable master to implementation #2 (#2553) 2021-03-03 12:31:33 +01:00
e2bf45f262 Rename variable master to implementation
(cherry picked from commit cdb929aada)
2021-03-02 21:30:26 -03:00
cdb929aada Rename variable master to implementation 2021-03-02 21:25:56 -03:00
93d990c653 Optimize constructor of ERC777 (#2551)
(cherry picked from commit 62af16b9f2)
2021-03-02 21:31:07 +01:00
62af16b9f2 Optimize constructor of ERC777 (#2551) 2021-03-02 21:29:05 +01:00
3dfd02b4b4 Fix link to TimelockController
(cherry picked from commit ba1d773176)
2021-03-02 21:14:33 +01:00
7a7bd8f6d7 Fix typo Controler -> Controller
(cherry picked from commit 583146f9d6)
2021-03-02 21:14:26 +01:00
16312fcfb9 Rename UpgradeableProxy to ERC1967Proxy (#2547)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit c789941d76)
2021-03-02 21:14:08 +01:00
a81a88cca0 Fix mentions of buidler (#2548)
(cherry picked from commit 232c355b3a)
2021-03-02 21:14:00 +01:00
5acedf5027 Change title of meta transactions page in docs sidebar
(cherry picked from commit 773c7265e8)
2021-03-02 21:13:51 +01:00
566c601d41 Update lockfile (#2546)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
(cherry picked from commit 742c436d28)
2021-03-02 21:13:39 +01:00
ba1d773176 Fix link to TimelockController 2021-03-02 15:53:03 -03:00
583146f9d6 Fix typo Controler -> Controller 2021-03-02 15:32:10 -03:00
c789941d76 Rename UpgradeableProxy to ERC1967Proxy (#2547)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-03-02 11:20:59 -03:00
232c355b3a Fix mentions of buidler (#2548) 2021-03-02 09:24:37 +01:00
773c7265e8 Change title of meta transactions page in docs sidebar 2021-03-01 14:38:12 -03:00
742c436d28 Update lockfile (#2546)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-03-01 14:02:18 -03:00
15214a53ce Optimize implementation of ERC20Capped (#2524)
(cherry picked from commit 36b855972b)
2021-03-01 12:09:21 -03:00
36b855972b Optimize implementation of ERC20Capped (#2524) 2021-02-24 22:07:03 +00:00
d5f4862405 Fix package.json files field
(cherry picked from commit 735c03fcf3)
2021-02-24 00:36:08 -03:00
735c03fcf3 Fix package.json files field 2021-02-24 00:35:47 -03:00
4a1985f870 Fix migrate-imports.js test for upgradeable paths
(cherry picked from commit 4519c237c5)
2021-02-24 00:20:07 -03:00
4519c237c5 Fix migrate-imports.js test for upgradeable paths 2021-02-23 23:50:40 -03:00
ac8279a0a5 Update Antora component version 2021-02-23 23:31:48 -03:00
7cab19a2e4 Check upgradeable paths in migrate-imports test
(cherry picked from commit 4ee9fd77fd)
2021-02-23 23:31:34 -03:00
4ee9fd77fd Check upgradeable paths in migrate-imports test 2021-02-23 23:29:43 -03:00
556cdf5f1a 4.0.0-beta.0 2021-02-22 17:44:21 -03:00
c760fe9a2e Update package-lock.json 2021-02-22 17:44:02 -03:00
24a0bc23cf Reorganize the repo structure (#2503)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-22 16:44:16 +00:00
c3178ff942 Add message to caution that SafeMath.sol is for Solidity 0.8 2021-02-19 18:17:42 -03:00
f8cc8b844a Minimal support for ERC2771 (GSNv2) (#2508)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-19 15:36:48 -03:00
e341bdc1b7 Remove enumerable from AccessControl and add AccessControlEnumerable extension (#2512)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-19 17:36:56 +00:00
09734e8028 Remove enumerable from ERC721 and add an ERC721Enumerable extension (#2511)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-19 13:24:39 -03:00
7d20d0e2d2 Use immutable variables where possible (#2528)
Co-authored-by: rotciv <victorfage@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2021-02-19 11:11:54 -03:00
0059b17dfc Remove _isConstructor() check in initializer modifier (#2531)
* Remove _isConstructor() check in initializer modifier

* add changelog entry
2021-02-18 20:53:00 -03:00
e733b24dfe Refactor ERC165 to use function overriding instead of storage (#2505)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-18 19:02:28 +00:00
f7c8252611 Remove GSNv1 contracts (#2521)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-18 15:27:18 +00:00
e66e3ca523 Improve gas efficiency of EnumerableMap (#2518)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-18 15:19:57 +00:00
24660c3e48 Fix keccak256 typo (#2525) 2021-02-17 13:34:39 +01:00
ee6348a7a0 change CHANGELOG indentation for consistency 2021-02-09 17:25:41 +01:00
a44303c373 Remove double sload when doing math checks in tokens (#2506)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-09 12:58:23 -03:00
f49e9ee41b Update lockfile (#2493)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-02-09 11:59:35 -03:00
1ba03b164a Add support for eth-gas-reporter (#2501)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-09 00:42:35 +00:00
9c1e703990 Add a Strings.toHexString function (#2504)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-08 20:55:56 +00:00
f2112be4d8 Add revert string to Counter decrement overflow (#2500) 2021-02-04 20:28:13 +00:00
c82895fb65 Fix codecov reports 2021-02-04 17:15:32 -03:00
b840341a77 Remove the storage associated with decimals (#2502)
* Removing the storage associated with decimals

* changelog entry

* changelog link to new issue number

* Update contracts/token/ERC20/ERC20.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* Update contracts/token/ERC20/ERC20.sol

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-02-04 20:06:00 +01:00
ed7623273a Fix prepare-docs-solc.js for Hardhat 2021-02-04 14:22:19 -03:00
9425a7e0ab Merge branch 'solc-0.8'
Conflicts:
	CHANGELOG.md
	package-lock.json
	test/math/SafeMath.test.js
2021-02-02 22:13:28 +01:00
93438eca0b Merge 3.4 master into solc-0.8 (#2499)
* 3.4.0-rc.0

* Allow manual dispatch of Test CI job

* Update lockfile (#2481)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Add "available since" comments in documentation

* Add "available since" comments in documentation

(cherry picked from commit 63a0343dda)

* Remove SafeMathMock compilation warnings (#2497)

* Remove SafeMathMock compilation warnings (#2497)

(cherry picked from commit f4e57fd529)

* 3.4.0

* fix safemath test to use renamed function from the mock

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-02-02 22:07:56 +01:00
e28615628b Merge branch 'release-v3.4' 2021-02-02 16:16:16 -03:00
fa64a1ced0 3.4.0 2021-02-02 16:15:12 -03:00
0f553e7f9e Remove SafeMathMock compilation warnings (#2497)
(cherry picked from commit f4e57fd529)
2021-02-02 12:03:02 -03:00
f4e57fd529 Remove SafeMathMock compilation warnings (#2497) 2021-02-02 11:46:23 -03:00
a0e2bca79a Add "available since" comments in documentation
(cherry picked from commit 63a0343dda)
2021-02-01 21:45:27 -03:00
63a0343dda Add "available since" comments in documentation 2021-02-01 21:44:58 -03:00
5db7413827 re-enabling safemath revert reasons in ERC20, ERC777 and ERC1155 (#2491)
* re-enabling safemath revert reasons in ERC20 and ERC1155

* adding revert messages to ERC777

* removing uncheck block
2021-02-01 11:00:16 +01:00
d163aeb80d Update lockfile (#2481)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-01-29 19:41:00 -03:00
60205944bb Adopt new Solidity features interfaceId, try/catch, keccak constants (#2487)
* Clean code

-  using type().interfaceId to improve readeability of ERC165 registration
- hardcoding some keccak256 that are otherwise computed at construction.

* hardcode keccak256 result

* Improve code readeability using try/catch

* Remove hardcoded hash 

tests show that solc 0.8.0 does the optimization as expected

* Use try/catch to improve readability

* ERC165Checker: Do not revert when returndata is empty + new test

* Address PR comments

* improve testing of ERC721Receiver errors

* put back comment about invalid interface id

* coverage does not support 0.8.1. Reverting back to 0.8.0

* bubble all data with length > 0 if onERC721Receive fails.

* Fix test: revert without message trigger is bubble with the default message

* using enum object to improve readability
2021-01-29 22:20:49 +01:00
03832c130c Make Context._msgData return "bytes calldata" (#2492) 2021-01-29 12:51:51 -03:00
9f93e25b88 Merge branch 'solc-0.7' into 'solc-0.8' 2021-01-27 18:36:46 -03:00
afaebc3869 Disable solhint until Solidity 0.8 supported 2021-01-27 18:17:13 -03:00
fdf57a9788 Lint 2021-01-27 18:14:15 -03:00
5609cd4c74 Fix merge errors 2021-01-27 18:04:52 -03:00
a0323d446c Transition from buidler to hardhat 2021-01-27 11:37:18 +01:00
0db76e98f9 Merge branch 'solc-0.7' into solc-0.8 2021-01-27 11:28:23 +01:00
fa33fbce75 Allow manual dispatch of Test CI job
(cherry picked from commit bcc7192af7)
2021-01-26 18:21:49 -03:00
bcc7192af7 Allow manual dispatch of Test CI job 2021-01-26 18:20:33 -03:00
0d27b7a7ff Add package-lock.json 2021-01-26 18:18:58 -03:00
6d202894b6 Merge branch 'master' 2021-01-26 18:58:15 +01:00
ff300b10e1 3.4.0-rc.0 2021-01-26 13:31:55 -03:00
18c7efe800 Make view and pure functions virtual (#2473)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-26 13:23:23 -03:00
0931062a3f Use Address.sendValue instead of address.transfer in RefundEscrow (#2480)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-26 13:07:19 -03:00
3b4c951838 Fix ERC777 potential reentrancy issues (#2483) 2021-01-26 10:57:18 -03:00
c2c08af16d Add ERC165Checker.getSupportedInterfaces (#2469)
Co-authored-by: conspyrosy <1027439+Spyros-Stylianou@users.noreply.github.com>
Co-authored-by: kamiebisu <kamiebisu@protonmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-19 17:55:22 -03:00
9e49be41b6 Add ERC1167 library (minimal proxy) (#2449)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-19 17:54:47 -03:00
dd86c97e18 Fix scripts/prepare-docs.sh 2021-01-19 14:56:17 -03:00
5a8e6bda51 Update pull request template 2021-01-19 13:41:00 -03:00
c34211417c Refactor SafeMath to avoid memory leaks (#2462)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-18 18:06:27 -03:00
974c534210 Update contracts to support Solidity 0.8.x (#2442)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-14 19:38:53 -03:00
5a58fd2de0 Update lockfile (#2467)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-01-13 21:06:06 -03:00
faec973e09 Make non-view functions virtual (#2468) 2021-01-13 18:25:39 -03:00
65b7e515a2 Align comments (#2458) 2021-01-11 16:43:45 -03:00
318c4b44ea Move Context from GSN to utils directory (#2453)
Co-authored-by: Hadrien Croubois <hadrien@openzeppelin.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-07 13:04:13 -03:00
b6e5187973 Use Address.sendValue for PaymentSplitter (#2456)
* use Address.sendValue instead of .transfer

* changelog entry

Co-authored-by: Hadrien Croubois <hadrien@openzeppelin.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2021-01-07 13:03:20 -03:00
1e8cb4b4a4 Bubble revert reasons in proxy initialization (#2454)
Co-authored-by: Hadrien Croubois <hadrien@openzeppelin.com>
2021-01-07 12:45:36 -03:00
9daa0d4d2f Update lockfile (#2447)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-01-04 15:19:03 -03:00
ceb7324657 Update TimelockController.sol (#2446) 2020-12-23 20:25:01 -03:00
da00d28cb7 Rename "amount" to "value" in permit (#2445) 2020-12-23 12:09:16 -03:00
c23d5e0143 Update lockfile (#2444)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-12-22 16:31:03 -03:00
d8658dbc47 Update actions/setup-node action to v2 (#2440)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-12-22 16:06:12 -03:00
a6a4c042f5 Adjust for chainid becoming view in 0.8.0. (#2443)
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>

Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2020-12-21 18:14:21 -03:00
6be0b410dc Use explicit conversions between addresses and numbers (#2439)
Co-authored-by: hrkrshnn <webmail.hari@gmail.com>
Co-authored-by: cameel <cameel2@gmail.com>
2020-12-17 22:51:48 -03:00
051d340171 Use bytes1 and avoid using the obsolete byte type (#2438) 2020-12-14 16:42:01 -03:00
0a4233f0f6 Update lockfile (#2435)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-12-14 13:50:33 -03:00
ecc66719bd Add ERC20 Permit (EIP-2612) (#2237)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Santiago Palladino <spalladino@gmail.com>
2020-12-11 13:34:02 -03:00
03d51c5677 Bump ini from 1.3.5 to 1.3.7 (#2430)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-10 19:14:51 -03:00
268c6ab36c Edit ERC20 API index to make it clearer 2020-12-09 20:04:08 -03:00
0786f31f22 Update lockfile (#2428)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-12-09 13:32:42 -03:00
883116e4af Add ERC20 and ERC777 fixed supply presets #2377 (#2399)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-12-02 14:51:33 -03:00
5748034cd3 Add EIP 712 helpers (#2418) 2020-12-02 13:17:24 -03:00
061e7f0da7 Fix Solidity warning 2020-12-01 18:33:58 -03:00
a138dc3970 Remove stalebot 2020-12-01 12:33:09 -03:00
fa2b204535 Update TimelockController docs (#2415)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-11-30 20:14:02 -03:00
73c7af102b Configure Codecov parameters 2020-11-30 19:03:58 -03:00
18a8ae5a8a Change styling for headings in API pages 2020-11-30 18:09:32 -03:00
fa65bf89be Remove inheritance that conflicts with upgradeable transpiler 2020-11-30 16:34:07 -03:00
60c8b0e02f Update lockfile (#2416)
* Update lockfile

* fix ERC1155Pausable test

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-11-30 16:16:58 -03:00
acac4a7fca Merge branch 'release-v3.3' 2020-11-26 20:48:06 -03:00
6be5ffe54f 3.3.0 2020-11-26 20:43:43 -03:00
ba843f0ad9 Fix release script 2020-11-26 20:42:32 -03:00
4297be6ac1 Use custom ids for timelock docs section titles
(cherry picked from commit 7d02933da3)
2020-11-26 19:13:44 -03:00
7d02933da3 Use custom ids for timelock docs section titles 2020-11-26 19:12:58 -03:00
d2003a6fff Fix NatSpec comment syntax
(cherry picked from commit ef0483b4be)
2020-11-26 18:57:46 -03:00
ef0483b4be Fix NatSpec comment syntax 2020-11-26 18:56:49 -03:00
9e51b2e5df Add beacon proxy changelog entry 2020-11-26 13:10:54 -03:00
951e946e71 Add a beacon proxy contract (#2411)
Co-authored-by: Santiago Palladino <spalladino@gmail.com>
2020-11-26 13:03:01 -03:00
1fccf6fa53 3.3.0-rc.2 2020-11-24 18:51:47 -03:00
7f8fc584de Remove Address.functionDelegateCall 2020-11-24 18:47:09 -03:00
1d1d2ba661 Add mention of TimelockController in intro to access docs
(cherry picked from commit 520bf7ac61)
2020-11-24 18:15:57 -03:00
520bf7ac61 Add mention of TimelockController in intro to access docs 2020-11-24 18:14:40 -03:00
85f50d3e06 Update lockfile (#2412)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-11-24 17:06:01 -03:00
e12cb97e16 Only display own modifiers in contract docs index 2020-11-20 13:37:22 -03:00
a3a7e6fa34 Remove Context from function index in docs site 2020-11-20 13:12:15 -03:00
3881175d72 Fix TimelockController link in changelog
(cherry picked from commit ef32c04795)
2020-11-19 16:05:16 -03:00
ef32c04795 Fix TimelockController link in changelog 2020-11-19 16:04:12 -03:00
42da4d6867 Fix name of argument in docstring
Fixes #2410
2020-11-18 18:54:09 -03:00
f7bb84ce4c Add changelog entry about support for both 0.6 and 0.7
(cherry picked from commit 5bd1c0d063)
2020-11-18 16:31:41 -03:00
5bd1c0d063 Add changelog entry about support for both 0.6 and 0.7 2020-11-18 16:31:15 -03:00
c67d81bae1 3.3.0-rc.1 2020-11-17 21:39:45 -03:00
a5d1ac7ed0 Merge branch 'master' into release-v3.3 2020-11-17 21:39:07 -03:00
b8187aa529 Merge branch 'master' into solc-0.7 2020-11-17 21:37:54 -03:00
877f440331 Fix package.json version out of sync 2020-11-17 21:37:21 -03:00
58892471a3 Merge branch 'master' into solc-0.7 2020-11-17 21:34:25 -03:00
90ed1af972 Support compiling with solc 0.7 (#2408) 2020-11-17 21:29:39 -03:00
21344b91ed Lint 2020-11-17 20:26:17 -03:00
3f9673c177 Update package-lock.json 2020-11-17 19:52:43 -03:00
fce2513827 Remove date from changelog 2020-11-17 19:25:45 -03:00
3debb8820e Fix changelog versioning to include date only after final release
(cherry picked from commit d3a4e31fe2)
2020-11-17 19:24:35 -03:00
d3a4e31fe2 Fix changelog versioning to include date only after final release 2020-11-17 19:23:02 -03:00
25ac33486c 3.3.0-rc.0 2020-11-17 18:58:48 -03:00
5803e11663 Improve script to version changelog 2020-11-17 18:50:10 -03:00
b33372cc92 Fix changelog entry for Bytes32Set 2020-11-17 18:27:23 -03:00
bcb2b5d1cd Update lockfile (#2407)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-11-16 15:44:11 -03:00
3f2a2b5f62 Configure compilation with solc 0.7.4 2020-11-16 14:17:03 -03:00
4972bf4f23 Merge branch 'master' into solc-0.7 2020-11-16 14:11:46 -03:00
3d2e5c0310 Update lockfile (#2384)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-11-13 22:50:00 -03:00
f547b6ff27 Remove outdated comment in testing.md 2020-11-13 16:44:11 -03:00
5272799bdd Fix ERC1155 URI example (#2401) 2020-11-12 18:23:35 -03:00
1a230e3aa5 Rename upgrade-safe package to upgradeable 2020-11-12 16:10:01 -03:00
679b7d147c Clean Buidler cache before publishing 2020-11-11 17:47:15 -03:00
8effd1e02a Add scripts for when publishing @openzeppelin/contracts directly
(cherry picked from commit a1408a3411)
2020-11-11 16:40:23 -03:00
cb19930b83 Run tests on release branches 2020-11-11 12:49:23 -03:00
c6b07b33c5 Lint 2020-11-11 12:24:08 -03:00
47e37975c9 Remove bad SafeCast test 2020-11-11 12:22:06 -03:00
5472eedbad Add guide about OZ Contracts Upgrade Safe (#2403)
Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com>
2020-11-10 18:24:47 -03:00
af95fe7a93 Reorder package.json fields 2020-11-09 16:40:38 -03:00
705b0b0001 Improve GitHub Actions node_modules caching 2020-11-06 23:39:56 -03:00
35c931126b Remove old contracts/examples directory from package.json 2020-11-06 19:45:08 -03:00
6aada9d356 Update dependencies 2020-11-06 17:20:48 -03:00
da9161fc91 Migrate to GitHub Actions 2020-11-06 17:20:45 -03:00
1e78adc28c Refactor buidler config 2020-11-06 14:28:01 -03:00
fcdf8f4618 Add BytesSet (#2395)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-11-04 16:57:48 -03:00
8533499507 Lint 2020-10-29 16:42:32 -03:00
fb4659c5d7 Change convention for unreleased changelog entries 2020-10-28 17:23:54 -03:00
a1408a3411 Add scripts for when publishing @openzeppelin/contracts directly 2020-10-28 17:05:14 -03:00
f06738828b Migrate to Hardhat (#2397) 2020-10-28 17:03:05 -03:00
b6b1c0130b 3.2.2-solc-0.7 2020-10-28 16:33:23 -03:00
ea305cf32e Change convention for unreleased changelog entries 2020-10-28 16:33:08 -03:00
d41102d6c3 add changelog entry for #2396 2020-10-28 16:27:38 -03:00
0c27ecc536 configure renovate using openzeppelin shareable config 2020-10-28 14:05:14 -03:00
0f55c18595 Fix/solc 0.7.4 warnings #2391 (#2396)
* Fix unnamed return variable warning

This commit fixes warnings thrown by the solc 0.7.4 compiler:
"Warning: Unnamed return variable can remain unassigned. Add an explicit
return with value to all non-reverting code paths or name the variable."

* Fix function state mutability warning

This commit fixes warnings thrown by the solc 0.7.4 compiler:
"Warning: Function state mutability can be restricted to pure"

* Fix shadows an existing declaration warning

This commit fixes warnings thrown by the solc 0.7.4 compiler:
"Warning: This declaration shadows an existing declaration."

1. Arguments by default are not underscored.
2. If the name isn't available due to shadowing, use prefix underscore.
3. If prefix underscore isn't available due to shadowing, use suffix underscore.
2020-10-28 13:42:38 -03:00
e5fbbda9ba Add audit links to readme and doc index (#2392) 2020-10-21 15:59:43 -03:00
7650210ad6 Make contracts abstract if they had internal constructors (#2383) 2020-10-20 12:24:46 -03:00
ba125961d6 Update lockfile (#2381) 2020-10-16 12:48:30 -03:00
2bb06b1af4 Replace if (...) revert() with require(...) (#2376) 2020-10-13 18:36:47 -03:00
8108f2f9b9 Fixed comment typo (#2372) 2020-10-07 17:43:40 -03:00
08dfaab829 Add changelog entry for TimelockController 2020-10-05 16:26:41 -03:00
d1c121b599 Test ERC165 support in ERC1155Holder (#2365) 2020-09-18 19:19:29 -03:00
e98b187e64 Fix typos in ERC20 docs (#2364) 2020-09-17 19:45:12 -03:00
87326f7313 Add functionStaticCall and functionDelegateCall methods to Address library (#2333)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-09-17 16:19:11 -03:00
7f3eee750a Add TimelockController (#2354)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-09-17 16:16:05 -03:00
ace35fdeda Update all dependencies transitively (#2363) 2020-09-16 12:14:53 -03:00
bf4c9d700d Update all non-major dependencies (#2349)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-15 23:39:41 -03:00
c7d99531a7 Re-enable coverage analysis (#2291)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-09-15 20:59:42 -03:00
ca7ee098ca Fix whitespace in IERC721Receiver (#2359)
Slight nit on spacing to reduce # of lines // conform to other OZ function syntax
2020-09-15 19:30:09 -03:00
ec8efd52b4 3.2.1-solc-0.7 2020-09-15 18:17:10 -03:00
9a83ced46e Add changelog entry for 3.2.1-solc-0.7 2020-09-15 18:15:15 -03:00
0d7bf01ac1 Merge branch 'solc-0.7' into release-v3.2.0-solc-0.7 2020-09-15 17:48:27 -03:00
1229c28ce0 Update ERC20.sol (#2357)
Remove unused `Address` library import, references.
2020-09-14 13:35:46 -03:00
f7ca35c9c6 Configure solhint for solc 0.7 2020-09-10 20:41:40 -03:00
c08d1439dd Bump solhint to 3.2.0
(cherry picked from commit 09d437c1f9)
2020-09-10 20:39:26 -03:00
09d437c1f9 Bump solhint to 3.2.0 2020-09-10 20:37:32 -03:00
492d4ac013 Merge branch 'release-v3.2.0' into master 2020-09-10 20:27:39 -03:00
870ea2a88a Add -solc-0.7 version tag 2020-09-10 20:26:59 -03:00
29f4a38c0d Merge branch 'release-v3.2.0' into release-v3.2.0-solc-0.7 2020-09-10 20:14:37 -03:00
1ada3b633e 3.2.0 2020-09-10 20:10:42 -03:00
0ce14a078a Merge branch 'release-v3.2.0' into release-v3.2.0-solc-0.7 2020-09-09 17:43:31 -03:00
45b81c969f Add note about proxy changes in the changelog
(cherry picked from commit cfb7f80003)
2020-09-09 17:43:23 -03:00
cfb7f80003 Add note about proxy changes in the changelog 2020-09-09 17:43:00 -03:00
628dea7a08 update new contracts for solidity 0.7 2020-09-08 20:15:43 -03:00
22de765f3c Merge branch 'release-v3.2.0' into release-v3.2.0-solc-0.7 2020-09-08 20:14:42 -03:00
ae4e9845de Fix a grammatical error in a comment (#2352)
changed a comment in the isContract function to make it grammatically right.
2020-09-08 14:50:12 -03:00
95dc7525ac Bump decompress from 4.2.0 to 4.2.1 (#2347)
Bumps [decompress](https://github.com/kevva/decompress) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/kevva/decompress/releases)
- [Commits](https://github.com/kevva/decompress/compare/v4.2.0...v4.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 20:08:27 -03:00
f1cce7e223 Bump tree-kill from 1.2.1 to 1.2.2 (#2348)
Bumps [tree-kill](https://github.com/pkrumins/node-tree-kill) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/pkrumins/node-tree-kill/releases)
- [Commits](https://github.com/pkrumins/node-tree-kill/compare/v1.2.1...v1.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 20:08:01 -03:00
f2fb8cf23b 3.2.0-rc.0 2020-09-03 16:26:55 -03:00
9f900f6dba Add changelog entries for proxies and ERC20Snapshot 2020-09-03 14:20:42 -03:00
91f16a7e47 Adapt proxies to Contracts conventions (#2345) 2020-09-03 13:49:47 -03:00
6bc2ae3731 Add documentation for proxies (#2344) 2020-09-02 20:19:54 -03:00
885b76f66f Fix AsciiDoc missing attribute references 2020-09-01 18:48:43 -03:00
ded2b0a55c Fix minor typos and grammar in docs (#2338)
* Fix typos and formatting

* Add Solidity release dates: releases-stability
2020-09-01 15:19:17 -03:00
0f08b1d099 Update dependency mocha to v8.1.3 (#2340)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-09-01 15:10:54 -03:00
aaa5ef81cf Fix typos (#2343) 2020-09-01 14:57:40 -03:00
cb791a1b21 Add Proxies from OpenZeppelin SDK (#2335) 2020-08-27 21:02:42 -03:00
0b489f4d79 Improve test descriptions #1157 (#2334)
Co-authored-by: Paolo Dibitonto <p.dibitonto@almaviva.it>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-08-25 14:58:45 -03:00
c187517395 fix solhint func-visibility for 0.7.0 2020-08-24 18:20:50 -03:00
89e2b7424b Merge branch 'master' into solc-0.7 2020-08-24 18:14:25 -03:00
1f06fd7e66 Update all non-major dependencies (#2317)
* Update all non-major dependencies

* disable solhint reason-string rule

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-08-24 18:00:34 -03:00
e5da0986bb Fix code style parameters in Event (#2324)
* chore: fix code style parameters in Event

* chore: update code style for events
2020-08-19 11:23:36 -03:00
0fc9578fe6 Merge CODE_STYLE.md into GUIDELINES.md (#2330) 2020-08-18 20:57:49 -03:00
b1ea59e814 Improve testing for ERC20Snapshot (#2331) 2020-08-18 20:40:51 -03:00
7d48d79b53 Fixed sidebar reference in README.md (#2329) 2020-08-18 12:50:35 -03:00
6d5a73815d Fix ERC20Snapshot#_beforeTokenTransfer (#2328) 2020-08-14 11:59:20 -03:00
d1f336d8fd use svg logo for better scaling 2020-08-12 20:51:33 -03:00
48072e439d Fix function state mutability warning (#2327)
Changes state mutability of granularity function from view to pure.
2020-08-12 16:06:21 -03:00
9700e6b4bd Use beforeTokenTransfer hook in ERC20Snapshot (#2312) 2020-08-11 16:51:58 -03:00
722879b32d increase mocha timeout 2020-08-11 16:45:44 -03:00
943a663a31 Updated ERC1155 tests (#2107)
Co-authored-by: Alan Lu <alanlu1023@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-08-11 16:42:51 -03:00
2acb1abb1f 3.1.0-solc-0.7 2020-07-30 17:04:48 -03:00
4eb8d2bb10 Revert "feat: use extcodesize for isContract to reduce gas (#2311)"
This reverts commit c801c8d2bb.
2020-07-30 16:53:44 -03:00
04fc35707d Migrate contracts to Solidity 0.7 (#2319)
* Update contract pragmas to solidity 0.7

* Remove internal declaration on constructors

* Reference SafeMath explicitely

* Remove public constructor declaration from abstract contracts

* Remove public constructor declaration from non-abstract contracts
2020-07-29 18:11:32 -03:00
09014f90f9 Remove acronym from Readme 2020-07-24 12:52:40 -03:00
0c667ca32a docs: add note explaining opinionated presets (#2313)
* docs: add notes explaining presets

* fix links for mint function

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-07-21 19:04:21 -03:00
7c4a2a0a29 Fix comment reference for function hash (#2307)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-07-21 17:06:36 -03:00
c801c8d2bb feat: use extcodesize for isContract to reduce gas (#2311)
* feat: use extcodesize for isContract to reduce gas

* feat: add changelog entry
2020-07-14 17:08:41 -03:00
98e862e162 Update all non-major dependencies (#2309)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-13 14:39:19 -03:00
b9d72d2991 Clean up build directory when publishing 2020-07-07 21:15:26 -03:00
c6612871fb Fix remaining preset links 2020-07-01 17:37:25 -03:00
b991fca341 Fix presets link 2020-07-01 12:25:05 -03:00
ef3bbbcf40 Add readme notices with link to docs site (#2300)
* add readme notices

* remove period after url
2020-06-29 17:23:53 -03:00
32f0fe5d08 Add to ERC1155 doc and minor fixes (#2282)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-06-25 14:28:50 -03:00
6d987f1418 Merge branch 'release-v3.1.0' 2020-06-23 16:10:59 -03:00
de99bccbfd 3.1.0 2020-06-23 16:09:01 -03:00
0cc882ef9d typo fix: forwared -> forwarded (#2290) 2020-06-23 14:25:30 -03:00
3f4420527b Separate mapping keyword by whitespace (#2287)
Co-authored-by: pm_468 <oleg.kuzmenko@lindenvalley.de>
2020-06-19 11:00:05 -03:00
21d06999f6 delete dependabot config 2020-06-16 19:40:06 -03:00
f3803d3a5d Bump mocha from 7.2.0 to 8.0.1 (#2280)
Bumps [mocha](https://github.com/mochajs/mocha) from 7.2.0 to 8.0.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v7.2.0...v8.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-16 15:48:42 -03:00
c6da044dc5 Update ERC20 Supply guide (#2276)
* update for ERC20PresetMinterPauser

* fix erc20 supply guide to use hooks
2020-06-12 20:20:33 -03:00
02a6b05bde Update functionCall docs
(cherry picked from commit 242400e9ea)
2020-06-12 13:23:07 -03:00
242400e9ea Update functionCall docs 2020-06-12 13:22:52 -03:00
8c1daaab57 3.1.0-rc.0 2020-06-11 16:53:19 -03:00
7f62c8e145 Fix docs links to overloaded functions (#2275)
* fix links to overloaded functions

* fix Address xrefs

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-06-11 16:50:00 -03:00
e2876b947d Fix docs link 2020-06-11 16:49:14 -03:00
ed3a513f86 Fix broken links 2020-06-11 16:48:00 -03:00
b72088a90a Add 'available since' notices 2020-06-11 16:46:33 -03:00
8b58fc7191 feat: add wrapper function for low level calls (#2264)
* feat: add wrapper function for low level calls

* add error message parameter

* adding unit tests and required mocks

* implement error message on SafeERC20

* fixed variable name in tests

* Add missing tests

* Improve docs.

* Add functionCallWithValue

* Add functionCallWithValue

* Skip balance check on non-value functionCall variants

* Increase out of gas test timeout

* Fix compile errors

* Apply suggestions from code review

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* Add missing tests

* Add changelog entry

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-06-11 16:25:46 -03:00
d9fa59f30a Address ERC1155 changes (#2267)
* Make holder fns public

* Add context, remove msg.sender from check

* Fix location of Holder arguments

* Add beforeTransfer hook

* Minor test improvements

* Add ERC1155Burnable and tests

* Add ERC1155Pausable

* Add ERC1155PresetMinterPauser.sol

* Add uri constructors

* Improved revert reasons

* Initial docs improvements

* Add missing docs

* Improve acceptance checks revert reasons

* Apply suggestions from code review

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* Remove note about 1155 preset uri in mint

* Add rquirements to balanceOfBatch

* Add note about URI and uri

* Fix list in docs

* Fix lint errors

* Use natural sorting for API titles

* Fix doc references

* Escape {id} references to remove docgen warnings

* Added intro docs, fixed links

* Apply suggestions from code review

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>

* Add changelog entry

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-06-09 14:47:51 -03:00
13e2132b69 docs: minor - spelling, grammar (#2273) 2020-06-09 13:18:38 -03:00
298e1b5fdc Merge branch 'release-v3.0.0' 2020-06-08 13:14:15 -03:00
5294f3b9b7 3.0.2 2020-06-08 13:09:47 -03:00
b191e67552 Add changelog entry 2020-06-08 13:07:02 -03:00
fac773ac99 Add SPX license identifier (#2235)
(cherry picked from commit 56de324afe)
2020-06-08 13:05:11 -03:00
82769e54c3 Fix 721 preset docs 2020-06-05 19:26:40 -03:00
022f2bc177 Improve SignedSafeMath docs 2020-06-05 18:42:28 -03:00
ccf79ee483 Fix SafeMath docs 2020-06-05 18:42:28 -03:00
ecf0725dd1 Documentation/erc721 contracts (#2218)
* Adds / Updates documentation of ERC721 contract

* Improve ERC721Burnable documentation

* Fix typo

* Revert changes on ERC721 private functions

* Add documentation to the ERC721 contract's constructor

* Add IERC721Receiver & ERC721Holder documentations

* Add references to IERC721 functions

* Add references to IERC721Metadata/Receiver

* PR fixes

* Fixes to ERC721 documentation

* Add missing fixes

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-06-05 14:29:06 -03:00
d3ef93a9a5 Deprecate SafeERC20.safeApprove (#2268)
* Deprecate SafeERC20.safeApprove

* Add changelog entry
2020-06-05 14:13:53 -03:00
47a7a575e8 [Security] Bump websocket-extensions from 0.1.3 to 0.1.4 (#2269)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4. **This update includes a security fix.**
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-05 14:12:27 -03:00
ff8fe4be7e [Security] Bump acorn from 6.4.0 to 6.4.1 (#2270)
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. **This update includes security fixes.**
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-05 14:12:10 -03:00
d7a6e7be2e Feature/uint enumerable set tests #2253 (#2254)
* feature: setting sublevel test scenario for AddressSet

* feat: adding tests for EnumerableSet.UintSet

* feat: adding Behavior and AddressSet and UintSet tests
2020-06-04 14:57:35 -03:00
a81e948fc9 Add a simple catch-all implementation of the metadata URI interface (#2029)
* Initial ERC1155 implementation with some tests (#1803)

* Initial ERC1155 implementation with some tests

* Remove mocked isERC1155TokenReceiver

* Revert reason edit nit

* Remove parameters associated with isERC1155TokenReceiver call

* Add tests for approvals and single transfers

* Add tests for transferring to contracts

* Add tests for batch transfers

* Make expectEvent.inTransaction tests async

* Renamed "owner" to "account" and "holder"

* Document unspecified balanceOfBatch reversion on zero behavior

* Ensure accounts can't set their own operator status

* Specify descriptive messages for underflow errors

* Bring SafeMath.add calls in line with OZ style

* Explicitly prevent _burn on the zero account

* Implement batch minting/burning

* Refactored operator approval check into isApprovedForAll calls

* Renamed ERC1155TokenReceiver to ERC1155Receiver

* Added ERC1155Holder

* Fix lint issues

* Migrate tests to @openzeppelin/test-environment

* port ERC1155 to Solidity 0.6

* make ERC1155 constructor more similar to ERC721 one

* also migrate mock contracts to Solidity 0.6

* mark all non-view functions as virtual

* add simple catch-all implementation for the metadata URI interface

* include an internal function to set the URI so users can implement functionality to switch URIs

* add tests for ERC1155 metadata URI

* fix nits, mostly pointed out by linter

* convert ERC1155 metadata URI work to Solidity 0.6

* mark all non-view functions as virtual

* Port ERC 1155 branch to Solidity 0.6 (and current master) (#2130)

* port ERC1155 to Solidity 0.6

* make ERC1155 constructor more similar to ERC721 one

* also migrate mock contracts to Solidity 0.6

* mark all non-view functions as virtual

* Update contracts/token/ERC1155/IERC1155MetadataURI.sol

Starting on Solidity v0.6.2, interfaces can now inherit. \o/

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>

* Fix compile errors

* Remove URI event

* Merge MetadataCatchAll into ERC1155

* Improve documentation.

* Simplify tests

* Move tests into ERC1155 tests

* Update documentation

* Bump minimum compiler version for inteface inheritance

* Fix holder tests

* Improve setUri docs

* Fix docs generation

Co-authored-by: Alan Lu <alanlu1023@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-06-03 11:56:58 -03:00
ccfd370b89 Update Test Helpers to 0.5.6 (#2261)
* update test-helpers to 0.5.6-rc.0

* remove comment that no longer applies

* fix uses of expectEvent.notEmitted

* remove mocha only

* update to final version

* Update test/token/ERC777/ERC777.test.js

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-06-02 17:00:56 -03:00
91516b2318 Allow overriding of ERC1155 functions (#2263)
* Make receiver functions private

* Make external functions public
2020-06-02 15:06:34 -03:00
52f7b6e03b Remove TokenVesting reference from Timelock docs (#2262) 2020-06-02 13:32:14 -03:00
64ab594ad6 Modify token presets "mint" function as virtual to allow extending (#2257)
* Modify token presets "mint" function as virtual to allow extending in parent contracts

* Update ERC20PresetMinterPauser.sol

* Update ERC721PresetMinterPauserAutoId.sol

* Update CHANGELOG.md

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-06-01 17:17:32 -03:00
394987f365 Fix ERC777 hook docs, fixes #2256 2020-06-01 13:17:15 -03:00
df4b317fb3 Update start docs command line (#2255) 2020-06-01 11:53:04 -03:00
142f6c3f05 configure renovate to run weekly 2020-05-30 23:15:48 -03:00
414adb94f0 Update dependency ethereumjs-util to v7.0.2 (#2250)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-29 17:01:43 -03:00
7ee98cf525 Configure Renovate (#2248)
* Add renovate.json

* configure renovatebot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-05-29 16:43:57 -03:00
d418da6b91 Decrease CREATE2 address computation gas usage from 623 to 539 (#2244)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-05-28 20:47:45 -03:00
2a0f2a8ba8 Update LICENSE (#2247)
bump to 2020 reference for (c)
2020-05-28 19:15:43 -03:00
5513dfd3cf Adding SafeCast variants for signed integers (#2243)
* feat: Adding SafeCast variants for signed integers

* Add newline at EOF

* Update CHANGELOG.md

* Update contracts/utils/SafeCast.sol

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-05-26 19:17:34 -03:00
c18ffd7c81 Bump mocha from 7.1.2 to 7.2.0 (#2245)
Bumps [mocha](https://github.com/mochajs/mocha) from 7.1.2 to 7.2.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v7.1.2...v7.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-26 18:09:17 -03:00
424ab2a024 Update SafeERC20.sol (#2246)
tweak intro dev comment to reflect more typical use case, wrapping an `IERC20` reference for a deposit contract using others' ERC-20 tokens. I might be mistaken ~ but typically SafeERC20 won't be used in conjunction with ERC20 for OZ token deployments?
2020-05-26 13:39:54 -03:00
e2b97d6712 Update readme to reflect docsite, fixes #2168 2020-05-19 13:54:11 -03:00
217a616fde Bump ethereumjs-util from 7.0.0 to 7.0.1 (#2238)
Bumps [ethereumjs-util](https://github.com/ethereumjs/ethereumjs-util) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/ethereumjs/ethereumjs-util/releases)
- [Changelog](https://github.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ethereumjs/ethereumjs-util/compare/v7.0.0...v7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-18 15:53:38 -03:00
56de324afe Add SPX license identifier (#2235) 2020-05-14 21:58:11 -03:00
fa36244bec separate prepare and prepack scripts to fix CI 2020-05-13 17:28:13 -03:00
4fe31f8d4d Fixed typo in ERC20PresetMinterPauser (#2233)
* Fixed typo in ERC20PresetMinterPauser

* Update ERC721PresetMinterPauserAutoId.sol

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-05-13 13:26:16 -03:00
cfa9ad9943 Fix ReentrancyGuard for Proxy Pattern (#2171)
* Fix ReentrancyGuard for Proxy Pattern

* Update ReentrancyGuard.sol

* Change constant values

* Add changelog entry

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-05-12 20:23:28 -03:00
fd981ad315 fix removal of mocks from published package 2020-05-12 17:36:16 -03:00
5f9a86a8f2 Remove leftovers of TokenVesting contract 2020-05-08 17:04:22 -03:00
956d6632d9 ERC1155 feature pending tasks (#2014)
* Initial ERC1155 implementation with some tests (#1803)

* Initial ERC1155 implementation with some tests

* Remove mocked isERC1155TokenReceiver

* Revert reason edit nit

* Remove parameters associated with isERC1155TokenReceiver call

* Add tests for approvals and single transfers

* Add tests for transferring to contracts

* Add tests for batch transfers

* Make expectEvent.inTransaction tests async

* Renamed "owner" to "account" and "holder"

* Document unspecified balanceOfBatch reversion on zero behavior

* Ensure accounts can't set their own operator status

* Specify descriptive messages for underflow errors

* Bring SafeMath.add calls in line with OZ style

* Explicitly prevent _burn on the zero account

* Implement batch minting/burning

* Refactored operator approval check into isApprovedForAll calls

* Renamed ERC1155TokenReceiver to ERC1155Receiver

* Added ERC1155Holder

* Fix lint issues

* Migrate tests to @openzeppelin/test-environment

* Port ERC 1155 branch to Solidity 0.6 (and current master) (#2130)

* port ERC1155 to Solidity 0.6

* make ERC1155 constructor more similar to ERC721 one

* also migrate mock contracts to Solidity 0.6

* mark all non-view functions as virtual

Co-authored-by: Alan Lu <alanlu1023@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Robert Kaiser <kairo@kairo.at>
2020-05-08 13:38:43 -03:00
0c7b2ec09e Make Context abstract (#2229) 2020-05-08 13:02:07 -03:00
4cbcaf35e4 Fix linter errors 2020-05-08 12:57:43 -03:00
73baf0b635 Feature/Adding RoleAdminChanged event in AccessControl (#2214)
* Emit new event RoleAdminChanged

* Adding new RoleAdminChanged event in Tests

* Update suggested comments on new Event

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>

* Adding PreviousAdminRole to event

* Update AccessControl.test.js

* Update CHANGELOG.md

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-05-06 17:21:39 -03:00
78dc37739f Making IERC721Receiver an interface (#2225)
* Making IERC721Receiver an interface

* Update IERC721Receiver.sol

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
2020-05-06 16:47:53 -03:00
ac0a4327a9 Bump solidity-docgen from 0.4.1 to 0.5.3 (#2221)
* Bump solidity-docgen from 0.4.1 to 0.5.3

Bumps solidity-docgen from 0.4.1 to 0.5.3.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update prepare-docs.sh

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-05-04 17:14:12 -03:00
c20e620a06 Improve Pausable docs 2020-05-04 16:37:05 -03:00
4bc45e35c2 [Security] Bump acorn from 6.4.0 to 6.4.1 (#2224)
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. **This update includes security fixes.**
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-04 15:04:48 -03:00
b362e886ec Bump ethereumjs-util from 6.2.0 to 7.0.0 (#2222)
* Bump ethereumjs-util from 6.2.0 to 7.0.0

Bumps [ethereumjs-util](https://github.com/ethereumjs/ethereumjs-util) from 6.2.0 to 7.0.0.
- [Release notes](https://github.com/ethereumjs/ethereumjs-util/releases)
- [Changelog](https://github.com/ethereumjs/ethereumjs-util/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ethereumjs/ethereumjs-util/compare/v6.2.0...v7.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* update use of ethereumjs-util

* fix use of keccak hash function

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2020-05-04 14:55:16 -03:00
ca38899ede Upgrade solhint to 3.0 (#2223) 2020-05-04 14:49:41 -03:00
61973af29f Remove misleading SafeMath comment 2020-04-28 12:46:32 -03:00
738 changed files with 76510 additions and 44217 deletions

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`Initializable`: optimize `_disableInitializers` by using `!=` instead of `<`. ([#3787](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3787))

12
.changeset/config.json Normal file
View File

@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "OpenZeppelin/openzeppelin-contracts"
}
],
"commit": false,
"access": "public",
"baseBranch": "master"
}

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`Ownable2Step`: make `acceptOwnership` public virtual to enable usecases that require overriding it. ([#3960](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3960))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ERC721Wrapper`: add a new extension of the `ERC721` token which wraps an underlying token. Deposit and withdraw guarantee that the ownership of each token is backed by a corresponding underlying token with the same identifier.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`EnumerableMap`: add a `keys()` function that returns an array containing all the keys. ([#3920](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3920))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`UUPSUpgradeable.sol`: Change visibility to the functions `upgradeTo ` and `upgradeToAndCall ` from `external` to `public`.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`TimelockController`: Add the `CallSalt` event to emit on operation schedule.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`Governor`: add a public `cancel(uint256)` function.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`Governor`: Enable timestamp operation for blockchains without a stable block time. This is achieved by connecting a Governor's internal clock to match a voting token's EIP-6372 interface.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
Reformatted codebase with latest version of Prettier Solidity. ([#3898](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3898))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`Strings`: add `equal` method. ([#3774](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3774))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`IERC5313`: Add an interface for EIP-5313 that is now final.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`Math`: optimize `log256` rounding check. ([#3745](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3745))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`ERC20Votes`: optimize by using unchecked arithmetic. ([#3748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3748))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`Multicall`: annotate `multicall` function as upgrade safe to not raise a flag for its delegatecall. ([#3961](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3961))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`IERC4906`: Add an interface for ERC-4906 that is now Final.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`TransparentUpgradeableProxy`: support value passthrough for all ifAdmin function.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`StorageSlot`: Add support for `string` and `bytes`.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`ERC20Pausable`, `ERC721Pausable`, `ERC1155Pausable`: Add note regarding missing public pausing functionality

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`Votes`, `ERC20Votes`, `ERC721Votes`: support timestamp checkpointing using EIP-6372.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ERC4626`: Add mitigation to the inflation attack through virtual shares and assets.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`Strings`: add `toString` method for signed integers. ([#3773](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3773))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ERC20Wrapper`: Make the `underlying` variable private and add a public accessor.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`EIP712`: add EIP-5267 support for better domain discovery.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`AccessControlDefaultAdminRules`: Add an extension of `AccessControl` with additional security rules for the `DEFAULT_ADMIN_ROLE`.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`SignatureChecker`: Add `isValidERC1271SignatureNow` for checking a signature directly against a smart contract using ERC-1271.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`ECDSA`: Add a function `toDataWithIntendedValidatorHash` that encodes data with version 0x00 following EIP-191.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`SafeERC20`: Add a `forceApprove` function to improve compatibility with tokens behaving like USDT.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ERC1967Upgrade`: removed contract-wide `oz-upgrades-unsafe-allow delegatecall` annotation, replaced by granular annotation in `UUPSUpgradeable`.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---
`MerkleProof`: optimize by using unchecked arithmetic. ([#3745](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3745))

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ECDSA`: optimize bytes32 computation by using assembly instead of `abi.encodePacked`.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ERC721URIStorage`: Emit ERC-4906 `MetadataUpdate` in `_setTokenURI`.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`ShortStrings`: Added a library for handling short strings in a gas efficient way, with fallback to storage for longer strings.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`SignatureChecker`: Allow return data length greater than 32 from EIP-1271 signers.

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`UUPSUpgradeable`: added granular `oz-upgrades-unsafe-allow-reachable` annotation to improve upgrade safety checks on latest version of the Upgrades Plugins (starting with `@openzeppelin/upgrades-core@1.21.0`).

View File

@ -1,84 +0,0 @@
version: 2
# 2.1 does not yet support local run
# unless with workaround. For simplicity just use it.
# https://github.com/CircleCI-Public/circleci-cli/issues/79
aliases:
- &defaults
docker:
- image: circleci/node:10
- &cache_key_node_modules
key: v1-node_modules-{{ checksum "package-lock.json" }}
jobs:
dependencies:
<<: *defaults
steps:
- checkout
- restore_cache:
<<: *cache_key_node_modules
- run:
name: Install npm dependencies and prepare
command: |
if [ ! -d node_modules ]; then
npm ci
else
npm run prepare
fi
- persist_to_workspace:
root: .
paths:
- node_modules
- build
- save_cache:
paths:
- node_modules
<<: *cache_key_node_modules
lint:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Linter
command: npm run lint
test:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Unit tests
command: npm run test
coverage:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Unit tests with coverage report
command: npm run coverage
# TODO(xinbenlv, #1839): run SOLC_NIGHTLY to be run but allow it to fail.
workflows:
version: 2
everything:
jobs:
- dependencies
- lint:
requires:
- dependencies
- test:
requires:
- dependencies
- coverage:
requires:
- dependencies

View File

@ -1,3 +1,12 @@
comment: off
github_checks:
annotations: false
coverage:
range: "100...100"
status:
patch:
default:
target: 95%
only_pulls: true
project:
default:
threshold: 1%

View File

@ -1,7 +0,0 @@
version: 1
update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "weekly"
version_requirement_updates: "increase_versions"

View File

@ -8,7 +8,7 @@ charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
trim_trailing_whitespace = false
max_line_length = 120
[*.sol]
@ -16,3 +16,6 @@ indent_size = 4
[*.js]
indent_size = 2
[*.{adoc,md}]
max_line_length = 0

View File

@ -1,62 +1,20 @@
{
"root": true,
"extends" : [
"standard",
"plugin:promise/recommended",
],
"plugins": [
"mocha-no-only",
"promise",
"eslint:recommended",
"prettier",
],
"env": {
"browser" : true,
"node" : true,
"mocha" : true,
"jest" : true,
"es2022": true,
"browser": true,
"node": true,
"mocha": true,
},
"globals" : {
"artifacts": false,
"contract": false,
"assert": false,
"web3": false,
},
"rules": {
// Strict mode
"strict": ["error", "global"],
// Code style
"array-bracket-spacing": ["off"],
"camelcase": ["error", {"properties": "always"}],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", {"before": false, "after": true}],
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}],
"eol-last": ["error", "always"],
"eqeqeq": ["error", "smart"],
"generator-star-spacing": ["error", "before"],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120, 2],
"no-debugger": "off",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-redeclare": ["error", {"builtinGlobals": true}],
"no-trailing-spaces": ["error", { "skipBlankLines": false }],
"no-undef": "error",
"no-use-before-define": "off",
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"mocha-no-only/mocha-no-only": ["error"],
"promise/always-return": "off",
"promise/avoid-new": "off",
},
"parserOptions": {
"ecmaVersion": 2018
"artifacts": "readonly",
"contract": "readonly",
"web3": "readonly",
"extendEnvironment": "readonly",
"expect": "readonly",
}
}

1
.gitattributes vendored
View File

@ -1 +0,0 @@
*.sol linguist-language=Solidity

View File

@ -1,4 +1,4 @@
contact_links:
- name: Support request
- name: Questions & Support Requests
url: https://forum.openzeppelin.com/c/support/contracts/18
about: Ask the community in the Community Forum
about: Ask in the OpenZeppelin Forum

View File

@ -10,5 +10,5 @@ about: Suggest an idea for OpenZeppelin Contracts
**📝 Details**
<!-- Please describe your feature request in detail. -->
<!-- Make sure that you have reviewed the OpenZeppelin Contributor Guidelines. -->
<!-- Make sure that you have reviewed the OpenZeppelin Contracts Contributor Guidelines. -->
<!-- https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md -->

View File

@ -1,22 +1,20 @@
<!-- 0. 🎉 Thank you for submitting a PR! -->
<!-- Thank you for your interest in contributing to OpenZeppelin! -->
<!-- 1. Does this close any open issues? Please list them below. -->
<!-- Consider opening an issue for discussion prior to submitting a PR. -->
<!-- New features will be merged faster if they were first discussed and designed with the team. -->
<!-- Keep in mind that new features have a better chance of being merged fast if
they were first discussed and designed with the maintainers. If there is no
corresponding issue, please consider opening one for discussion first! -->
Fixes #???? <!-- Fill in with issue number -->
Fixes #
<!-- Describe the changes introduced in this pull request. -->
<!-- Include any context necessary for understanding the PR's purpose. -->
<!-- 2. Describe the changes introduced in this pull request. -->
<!-- Include any context necessary for understanding the PR's purpose. -->
<!-- 3. Before submitting, please make sure that you have:
- reviewed the OpenZeppelin Contributor Guidelines
(https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md),
- added tests where applicable to test new functionality,
- made sure that your contracts are well-documented,
- run the Solidity linter (`npm run lint:sol`) and fixed any issues,
- run the JS linter and fixed any issues (`npm run lint:fix`), and
- updated the changelog, if applicable.
-->
#### PR Checklist
<!-- Before merging the pull request all of the following must be complete. -->
<!-- Feel free to submit a PR or Draft PR even if some items are pending. -->
<!-- Some of the items may not apply. -->
- [ ] Tests
- [ ] Documentation
- [ ] Changeset entry (run `npx changeset add`)

49
.github/actions/gas-compare/action.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: Compare gas costs
inputs:
token:
description: github token
required: true
report:
description: report to read from
required: false
default: gasReporterOutput.json
out_report:
description: report to read
required: false
default: ${{ github.ref_name }}.gasreport.json
ref_report:
description: report to read from
required: false
default: ${{ github.base_ref }}.gasreport.json
runs:
using: composite
steps:
- name: Download reference report
if: github.event_name == 'pull_request'
run: |
RUN_ID=`gh run list --repo ${{ github.repository }} --branch ${{ github.base_ref }} --workflow ${{ github.workflow }} --limit 100 --json 'conclusion,databaseId,event' --jq 'map(select(.conclusion=="success" and .event!="pull_request"))[0].databaseId'`
gh run download ${RUN_ID} --repo ${{ github.repository }} -n gasreport
env:
GITHUB_TOKEN: ${{ inputs.token }}
shell: bash
continue-on-error: true
id: reference
- name: Compare reports
if: steps.reference.outcome == 'success' && github.event_name == 'pull_request'
run: |
node scripts/checks/compareGasReports.js ${{ inputs.report }} ${{ inputs.ref_report }} >> $GITHUB_STEP_SUMMARY
env:
STYLE: markdown
shell: bash
- name: Rename report for upload
if: github.event_name != 'pull_request'
run: |
mv ${{ inputs.report }} ${{ inputs.out_report }}
shell: bash
- name: Save report
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: gasreport
path: ${{ inputs.out_report }}

19
.github/actions/setup/action.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Setup
runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: 14.x
- uses: actions/cache@v3
id: cache
with:
path: '**/node_modules'
key: npm-v3-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
env:
SKIP_COMPILE: true

View File

@ -0,0 +1,55 @@
name: Compare storage layouts
inputs:
token:
description: github token
required: true
buildinfo:
description: compilation artifacts
required: false
default: artifacts/build-info/*.json
layout:
description: extracted storage layout
required: false
default: HEAD.layout.json
out_layout:
description: storage layout to upload
required: false
default: ${{ github.ref_name }}.layout.json
ref_layout:
description: storage layout for the reference branch
required: false
default: ${{ github.base_ref }}.layout.json
runs:
using: composite
steps:
- name: Extract layout
run: |
node scripts/checks/extract-layout.js ${{ inputs.buildinfo }} > ${{ inputs.layout }}
shell: bash
- name: Download reference
if: github.event_name == 'pull_request'
run: |
RUN_ID=`gh run list --repo ${{ github.repository }} --branch ${{ github.base_ref }} --workflow ${{ github.workflow }} --limit 100 --json 'conclusion,databaseId,event' --jq 'map(select(.conclusion=="success" and .event!="pull_request"))[0].databaseId'`
gh run download ${RUN_ID} --repo ${{ github.repository }} -n layout
env:
GITHUB_TOKEN: ${{ inputs.token }}
shell: bash
continue-on-error: true
id: reference
- name: Compare layouts
if: steps.reference.outcome == 'success' && github.event_name == 'pull_request'
run: |
node scripts/checks/compare-layout.js --head ${{ inputs.layout }} --ref ${{ inputs.ref_layout }}
shell: bash
- name: Rename artifacts for upload
if: github.event_name != 'pull_request'
run: |
mv ${{ inputs.layout }} ${{ inputs.out_layout }}
shell: bash
- name: Save artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: layout
path: ${{ inputs.out_layout }}

67
.github/stale.yml vendored
View File

@ -1,67 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 15
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 15
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- on hold
- meta
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
Hi all!
This Pull Request has not had any recent activity, is it still relevant? If so, what is blocking it?
Is there anything we can do to help move it forward?
Thanks!
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
Hi folks!
This Pull Request is being closed as there was no response to the previous prompt.
However, please leave a comment whenever you're ready to resume, so it can be reopened.
Thanks again!
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
# Limit to only `issues` or `pulls`
only: pulls
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.
# issues:
# exemptLabels:
# - confirmed

18
.github/workflows/actionlint.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: lint workflows
on:
pull_request:
paths:
- '.github/**/*.ya?ml'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add problem matchers
run: |
# https://github.com/rhysd/actionlint/blob/3a2f2c7/docs/usage.md#problem-matchers
curl -LO https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json
echo "::add-matcher::actionlint-matcher.json"
- uses: docker://rhysd/actionlint:latest

28
.github/workflows/changeset.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: changeset
on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- labeled
- unlabeled
concurrency:
group: changeset-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changeset') }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Include history so Changesets finds merge-base
- name: Set up environment
uses: ./.github/actions/setup
- name: Check changeset
run: npx changeset status --since=origin/${{ github.base_ref }}

96
.github/workflows/checks.yml vendored Normal file
View File

@ -0,0 +1,96 @@
name: checks
on:
push:
branches:
- master
- release-v*
pull_request: {}
workflow_dispatch: {}
concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- run: npm run lint
tests:
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
NODE_OPTIONS: --max_old_space_size=4096
GAS: true
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests and generate gas report
run: npm run test
- name: Check linearisation of the inheritance graph
run: npm run test:inheritance
- name: Check proceduraly generated contracts are up-to-date
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
run: npm run test:generation
- name: Compare gas costs
uses: ./.github/actions/gas-compare
with:
token: ${{ github.token }}
- name: Check storage layout
uses: ./.github/actions/storage-layout
with:
token: ${{ github.token }}
foundry-tests:
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run tests
run: forge test -vv
coverage:
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- run: npm run coverage
env:
NODE_OPTIONS: --max_old_space_size=4096
- uses: codecov/codecov-action@v3
slither:
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- run: rm foundry.toml
- uses: crytic/slither-action@v0.3.0
codespell:
if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run CodeSpell
uses: codespell-project/actions-codespell@v1.0
with:
check_filenames: true
skip: package-lock.json,*.pdf

19
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Build Docs
on:
push:
branches: [release-v*]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- run: bash scripts/git-user-config.sh
- run: node scripts/update-docs-branch.js
- run: git push --all origin

View File

@ -0,0 +1,55 @@
name: Formal verification
on:
push:
branches:
- master
- release-v*
- formal-verification
pull_request: {}
workflow_dispatch: {}
jobs:
list-scripts:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: echo ::set-output name=matrix::$(ls certora/scripts/{,**}/*.sh | grep -v '\WnoCI\W' | jq -Rsc 'split("\n")[:-1]')
verify:
runs-on: ubuntu-latest
needs: list-scripts
steps:
- uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: '3.10'
cache: 'pip'
- name: Install java
uses: actions/setup-java@v1
with:
java-version: '11'
java-package: 'jre'
- name: Install certora
run: pip install certora-cli
- name: Install solc
run: |
wget https://github.com/ethereum/solidity/releases/download/v0.8.19/solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc
chmod +x /usr/local/bin/solc
- name: Verify rule ${{ matrix.params }}
run: |
touch certora/applyHarness.patch
make -C certora munged
bash ${{ matrix.params }}
env:
CERTORAKEY: ${{ secrets.CERTORAKEY }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
params: ${{ fromJson(needs.list-scripts.outputs.matrix) }}

214
.github/workflows/release-cycle.yml vendored Normal file
View File

@ -0,0 +1,214 @@
# D: Manual Dispatch
# M: Merge release PR
# C: Commit
# ┌───────────┐ ┌─────────────┐ ┌────────────────┐
# │Development├──D──►RC-Unreleased│ ┌──►Final-Unreleased│
# └───────────┘ └─┬─────────▲─┘ │ └─┬────────────▲─┘
# │ │ │ │ │
# M C D M C
# │ │ │ │ │
# ┌▼─────────┴┐ │ ┌▼────────────┴┐
# │RC-Released├───┘ │Final-Released│
# └───────────┘ └──────────────┘
name: Release Cycle
on:
push:
branches:
- release-v*
workflow_dispatch: {}
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
state:
name: Check state
permissions:
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- id: state
name: Get state
uses: actions/github-script@v6
env:
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
with:
result-encoding: string
script: await require('./scripts/release/workflow/state.js')({ github, context, core })
outputs:
# Job Flags
start: ${{ steps.state.outputs.start }}
changesets: ${{ steps.state.outputs.changesets }}
promote: ${{ steps.state.outputs.promote }}
publish: ${{ steps.state.outputs.publish }}
merge: ${{ steps.state.outputs.merge }}
# Global variables
is_prerelease: ${{ steps.state.outputs.is_prerelease }}
start:
needs: state
name: Start new release candidate
permissions:
contents: write
actions: write
if: needs.state.outputs.start == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- run: bash scripts/git-user-config.sh
- id: start
name: Create branch with release candidate
run: bash scripts/release/workflow/start.sh
- name: Re-run workflow
uses: actions/github-script@v6
env:
REF: ${{ steps.start.outputs.branch }}
with:
script: await require('./scripts/release/workflow/rerun.js')({ github, context })
promote:
needs: state
name: Promote to final release
permissions:
contents: write
actions: write
if: needs.state.outputs.promote == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- run: bash scripts/git-user-config.sh
- name: Exit prerelease state
if: needs.state.outputs.is_prerelease == 'true'
run: bash scripts/release/workflow/exit-prerelease.sh
- name: Re-run workflow
uses: actions/github-script@v6
with:
script: await require('./scripts/release/workflow/rerun.js')({ github, context })
changesets:
needs: state
name: Update PR to release
permissions:
contents: write
pull-requests: write
if: needs.state.outputs.changesets == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # To get all tags
- name: Set up environment
uses: ./.github/actions/setup
- name: Set release title
uses: actions/github-script@v6
with:
result-encoding: string
script: await require('./scripts/release/workflow/set-changesets-pr-title.js')({ core })
- name: Create PR
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRERELEASE: ${{ needs.state.outputs.is_prerelease }}
with:
version: npm run version
title: ${{ env.TITLE }}
commit: ${{ env.TITLE }}
body: | # Wait for support on this https://github.com/changesets/action/pull/250
This is an automated PR for releasing ${{ github.repository }}
Check [CHANGELOG.md](${{ github.repository }}/CHANGELOG.md)
publish:
needs: state
name: Publish to npm
environment: npm
permissions:
contents: write
if: needs.state.outputs.publish == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- id: pack
name: Pack
run: bash scripts/release/workflow/pack.sh
env:
PRERELEASE: ${{ needs.state.outputs.is_prerelease }}
- name: Upload tarball artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.ref_name }}
path: ${{ steps.pack.outputs.tarball }}
- name: Tag
run: npx changeset tag
- name: Publish
run: bash scripts/release/workflow/publish.sh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TARBALL: ${{ steps.pack.outputs.tarball }}
TAG: ${{ steps.pack.outputs.tag }}
- name: Push tags
run: git push --tags
- name: Create Github Release
uses: actions/github-script@v6
env:
PRERELEASE: ${{ needs.state.outputs.is_prerelease }}
with:
script: await require('./scripts/release/workflow/github-release.js')({ github, context })
outputs:
tarball_name: ${{ steps.pack.outputs.tarball_name }}
integrity_check:
needs: publish
name: Tarball Integrity Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download tarball artifact
id: artifact
# Replace with actions/upload-artifact@v3 when
# https://github.com/actions/download-artifact/pull/194 gets released
uses: actions/download-artifact@e9ef242655d12993efdcda9058dee2db83a2cb9b
with:
name: ${{ github.ref_name }}
- name: Check integrity
run: bash scripts/release/workflow/integrity-check.sh
env:
TARBALL: ${{ steps.artifact.outputs.download-path }}/${{ needs.publish.outputs.tarball_name }}
merge:
needs: state
name: Create PR back to master
permissions:
contents: write
pull-requests: write
if: needs.state.outputs.merge == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # All branches
- name: Set up environment
uses: ./.github/actions/setup
- run: bash scripts/git-user-config.sh
- name: Create branch to merge
run: bash scripts/release/workflow/prepare-release-merge.sh
- name: Create PR back to master
uses: actions/github-script@v6
with:
script: |
await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: 'merge/${{ github.ref_name }}',
base: 'master',
title: '${{ format('Merge {0} branch', github.ref_name) }}'
});

23
.github/workflows/upgradeable.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Upgradeable Trigger
on:
push:
branches:
- master
- release-v*
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- id: app
uses: getsentry/action-github-app-token@v2
with:
app_id: ${{ secrets.UPGRADEABLE_APP_ID }}
private_key: ${{ secrets.UPGRADEABLE_APP_PK }}
- run: |
curl -X POST \
https://api.github.com/repos/OpenZeppelin/openzeppelin-contracts-upgradeable/dispatches \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: token ${{ steps.app.outputs.token }}' \
-d '{ "event_type": "Update", "client_payload": { "ref": "${{ github.ref }}" } }'

19
.gitignore vendored
View File

@ -50,3 +50,22 @@ contracts/README.md
# temporary artifact from solidity-coverage
allFiredEvents
.coverage_artifacts
.coverage_cache
.coverage_contracts
# hardat-exposed
contracts-exposed
# Hardhat
/cache
/artifacts
# Foundry
/out
# Certora
.certora*
.last_confs
certora_*
resource_errors.json

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/erc4626-tests"]
path = lib/erc4626-tests
url = https://github.com/a16z/erc4626-tests.git

4
.mocharc.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
require: 'hardhat/register',
timeout: 4000,
};

14
.prettierrc Normal file
View File

@ -0,0 +1,14 @@
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid",
"overrides": [
{
"files": "*.sol",
"options": {
"singleQuote": false
}
}
]
}

View File

@ -1,8 +1,13 @@
module.exports = {
norpc: true,
testCommand: 'npm test',
compileCommand: 'npm run compile',
skipFiles: [
'mocks',
]
}
norpc: true,
testCommand: 'npm test',
compileCommand: 'npm run compile',
skipFiles: ['mocks'],
providerOptions: {
default_balance_ether: '10000000000000000000000000',
},
mocha: {
fgrep: '[skip-on-coverage]',
invert: true,
},
};

View File

@ -1,10 +1,14 @@
{
"extends": "solhint:recommended",
"rules": {
"func-order": "off",
"mark-callable-contracts": "off",
"no-empty-blocks": "off",
"compiler-version": ["error", "^0.6.0"],
"private-vars-leading-underscore": "error"
"no-unused-vars": "error",
"const-name-snakecase": "error",
"contract-name-camelcase": "error",
"event-name-camelcase": "error",
"func-name-mixedcase": "error",
"func-param-name-mixedcase": "error",
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": "error",
"var-name-mixedcase": "error",
"imports-on-top": "error"
}
}

View File

@ -1,101 +1,567 @@
# Changelog
### Breaking changes
- `EIP712`: Addition of ERC5267 support requires support for user defined value types, which was released in Solidity version 0.8.8. This requires a pragma change from `^0.8.0` to `^0.8.8`.
- `EIP712`: Optimization of the cache for the upgradeable version affects the way `name` and `version` are set. This is no longer done through an initializer, and is instead part of the implementation's constructor. As a consequence, all proxies using the same implementation will necessarily share the same `name` and `version`. Additionally, an implementation upgrade risks changing the EIP712 domain unless the same `name` and `version` are used when deploying the new implementation contract.
### Deprecations
- `ERC20Permit`: Added the file `IERC20Permit.sol` and `ERC20Permit.sol` and deprecated `draft-IERC20Permit.sol` and `draft-ERC20Permit.sol` since [EIP-2612](https://eips.ethereum.org/EIPS/eip-2612) is no longer a Draft. Developers are encouraged to update their imports. ([#3793](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3793))
- `Timers`: The `Timers` library is now deprecated and will be removed in the next major release. ([#4062](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4062))
- `ERC777`: The `ERC777` token standard is no longer supported by OpenZeppelin. Our implementation is now deprecated and will be removed in the next major release. The corresponding standard interfaces remain available. ([#4066](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4066))
- `ERC1820Implementer`: The `ERC1820` pseudo-introspection mechanism is no longer supported by OpenZeppelin. Our implementation is now deprecated and will be removed in the next major release. The corresponding standard interfaces remain available. ([#4066](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4066))
## 4.8.1 (2023-01-12)
- `ERC4626`: Use staticcall instead of call when fetching underlying ERC-20 decimals. ([#3943](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3943))
## 4.8.0 (2022-11-08)
- `TimelockController`: Added a new `admin` constructor parameter that is assigned the admin role instead of the deployer account. ([#3722](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3722))
- `Initializable`: add internal functions `_getInitializedVersion` and `_isInitializing` ([#3598](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3598))
- `ERC165Checker`: add `supportsERC165InterfaceUnchecked` for consulting individual interfaces without the full ERC165 protocol. ([#3339](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3339))
- `Address`: optimize `functionCall` by calling `functionCallWithValue` directly. ([#3468](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3468))
- `Address`: optimize `functionCall` functions by checking contract size only if there is no returned data. ([#3469](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3469))
- `Governor`: make the `relay` function payable, and add support for EOA payments. ([#3730](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3730))
- `GovernorCompatibilityBravo`: remove unused `using` statements. ([#3506](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3506))
- `ERC20`: optimize `_transfer`, `_mint` and `_burn` by using `unchecked` arithmetic when possible. ([#3513](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3513))
- `ERC20Votes`, `ERC721Votes`: optimize `getPastVotes` for looking up recent checkpoints. ([#3673](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3673))
- `ERC20FlashMint`: add an internal `_flashFee` function for overriding. ([#3551](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3551))
- `ERC4626`: use the same `decimals()` as the underlying asset by default (if available). ([#3639](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3639))
- `ERC4626`: add internal `_initialConvertToShares` and `_initialConvertToAssets` functions to customize empty vaults behavior. ([#3639](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3639))
- `ERC721`: optimize transfers by making approval clearing implicit instead of emitting an event. ([#3481](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3481))
- `ERC721`: optimize burn by making approval clearing implicit instead of emitting an event. ([#3538](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3538))
- `ERC721`: Fix balance accounting when a custom `_beforeTokenTransfer` hook results in a transfer of the token under consideration. ([#3611](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3611))
- `ERC721`: use unchecked arithmetic for balance updates. ([#3524](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3524))
- `ERC721Consecutive`: Implementation of EIP-2309 that allows batch minting of ERC721 tokens during construction. ([#3311](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3311))
- `ReentrancyGuard`: Reduce code size impact of the modifier by using internal functions. ([#3515](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3515))
- `SafeCast`: optimize downcasting of signed integers. ([#3565](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3565))
- `ECDSA`: Remove redundant check on the `v` value. ([#3591](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3591))
- `VestingWallet`: add `releasable` getters. ([#3580](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3580))
- `VestingWallet`: remove unused library `Math.sol`. ([#3605](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3605))
- `VestingWallet`: make constructor payable. ([#3665](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3665))
- `Create2`: optimize address computation by using assembly instead of `abi.encodePacked`. ([#3600](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3600))
- `Clones`: optimized the assembly to use only the scratch space during deployments, and optimized `predictDeterministicAddress` to use fewer operations. ([#3640](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3640))
- `Checkpoints`: Use procedural generation to support multiple key/value lengths. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
- `Checkpoints`: Add new lookup mechanisms. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
- `Arrays`: Add `unsafeAccess` functions that allow reading and writing to an element in a storage array bypassing Solidity's "out-of-bounds" check. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
- `Strings`: optimize `toString`. ([#3573](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3573))
- `Ownable2Step`: extension of `Ownable` that makes the ownership transfers a two step process. ([#3620](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3620))
- `Math` and `SignedMath`: optimize function `max` by using `>` instead of `>=`. ([#3679](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3679))
- `Math`: Add `log2`, `log10` and `log256`. ([#3670](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3670))
- Arbitrum: Update the vendored arbitrum contracts to match the nitro upgrade. ([#3692](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3692))
### Breaking changes
- `ERC721`: In order to add support for batch minting via `ERC721Consecutive` it was necessary to make a minor breaking change in the internal interface of `ERC721`. Namely, the hooks `_beforeTokenTransfer` and `_afterTokenTransfer` have one additional argument that may need to be added to overrides:
```diff
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
+ uint256 batchSize
) internal virtual override
```
- `ERC4626`: Conversion from shares to assets (and vice-versa) in an empty vault used to consider the possible mismatch between the underlying asset's and the vault's decimals. This initial conversion rate is now set to 1-to-1 irrespective of decimals, which are meant for usability purposes only. The vault now uses the assets decimals by default, so off-chain the numbers should appear the same. Developers overriding the vault decimals to a value that does not match the underlying asset may want to override the `_initialConvertToShares` and `_initialConvertToAssets` to replicate the previous behavior.
- `TimelockController`: During deployment, the TimelockController used to grant the `TIMELOCK_ADMIN_ROLE` to the deployer and to the timelock itself. The deployer was then expected to renounce this role once configuration of the timelock is over. Failing to renounce that role allows the deployer to change the timelock permissions (but not to bypass the delay for any time-locked actions). The role is no longer given to the deployer by default. A new parameter `admin` can be set to a non-zero address to grant the admin role during construction (to the deployer or any other address). Just like previously, this admin role should be renounced after configuration. If this param is given `address(0)`, the role is not allocated and doesn't need to be revoked. In any case, the timelock itself continues to have this role.
### Deprecations
- `EIP712`: Added the file `EIP712.sol` and deprecated `draft-EIP712.sol` since the EIP is no longer a Draft. Developers are encouraged to update their imports. ([#3621](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3621))
```diff
-import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
+import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
```
- `ERC721Votes`: Added the file `ERC721Votes.sol` and deprecated `draft-ERC721Votes.sol` since it no longer depends on a Draft EIP (EIP-712). Developers are encouraged to update their imports. ([#3699](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3699))
```diff
-import "@openzeppelin/contracts/token/ERC721/extensions/draft-ERC721Votes.sol";
+import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol";
```
### ERC-721 Compatibility Note
ERC-721 integrators that interpret contract state from events should make sure that they implement the clearing of approval that is implicit in every transfer according to the EIP. Previous versions of OpenZeppelin Contracts emitted an explicit `Approval` event even though it was not required by the specification, and this is no longer the case.
With the new `ERC721Consecutive` extension, the internal workings of `ERC721` are slightly changed. Custom extensions to ERC721 should be reviewed to ensure they remain correct. The internal functions that should be considered are `_ownerOf` (new), `_beforeTokenTransfer`, and `_afterTokenTransfer`.
### ERC-4626 Upgrade Note
Existing `ERC4626` contracts that are upgraded to 4.8 must initialize a new variable that holds the vault token decimals. The recommended way to do this is to use a [reinitializer]:
[reinitializer]: https://docs.openzeppelin.com/contracts/4.x/api/proxy#Initializable-reinitializer-uint8-
```solidity
function migrateToV48() public reinitializer(2) {
__ERC4626_init(IERC20Upgradeable(asset()));
}
```
## 4.7.3 (2022-08-10)
### Breaking changes
- `ECDSA`: `recover(bytes32,bytes)` and `tryRecover(bytes32,bytes)` no longer accept compact signatures to prevent malleability. Compact signature support remains available using `recover(bytes32,bytes32,bytes32)` and `tryRecover(bytes32,bytes32,bytes32)`.
## 4.7.2 (2022-07-25)
- `LibArbitrumL2`, `CrossChainEnabledArbitrumL2`: Fixed detection of cross-chain calls for EOAs. Previously, calls from EOAs would be classified as cross-chain calls. ([#3578](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3578))
- `GovernorVotesQuorumFraction`: Fixed quorum updates so they do not affect past proposals that failed due to lack of quorum. ([#3561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3561))
- `ERC165Checker`: Added protection against large returndata. ([#3587](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3587))
## 4.7.1 (2022-07-18)
- `SignatureChecker`: Fix an issue that causes `isValidSignatureNow` to revert when the target contract returns ill-encoded data. ([#3552](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552))
- `ERC165Checker`: Fix an issue that causes `supportsInterface` to revert when the target contract returns ill-encoded data. ([#3552](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552))
## 4.7.0 (2022-06-29)
- `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317))
- `CrossChainEnabledPolygonChild`: replace the `require` statement with the custom error `NotCrossChainCall`. ([#3380](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3380))
- `ERC20FlashMint`: Add customizable flash fee receiver. ([#3327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3327))
- `ERC4626`: add an extension of `ERC20` that implements the ERC4626 Tokenized Vault Standard. ([#3171](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3171))
- `SafeERC20`: add `safePermit` as mitigation against phantom permit functions. ([#3280](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3280))
- `Math`: add a `mulDiv` function that can round the result either up or down. ([#3171](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3171))
- `Math`: Add a `sqrt` function to compute square roots of integers, rounding either up or down. ([#3242](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3242))
- `Strings`: add a new overloaded function `toHexString` that converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. ([#3403](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3403))
- `EnumerableMap`: add new `UintToUintMap` map type. ([#3338](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3338))
- `EnumerableMap`: add new `Bytes32ToUintMap` map type. ([#3416](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3416))
- `SafeCast`: add support for many more types, using procedural code generation. ([#3245](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3245))
- `MerkleProof`: add `multiProofVerify` to prove multiple values are part of a Merkle tree. ([#3276](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3276))
- `MerkleProof`: add calldata versions of the functions to avoid copying input arrays to memory and save gas. ([#3200](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3200))
- `ERC721`, `ERC1155`: simplified revert reasons. ([#3254](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3254), ([#3438](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3438)))
- `ERC721`: removed redundant require statement. ([#3434](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3434))
- `PaymentSplitter`: add `releasable` getters. ([#3350](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3350))
- `Initializable`: refactored implementation of modifiers for easier understanding. ([#3450](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3450))
- `Proxies`: remove runtime check of ERC1967 storage slots. ([#3455](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3455))
### Breaking changes
- `Initializable`: functions decorated with the modifier `reinitializer(1)` may no longer invoke each other.
## 4.6.0 (2022-04-26)
- `crosschain`: Add a new set of contracts for cross-chain applications. `CrossChainEnabled` is a base contract with instantiations for several chains and bridges, and `AccessControlCrossChain` is an extension of access control that allows cross-chain operation. ([#3183](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3183))
- `AccessControl`: add a virtual `_checkRole(bytes32)` function that can be overridden to alter the `onlyRole` modifier behavior. ([#3137](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3137))
- `EnumerableMap`: add new `AddressToUintMap` map type. ([#3150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3150))
- `EnumerableMap`: add new `Bytes32ToBytes32Map` map type. ([#3192](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3192))
- `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226))
- `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259))
- `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196))
- `ERC1155`: Add a `_afterTokenTransfer` hook for improved extensibility. ([#3166](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3166))
- `ERC1155URIStorage`: add a new extension that implements a `_setURI` behavior similar to ERC721's `_setTokenURI`. ([#3210](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3210))
- `DoubleEndedQueue`: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. ([#3153](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3153))
- `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147))
- `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
- `Governor`: rewording of revert reason for consistency. ([#3275](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3275))
- `Governor`: fix an inconsistency in data locations that could lead to invalid bytecode being produced. ([#3295](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3295))
- `Governor`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by governors. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230))
- `TimelockController`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by timelocks. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230))
- `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165))
- `Initializable`: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. ([#3232](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3232))
- `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294))
- `ERC2981`: make `royaltyInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305))
### Upgradeability notice
- `TimelockController`: **(Action needed)** The upgrade from <4.6 to >=4.6 introduces a new `CANCELLER_ROLE` that requires set up to be assignable. After the upgrade, only addresses with this role will have the ability to cancel. Proposers will no longer be able to cancel. Assigning cancellers can be done by an admin (including the timelock itself) once the role admin is set up. To do this, we recommend upgrading to the `TimelockControllerWith46MigrationUpgradeable` contract and then calling the `migrateTo46` function.
### Breaking changes
- `Governor`: Adds internal virtual `_getVotes` method that must be implemented; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing voting module extension, rename `getVotes` to `_getVotes` and add a `bytes memory` argument. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
- `Governor`: Adds `params` parameter to internal virtual `_countVote` method; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing counting module extension, add a `bytes memory` argument to `_countVote`. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
- `Governor`: Does not emit `VoteCast` event when params data is non-empty; instead emits `VoteCastWithParams` event. To fix this on an integration that consumes the `VoteCast` event, also fetch/monitor `VoteCastWithParams` events. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
- `Votes`: The internal virtual function `_getVotingUnits` was made `view` (which was accidentally missing). Any overrides should now be updated so they are `view` as well.
## 4.5.0 (2022-02-09)
- `ERC2981`: add implementation of the royalty standard, and the respective extensions for `ERC721` and `ERC1155`. ([#3012](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3012))
- `GovernorTimelockControl`: improve the `state()` function to have it reflect cases where a proposal has been canceled directly on the timelock. ([#2977](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2977))
- Preset contracts are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com). ([#2986](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2986))
- `Governor`: add a relay function to help recover assets sent to a governor that is not its own executor (e.g. when using a timelock). ([#2926](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2926))
- `GovernorPreventLateQuorum`: add new module to ensure a minimum voting duration is available after the quorum is reached. ([#2973](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2973))
- `ERC721`: improved revert reason when transferring from wrong owner. ([#2975](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2975))
- `Votes`: Added a base contract for vote tracking with delegation. ([#2944](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2944))
- `ERC721Votes`: Added an extension of ERC721 enabled with vote tracking and delegation. ([#2944](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2944))
- `ERC2771Context`: use immutable storage to store the forwarder address, no longer an issue since Solidity >=0.8.8 allows reading immutable variables in the constructor. ([#2917](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2917))
- `Base64`: add a library to parse bytes into base64 strings using `encode(bytes memory)` function, and provide examples to show how to use to build URL-safe `tokenURIs`. ([#2884](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2884))
- `ERC20`: reduce allowance before triggering transfer. ([#3056](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3056))
- `ERC20`: do not update allowance on `transferFrom` when allowance is `type(uint256).max`. ([#3085](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3085))
- `ERC20`: add a `_spendAllowance` internal function. ([#3170](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3170))
- `ERC20Burnable`: do not update allowance on `burnFrom` when allowance is `type(uint256).max`. ([#3170](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3170))
- `ERC777`: do not update allowance on `transferFrom` when allowance is `type(uint256).max`. ([#3085](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3085))
- `ERC777`: add a `_spendAllowance` internal function. ([#3170](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3170))
- `SignedMath`: a new signed version of the Math library with `max`, `min`, and `average`. ([#2686](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2686))
- `SignedMath`: add an `abs(int256)` method that returns the unsigned absolute value of a signed value. ([#2984](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2984))
- `ERC1967Upgrade`: Refactor the secure upgrade to use `ERC1822` instead of the previous rollback mechanism. This reduces code complexity and attack surface with similar security guarantees. ([#3021](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3021))
- `UUPSUpgradeable`: Add `ERC1822` compliance to support the updated secure upgrade mechanism. ([#3021](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3021))
- Some more functions have been made virtual to customize them via overrides. In many cases this will not imply that other functions in the contract will automatically adapt to the overridden definitions. People who wish to override should consult the source code to understand the impact and if they need to override any additional functions to achieve the desired behavior.
### Breaking changes
- `ERC1967Upgrade`: The function `_upgradeToAndCallSecure` was renamed to `_upgradeToAndCallUUPS`, along with the change in security mechanism described above.
- `Address`: The Solidity pragma is increased from `^0.8.0` to `^0.8.1`. This is required by the `account.code.length` syntax that replaces inline assembly. This may require users to bump their compiler version from `0.8.0` to `0.8.1` or later. Note that other parts of the code already include stricter requirements.
## 4.4.2 (2022-01-11)
### Bugfixes
- `GovernorCompatibilityBravo`: Fix error in the encoding of calldata for proposals submitted through the compatibility interface with explicit signatures. ([#3100](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3100))
## 4.4.1 (2021-12-14)
- `Initializable`: change the existing `initializer` modifier and add a new `onlyInitializing` modifier to prevent reentrancy risk. ([#3006](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3006))
### Breaking change
It is no longer possible to call an `initializer`-protected function from within another `initializer` function outside the context of a constructor. Projects using OpenZeppelin upgradeable proxies should continue to work as is, since in the common case the initializer is invoked in the constructor directly. If this is not the case for you, the suggested change is to use the new `onlyInitializing` modifier in the following way:
```diff
contract A {
- function initialize() public initializer { ... }
+ function initialize() internal onlyInitializing { ... }
}
contract B is A {
function initialize() public initializer {
A.initialize();
}
}
```
## 4.4.0 (2021-11-25)
- `Ownable`: add an internal `_transferOwnership(address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
- `AccessControl`: add internal `_grantRole(bytes32,address)` and `_revokeRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
- `AccessControl`: mark `_setupRole(bytes32,address)` as deprecated in favor of `_grantRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
- `AccessControlEnumerable`: hook into `_grantRole(bytes32,address)` and `_revokeRole(bytes32,address)`. ([#2946](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2946))
- `EIP712`: cache `address(this)` to immutable storage to avoid potential issues if a vanilla contract is used in a delegatecall context. ([#2852](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2852))
- Add internal `_setApprovalForAll` to `ERC721` and `ERC1155`. ([#2834](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2834))
- `Governor`: shift vote start and end by one block to better match Compound's GovernorBravo and prevent voting at the Governor level if the voting snapshot is not ready. ([#2892](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2892))
- `GovernorCompatibilityBravo`: consider quorum an inclusive rather than exclusive minimum to match Compound's GovernorBravo. ([#2974](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2974))
- `GovernorSettings`: a new governor module that manages voting settings updatable through governance actions. ([#2904](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2904))
- `PaymentSplitter`: now supports ERC20 assets in addition to Ether. ([#2858](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2858))
- `ECDSA`: add a variant of `toEthSignedMessageHash` for arbitrary length message hashing. ([#2865](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2865))
- `MerkleProof`: add a `processProof` function that returns the rebuilt root hash given a leaf and a proof. ([#2841](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2841))
- `VestingWallet`: new contract that handles the vesting of Ether and ERC20 tokens following a customizable vesting schedule. ([#2748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2748))
- `Governor`: enable receiving Ether when a Timelock contract is not used. ([#2849](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2849))
- `GovernorTimelockCompound`: fix ability to use Ether stored in the Timelock contract. ([#2849](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2849))
## 4.3.3 (2021-11-08)
- `ERC1155Supply`: Handle `totalSupply` changes by hooking into `_beforeTokenTransfer` to ensure consistency of balances and supply during `IERC1155Receiver.onERC1155Received` calls.
## 4.3.2 (2021-09-14)
- `UUPSUpgradeable`: Add modifiers to prevent `upgradeTo` and `upgradeToAndCall` being executed on any contract that is not the active ERC1967 proxy. This prevents these functions being called on implementation contracts or minimal ERC1167 clones, in particular.
## 4.3.1 (2021-08-26)
- `TimelockController`: Add additional isOperationReady check.
## 4.3.0 (2021-08-17)
- `ERC2771Context`: use private variable from storage to store the forwarder address. Fixes issues where `_msgSender()` was not callable from constructors. ([#2754](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2754))
- `EnumerableSet`: add `values()` functions that returns an array containing all values in a single call. ([#2768](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2768))
- `Governor`: added a modular system of `Governor` contracts based on `GovernorAlpha` and `GovernorBravo`. ([#2672](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2672))
- Add an `interfaces` folder containing solidity interfaces to final ERCs. ([#2517](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2517))
- `ECDSA`: add `tryRecover` functions that will not throw if the signature is invalid, and will return an error flag instead. ([#2661](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2661))
- `SignatureChecker`: Reduce gas usage of the `isValidSignatureNow` function for the "signature by EOA" case. ([#2661](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2661))
## 4.2.0 (2021-06-30)
- `ERC20Votes`: add a new extension of the `ERC20` token with support for voting snapshots and delegation. ([#2632](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2632))
- `ERC20VotesComp`: Variant of `ERC20Votes` that is compatible with Compound's `Comp` token interface but restricts supply to `uint96`. ([#2706](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2706))
- `ERC20Wrapper`: add a new extension of the `ERC20` token which wraps an underlying token. Deposit and withdraw guarantee that the total supply is backed by a corresponding amount of underlying token. ([#2633](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2633))
- Enumerables: Improve gas cost of removal in `EnumerableSet` and `EnumerableMap`.
- Enumerables: Improve gas cost of lookup in `EnumerableSet` and `EnumerableMap`.
- `Counter`: add a reset method. ([#2678](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2678))
- Tokens: Wrap definitely safe subtractions in `unchecked` blocks.
- `Math`: Add a `ceilDiv` method for performing ceiling division.
- `ERC1155Supply`: add a new `ERC1155` extension that keeps track of the totalSupply of each tokenId. ([#2593](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2593))
- `BitMaps`: add a new `BitMaps` library that provides a storage efficient datastructure for `uint256` to `bool` mapping with contiguous keys. ([#2710](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2710))
### Breaking Changes
- `ERC20FlashMint` is no longer a Draft ERC. ([#2673](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2673)))
**How to update:** Change your import paths by removing the `draft-` prefix from `@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol`.
> See [Releases and Stability: Drafts](https://docs.openzeppelin.com/contracts/4.x/releases-stability#drafts).
## 4.1.0 (2021-04-29)
- `IERC20Metadata`: add a new extended interface that includes the optional `name()`, `symbol()` and `decimals()` functions. ([#2561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2561))
- `ERC777`: make reception acquirement optional in `_mint`. ([#2552](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2552))
- `ERC20Permit`: add a `_useNonce` to enable further usage of ERC712 signatures. ([#2565](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2565))
- `ERC20FlashMint`: add an implementation of the ERC3156 extension for flash-minting ERC20 tokens. ([#2543](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2543))
- `SignatureChecker`: add a signature verification library that supports both EOA and ERC1271 compliant contracts as signers. ([#2532](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2532))
- `Multicall`: add abstract contract with `multicall(bytes[] calldata data)` function to bundle multiple calls together ([#2608](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2608))
- `ECDSA`: add support for ERC2098 short-signatures. ([#2582](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2582))
- `AccessControl`: add an `onlyRole` modifier to restrict specific function to callers bearing a specific role. ([#2609](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2609))
- `StorageSlot`: add a library for reading and writing primitive types to specific storage slots. ([#2542](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2542))
- UUPS Proxies: add `UUPSUpgradeable` to implement the UUPS proxy pattern together with `EIP1967Proxy`. ([#2542](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2542))
### Breaking changes
This release includes two small breaking changes in `TimelockController`.
1. The `onlyRole` modifier in this contract was designed to let anyone through if the role was granted to `address(0)`,
allowing the possibility to to make a role "open", which can be used for `EXECUTOR_ROLE`. This modifier is now
replaced by `AccessControl.onlyRole`, which does not have this ability. The previous behavior was moved to the
modifier `TimelockController.onlyRoleOrOpenRole`.
2. It was possible to make `PROPOSER_ROLE` an open role (as described in the previous item) if it was granted to
`address(0)`. This would affect the `schedule`, `scheduleBatch`, and `cancel` operations in `TimelockController`.
This ability was removed as it does not make sense to open up the `PROPOSER_ROLE` in the same way that it does for
`EXECUTOR_ROLE`.
## 4.0.0 (2021-03-23)
- Now targeting the 0.8.x line of Solidity compilers. For 0.6.x (resp 0.7.x) support, use version 3.4.0 (resp 3.4.0-solc-0.7) of OpenZeppelin.
- `Context`: making `_msgData` return `bytes calldata` instead of `bytes memory` ([#2492](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2492))
- `ERC20`: removed the `_setDecimals` function and the storage slot associated to decimals. ([#2502](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2502))
- `Strings`: addition of a `toHexString` function. ([#2504](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2504))
- `EnumerableMap`: change implementation to optimize for `key → value` lookups instead of enumeration. ([#2518](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2518))
- `GSN`: deprecate GSNv1 support in favor of upcoming support for GSNv2. ([#2521](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2521))
- `ERC165`: remove uses of storage in the base ERC165 implementation. ERC165 based contracts now use storage-less virtual functions. Old behavior remains available in the `ERC165Storage` extension. ([#2505](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2505))
- `Initializable`: make initializer check stricter during construction. ([#2531](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2531))
- `ERC721`: remove enumerability of tokens from the base implementation. This feature is now provided separately through the `ERC721Enumerable` extension. ([#2511](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2511))
- `AccessControl`: removed enumerability by default for a more lightweight contract. It is now opt-in through `AccessControlEnumerable`. ([#2512](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2512))
- Meta Transactions: add `ERC2771Context` and a `MinimalForwarder` for meta-transactions. ([#2508](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2508))
- Overall reorganization of the contract folder to improve clarity and discoverability. ([#2503](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2503))
- `ERC20Capped`: optimize gas usage by enforcing the check directly in `_mint`. ([#2524](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2524))
- Rename `UpgradeableProxy` to `ERC1967Proxy`. ([#2547](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2547))
- `ERC777`: optimize the gas costs of the constructor. ([#2551](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2551))
- `ERC721URIStorage`: add a new extension that implements the `_setTokenURI` behavior as it was available in 3.4.0. ([#2555](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2555))
- `AccessControl`: added ERC165 interface detection. ([#2562](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2562))
- `ERC1155`: make `uri` public so overloading function can call it using super. ([#2576](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2576))
### Bug fixes for beta releases
- `AccessControlEnumerable`: Fixed `renounceRole` not updating enumerable set of addresses for a role. ([#2572](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2572))
### How to upgrade from 3.x
Since this version has moved a few contracts to different directories, users upgrading from a previous version will need to adjust their import statements. To make this easier, the package includes a script that will migrate import statements automatically. After upgrading to the latest version of the package, run:
```
npx openzeppelin-contracts-migrate-imports
```
Make sure you're using git or another version control system to be able to recover from any potential error in our script.
### How to upgrade from 4.0-beta.x
Some further changes have been done between the different beta iterations. Transitions made during this period are configured in the `migrate-imports` script. Consequently, you can upgrade from any previous 4.0-beta.x version using the same script as described in the _How to upgrade from 3.x_ section.
## 3.4.2 (2021-07-24)
- `TimelockController`: Add additional isOperationReady check.
## 3.4.1 (2021-03-03)
- `ERC721`: made `_approve` an internal function (was private).
## 3.4.0 (2021-02-02)
- `BeaconProxy`: added new kind of proxy that allows simultaneous atomic upgrades. ([#2411](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2411))
- `EIP712`: added helpers to verify EIP712 typed data signatures on chain. ([#2418](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2418))
- `ERC20Permit`: added an implementation of the ERC20 permit extension for gasless token approvals. ([#2237](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2237))
- Presets: added token presets with preminted fixed supply `ERC20PresetFixedSupply` and `ERC777PresetFixedSupply`. ([#2399](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2399))
- `Address`: added `functionDelegateCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
- `Clones`: added a library for deploying EIP 1167 minimal proxies. ([#2449](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2449))
- `Context`: moved from `contracts/GSN` to `contracts/utils`. ([#2453](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2453))
- `PaymentSplitter`: replace usage of `.transfer()` with `Address.sendValue` for improved compatibility with smart wallets. ([#2455](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2455))
- `UpgradeableProxy`: bubble revert reasons from initialization calls. ([#2454](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2454))
- `SafeMath`: fix a memory allocation issue by adding new `SafeMath.tryOp(uint,uint)→(bool,uint)` functions. `SafeMath.op(uint,uint,string)→uint` are now deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))
- `EnumerableMap`: fix a memory allocation issue by adding new `EnumerableMap.tryGet(uint)→(bool,address)` functions. `EnumerableMap.get(uint)→string` is now deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))
- `ERC165Checker`: added batch `getSupportedInterfaces`. ([#2469](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2469))
- `RefundEscrow`: `beneficiaryWithdraw` will forward all available gas to the beneficiary. ([#2480](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2480))
- Many view and pure functions have been made virtual to customize them via overrides. In many cases this will not imply that other functions in the contract will automatically adapt to the overridden definitions. People who wish to override should consult the source code to understand the impact and if they need to override any additional functions to achieve the desired behavior.
### Security Fixes
- `ERC777`: fix potential reentrancy issues for custom extensions to `ERC777`. ([#2483](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2483))
If you're using our implementation of ERC777 from version 3.3.0 or earlier, and you define a custom `_beforeTokenTransfer` function that writes to a storage variable, you may be vulnerable to a reentrancy attack. If you're affected and would like assistance please write to security@openzeppelin.com. [Read more in the pull request.](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2483)
## 3.3.0 (2020-11-26)
- Now supports both Solidity 0.6 and 0.7. Compiling with solc 0.7 will result in warnings. Install the `solc-0.7` tag to compile without warnings.
- `Address`: added `functionStaticCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
- `TimelockController`: added a contract to augment access control schemes with a delay. ([#2354](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2354))
- `EnumerableSet`: added `Bytes32Set`, for sets of `bytes32`. ([#2395](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2395))
## 3.2.2-solc-0.7 (2020-10-28)
- Resolve warnings introduced by Solidity 0.7.4. ([#2396](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2396))
## 3.2.1-solc-0.7 (2020-09-15)
- `ERC777`: Remove a warning about function state visibility in Solidity 0.7. ([#2327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2327))
## 3.2.0 (2020-09-10)
### New features
- Proxies: added the proxy contracts from OpenZeppelin SDK. ([#2335](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2335))
#### Proxy changes with respect to OpenZeppelin SDK
Aside from upgrading them from Solidity 0.5 to 0.6, we've changed a few minor things from the proxy contracts as they were found in OpenZeppelin SDK.
- `UpgradeabilityProxy` was renamed to `UpgradeableProxy`.
- `AdminUpgradeabilityProxy` was renamed to `TransparentUpgradeableProxy`.
- `Proxy._willFallback` was renamed to `Proxy._beforeFallback`.
- `UpgradeabilityProxy._setImplementation` and `AdminUpgradeabilityProxy._setAdmin` were made private.
### Improvements
- `Address.isContract`: switched from `extcodehash` to `extcodesize` for less gas usage. ([#2311](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2311))
### Breaking changes
- `ERC20Snapshot`: switched to using `_beforeTokenTransfer` hook instead of overriding ERC20 operations. ([#2312](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2312))
This small change in the way we implemented `ERC20Snapshot` may affect users who are combining this contract with
other ERC20 flavors, since it no longer overrides `_transfer`, `_mint`, and `_burn`. This can result in having to remove Solidity `override(...)` specifiers in derived contracts for these functions, and to instead have to add it for `_beforeTokenTransfer`. See [Using Hooks](https://docs.openzeppelin.com/contracts/3.x/extending-contracts#using-hooks) in the documentation.
## 3.1.0 (2020-06-23)
### New features
- `SafeCast`: added functions to downcast signed integers (e.g. `toInt32`), improving usability of `SignedSafeMath`. ([#2243](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2243))
- `functionCall`: new helpers that replicate Solidity's function call semantics, reducing the need to rely on `call`. ([#2264](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2264))
- `ERC1155`: added support for a base implementation, non-standard extensions and a preset contract. ([#2014](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2014), [#2230](https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2230))
### Improvements
- `ReentrancyGuard`: reduced overhead of using the `nonReentrant` modifier. ([#2171](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2171))
- `AccessControl`: added a `RoleAdminChanged` event to `_setAdminRole`. ([#2214](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2214))
- Made all `public` functions in the token preset contracts `virtual`. ([#2257](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2257))
### Deprecations
- `SafeERC20`: deprecated `safeApprove`. ([#2268](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2268))
## 3.0.2 (2020-06-08)
### Improvements
- Added SPX license identifier to all contracts. ([#2235](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2235))
## 3.0.1 (2020-04-27)
### Bugfixes
* `ERC777`: fixed the `_approve` internal function not validating some of their arguments for non-zero addresses. ([#2213](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2213))
- `ERC777`: fixed the `_approve` internal function not validating some of their arguments for non-zero addresses. ([#2213](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2213))
## 3.0.0 (2020-04-20)
### New features
* `AccessControl`: new contract for managing permissions in a system, replacement for `Ownable` and `Roles`. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
* `SafeCast`: new functions to convert to and from signed and unsigned values: `toUint256` and `toInt256`. ([#2123](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2123))
* `EnumerableMap`: a new data structure for key-value pairs (like `mapping`) that can be iterated over. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
- `AccessControl`: new contract for managing permissions in a system, replacement for `Ownable` and `Roles`. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
- `SafeCast`: new functions to convert to and from signed and unsigned values: `toUint256` and `toInt256`. ([#2123](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2123))
- `EnumerableMap`: a new data structure for key-value pairs (like `mapping`) that can be iterated over. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
### Breaking changes
* `ERC721`: `burn(owner, tokenId)` was removed, use `burn(tokenId)` instead. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
* `ERC721`: `_checkOnERC721Received` was removed. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
* `ERC721`: `_transferFrom` and `_safeTransferFrom` were renamed to `_transfer` and `_safeTransfer`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
* `Ownable`: removed `_transferOwnership`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
* `PullPayment`, `Escrow`: `withdrawWithGas` was removed. The old `withdraw` function now forwards all gas. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
* `Roles` was removed, use `AccessControl` as a replacement. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
* `ECDSA`: when receiving an invalid signature, `recover` now reverts instead of returning the zero address. ([#2114](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2114))
* `Create2`: added an `amount` argument to `deploy` for contracts with `payable` constructors. ([#2117](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2117))
* `Pausable`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
* `Strings`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
* `Counters`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
* `SignedSafeMath`: moved to the `math` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
* `ERC20Snapshot`: moved to the `token/ERC20` directory. `snapshot` was changed into an `internal` function. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
* `Ownable`: moved to the `access` directory. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
* `Ownable`: removed `isOwner`. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
* `Secondary`: removed from the library, use `Ownable` instead. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
* `Escrow`, `ConditionalEscrow`, `RefundEscrow`: these now use `Ownable` instead of `Secondary`, their external API changed accordingly. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
* `ERC20`: removed `_burnFrom`. ([#2119](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2119))
* `Address`: removed `toPayable`, use `payable(address)` instead. ([#2133](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2133))
* `ERC777`: `_send`, `_mint` and `_burn` now use the caller as the operator. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
* `ERC777`: removed `_callsTokensToSend` and `_callTokensReceived`. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
* `EnumerableSet`: renamed `get` to `at`. ([#2151](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2151))
* `ERC165Checker`: functions no longer have a leading underscore. ([#2150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2150))
* `ERC721Metadata`, `ERC721Enumerable`: these contracts were removed, and their functionality merged into `ERC721`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
* `ERC721`: added a constructor for `name` and `symbol`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
* `ERC20Detailed`: this contract was removed and its functionality merged into `ERC20`. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
* `ERC20`: added a constructor for `name` and `symbol`. `decimals` now defaults to 18. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
* `Strings`: renamed `fromUint256` to `toString` ([#2188](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2188))
- `ERC721`: `burn(owner, tokenId)` was removed, use `burn(tokenId)` instead. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
- `ERC721`: `_checkOnERC721Received` was removed. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
- `ERC721`: `_transferFrom` and `_safeTransferFrom` were renamed to `_transfer` and `_safeTransfer`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
- `Ownable`: removed `_transferOwnership`. ([#2162](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2162))
- `PullPayment`, `Escrow`: `withdrawWithGas` was removed. The old `withdraw` function now forwards all gas. ([#2125](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2125))
- `Roles` was removed, use `AccessControl` as a replacement. ([#2112](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2112))
- `ECDSA`: when receiving an invalid signature, `recover` now reverts instead of returning the zero address. ([#2114](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2114))
- `Create2`: added an `amount` argument to `deploy` for contracts with `payable` constructors. ([#2117](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2117))
- `Pausable`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
- `Strings`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
- `Counters`: moved to the `utils` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
- `SignedSafeMath`: moved to the `math` directory. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
- `ERC20Snapshot`: moved to the `token/ERC20` directory. `snapshot` was changed into an `internal` function. ([#2122](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2122))
- `Ownable`: moved to the `access` directory. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
- `Ownable`: removed `isOwner`. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
- `Secondary`: removed from the library, use `Ownable` instead. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
- `Escrow`, `ConditionalEscrow`, `RefundEscrow`: these now use `Ownable` instead of `Secondary`, their external API changed accordingly. ([#2120](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2120))
- `ERC20`: removed `_burnFrom`. ([#2119](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2119))
- `Address`: removed `toPayable`, use `payable(address)` instead. ([#2133](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2133))
- `ERC777`: `_send`, `_mint` and `_burn` now use the caller as the operator. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
- `ERC777`: removed `_callsTokensToSend` and `_callTokensReceived`. ([#2134](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2134))
- `EnumerableSet`: renamed `get` to `at`. ([#2151](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2151))
- `ERC165Checker`: functions no longer have a leading underscore. ([#2150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2150))
- `ERC721Metadata`, `ERC721Enumerable`: these contracts were removed, and their functionality merged into `ERC721`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
- `ERC721`: added a constructor for `name` and `symbol`. ([#2160](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2160))
- `ERC20Detailed`: this contract was removed and its functionality merged into `ERC20`. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
- `ERC20`: added a constructor for `name` and `symbol`. `decimals` now defaults to 18. ([#2161](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2161))
- `Strings`: renamed `fromUint256` to `toString` ([#2188](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2188))
## 2.5.1 (2020-04-24)
### Bugfixes
* `ERC777`: fixed the `_send` and `_approve` internal functions not validating some of their arguments for non-zero addresses. ([#2212](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2212))
- `ERC777`: fixed the `_send` and `_approve` internal functions not validating some of their arguments for non-zero addresses. ([#2212](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2212))
## 2.5.0 (2020-02-04)
### New features
* `SafeCast.toUintXX`: new library for integer downcasting, which allows for safe operation on smaller types (e.g. `uint32`) when combined with `SafeMath`. ([#1926](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1926))
* `ERC721Metadata`: added `baseURI`, which can be used for dramatic gas savings when all token URIs share a prefix (e.g. `http://api.myapp.com/tokens/<id>`). ([#1970](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1970))
* `EnumerableSet`: new library for storing enumerable sets of values. Only `AddressSet` is supported in this release. ([#2061](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/2061))
* `Create2`: simple library to make usage of the `CREATE2` opcode easier. ([#1744](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1744))
- `SafeCast.toUintXX`: new library for integer downcasting, which allows for safe operation on smaller types (e.g. `uint32`) when combined with `SafeMath`. ([#1926](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1926))
- `ERC721Metadata`: added `baseURI`, which can be used for dramatic gas savings when all token URIs share a prefix (e.g. `http://api.myapp.com/tokens/<id>`). ([#1970](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1970))
- `EnumerableSet`: new library for storing enumerable sets of values. Only `AddressSet` is supported in this release. ([#2061](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/2061))
- `Create2`: simple library to make usage of the `CREATE2` opcode easier. ([#1744](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1744))
### Improvements
* `ERC777`: `_burn` is now internal, providing more flexibility and making it easier to create tokens that deflate. ([#1908](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1908))
* `ReentrancyGuard`: greatly improved gas efficiency by using the net gas metering mechanism introduced in the Istanbul hardfork. ([#1992](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1992), [#1996](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1996))
* `ERC777`: improve extensibility by making `_send` and related functions `internal`. ([#2027](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2027))
* `ERC721`: improved revert reason when transferring tokens to a non-recipient contract. ([#2018](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2018))
- `ERC777`: `_burn` is now internal, providing more flexibility and making it easier to create tokens that deflate. ([#1908](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1908))
- `ReentrancyGuard`: greatly improved gas efficiency by using the net gas metering mechanism introduced in the Istanbul hardfork. ([#1992](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1992), [#1996](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1996))
- `ERC777`: improve extensibility by making `_send` and related functions `internal`. ([#2027](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2027))
- `ERC721`: improved revert reason when transferring tokens to a non-recipient contract. ([#2018](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2018))
### Breaking changes
* `ERC165Checker` now requires a minimum Solidity compiler version of 0.5.10. ([#1829](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1829))
- `ERC165Checker` now requires a minimum Solidity compiler version of 0.5.10. ([#1829](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1829))
## 2.4.0 (2019-10-29)
### New features
* `Address.toPayable`: added a helper to convert between address types without having to resort to low-level casting. ([#1773](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1773))
* Facilities to make metatransaction-enabled contracts through the Gas Station Network. ([#1844](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1844))
* `Address.sendValue`: added a replacement to Solidity's `transfer`, removing the fixed gas stipend. ([#1962](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1962))
* Added replacement for functions that don't forward all gas (which have been deprecated): ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
* `PullPayment.withdrawPaymentsWithGas(address payable payee)`
* `Escrow.withdrawWithGas(address payable payee)`
* `SafeMath`: added support for custom error messages to `sub`, `div` and `mod` functions. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
- `Address.toPayable`: added a helper to convert between address types without having to resort to low-level casting. ([#1773](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1773))
- Facilities to make metatransaction-enabled contracts through the Gas Station Network. ([#1844](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1844))
- `Address.sendValue`: added a replacement to Solidity's `transfer`, removing the fixed gas stipend. ([#1962](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1962))
- Added replacement for functions that don't forward all gas (which have been deprecated): ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
- `PullPayment.withdrawPaymentsWithGas(address payable payee)`
- `Escrow.withdrawWithGas(address payable payee)`
- `SafeMath`: added support for custom error messages to `sub`, `div` and `mod` functions. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
### Improvements
* `Address.isContract`: switched from `extcodesize` to `extcodehash` for less gas usage. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
* `ERC20` and `ERC777` updated to throw custom errors on subtraction overflows. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
- `Address.isContract`: switched from `extcodesize` to `extcodehash` for less gas usage. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
- `ERC20` and `ERC777` updated to throw custom errors on subtraction overflows. ([#1828](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1828))
### Deprecations
* Deprecated functions that don't forward all gas: ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
* `PullPayment.withdrawPayments(address payable payee)`
* `Escrow.withdraw(address payable payee)`
- Deprecated functions that don't forward all gas: ([#1976](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1976))
- `PullPayment.withdrawPayments(address payable payee)`
- `Escrow.withdraw(address payable payee)`
### Breaking changes
* `Address` now requires a minimum Solidity compiler version of 0.5.5. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
* `SignatureBouncer` has been removed from drafts, both to avoid confusions with the GSN and `GSNRecipientSignature` (previously called `GSNBouncerSignature`) and because the API was not very clear. ([#1879](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1879))
- `Address` now requires a minimum Solidity compiler version of 0.5.5. ([#1802](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1802))
- `SignatureBouncer` has been removed from drafts, both to avoid confusions with the GSN and `GSNRecipientSignature` (previously called `GSNBouncerSignature`) and because the API was not very clear. ([#1879](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1879))
### How to upgrade from 2.4.0-beta
The final 2.4.0 release includes a refactor of the GSN contracts that will be a breaking change for 2.4.0-beta users.
* The default empty implementations of `_preRelayedCall` and `_postRelayedCall` were removed and must now be explicitly implemented always in custom recipients. If your custom recipient didn't include an implementation, you can provide an empty one.
* `GSNRecipient`, `GSNBouncerBase`, and `GSNContext` were all merged into `GSNRecipient`.
* `GSNBouncerSignature` and `GSNBouncerERC20Fee` were renamed to `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
* It is no longer necessary to inherit from `GSNRecipient` when using `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
- The default empty implementations of `_preRelayedCall` and `_postRelayedCall` were removed and must now be explicitly implemented always in custom recipients. If your custom recipient didn't include an implementation, you can provide an empty one.
- `GSNRecipient`, `GSNBouncerBase`, and `GSNContext` were all merged into `GSNRecipient`.
- `GSNBouncerSignature` and `GSNBouncerERC20Fee` were renamed to `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
- It is no longer necessary to inherit from `GSNRecipient` when using `GSNRecipientSignature` and `GSNRecipientERC20Fee`.
For example, a contract using `GSNBouncerSignature` would have to be changed in the following way.
@ -106,81 +572,94 @@ For example, a contract using `GSNBouncerSignature` would have to be changed in
Refer to the table below to adjust your inheritance list.
| 2.4.0-beta | 2.4.0 |
| ---------------------------------- | ---------------------------- |
| `GSNRecipient, GSNBouncerSignature`| `GSNRecipientSignature` |
| `GSNRecipient, GSNBouncerERC20Fee` | `GSNRecipientERC20Fee` |
| `GSNBouncerBase` | `GSNRecipient` |
| 2.4.0-beta | 2.4.0 |
| ----------------------------------- | ----------------------- |
| `GSNRecipient, GSNBouncerSignature` | `GSNRecipientSignature` |
| `GSNRecipient, GSNBouncerERC20Fee` | `GSNRecipientERC20Fee` |
| `GSNBouncerBase` | `GSNRecipient` |
## 2.3.0 (2019-05-27)
### New features
* `ERC1820`: added support for interacting with the [ERC1820](https://eips.ethereum.org/EIPS/eip-1820) registry contract (`IERC1820Registry`), as well as base contracts that can be registered as implementers there. ([#1677](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1677))
* `ERC777`: support for the [ERC777 token](https://eips.ethereum.org/EIPS/eip-777), which has multiple improvements over `ERC20` (but is backwards compatible with it) such as built-in burning, a more straightforward permission system, and optional sender and receiver hooks on transfer (mandatory for contracts!). ([#1684](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1684))
* All contracts now have revert reason strings, which give insight into error conditions, and help debug failing transactions. ([#1704](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1704))
- `ERC1820`: added support for interacting with the [ERC1820](https://eips.ethereum.org/EIPS/eip-1820) registry contract (`IERC1820Registry`), as well as base contracts that can be registered as implementers there. ([#1677](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1677))
- `ERC777`: support for the [ERC777 token](https://eips.ethereum.org/EIPS/eip-777), which has multiple improvements over `ERC20` (but is backwards compatible with it) such as built-in burning, a more straightforward permission system, and optional sender and receiver hooks on transfer (mandatory for contracts!). ([#1684](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1684))
- All contracts now have revert reason strings, which give insight into error conditions, and help debug failing transactions. ([#1704](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1704))
### Improvements
* Reverted the Solidity version bump done in v2.2.0, setting the minimum compiler version to v0.5.0, to prevent unexpected build breakage. Users are encouraged however to stay on top of new compiler releases, which usually include bugfixes. ([#1729](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1729))
- Reverted the Solidity version bump done in v2.2.0, setting the minimum compiler version to v0.5.0, to prevent unexpected build breakage. Users are encouraged however to stay on top of new compiler releases, which usually include bugfixes. ([#1729](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1729))
### Bugfixes
* `PostDeliveryCrowdsale`: some validations where skipped when paired with other crowdsale flavors, such as `AllowanceCrowdsale`, or `MintableCrowdsale` and `ERC20Capped`, which could cause buyers to not be able to claim their purchased tokens. ([#1721](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1721))
* `ERC20._transfer`: the `from` argument was allowed to be the zero address, so it was possible to internally trigger a transfer of 0 tokens from the zero address. This address is not a valid destinatary of transfers, nor can it give or receive allowance, so this behavior was inconsistent. It now reverts. ([#1752](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1752))
- `PostDeliveryCrowdsale`: some validations where skipped when paired with other crowdsale flavors, such as `AllowanceCrowdsale`, or `MintableCrowdsale` and `ERC20Capped`, which could cause buyers to not be able to claim their purchased tokens. ([#1721](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1721))
- `ERC20._transfer`: the `from` argument was allowed to be the zero address, so it was possible to internally trigger a transfer of 0 tokens from the zero address. This address is not a valid destinatary of transfers, nor can it give or receive allowance, so this behavior was inconsistent. It now reverts. ([#1752](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1752))
## 2.2.0 (2019-03-14)
### New features
* `ERC20Snapshot`: create snapshots on demand of the token balances and total supply, to later retrieve and e.g. calculate dividends at a past time. ([#1617](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1617))
* `SafeERC20`: `ERC20` contracts with no return value (i.e. that revert on failure) are now supported. ([#1655](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1655))
* `ERC20`: added internal `_approve(address owner, address spender, uint256 value)`, allowing derived contracts to set the allowance of arbitrary accounts. ([#1609](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1609))
* `ERC20Metadata`: added internal `_setTokenURI(string memory tokenURI)`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
* `TimedCrowdsale`: added internal `_extendTime(uint256 newClosingTime)` as well as `TimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime)` event allowing to extend the crowdsale, as long as it hasn't already closed.
- `ERC20Snapshot`: create snapshots on demand of the token balances and total supply, to later retrieve and e.g. calculate dividends at a past time. ([#1617](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1617))
- `SafeERC20`: `ERC20` contracts with no return value (i.e. that revert on failure) are now supported. ([#1655](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1655))
- `ERC20`: added internal `_approve(address owner, address spender, uint256 value)`, allowing derived contracts to set the allowance of arbitrary accounts. ([#1609](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1609))
- `ERC20Metadata`: added internal `_setTokenURI(string memory tokenURI)`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
- `TimedCrowdsale`: added internal `_extendTime(uint256 newClosingTime)` as well as `TimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime)` event allowing to extend the crowdsale, as long as it hasn't already closed.
### Improvements
* Upgraded the minimum compiler version to v0.5.2: this removes many Solidity warnings that were false positives. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
* `ECDSA`: `recover` no longer accepts malleable signatures (those using upper-range values for `s`, or 0/1 for `v`). ([#1622](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1622))
* ``ERC721``'s transfers are now more gas efficient due to removal of unnecessary `SafeMath` calls. ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
* Fixed variable shadowing issues. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
- Upgraded the minimum compiler version to v0.5.2: this removes many Solidity warnings that were false positives. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
- `ECDSA`: `recover` no longer accepts malleable signatures (those using upper-range values for `s`, or 0/1 for `v`). ([#1622](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1622))
- `ERC721`'s transfers are now more gas efficient due to removal of unnecessary `SafeMath` calls. ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
- Fixed variable shadowing issues. ([#1606](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1606))
### Bugfixes
* (minor) `SafeERC20`: `safeApprove` wasn't properly checking for a zero allowance when attempting to set a non-zero allowance. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
- (minor) `SafeERC20`: `safeApprove` wasn't properly checking for a zero allowance when attempting to set a non-zero allowance. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
### Breaking changes in drafts
* `TokenMetadata` has been renamed to `ERC20Metadata`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
* The library `Counter` has been renamed to `Counters` and its API has been improved. See an example in `ERC721`, lines [17](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L17) and [204](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L204). ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
- `TokenMetadata` has been renamed to `ERC20Metadata`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))
- The library `Counter` has been renamed to `Counters` and its API has been improved. See an example in `ERC721`, lines [17](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L17) and [204](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/3cb4a00fce1da76196ac0ac3a0ae9702b99642b5/contracts/token/ERC721/ERC721.sol#L204). ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))
## 2.1.3 (2019-02-26)
* Backported `SafeERC20.safeApprove` bugfix. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
- Backported `SafeERC20.safeApprove` bugfix. ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))
## 2.1.2 (2019-01-17)
* Removed most of the test suite from the npm package, except `PublicRole.behavior.js`, which may be useful to users testing their own `Roles`.
- Removed most of the test suite from the npm package, except `PublicRole.behavior.js`, which may be useful to users testing their own `Roles`.
## 2.1.1 (2019-01-04)
* Version bump to avoid conflict in the npm registry.
- Version bump to avoid conflict in the npm registry.
## 2.1.0 (2019-01-04)
### New features
* Now targeting the 0.5.x line of Solidity compilers. For 0.4.24 support, use version 2.0 of OpenZeppelin.
* `WhitelistCrowdsale`: a crowdsale where only whitelisted accounts (`WhitelistedRole`) can purchase tokens. Adding or removing accounts from the whitelist is done by whitelist admins (`WhitelistAdminRole`). Similar to the pre-2.0 `WhitelistedCrowdsale`. ([#1525](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1525), [#1589](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1589))
* `RefundablePostDeliveryCrowdsale`: replacement for `RefundableCrowdsale` (deprecated, see below) where tokens are only granted once the crowdsale ends (if it meets its goal). ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))
* `PausableCrowdsale`: allows for pausers (`PauserRole`) to pause token purchases. Other crowdsale operations (e.g. withdrawals and refunds, if applicable) are not affected. ([#832](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/832))
* `ERC20`: `transferFrom` and `_burnFrom ` now emit `Approval` events, to represent the token's state comprehensively through events. ([#1524](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1524))
* `ERC721`: added `_burn(uint256 tokenId)`, replacing the similar deprecated function (see below). ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
* `ERC721`: added `_tokensOfOwner(address owner)`, allowing to internally retrieve the array of an account's owned tokens. ([#1522](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1522))
* Crowdsales: all constructors are now `public`, meaning it is not necessary to extend these contracts in order to deploy them. The exception is `FinalizableCrowdsale`, since it is meaningless unless extended. ([#1564](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1564))
* `SignedSafeMath`: added overflow-safe operations for signed integers (`int256`). ([#1559](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1559), [#1588](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1588))
- Now targeting the 0.5.x line of Solidity compilers. For 0.4.24 support, use version 2.0 of OpenZeppelin.
- `WhitelistCrowdsale`: a crowdsale where only whitelisted accounts (`WhitelistedRole`) can purchase tokens. Adding or removing accounts from the whitelist is done by whitelist admins (`WhitelistAdminRole`). Similar to the pre-2.0 `WhitelistedCrowdsale`. ([#1525](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1525), [#1589](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1589))
- `RefundablePostDeliveryCrowdsale`: replacement for `RefundableCrowdsale` (deprecated, see below) where tokens are only granted once the crowdsale ends (if it meets its goal). ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))
- `PausableCrowdsale`: allows for pausers (`PauserRole`) to pause token purchases. Other crowdsale operations (e.g. withdrawals and refunds, if applicable) are not affected. ([#832](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/832))
- `ERC20`: `transferFrom` and `_burnFrom ` now emit `Approval` events, to represent the token's state comprehensively through events. ([#1524](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1524))
- `ERC721`: added `_burn(uint256 tokenId)`, replacing the similar deprecated function (see below). ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
- `ERC721`: added `_tokensOfOwner(address owner)`, allowing to internally retrieve the array of an account's owned tokens. ([#1522](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1522))
- Crowdsales: all constructors are now `public`, meaning it is not necessary to extend these contracts in order to deploy them. The exception is `FinalizableCrowdsale`, since it is meaningless unless extended. ([#1564](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1564))
- `SignedSafeMath`: added overflow-safe operations for signed integers (`int256`). ([#1559](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1559), [#1588](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1588))
### Improvements
* The compiler version required by `Array` was behind the rest of the libray so it was updated to `v0.4.24`. ([#1553](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1553))
* Now conforming to a 4-space indentation code style. ([1508](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1508))
* `ERC20`: more gas efficient due to removed redundant `require`s. ([#1409](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1409))
* `ERC721`: fixed a bug that prevented internal data structures from being properly cleaned, missing potential gas refunds. ([#1539](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1539) and [#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
* `ERC721`: general gas savings on `transferFrom`, `_mint` and `_burn`, due to redudant `require`s and `SSTORE`s. ([#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
- The compiler version required by `Array` was behind the rest of the library so it was updated to `v0.4.24`. ([#1553](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1553))
- Now conforming to a 4-space indentation code style. ([1508](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1508))
- `ERC20`: more gas efficient due to removed redundant `require`s. ([#1409](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1409))
- `ERC721`: fixed a bug that prevented internal data structures from being properly cleaned, missing potential gas refunds. ([#1539](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1539) and [#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
- `ERC721`: general gas savings on `transferFrom`, `_mint` and `_burn`, due to redundant `require`s and `SSTORE`s. ([#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549))
### Bugfixes
### Breaking changes
### Deprecations
* `ERC721._burn(address owner, uint256 tokenId)`: due to the `owner` parameter being unnecessary. ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
* `RefundableCrowdsale`: due to trading abuse potential on crowdsales that miss their goal. ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))
- `ERC721._burn(address owner, uint256 tokenId)`: due to the `owner` parameter being unnecessary. ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
- `RefundableCrowdsale`: due to trading abuse potential on crowdsales that miss their goal. ([#1543](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1543))

View File

@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at maintainers@openzeppelin.org. All
reported by contacting the project team at contact@openzeppelin.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.

View File

@ -1,69 +0,0 @@
# Code Style
We value clean code and consistency, and those are prerequisites for us to
include new code in the repository. Before proposing a change, please read this
document and take some time to familiarize yourself with the style of the
existing codebase.
## Solidity code
In order to be consistent with all the other Solidity projects, we follow the
[official recommendations documented in the Solidity style guide](http://solidity.readthedocs.io/en/latest/style-guide.html).
Any exception or additions specific to our project are documented below.
### Naming
* Try to avoid acronyms and abbreviations.
* All state variables should be private.
* Private state variables should have an underscore prefix.
```
contract TestContract {
uint256 private _privateVar;
uint256 internal _internalVar;
}
```
* Parameters must not be prefixed with an underscore.
```
function test(uint256 testParameter1, uint256 testParameter2) {
...
}
```
* Internal and private functions should have an underscore prefix.
```
function _testInternal() internal {
...
}
```
```
function _testPrivate() private {
...
}
```
* Events should be emitted immediately after the state change that they
represent, and consequently they should be named in past tense.
```
function _burn(address _who, uint256 _value) internal {
super._burn(_who, _value);
emit TokensBurned(_who, _value);
}
```
Some standards (e.g. ERC20) use present tense, and in those cases the
standard specification prevails.
* Interface names should have a capital I prefix.
```
interface IERC777 {
```

View File

@ -1,71 +1,36 @@
Contributing to OpenZeppelin Contracts
=======
# Contributing Guidelines
We really appreciate and value contributions to OpenZeppelin Contracts. Please take 5' to review the items listed below to make sure that your contributions are merged as soon as possible.
There are many ways to contribute to OpenZeppelin Contracts.
## Contribution guidelines
## Troubleshooting
Smart contracts manage value and are highly vulnerable to errors and attacks. We have very strict [guidelines], please make sure to review them!
You can help other users in the community to solve their smart contract issues in the [OpenZeppelin Forum].
## Creating Pull Requests (PRs)
[OpenZeppelin Forum]: https://forum.openzeppelin.com/
As a contributor, you are expected to fork this repository, work on your own fork and then submit pull requests. The pull requests will be reviewed and eventually merged into the main repo. See ["Fork-a-Repo"](https://help.github.com/articles/fork-a-repo/) for how this works.
## Opening an issue
## A typical workflow
You can [open an issue] to suggest a feature or report a minor bug. For serious bugs please do not open an issue, instead refer to our [security policy] for appropriate steps.
1) Make sure your fork is up to date with the main repository:
If you believe your issue may be due to user error and not a problem in the library, consider instead posting a question on the [OpenZeppelin Forum].
```
cd openzeppelin-contracts
git remote add upstream https://github.com/OpenZeppelin/openzeppelin-contracts.git
git fetch upstream
git pull --rebase upstream master
```
NOTE: The directory `openzeppelin-contracts` represents your fork's local copy.
Before opening an issue, be sure to search through the existing open and closed issues, and consider posting a comment in one of those instead.
2) Branch out from `master` into `fix/some-bug-#123`:
(Postfixing #123 will associate your PR with the issue #123 and make everyone's life easier =D)
```
git checkout -b fix/some-bug-#123
```
When requesting a new feature, include as many details as you can, especially around the use cases that motivate it. Features are prioritized according to the impact they may have on the ecosystem, so we appreciate information showing that the impact could be high.
3) Make your changes, add your files, commit, and push to your fork.
[security policy]: https://github.com/OpenZeppelin/openzeppelin-contracts/security
[open an issue]: https://github.com/OpenZeppelin/openzeppelin-contracts/issues/new/choose
```
git add SomeFile.js
git commit "Fix some bug #123"
git push origin fix/some-bug-#123
```
## Submitting a pull request
4) Run tests, linter, etc. This can be done by running local continuous integration and make sure it passes.
If you would like to contribute code or documentation you may do so by forking the repository and submitting a pull request.
```bash
npm test
npm run lint
```
Any non-trivial code contribution must be first discussed with the maintainers in an issue (see [Opening an issue](#opening-an-issue)). Only very minor changes are accepted without prior discussion.
or you can simply run CircleCI locally
```bash
circleci local execute --job build
circleci local execute --job test
```
*Note*: requires installing CircleCI and docker locally on your machine.
Make sure to read and follow the [engineering guidelines](./GUIDELINES.md). Run linter and tests to make sure your pull request is good before submitting it.
5) Go to [github.com/OpenZeppelin/openzeppelin-contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) in your web browser and issue a new pull request.
Changelog entries should be added to each pull request by using [Changesets](https://github.com/changesets/changesets/).
*IMPORTANT* Read the PR template very carefully and make sure to follow all the instructions. These instructions
refer to some very important conditions that your PR must meet in order to be accepted, such as making sure that all tests pass, JS linting tests pass, Solidity linting tests pass, etc.
When opening the pull request you will be presented with a template and a series of instructions. Read through it carefully and follow all the steps. Expect a review and feedback from the maintainers afterwards.
6) Maintainers will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of OpenZeppelin.
*IMPORTANT* Please pay attention to the maintainer's feedback, since its a necessary step to keep up with the standards OpenZeppelin attains to.
## All set!
If you have any questions, feel free to post them to github.com/OpenZeppelin/openzeppelin-contracts/issues.
Finally, if you're looking to collaborate and want to find easy tasks to start, look at the issues we marked as ["Good first issue"](https://github.com/OpenZeppelin/openzeppelin-contracts/labels/good%20first%20issue).
Thanks for your time and code!
[guidelines]: GUIDELINES.md
If you're looking for a good place to start, look for issues labelled ["good first issue"](https://github.com/OpenZeppelin/openzeppelin-contracts/labels/good%20first%20issue)!

View File

@ -1,64 +1,117 @@
Design Guidelines
=======
# Engineering Guidelines
These are some global design goals in OpenZeppelin.
## Testing
#### D0 - Security in Depth
We strive to provide secure, tested, audited code. To achieve this, we need to match intention with function. Thus, documentation, code clarity, community review and security discussions are fundamental.
Code must be thoroughly tested with quality unit tests.
#### D1 - Simple and Modular
Simpler code means easier audits, and better understanding of what each component does. We look for small files, small contracts, and small functions. If you can separate a contract into two independent functionalities you should probably do it.
We defer to the [Moloch Testing Guide](https://github.com/MolochVentures/moloch/tree/master/test#readme) for specific recommendations, though not all of it is relevant here. Note the introduction:
#### D2 - Naming Matters
> Tests should be written, not only to verify correctness of the target code, but to be comprehensively reviewed by other programmers. Therefore, for mission critical Solidity code, the quality of the tests are just as important (if not more so) than the code itself, and should be written with the highest standards of clarity and elegance.
We take our time with picking names. Code is going to be written once, and read hundreds of times. Renaming for clarity is encouraged.
Every addition or change to the code must come with relevant and comprehensive tests.
#### D3 - Tests
Refactors should avoid simultaneous changes to tests.
Write tests for all your code. We encourage Test Driven Development so we know when our code is right. Even though not all code in the repository is tested at the moment, we aim to test every line of code in the future.
Flaky tests are not acceptable.
#### D4 - Check preconditions and post-conditions
The test suite should run automatically for every change in the repository, and in pull requests tests must pass before merging.
A very important way to prevent vulnerabilities is to catch a contracts inconsistent state as early as possible. This is why we want functions to check pre- and post-conditions for executing its logic. When writing code, ask yourself what you are expecting to be true before and after the function runs, and express it in code.
The test suite coverage must be kept as close to 100% as possible, enforced in pull requests.
#### D5 - Code Consistency
In some cases unit tests may be insufficient and complementary techniques should be used:
Consistency on the way classes are used is paramount to an easier understanding of the library. The codebase should be as unified as possible. Read existing code and get inspired before you write your own. Follow the style guidelines. Dont hesitate to ask for help on how to best write a specific piece of code.
1. Property-based tests (aka. fuzzing) for math-heavy code.
2. Formal verification for state machines.
#### D6 - Regular Audits
Following good programming practices is a way to reduce the risk of vulnerabilities, but professional code audits are still needed. We will perform regular code audits on major releases, and hire security professionals to provide independent review.
## Code style
## Style Guidelines
Solidity code should be written in a consistent format enforced by a linter, following the official [Solidity Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html). See below for further [Solidity Conventions](#solidity-conventions).
The design guidelines have quite a high abstraction level. These style guidelines are more concrete and easier to apply, and also more opinionated.
The code should be simple and straightforward, prioritizing readability and understandability. Consistency and predictability should be maintained across the codebase. In particular, this applies to naming, which should be systematic, clear, and concise.
### General
Sometimes these guidelines may be broken if doing so brings significant efficiency gains, but explanatory comments should be added.
#### G0 - Default to Solidity's official style guide.
Modularity should be pursued, but not at the cost of the above priorities.
Follow the official Solidity style guide: https://solidity.readthedocs.io/en/latest/style-guide.html
## Documentation
#### G1 - No Magic Constants
For contributors, project guidelines and processes must be documented publicly.
Avoid constants in the code as much as possible. Magic strings are also magic constants.
For users, features must be abundantly documented. Documentation should include answers to common questions, solutions to common problems, and recommendations for critical decisions that the user may face.
#### G2 - Code that Fails Early
All changes to the core codebase (excluding tests, auxiliary scripts, etc.) must be documented in a changelog, except for purely cosmetic or documentation changes.
We ask our code to fail as soon as possible when an unexpected input was provided or unexpected state was found.
## Peer review
#### G3 - Internal Amounts Must be Signed Integers and Represent the Smallest Units.
All changes must be submitted through pull requests and go through peer code review.
Avoid representation errors by always dealing with weis when handling ether. GUIs can convert to more human-friendly representations. Use Signed Integers (int) to prevent underflow problems.
The review must be approached by the reviewer in a similar way as if it was an audit of the code in question (but importantly it is not a substitute for and should not be considered an audit).
Reviewers should enforce code and project guidelines.
### Testing
External contributions must be reviewed separately by multiple maintainers.
#### T1 - Tests Must be Written Elegantly
## Automation
Style guidelines are not relaxed for tests. Tests are a good way to show how to use the library, and maintaining them is extremely necessary.
Automation should be used as much as possible to reduce the possibility of human error and forgetfulness.
Don't write long tests, write helper functions to make them be as short and concise as possible (they should take just a few lines each), and use good variable names.
Automations that make use of sensitive credentials must use secure secret management, and must be strengthened against attacks such as [those on GitHub Actions worklows](https://github.com/nikitastupin/pwnhub).
#### T2 - Tests Must not be Random
Some other examples of automation are:
Inputs for tests should not be generated randomly. Accounts used to create test contracts are an exception, those can be random. Also, the type and structure of outputs should be checked.
- Looking for common security vulnerabilities or errors in our code (eg. reentrancy analysis).
- Keeping dependencies up to date and monitoring for vulnerable dependencies.
## Pull requests
Pull requests are squash-merged to keep the `master` branch history clean. The title of the pull request becomes the commit message, so it should be written in a consistent format:
1) Begin with a capital letter.
2) Do not end with a period.
3) Write in the imperative: "Add feature X" and not "Adds feature X" or "Added feature X".
This repository does not follow conventional commits, so do not prefix the title with "fix:" or "feat:".
Work in progress pull requests should be submitted as Drafts and should not be prefixed with "WIP:".
Branch names don't matter, and commit messages within a pull request mostly don't matter either, although they can help the review process.
# Solidity Conventions
In addition to the official Solidity Style Guide we have a number of other conventions that must be followed.
* All state variables should be private.
Changes to state should be accompanied by events, and in some cases it is not correct to arbitrarily set state. Encapsulating variables as private and only allowing modification via setters enables us to ensure that events and other rules are followed reliably and prevents this kind of user error.
* Internal or private state variables or functions should have an underscore prefix.
```solidity
contract TestContract {
uint256 private _privateVar;
uint256 internal _internalVar;
function _testInternal() internal { ... }
function _testPrivate() private { ... }
}
```
* Events should be emitted immediately after the state change that they
represent, and should be named in the past tense.
```solidity
function _burn(address who, uint256 value) internal {
super._burn(who, value);
emit TokensBurned(who, value);
}
```
Some standards (e.g. ERC20) use present tense, and in those cases the
standard specification is used.
* Interface names should have a capital I prefix.
```solidity
interface IERC777 {
```
* Unchecked arithmetic blocks should contain comments explaining why overflow is guaranteed not to happen. If the reason is immediately apparent from the line above the unchecked block, the comment may be omitted.

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016-2019 zOS Global Limited
Copyright (c) 2016-2023 zOS Global Limited and contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@ -1,60 +1,63 @@
# <img src="logo.png" alt="OpenZeppelin" height="40px">
# <img src="logo.svg" alt="OpenZeppelin" height="40px">
[![Docs](https://img.shields.io/badge/docs-%F0%9F%93%84-blue)](https://docs.openzeppelin.com/contracts)
[![NPM Package](https://img.shields.io/npm/v/@openzeppelin/contracts.svg)](https://www.npmjs.org/package/@openzeppelin/contracts)
[![Build Status](https://circleci.com/gh/OpenZeppelin/openzeppelin-contracts.svg?style=shield)](https://circleci.com/gh/OpenZeppelin/openzeppelin-contracts)
[![Coverage Status](https://codecov.io/gh/OpenZeppelin/openzeppelin-contracts/graph/badge.svg)](https://codecov.io/gh/OpenZeppelin/openzeppelin-contracts)
[![GitPOAPs](https://public-api.gitpoap.io/v1/repo/OpenZeppelin/openzeppelin-contracts/badge)](https://www.gitpoap.io/gh/OpenZeppelin/openzeppelin-contracts)
[![Docs](https://img.shields.io/badge/docs-%F0%9F%93%84-yellow)](https://docs.openzeppelin.com/contracts)
[![Forum](https://img.shields.io/badge/forum-%F0%9F%92%AC-yellow)](https://docs.openzeppelin.com/contracts)
**A library for secure smart contract development.** Build on a solid foundation of community-vetted code.
* Implementations of standards like [ERC20](https://docs.openzeppelin.com/contracts/erc20) and [ERC721](https://docs.openzeppelin.com/contracts/erc721).
* Flexible [role-based permissioning](https://docs.openzeppelin.com/contracts/access-control) scheme.
* Reusable [Solidity components](https://docs.openzeppelin.com/contracts/utilities) to build custom contracts and complex decentralized systems.
* First-class integration with the [Gas Station Network](https://docs.openzeppelin.com/contracts/gsn) for systems with no gas fees!
* Audited by leading security firms (_last full audit on v2.0.0_).
:mage: **Not sure how to get started?** Check out [Contracts Wizard](https://wizard.openzeppelin.com/) — an interactive smart contract generator.
:building_construction: **Want to scale your decentralized application?** Check out [OpenZeppelin Defender](https://openzeppelin.com/defender) — a secure platform for automating and monitoring your operations.
## Overview
### Installation
```console
```
$ npm install @openzeppelin/contracts
```
OpenZeppelin Contracts features a [stable API](https://docs.openzeppelin.com/contracts/releases-stability#api-stability), which means your contracts won't break unexpectedly when upgrading to a newer minor version.
OpenZeppelin Contracts features a [stable API](https://docs.openzeppelin.com/contracts/releases-stability#api-stability), which means that your contracts won't break unexpectedly when upgrading to a newer minor version.
An alternative to npm is to use the GitHub repository (`openzeppelin/openzeppelin-contracts`) to retrieve the contracts. When doing this, make sure to specify the tag for a release such as `v4.5.0`, instead of using the `master` branch.
### Usage
Once installed, you can use the contracts in the library by importing them:
```solidity
pragma solidity ^0.5.0;
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721Mintable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract MyNFT is ERC721Full, ERC721Mintable {
constructor() ERC721Full("MyNFT", "MNFT") public {
contract MyCollectible is ERC721 {
constructor() ERC721("MyCollectible", "MCO") {
}
}
```
_If you're new to smart contract development, head to [Developing Smart Contracts](https://docs.openzeppelin.com/learn/developing-smart-contracts) to learn about creating a new project and compiling your contracts._
To keep your system secure, you should **always** use the installed code as-is, and neither copy-paste it from online sources, nor modify it yourself. The library is designed so that only the contracts and functions you use are deployed, so you don't need to worry about it needlessly increasing gas costs.
To keep your system secure, you should **always** use the installed code as-is, and neither copy-paste it from online sources nor modify it yourself. The library is designed so that only the contracts and functions you use are deployed, so you don't need to worry about it needlessly increasing gas costs.
## Learn More
The guides in the sidebar will teach about different concepts, and how to use the related contracts that OpenZeppelin Contracts provides:
The guides in the [documentation site](https://docs.openzeppelin.com/contracts) will teach about different concepts, and how to use the related contracts that OpenZeppelin Contracts provides:
* [Access Control](https://docs.openzeppelin.com/contracts/access-control): decide who can perform each of the actions on your system.
* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectives, and distribute them via [Crowdsales](https://docs.openzeppelin.com/contracts/crowdsales).
* [Gas Station Network](https://docs.openzeppelin.com/contracts/gsn): let your users interact with your contracts without having to pay for gas themselves.
* [Utilities](https://docs.openzeppelin.com/contracts/utilities): generic useful tools, including non-overflowing math, signature verification, and trustless paying systems.
* [Utilities](https://docs.openzeppelin.com/contracts/utilities): generic useful tools including non-overflowing math, signature verification, and trustless paying systems.
The [full API](https://docs.openzeppelin.com/contracts/api/token/ERC20) is also thoroughly documented, and serves as a great reference when developing your smart contract application. You can also ask for help or follow Contracts's development in the [community forum](https://forum.openzeppelin.com).
Finally, you may want to take a look at the [guides on our blog](https://blog.openzeppelin.com/guides), which cover several common use cases and good practices.. The following articles provide great background reading, though please note, some of the referenced tools have changed as the tooling in the ecosystem continues to rapidly evolve.
Finally, you may want to take a look at the [guides on our blog](https://blog.openzeppelin.com/guides), which cover several common use cases and good practices. The following articles provide great background reading, though please note that some of the referenced tools have changed, as the tooling in the ecosystem continues to rapidly evolve.
* [The Hitchhikers Guide to Smart Contracts in Ethereum](https://blog.openzeppelin.com/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05) will help you get an overview of the various tools available for smart contract development, and help you set up your environment.
* [A Gentle Introduction to Ethereum Programming, Part 1](https://blog.openzeppelin.com/a-gentle-introduction-to-ethereum-programming-part-1-783cc7796094) provides very useful information on an introductory level, including many basic concepts from the Ethereum platform.
@ -62,18 +65,26 @@ Finally, you may want to take a look at the [guides on our blog](https://blog.op
## Security
This project is maintained by [OpenZeppelin](https://openzeppelin.com), and developed following our high standards for code quality and security. OpenZeppelin is meant to provide tested and community-audited code, but please use common sense when doing anything that deals with real money! We take no responsibility for your implementation decisions and any security problems you might experience.
This project is maintained by [OpenZeppelin](https://openzeppelin.com) with the goal of providing a secure and reliable library of smart contract components for the ecosystem. We address security through risk management in various areas such as engineering and open source best practices, scoping and API design, multi-layered review processes, and incident response preparedness.
The core development principles and strategies that OpenZeppelin is based on include: security in depth, simple and modular code, clarity-driven naming conventions, comprehensive unit testing, pre-and-post-condition sanity checks, code consistency, and regular audits.
The security policy is detailed in [`SECURITY.md`](./SECURITY.md), and specifies how you can report security vulnerabilities, which versions will receive security patches, and how to stay informed about them. We run a [bug bounty program on Immunefi](https://immunefi.com/bounty/openzeppelin) to reward the responsible disclosure of vulnerabilities.
The latest audit was done on October 2018 on version 2.0.0.
The engineering guidelines we follow to promote project quality can be found in [`GUIDELINES.md`](./GUIDELINES.md).
Please report any security issues you find to security@openzeppelin.org.
Past audits can be found in [`audits/`](./audits).
Smart contracts are a nascent techology and carry a high level of technical risk and uncertainty. Although OpenZeppelin is well known for its security audits, using OpenZeppelin Contracts is not a substitute for a security audit.
OpenZeppelin Contracts is made available under the MIT License, which disclaims all warranties in relation to the project and which limits the liability of those that contribute and maintain the project, including OpenZeppelin. As set out further in the Terms, you acknowledge that you are solely responsible for any use of OpenZeppelin Contracts and you assume all risks associated with any such use.
## Contribute
OpenZeppelin exists thanks to its contributors. There are many ways you can participate and help build high quality software. Check out the [contribution guide](CONTRIBUTING.md)!
OpenZeppelin Contracts exists thanks to its contributors. There are many ways you can participate and help build high quality software. Check out the [contribution guide](CONTRIBUTING.md)!
## License
OpenZeppelin is released under the [MIT License](LICENSE).
OpenZeppelin Contracts is released under the [MIT License](LICENSE).
## Legal
Your use of this Project is governed by the terms found at www.openzeppelin.com/tos (the "Terms").

View File

@ -1,36 +1,47 @@
# Releasing
> Visit the documentation for [details about release schedule].
> Visit the documentation for [details about release schedule](https://docs.openzeppelin.com/contracts/releases-stability).
Start on an up-to-date `master` branch.
OpenZeppelin Contracts uses a fully automated release process that takes care of compiling, packaging, and publishing the library, all of which is carried out in a clean CI environment (GitHub Actions), implemented in the ([`release-cycle`](.github/workflows/release-cycle.yml)) workflow. This helps to reduce the potential for human error and inconsistencies, and ensures that the release process is ongoing and reliable.
Create the release branch with `npm run release start minor`.
## Changesets
Publish a release candidate with `npm run release rc`.
[Changesets](https://github.com/changesets/changesets/) is used as part of our release process for `CHANGELOG.md` management. Each change that is relevant for the codebase is expected to include a changeset.
Publish the final release with `npm run release final`.
## Branching model
Follow the general [OpenZeppelin release checklist].
The release cycle happens on release branches called `release-vX.Y`. Each of these branches starts as a release candidate (rc) and is eventually promoted to final.
[details about release schedule]: https://docs.openzeppelin.com/contracts/releases-stability
[OpenZeppelin release checklist]: https://github.com/OpenZeppelin/code-style/blob/master/RELEASE_CHECKLIST.md
A release branch can be updated with cherry-picked patches from `master`, or may sometimes be committed to directly in the case of old releases. These commits will lead to a new release candidate or a patch increment depending on the state of the release branch.
```mermaid
%%{init: {'gitGraph': {'mainBranchName': 'master'}} }%%
gitGraph
commit id: "Feature A"
commit id: "Feature B"
branch release-vX.Y
commit id: "Start release"
commit id: "Release vX.Y.0-rc.0"
## Merging the release branch
checkout master
commit id: "Feature C"
commit id: "Fix A"
After the final release, the release branch should be merged back into `master`. This merge must not be squashed because it would lose the tagged release commit. Since the GitHub repo is set up to only allow squashed merges, the merge should be done locally and pushed.
checkout release-vX.Y
cherry-pick id: "Fix A" tag: ""
commit id: "Release vX.Y.0-rc.1"
commit id: "Release vX.Y.0"
Make sure to have the latest changes from `upstream` in your local release branch.
checkout master
merge release-vX.Y
commit id: "Feature D"
commit id: "Patch B"
checkout release-vX.Y
cherry-pick id: "Patch B" tag: ""
commit id: "Release vX.Y.1"
checkout master
merge release-vX.Y
commit id: "Feature E"
```
git checkout release-vX.Y.Z
git pull upstream
```
```
git checkout master
git merge --no-ff release-vX.Y.Z
git push upstream master
```
The release branch can then be deleted on GitHub.

42
SECURITY.md Normal file
View File

@ -0,0 +1,42 @@
# Security Policy
Security vulnerabilities should be disclosed to the project maintainers through [Immunefi], or alternatively by email to security@openzeppelin.com.
[Immunefi]: https://immunefi.com/bounty/openzeppelin
## Bug Bounty
Responsible disclosure of security vulnerabilities is rewarded through a bug bounty program on [Immunefi].
There is a bonus reward for issues introduced in release candidates that are reported before making it into a stable release.
## Security Patches
Security vulnerabilities will be patched as soon as responsibly possible, and published as an advisory on this repository (see [advisories]) and on the affected npm packages.
[advisories]: https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories
Projects that build on OpenZeppelin Contracts are encouraged to clearly state, in their source code and websites, how to be contacted about security issues in the event that a direct notification is considered necessary. We recommend including it in the NatSpec for the contract as `/// @custom:security-contact security@example.com`.
Additionally, we recommend installing the library through npm and setting up vulnerability alerts such as [Dependabot].
[Dependabot]: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-supply-chain-security#what-is-dependabot
### Supported Versions
Security patches will be released for the latest minor of a given major release. For example, if an issue is found in versions >=4.6.0 and the latest is 4.8.0, the patch will be released only in version 4.8.1.
Only critical severity bug fixes will be backported to past major releases.
| Version | Critical security fixes | Other security fixes |
| ------- | ----------------------- | -------------------- |
| 4.x | :white_check_mark: | :white_check_mark: |
| 3.4 | :white_check_mark: | :x: |
| 2.5 | :white_check_mark: | :x: |
| < 2.0 | :x: | :x: |
Note as well that the Solidity language itself only guarantees security updates for the latest release.
## Legal
Smart contracts are a nascent techology and carry a high level of technical risk and uncertainty. OpenZeppelin Contracts is made available under the MIT License, which disclaims all warranties in relation to the project and which limits the liability of those that contribute and maintain the project, including OpenZeppelin. Your use of the project is also governed by the terms found at www.openzeppelin.com/tos (the "Terms"). As set out in the Terms, you are solely responsible for any use of OpenZeppelin Contracts and you assume all risks associated with any such use. This Security Policy in no way evidences or represents an on-going duty by any contributor, including OpenZeppelin, to correct any flaws or alert you to all or any of the potential risks of utilizing the project.

BIN
audit/2020-10-certora.pdf Normal file

Binary file not shown.

View File

@ -1,5 +1,7 @@
# OpenZeppelin Audit
NOTE ON 2021-07-19: This report makes reference to Zeppelin, OpenZeppelin, OpenZeppelin Contracts, the OpenZeppelin team, and OpenZeppelin library. Many of these things have since been renamed and know that this audit applies to what is currently called the OpenZeppelin Contracts which are maintained by the OpenZeppelin Contracts Community.
March, 2017
Authored by Dennis Peterson and Peter Vessenes
@ -131,7 +133,7 @@ I presume that the goal of this contract is to allow and annotate a migration to
We like these pauses! Note that these allow significant griefing potential by owners, and that this might not be obvious to participants in smart contracts using the OpenZeppelin framework. We would recommend that additional sample logic be added to for instance the TokenContract showing safer use of the pause and resume functions. In particular, we would recommend a timelock after which anyone could unpause the contract.
The modifers use the pattern `if(bool){_;}`. This is fine for functions that return false upon failure, but could be problematic for functions expected to throw upon failure. See our comments above on standardizing on `throw` or `return(false)`.
The modifiers use the pattern `if(bool){_;}`. This is fine for functions that return false upon failure, but could be problematic for functions expected to throw upon failure. See our comments above on standardizing on `throw` or `return(false)`.
## Ownership

Binary file not shown.

BIN
audits/2022-10-ERC4626.pdf Normal file

Binary file not shown.

15
audits/README.md Normal file
View File

@ -0,0 +1,15 @@
# Audits
| Date | Version | Commit | Auditor | Scope | Links |
| ------------ | ------- | --------- | ------------ | -------------------- | ----------------------------------------------------------- |
| October 2022 | v4.8.0 | `14f98db` | OpenZeppelin | ERC4626, Checkpoints | [🔗](./2022-10-ERC4626.pdf) [🔗](./2022-10-Checkpoints.pdf) |
| October 2018 | v2.0.0 | `dac5bcc` | LevelK | Everything | [🔗](./2018-10.pdf) |
| March 2017 | v1.0.4 | `9c5975a` | New Alchemy | Everything | [🔗](./2017-03.md) |
# Formal Verification
| Date | Version | Commit | Tool | Scope | Links |
| ------------ | ------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| May 2022 | v4.7.0 | `109778c` | Certora | Initializable, GovernorPreventLateQuorum, ERC1155Burnable, ERC1155Pausable, ERC1155Supply, ERC1155Holder, ERC1155Receiver | [🔗](../certora/reports/2022-05.pdf) |
| March 2022 | v4.4.0 | `4088540` | Certora | ERC20Votes, ERC20FlashMint, ERC20Wrapper, TimelockController, ERC721Votes, Votes, AccessControl, ERC1155 | [🔗](../certora/reports/2022-03.pdf) |
| October 2021 | v4.4.0 | `4088540` | Certora | Governor, GovernorCountingSimple, GovernorProposalThreshold, GovernorTimelockControl, GovernorVotes, GovernorVotesQuorumFraction | [🔗](../certora/reports/2021-10.pdf) |

1
certora/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
munged

25
certora/Makefile Normal file
View File

@ -0,0 +1,25 @@
default: help
PATCH = applyHarness.patch
CONTRACTS_DIR = ../contracts
MUNGED_DIR = munged
help:
@echo "usage:"
@echo " make clean: remove all generated files (those ignored by git)"
@echo " make $(MUNGED_DIR): create $(MUNGED_DIR) directory by applying the patch file to $(CONTRACTS_DIR)"
@echo " make record: record a new patch file capturing the differences between $(CONTRACTS_DIR) and $(MUNGED_DIR)"
munged: $(wildcard $(CONTRACTS_DIR)/*.sol) $(PATCH)
rm -rf $@
cp -r $(CONTRACTS_DIR) $@
patch -p0 -d $@ < $(PATCH)
record:
diff -druN $(CONTRACTS_DIR) $(MUNGED_DIR) | sed 's+../contracts/++g' | sed 's+munged/++g' > $(PATCH)
refresh: munged record
clean:
git clean -fdX
touch $(PATCH)

56
certora/README.md Normal file
View File

@ -0,0 +1,56 @@
# Running the certora verification tool
These instructions detail the process for running CVT on the OpenZeppelin (Wizard/Governor) contracts.
Documentation for CVT and the specification language are available
[here](https://certora.atlassian.net/wiki/spaces/CPD/overview)
## Running the verification
The scripts in the `certora/scripts` directory are used to submit verification
jobs to the Certora verification service. After the job is complete, the results will be available on
[the Certora portal](https://vaas-stg.certora.com/).
These scripts should be run from the root directory; for example by running
```
sh certora/scripts/verifyAll.sh <meaningful comment>
```
The most important of these is `verifyAll.sh`, which checks
all of the harnessed contracts (`certora/harness/Wizard*.sol`) against all of
the specifications (`certora/spec/*.spec`).
The other scripts run a subset of the specifications or the contracts. You can
verify different contracts or specifications by changing the `--verify` option,
and you can run a single rule or method with the `--rule` or `--method` option.
For example, to verify the `WizardFirstPriority` contract against the
`GovernorCountingSimple` specification, you could change the `--verify` line of
the `WizardControlFirstPriortity.sh` script to:
```
--verify WizardFirstPriority:certora/specs/GovernorCountingSimple.spec \
```
## Adapting to changes in the contracts
Some of our rules require the code to be simplified in various ways. Our
primary tool for performing these simplifications is to run verification on a
contract that extends the original contracts and overrides some of the methods.
These "harness" contracts can be found in the `certora/harness` directory.
This pattern does require some modifications to the original code: some methods
need to be made virtual or public, for example. These changes are handled by
applying a patch to the code before verification.
When one of the `verify` scripts is executed, it first applies the patch file
`certora/applyHarness.patch` to the `contracts` directory, placing the output
in the `certora/munged` directory. We then verify the contracts in the
`certora/munged` directory.
If the original contracts change, it is possible to create a conflict with the
patch. In this case, the verify scripts will report an error message and output
rejected changes in the `munged` directory. After merging the changes, run
`make record` in the `certora` directory; this will regenerate the patch file,
which can then be checked into git.

408
certora/applyHarness.patch Normal file
View File

@ -0,0 +1,408 @@
diff -druN governance/extensions/GovernorCountingSimple.sol governance/extensions/GovernorCountingSimple.sol
--- governance/extensions/GovernorCountingSimple.sol 2023-02-27 10:59:32.652558153 +0100
+++ governance/extensions/GovernorCountingSimple.sol 2023-02-28 16:49:10.417726143 +0100
@@ -27,7 +27,7 @@
mapping(address => bool) hasVoted;
}
- mapping(uint256 => ProposalVote) private _proposalVotes;
+ mapping(uint256 => ProposalVote) internal _proposalVotes; // HARNESS: private -> internal
/**
* @dev See {IGovernor-COUNTING_MODE}.
diff -druN governance/extensions/GovernorPreventLateQuorum.sol governance/extensions/GovernorPreventLateQuorum.sol
--- governance/extensions/GovernorPreventLateQuorum.sol 2023-02-27 10:59:32.652558153 +0100
+++ governance/extensions/GovernorPreventLateQuorum.sol 2023-02-28 16:49:10.417726143 +0100
@@ -20,10 +20,10 @@
abstract contract GovernorPreventLateQuorum is Governor {
using SafeCast for uint256;
- uint64 private _voteExtension;
+ uint64 internal _voteExtension; // HARNESS: private -> internal
/// @custom:oz-retyped-from mapping(uint256 => Timers.BlockNumber)
- mapping(uint256 => uint64) private _extendedDeadlines;
+ mapping(uint256 => uint64) internal _extendedDeadlines; // HARNESS: private -> internal
/// @dev Emitted when a proposal deadline is pushed back due to reaching quorum late in its voting period.
event ProposalExtended(uint256 indexed proposalId, uint64 extendedDeadline);
diff -druN governance/extensions/GovernorVotesQuorumFraction.sol governance/extensions/GovernorVotesQuorumFraction.sol
--- governance/extensions/GovernorVotesQuorumFraction.sol 2023-02-27 10:59:32.655891529 +0100
+++ governance/extensions/GovernorVotesQuorumFraction.sol 2023-02-28 16:49:10.417726143 +0100
@@ -17,10 +17,10 @@
using SafeCast for *;
using Checkpoints for Checkpoints.Trace224;
- uint256 private _quorumNumerator; // DEPRECATED in favor of _quorumNumeratorHistory
+ uint256 internal _quorumNumerator; // DEPRECATED // MUNGED private => internal
/// @custom:oz-retyped-from Checkpoints.History
- Checkpoints.Trace224 private _quorumNumeratorHistory;
+ Checkpoints.Trace224 internal _quorumNumeratorHistory; // MUNGED private => internal
event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);
diff -druN governance/Governor.sol governance/Governor.sol
--- governance/Governor.sol 2023-02-27 10:59:32.652558153 +0100
+++ governance/Governor.sol 2023-02-28 16:49:10.421059488 +0100
@@ -51,7 +51,7 @@
string private _name;
/// @custom:oz-retyped-from mapping(uint256 => Governor.ProposalCore)
- mapping(uint256 => ProposalCore) private _proposals;
+ mapping(uint256 => ProposalCore) internal _proposals; // HARNESS: private -> internal
// This queue keeps track of the governor operating on itself. Calls to functions protected by the
// {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute},
diff -druN governance/TimelockController.sol governance/TimelockController.sol
--- governance/TimelockController.sol 2023-02-27 10:59:32.652558153 +0100
+++ governance/TimelockController.sol 2023-02-28 16:49:10.421059488 +0100
@@ -28,10 +28,10 @@
bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE");
bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE");
bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE");
- uint256 internal constant _DONE_TIMESTAMP = uint256(1);
+ uint256 public constant _DONE_TIMESTAMP = uint256(1); // HARNESS: internal -> public
mapping(bytes32 => uint256) private _timestamps;
- uint256 private _minDelay;
+ uint256 public _minDelay; // HARNESS: private -> public
/**
* @dev Emitted when a call is scheduled as part of operation `id`.
diff -druN governance/utils/Votes.sol governance/utils/Votes.sol
--- governance/utils/Votes.sol 2023-02-27 10:59:32.655891529 +0100
+++ governance/utils/Votes.sol 2023-02-28 16:49:10.421059488 +0100
@@ -35,7 +35,25 @@
bytes32 private constant _DELEGATION_TYPEHASH =
keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
- mapping(address => address) private _delegation;
+ // HARNESS : Hooks cannot access any information from Checkpoints yet, so I am also updating votes and fromBlock in this struct
+ struct Ckpt {
+ uint32 fromBlock;
+ uint224 votes;
+ }
+ mapping(address => Ckpt) public _checkpoints;
+
+ // HARNESSED getters
+ function numCheckpoints(address account) public view returns (uint32) {
+ return SafeCast.toUint32(_delegateCheckpoints[account]._checkpoints.length);
+ }
+ function ckptFromBlock(address account, uint32 pos) public view returns (uint32) {
+ return _delegateCheckpoints[account]._checkpoints[pos]._key;
+ }
+ function ckptVotes(address account, uint32 pos) public view returns (uint224) {
+ return _delegateCheckpoints[account]._checkpoints[pos]._value;
+ }
+
+ mapping(address => address) public _delegation; // HARNESS: private -> public
/// @custom:oz-retyped-from mapping(address => Checkpoints.History)
mapping(address => Checkpoints.Trace224) private _delegateCheckpoints;
@@ -240,5 +258,5 @@
/**
* @dev Must return the voting units held by an account.
*/
- function _getVotingUnits(address) internal view virtual returns (uint256);
+ function _getVotingUnits(address) public view virtual returns (uint256); // HARNESS: internal -> public
}
diff -druN proxy/utils/Initializable.sol proxy/utils/Initializable.sol
--- proxy/utils/Initializable.sol 2023-02-27 10:59:32.655891529 +0100
+++ proxy/utils/Initializable.sol 2023-02-28 16:49:10.421059488 +0100
@@ -60,12 +60,12 @@
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
- uint8 private _initialized;
+ uint8 internal _initialized; // HARNESS: private -> internal
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
- bool private _initializing;
+ bool internal _initializing; // HARNESS: private -> internal
/**
* @dev Triggered when the contract has been initialized or reinitialized.
diff -druN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol
--- token/ERC1155/ERC1155.sol 2023-02-27 10:59:32.655891529 +0100
+++ token/ERC1155/ERC1155.sol 2023-02-28 16:49:10.421059488 +0100
@@ -21,7 +21,7 @@
using Address for address;
// Mapping from token ID to account balances
- mapping(uint256 => mapping(address => uint256)) private _balances;
+ mapping(uint256 => mapping(address => uint256)) internal _balances; // HARNESS: private -> internal
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
@@ -451,7 +451,7 @@
uint256 id,
uint256 amount,
bytes memory data
- ) private {
+ ) public { // HARNESS: private -> public
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
@@ -472,7 +472,7 @@
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
- ) private {
+ ) public { // HARNESS: private -> public
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
diff -druN token/ERC20/ERC20.sol token/ERC20/ERC20.sol
--- token/ERC20/ERC20.sol 2023-02-27 10:59:32.655891529 +0100
+++ token/ERC20/ERC20.sol 2023-02-28 16:49:10.421059488 +0100
@@ -248,7 +248,7 @@
*
* - `account` cannot be the zero address.
*/
- function _mint(address account, uint256 amount) internal virtual {
+ function _mint(address account, uint256 amount) public virtual { // HARNESS: internal -> public
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
@@ -274,7 +274,7 @@
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
- function _burn(address account, uint256 amount) internal virtual {
+ function _burn(address account, uint256 amount) public virtual { // HARNESS: internal -> public
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
diff -druN token/ERC20/extensions/ERC20Capped.sol token/ERC20/extensions/ERC20Capped.sol
--- token/ERC20/extensions/ERC20Capped.sol 2023-02-22 15:43:36.624717708 +0100
+++ token/ERC20/extensions/ERC20Capped.sol 2023-02-28 16:49:10.421059488 +0100
@@ -30,7 +30,7 @@
/**
* @dev See {ERC20-_mint}.
*/
- function _mint(address account, uint256 amount) internal virtual override {
+ function _mint(address account, uint256 amount) public virtual override { // HARNESS: internal -> public
require(ERC20.totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded");
super._mint(account, amount);
}
diff -druN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20FlashMint.sol
--- token/ERC20/extensions/ERC20FlashMint.sol 2023-02-27 10:59:32.655891529 +0100
+++ token/ERC20/extensions/ERC20FlashMint.sol 2023-02-28 16:49:10.421059488 +0100
@@ -53,9 +53,11 @@
// silence warning about unused variable without the addition of bytecode.
token;
amount;
- return 0;
+ return fee; // HARNESS: made "return" nonzero
}
+ uint256 public fee; // HARNESS: added it to simulate random fee amount
+
/**
* @dev Returns the receiver address of the flash fee. By default this
* implementation returns the address(0) which means the fee amount will be burnt.
diff -druN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Votes.sol
--- token/ERC20/extensions/ERC20Votes.sol 2023-02-27 10:59:32.655891529 +0100
+++ token/ERC20/extensions/ERC20Votes.sol 2023-02-28 16:49:10.421059488 +0100
@@ -33,8 +33,8 @@
bytes32 private constant _DELEGATION_TYPEHASH =
keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
- mapping(address => address) private _delegates;
- mapping(address => Checkpoint[]) private _checkpoints;
+ mapping(address => address) public _delegates; // HARNESS: private -> public
+ mapping(address => Checkpoint[]) public _checkpoints; // HARNESS: private -> public
Checkpoint[] private _totalSupplyCheckpoints;
/**
@@ -186,27 +186,27 @@
/**
* @dev Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1).
*/
- function _maxSupply() internal view virtual returns (uint224) {
+ function _maxSupply() public view virtual returns (uint224) { // HARNESS: internal -> public
return type(uint224).max;
}
/**
* @dev Snapshots the totalSupply after it has been increased.
*/
- function _mint(address account, uint256 amount) internal virtual override {
+ function _mint(address account, uint256 amount) public virtual override { // HARNESS: internal -> public
super._mint(account, amount);
require(totalSupply() <= _maxSupply(), "ERC20Votes: total supply risks overflowing votes");
- _writeCheckpoint(_totalSupplyCheckpoints, _add, amount);
+ _writeCheckpointAdd(_totalSupplyCheckpoints, amount); // HARNESS: new version without pointer
}
/**
* @dev Snapshots the totalSupply after it has been decreased.
*/
- function _burn(address account, uint256 amount) internal virtual override {
+ function _burn(address account, uint256 amount) public virtual override { // HARNESS: internal -> public (to comply with the ERC20 harness)
super._burn(account, amount);
- _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount);
+ _writeCheckpointSub(_totalSupplyCheckpoints, amount); // HARNESS: new version without pointer
}
/**
@@ -225,7 +225,7 @@
*
* Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.
*/
- function _delegate(address delegator, address delegatee) internal virtual {
+ function _delegate(address delegator, address delegatee) public virtual { // HARNESS: internal -> public
address currentDelegate = delegates(delegator);
uint256 delegatorBalance = balanceOf(delegator);
_delegates[delegator] = delegatee;
@@ -238,35 +238,60 @@
function _moveVotingPower(address src, address dst, uint256 amount) private {
if (src != dst && amount > 0) {
if (src != address(0)) {
- (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[src], _subtract, amount);
+ (uint256 oldWeight, uint256 newWeight) = _writeCheckpointSub(_checkpoints[src], amount); // HARNESS: new version without pointer
emit DelegateVotesChanged(src, oldWeight, newWeight);
}
if (dst != address(0)) {
- (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[dst], _add, amount);
+ (uint256 oldWeight, uint256 newWeight) = _writeCheckpointAdd(_checkpoints[dst], amount); // HARNESS: new version without pointer
emit DelegateVotesChanged(dst, oldWeight, newWeight);
}
}
}
- function _writeCheckpoint(
- Checkpoint[] storage ckpts,
- function(uint256, uint256) view returns (uint256) op,
- uint256 delta
- ) private returns (uint256 oldWeight, uint256 newWeight) {
+ // HARNESS: split _writeCheckpoint() to two functions as a workaround for function pointers that cannot be managed by the tool
+ // function _writeCheckpoint(
+ // Checkpoint[] storage ckpts,
+ // function(uint256, uint256) view returns (uint256) op,
+ // uint256 delta
+ // ) private returns (uint256 oldWeight, uint256 newWeight) {
+ // uint256 pos = ckpts.length;
+
+ // unchecked {
+ // Checkpoint memory oldCkpt = pos == 0 ? Checkpoint(0, 0) : _unsafeAccess(ckpts, pos - 1);
+
+ // oldWeight = oldCkpt.votes;
+ // newWeight = op(oldWeight, delta);
+
+ // if (pos > 0 && oldCkpt.fromBlock == clock()) {
+ // _unsafeAccess(ckpts, pos - 1).votes = SafeCast.toUint224(newWeight);
+ // } else {
+ // ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
+ // }
+ // }
+ // }
+
+ function _writeCheckpointAdd(Checkpoint[] storage ckpts, uint256 delta) private returns (uint256 oldWeight, uint256 newWeight) {
uint256 pos = ckpts.length;
+ oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes;
+ newWeight = _add(oldWeight, delta);
- unchecked {
- Checkpoint memory oldCkpt = pos == 0 ? Checkpoint(0, 0) : _unsafeAccess(ckpts, pos - 1);
+ if (pos > 0 && ckpts[pos - 1].fromBlock == clock()) {
+ ckpts[pos - 1].votes = SafeCast.toUint224(newWeight);
+ } else {
+ ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
+ }
+ }
- oldWeight = oldCkpt.votes;
- newWeight = op(oldWeight, delta);
+ function _writeCheckpointSub(Checkpoint[] storage ckpts, uint256 delta) private returns (uint256 oldWeight, uint256 newWeight) {
+ uint256 pos = ckpts.length;
+ oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes;
+ newWeight = _subtract(oldWeight, delta);
- if (pos > 0 && oldCkpt.fromBlock == clock()) {
- _unsafeAccess(ckpts, pos - 1).votes = SafeCast.toUint224(newWeight);
- } else {
- ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
- }
+ if (pos > 0 && ckpts[pos - 1].fromBlock == clock()) {
+ ckpts[pos - 1].votes = SafeCast.toUint224(newWeight);
+ } else {
+ ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(clock()), votes: SafeCast.toUint224(newWeight)}));
}
}
diff -druN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wrapper.sol
--- token/ERC20/extensions/ERC20Wrapper.sol 2023-02-27 10:59:32.655891529 +0100
+++ token/ERC20/extensions/ERC20Wrapper.sol 2023-02-28 16:49:10.421059488 +0100
@@ -62,7 +62,7 @@
* @dev Mint wrapped token to cover any underlyingTokens that would have been transferred by mistake. Internal
* function that can be exposed with access control if desired.
*/
- function _recover(address account) internal virtual returns (uint256) {
+ function _recover(address account) public virtual returns (uint256) { // HARNESS: internal -> public
uint256 value = _underlying.balanceOf(address(this)) - totalSupply();
_mint(account, value);
return value;
diff -druN token/ERC721/extensions/ERC721Votes.sol token/ERC721/extensions/ERC721Votes.sol
--- token/ERC721/extensions/ERC721Votes.sol 2023-02-27 10:59:32.655891529 +0100
+++ token/ERC721/extensions/ERC721Votes.sol 2023-02-28 16:49:10.421059488 +0100
@@ -35,7 +35,7 @@
/**
* @dev Returns the balance of `account`.
*/
- function _getVotingUnits(address account) internal view virtual override returns (uint256) {
+ function _getVotingUnits(address account) public view virtual override returns (uint256) { // HARNESS: internal -> public
return balanceOf(account);
}
}
diff -druN utils/Address.sol utils/Address.sol
--- utils/Address.sol 2023-02-27 10:59:32.659224903 +0100
+++ utils/Address.sol 2023-02-28 16:49:10.421059488 +0100
@@ -197,7 +197,7 @@
bool success,
bytes memory returndata,
string memory errorMessage
- ) internal view returns (bytes memory) {
+ ) internal view returns (bytes memory val) { // MUNGED undeterministic return causes error for Prover
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
@@ -220,7 +220,7 @@
bool success,
bytes memory returndata,
string memory errorMessage
- ) internal pure returns (bytes memory) {
+ ) internal pure returns (bytes memory val) { // MUNGED undeterministic return causes error for Prover
if (success) {
return returndata;
} else {
diff -druN utils/Checkpoints.sol utils/Checkpoints.sol
--- utils/Checkpoints.sol 2023-02-27 10:59:32.659224903 +0100
+++ utils/Checkpoints.sol 2023-02-28 16:49:10.424392833 +0100
@@ -84,13 +84,13 @@
*
* Returns previous value and new value.
*/
- function push(
- History storage self,
- function(uint256, uint256) view returns (uint256) op,
- uint256 delta
- ) internal returns (uint256, uint256) {
- return push(self, op(latest(self), delta));
- }
+ // function push(
+ // History storage self,
+ // function(uint256, uint256) view returns (uint256) op,
+ // uint256 delta
+ // ) internal returns (uint256, uint256) {
+ // return push(self, op(latest(self), delta));
+ // }
/**
* @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.

View File

@ -0,0 +1,8 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "../munged/access/AccessControl.sol";
contract AccessControlHarness is AccessControl {}

View File

@ -0,0 +1,5 @@
import "../../munged/token/ERC1155/extensions/ERC1155Burnable.sol";
contract ERC1155BurnableHarness is ERC1155Burnable {
constructor(string memory uri_) ERC1155(uri_) {}
}

View File

@ -0,0 +1,41 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../../munged/token/ERC1155/ERC1155.sol";
contract ERC1155Harness is ERC1155 {
constructor(string memory uri_) ERC1155(uri_) {}
function burn(
address from,
uint256 id,
uint256 amount
) public virtual {
_burn(from, id, amount);
}
function burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) public virtual {
_burnBatch(from, ids, amounts);
}
function mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual {
_mint(to, id, amount, data);
}
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual {
_mintBatch(to, ids, amounts, data);
}
}

View File

@ -0,0 +1,17 @@
import "../../munged/token/ERC1155/extensions/ERC1155Pausable.sol";
contract ERC1155PausableHarness is ERC1155Pausable {
constructor(string memory uri_) ERC1155(uri_) {}
function pause() public {
_pause();
}
function unpause() public {
_unpause();
}
function onlyWhenPausedMethod() public whenPaused {}
function onlyWhenNotPausedMethod() public whenNotPaused {}
}

View File

@ -0,0 +1,65 @@
import "../../munged/token/ERC1155/extensions/ERC1155Supply.sol";
contract ERC1155SupplyHarness is ERC1155Supply {
address public owner;
constructor(string memory uri_) ERC1155(uri_) {
owner = msg.sender;
}
// workaround for problem caused by `exists` being a CVL keyword
function exists_wrapper(uint256 id) public view virtual returns (bool) {
return exists(id);
}
// These rules were not implemented in the base but there are changes in supply
// that are affected by the internal contracts so we implemented them. We assume
// only the owner can call any of these functions to be able to test them but also
// limit false positives.
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function burn(
address from,
uint256 id,
uint256 amount
) public virtual onlyOwner {
_burn(from, id, amount);
}
function burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) public virtual onlyOwner {
_burnBatch(from, ids, amounts);
}
function mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual onlyOwner {
_mint(to, id, amount, data);
}
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual onlyOwner {
_mintBatch(to, ids, amounts, data);
}
// In order to check the invariant that zero address never holds any tokens, we need to remove the require
// from this function.
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
// require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
}

View File

@ -0,0 +1,5 @@
import "../munged/token/ERC20/extensions/ERC20FlashMint.sol";
contract ERC20FlashMintHarness is ERC20FlashMint {
constructor(string memory name, string memory symbol) ERC20(name, symbol) {}
}

View File

@ -0,0 +1,5 @@
import "../munged/token/ERC20/extensions/draft-ERC20Permit.sol";
contract ERC20PermitHarness is ERC20, ERC20Permit {
constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {}
}

View File

@ -0,0 +1,26 @@
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
contract ERC20VotesHarness is ERC20Votes {
constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {}
function ckptFromBlock(address account, uint32 pos) public view returns (uint32) {
return _checkpoints[account][pos].fromBlock;
}
function ckptVotes(address account, uint32 pos) public view returns (uint224) {
return _checkpoints[account][pos].fromBlock;
}
function unsafeNumCheckpoints(address account) public view returns (uint256) {
return _checkpoints[account].length;
}
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public virtual override {}
}

View File

@ -0,0 +1,17 @@
import "../munged/token/ERC20/extensions/ERC20Wrapper.sol";
contract ERC20WrapperHarness is ERC20Wrapper {
constructor(
IERC20 _underlying,
string memory _name,
string memory _symbol
) ERC20(_name, _symbol) ERC20Wrapper(_underlying) {}
function underlyingTotalSupply() public view returns (uint256) {
return underlying().totalSupply();
}
function underlyingBalanceOf(address account) public view returns (uint256) {
return underlying().balanceOf(account);
}
}

View File

@ -0,0 +1,26 @@
pragma solidity ^0.8.0;
import "../munged/token/ERC721/extensions/draft-ERC721Votes.sol";
contract ERC721VotesHarness is ERC721Votes {
constructor(string memory name, string memory symbol) ERC721(name, symbol) EIP712(name, symbol) {}
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public virtual override {
assert(true);
}
function mint(address account, uint256 tokenID) public {
_mint(account, tokenID);
}
function burn(uint256 tokenID) public {
_burn(tokenID);
}
}

View File

@ -0,0 +1,206 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../munged/governance/Governor.sol";
import "../munged/governance/extensions/GovernorCountingSimple.sol";
import "../munged/governance/extensions/GovernorPreventLateQuorum.sol";
import "../munged/governance/extensions/GovernorTimelockControl.sol";
import "../munged/governance/extensions/GovernorVotes.sol";
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
contract GovernorFullHarness is
Governor,
GovernorCountingSimple,
GovernorTimelockControl,
GovernorPreventLateQuorum,
GovernorVotes,
GovernorVotesQuorumFraction
{
using Checkpoints for Checkpoints.Trace224;
constructor(
IVotes _token,
TimelockController _timelock,
uint64 initialVoteExtension,
uint256 quorumNumeratorValue
)
Governor("Harness")
GovernorPreventLateQuorum(initialVoteExtension)
GovernorTimelockControl(_timelock)
GovernorVotes(_token)
GovernorVotesQuorumFraction(quorumNumeratorValue)
{}
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
// Harness from Votes //
function getPastTotalSupply(uint256 blockNumber) public view returns(uint256) {
return token.getPastTotalSupply(blockNumber);
}
// Harness from GovernorVotesQuorumFraction //
function getQuorumNumeratorLength() public view returns(uint256) {
return _quorumNumeratorHistory._checkpoints.length;
}
function getQuorumNumeratorLatest() public view returns(uint256) {
return _quorumNumeratorHistory.latest();
}
function getDeprecatedQuorumNumerator() public view returns(uint256) {
return _quorumNumerator;
}
// Harness from GovernorPreventLateQuorum //
function getVoteExtension() public view returns (uint64) {
return _voteExtension;
}
function getExtendedDeadline(uint256 proposalId) public view returns (uint64) {
return _extendedDeadlines[proposalId];
}
// Harness from GovernorCountingSimple //
function getAgainstVotes(uint256 proposalId) public view returns (uint256) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
return proposalvote.againstVotes;
}
function getAbstainVotes(uint256 proposalId) public view returns (uint256) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
return proposalvote.abstainVotes;
}
function getForVotes(uint256 proposalId) public view returns (uint256) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
return proposalvote.forVotes;
}
function quorumReached(uint256 proposalId) public view returns (bool) {
return _quorumReached(proposalId);
}
function voteSucceeded(uint256 proposalId) public view returns (bool) {
return _voteSucceeded(proposalId);
}
// Harness from Governor //
function getExecutor() public view returns (address) {
return _executor();
}
function proposalProposer(uint256 proposalId) public view returns (address) {
return _proposalProposer(proposalId);
}
function isExecuted(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].executed;
}
function isCanceled(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].canceled;
}
// The following functions are overrides required by Solidity added by Certora. //
function proposalDeadline(uint256 proposalId)
public
view
virtual
override(Governor, GovernorPreventLateQuorum, IGovernor)
returns (uint256)
{
return super.proposalDeadline(proposalId);
}
function _castVote(
uint256 proposalId,
address account,
uint8 support,
string memory reason,
bytes memory params
) internal virtual override(Governor, GovernorPreventLateQuorum) returns (uint256) {
// added to run GovernorCountingSimple.spec
uint256 deltaWeight = super._castVote(proposalId, account, support, reason, params);
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
return deltaWeight;
}
function lateQuorumVoteExtension() public view virtual override returns (uint64) {
return super.lateQuorumVoteExtension();
}
function setLateQuorumVoteExtension(uint64 newVoteExtension) public virtual override onlyGovernance {
super.setLateQuorumVoteExtension(newVoteExtension);
}
// The following functions are overrides required by Solidity added by OZ Wizard. //
function votingDelay() public pure override returns (uint256) {
return 1; // 1 block
}
function votingPeriod() public pure override returns (uint256) {
return 45818; // 1 week
}
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
return super.state(proposalId);
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public override(Governor, IGovernor) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
return super._cancel(targets, values, calldatas, descriptionHash);
}
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return super._executor();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockControl)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}

View File

@ -0,0 +1,154 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../munged/governance/Governor.sol";
import "../munged/governance/extensions/GovernorCountingSimple.sol";
import "../munged/governance/extensions/GovernorTimelockControl.sol";
import "../munged/governance/extensions/GovernorVotes.sol";
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
contract GovernorHarness is
Governor,
GovernorCountingSimple,
GovernorVotes,
GovernorVotesQuorumFraction,
GovernorTimelockControl
{
constructor(
IVotes _token,
TimelockController _timelock,
uint64 initialVoteExtension,
uint256 quorumNumeratorValue
)
Governor("Harness")
GovernorVotes(_token)
GovernorVotesQuorumFraction(quorumNumeratorValue)
GovernorTimelockControl(_timelock)
{}
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
// Harness from GovernorCountingSimple //
function getAgainstVotes(uint256 proposalId) public view returns (uint256) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
return proposalvote.againstVotes;
}
function getAbstainVotes(uint256 proposalId) public view returns (uint256) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
return proposalvote.abstainVotes;
}
function getForVotes(uint256 proposalId) public view returns (uint256) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
return proposalvote.forVotes;
}
function quorumReached(uint256 proposalId) public view returns (bool) {
return _quorumReached(proposalId);
}
function voteSucceeded(uint256 proposalId) public view returns (bool) {
return _voteSucceeded(proposalId);
}
// Harness from Governor //
function getExecutor() public view returns (address) {
return _executor();
}
function proposalProposer(uint256 proposalId) public view returns (address) {
return _proposalProposer(proposalId);
}
function isExecuted(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].executed;
}
function isCanceled(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].canceled;
}
// The following functions are overrides required by Solidity added by Certora. //
function _castVote(
uint256 proposalId,
address account,
uint8 support,
string memory reason,
bytes memory params
) internal virtual override returns (uint256) {
// added to run GovernorCountingSimple.spec
uint256 deltaWeight = super._castVote(proposalId, account, support, reason, params);
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
return deltaWeight;
}
// The following functions are overrides required by Solidity added by OZ Wizard. //
function votingDelay() public pure override returns (uint256) {
return 1; // 1 block
}
function votingPeriod() public pure override returns (uint256) {
return 45818; // 1 week
}
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
return super.state(proposalId);
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public override(Governor, IGovernor) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
return super._cancel(targets, values, calldatas, descriptionHash);
}
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return super._executor();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockControl)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}

View File

@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156FlashBorrower.sol)
import "../munged/interfaces/IERC3156FlashBorrower.sol";
pragma solidity ^0.8.0;
contract IERC3156FlashBorrowerHarness is IERC3156FlashBorrower {
bytes32 somethingToReturn;
function onFlashLoan(
address initiator,
address token,
uint256 amount,
uint256 fee,
bytes calldata data
) external override returns (bytes32) {
return somethingToReturn;
}
}

View File

@ -0,0 +1,80 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../munged/proxy/utils/Initializable.sol";
contract InitializableBasicHarness is Initializable {
uint256 public val;
uint256 public a;
uint256 public b;
modifier version1() {
require(_initialized == 1);
_;
}
modifier versionN(uint8 n) {
require(_initialized == n);
_;
}
function initialize(
uint256 _val,
uint256 _a,
uint256 _b
) public initializer {
a = _a;
b = _b;
val = _val;
}
function reinitialize(
uint256 _val,
uint256 _a,
uint256 _b,
uint8 n
) public reinitializer(n) {
a = _a;
b = _b;
val = _val;
}
// Versioned return functions for testing
function returnsV1() public view version1 returns (uint256) {
return val;
}
function returnsVN(uint8 n) public view versionN(n) returns (uint256) {
return val;
}
function returnsAV1() public view version1 returns (uint256) {
return a;
}
function returnsAVN(uint8 n) public view versionN(n) returns (uint256) {
return a;
}
function returnsBV1() public view version1 returns (uint256) {
return b;
}
function returnsBVN(uint8 n) public view versionN(n) returns (uint256) {
return b;
}
// Harness //
function initialized() public view returns (uint8) {
return _initialized;
}
function initializing() public view returns (bool) {
return _initializing;
}
function thisIsContract() public view returns (bool) {
return !Address.isContract(address(this));
}
}

View File

@ -0,0 +1,92 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../munged/proxy/utils/Initializable.sol";
contract InitializableA is Initializable {
uint256 public a;
modifier version1() {
require(_initialized == 1);
_;
}
modifier versionN(uint8 n) {
require(_initialized == n);
_;
}
function __InitializableA_init(uint256 _a) internal onlyInitializing {
a = _a;
}
function returnsAV1() public view version1 returns (uint256) {
return a;
}
function returnsAVN(uint8 n) public view versionN(n) returns (uint256) {
return a;
}
}
contract InitializableB is Initializable, InitializableA {
uint256 public b;
function __InitializableB_init(uint256 _b) internal onlyInitializing {
b = _b;
}
function returnsBV1() public view version1 returns (uint256) {
return b;
}
function returnsBVN(uint8 n) public view versionN(n) returns (uint256) {
return b;
}
}
contract InitializableComplexHarness is Initializable, InitializableB {
uint256 public val;
function initialize(
uint256 _val,
uint256 _a,
uint256 _b
) public initializer {
val = _val;
__InitializableA_init(_a);
__InitializableB_init(_b);
}
function reinitialize(
uint256 _val,
uint256 _a,
uint256 _b,
uint8 n
) public reinitializer(n) {
val = _val;
__InitializableA_init(_a);
__InitializableB_init(_b);
}
function returnsV1() public view version1 returns (uint256) {
return val;
}
function returnsVN(uint8 n) public view versionN(n) returns (uint256) {
return val;
}
// Harness //
function initialized() public view returns (uint8) {
return _initialized;
}
function initializing() public view returns (bool) {
return _initializing;
}
function thisIsContract() public view returns (bool) {
return !Address.isContract(address(this));
}
}

View File

@ -0,0 +1,12 @@
pragma solidity ^0.8.0;
import "../munged/governance/TimelockController.sol";
contract TimelockControllerHarness is TimelockController {
constructor(
uint256 minDelay,
address[] memory proposers,
address[] memory executors,
address admin
) TimelockController(minDelay, proposers, executors, admin) {}
}

View File

@ -0,0 +1,159 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../munged/governance/Governor.sol";
import "../munged/governance/extensions/GovernorCountingSimple.sol";
import "../munged/governance/extensions/GovernorVotes.sol";
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
import "../munged/governance/extensions/GovernorTimelockControl.sol";
import "../munged/governance/extensions/GovernorProposalThreshold.sol";
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
/*
Wizard options:
ProposalThreshhold = 10
ERC20Votes
TimelockController
*/
contract WizardControlFirstPriority is
Governor,
GovernorProposalThreshold,
GovernorCountingSimple,
GovernorVotes,
GovernorVotesQuorumFraction,
GovernorTimelockControl
{
constructor(
ERC20Votes _token,
TimelockController _timelock,
string memory name,
uint256 quorumFraction
)
Governor(name)
GovernorVotes(_token)
GovernorVotesQuorumFraction(quorumFraction)
GovernorTimelockControl(_timelock)
{}
//HARNESS
function isExecuted(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].executed;
}
function isCanceled(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].canceled;
}
uint256 _votingDelay;
uint256 _votingPeriod;
uint256 _proposalThreshold;
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
function _castVote(
uint256 proposalId,
address account,
uint8 support,
string memory reason
) internal virtual override returns (uint256) {
uint256 deltaWeight = super._castVote(proposalId, account, support, reason); //HARNESS
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
return deltaWeight;
}
function snapshot(uint256 proposalId) public view returns (uint64) {
return _proposals[proposalId].voteStart._deadline;
}
function getExecutor() public view returns (address) {
return _executor();
}
// original code, harnessed
function votingDelay() public view override returns (uint256) {
// HARNESS: pure -> view
return _votingDelay; // HARNESS: parametric
}
function votingPeriod() public view override returns (uint256) {
// HARNESS: pure -> view
return _votingPeriod; // HARNESS: parametric
}
function proposalThreshold() public view override returns (uint256) {
// HARNESS: pure -> view
return _proposalThreshold; // HARNESS: parametric
}
// original code, not harnessed
// The following functions are overrides required by Solidity.
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
function getVotes(address account, uint256 blockNumber)
public
view
override(IGovernor, Governor)
returns (uint256)
{
return super.getVotes(account, blockNumber);
}
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
return super.state(proposalId);
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public override(Governor, GovernorProposalThreshold, IGovernor) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
return super._cancel(targets, values, calldatas, descriptionHash);
}
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return super._executor();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockControl)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}

View File

@ -0,0 +1,154 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../munged/governance/Governor.sol";
import "../munged/governance/extensions/GovernorCountingSimple.sol";
import "../munged/governance/extensions/GovernorVotes.sol";
import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
import "../munged/governance/extensions/GovernorTimelockCompound.sol";
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
/*
Wizard options:
ERC20Votes
TimelockCompound
*/
contract WizardFirstTry is
Governor,
GovernorCountingSimple,
GovernorVotes,
GovernorVotesQuorumFraction,
GovernorTimelockCompound
{
constructor(
ERC20Votes _token,
ICompoundTimelock _timelock,
string memory name,
uint256 quorumFraction
)
Governor(name)
GovernorVotes(_token)
GovernorVotesQuorumFraction(quorumFraction)
GovernorTimelockCompound(_timelock)
{}
//HARNESS
function isExecuted(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].executed;
}
function isCanceled(uint256 proposalId) public view returns (bool) {
return _proposals[proposalId].canceled;
}
function snapshot(uint256 proposalId) public view returns (uint64) {
return _proposals[proposalId].voteStart._deadline;
}
function getExecutor() public view returns (address) {
return _executor();
}
uint256 _votingDelay;
uint256 _votingPeriod;
mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
function _castVote(
uint256 proposalId,
address account,
uint8 support,
string memory reason
) internal virtual override returns (uint256) {
uint256 deltaWeight = super._castVote(proposalId, account, support, reason); //HARNESS
ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
return deltaWeight;
}
// original code, harnessed
function votingDelay() public view virtual override returns (uint256) {
// HARNESS: pure -> view
return _votingDelay; // HARNESS: parametric
}
function votingPeriod() public view virtual override returns (uint256) {
// HARNESS: pure -> view
return _votingPeriod; // HARNESS: parametric
}
// original code, not harnessed
// The following functions are overrides required by Solidity.
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
function getVotes(address account, uint256 blockNumber)
public
view
override(IGovernor, Governor)
returns (uint256)
{
return super.getVotes(account, blockNumber);
}
function state(uint256 proposalId)
public
view
override(Governor, GovernorTimelockCompound)
returns (ProposalState)
{
return super.state(proposalId);
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public override(Governor, IGovernor) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockCompound) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockCompound) returns (uint256) {
return super._cancel(targets, values, calldatas, descriptionHash);
}
function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
return super._executor();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockCompound)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}

BIN
certora/reports/2021-10.pdf Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More