openzeppelin-contracts
openzeppelin-contracts copied to clipboard
OpenZeppelin Contracts is a library for secure smart contract development.
This is a more efficient method of computing a create2 address, utilizing the scratch space and (temporarily) the free memory pointer slot. See [this discussion with solc devs](https://gitter.im/ethereum/solidity?at=62ec271bb16e8236e36d0def) regarding the...
In this PR, I've added a new `transferRole` function to `AccessControl`, which allows role bearers to transfer their privileges to new accounts in case they are switching to a new...
**🧐 Motivation** Save gas for a condition requirement that could never be false **📝 Details** in ERC20.sol you have requirement ``` require(owner != address(0), "ERC20: approve from the zero address");...
Fixes #3584 @frangio, once you are okay with this. I would add the functions in `InitializableMock.sol` `SingleInheritanceInitializableMock.sol` `MultipleInitializableMock.sol` and write tests accordingly. Pardon me if I have messed up something...
**🧐 Motivation** In the current token implementations of OpenZeppelin contracts, [only the ERC721 implementation contains the `supportsInterface(...)` function](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d1b1e17d23cc28eecd07e411a461854988803aa8/contracts/token/ERC721/ERC721.sol#L52). ERC20 does not contain `supportsInterface(...)` by default. I am not sure why...
Fixes #???? #### PR Checklist - [ ] Tests - [ ] Documentation - [ ] Changelog entry
TransparentUpgradeableProxy has getters `admin()` and `implementation()` but these functions are guarded by `ifAdmin`, as a result calling the function by anyone except the admin will not return the values. This...
In spite of the warnings provided in the comments of the function itself, the name `isContract` is a misnomer and creates a potential security risk for anyone who doesn't bother...
Referring to Initializable. - `Initializable._getInitializedVersion() returns (uint8)` - `Initializable._isInitializing() returns (bool)`
See: https://twitter.com/alexberegszaszi/status/1534461421454606336?s=20&t=H0Dv3ZT2bicx00hLWJk7Fg