* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>