openzeppelin-solidity
EIPs
Our great sponsors
openzeppelin-solidity | EIPs | |
---|---|---|
4 | 486 | |
10,805 | 12,525 | |
- | 1.2% | |
9.4 | 9.8 | |
almost 3 years ago | 3 days ago | |
JavaScript | Python | |
MIT License | Creative Commons Zero v1.0 Universal |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
openzeppelin-solidity
-
Attack Vectors in Solidity #6:Unexpected Ether( Incorrect Use of this.balance)
pragma solidity ^0.5.0; import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract MyContract { using SafeMath for uint256; function deposit() public payable { // code to deposit ether } function withdraw(uint256 _amount) public { require(this.balance.sub(_amount) >= 0, "Insufficient funds"); // code to withdraw ether } }
-
How to check if tokenholder is holding 2 different tokens at the same time before an event is triggered?
The basic structure could be done as follows using OZ ERC20 interface https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/IERC20.sol
-
Is this why shib price keeps going down?
return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; }
-
can someone tell me what this contract wants?
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
EIPs
-
Ethereum Foundation removes their canary
Even more relevant would be the Ethereum Improvement Proposal repo (where people submit proposals to change the spec):
https://github.com/ethereum/EIPs
Or the go-ethereum execution client (the most popular execution client):
https://github.com/ethereum/go-ethereum
-
Bridging the Gap: Better Token Standards for Cross-chain Assets
It’s early in the life of the xERC20 standard, but progress is quickly being made. The standard has been audited and is already live with a few projects. The EIP to adopt the standard has been created, and implementation has begun. Alchemix recently announced support for the xERC20 standard. And Defi Wonderland has published a suggested implementation on their GitHub. This implementation has an interface for the xERC20 contract with eight core functions that the token issuer must implement. These are functions related to setting the Lockbox contract (setLockbox), issuance limits for bridges (setLimits, mintingMaxLimitOf, burningMaxLimitOf, etc.), and the core mint and burn functions.
-
Numbers Protocol submitted EIP-7517, Allowing Consent for AI Data Mining on the Blockchain
Check out EIP-7517: Giving Consent for AI Data Mining on the Blockchain
-
Exploring ERC20 Tokens: The Powerhouse Behind Ethereum's Tokenized World4
ERC223 is not widely implemented, and there is some debate in the ERC discussion thread about backward compatibility and trade-offs between implementing changes at the contract interface level versus the user interface.
- EIPs/.github/workflows/post-ci.yml at master · ethereum/EIPs
- EIPs/.github/workflows/ci.yml at master · ethereum/EIPs
-
Process of recalculating the transactionRoot from a block transaction hash
Ethereum Improvement Proposals (EIPs): These are proposals to change various aspects of Ethereum. They often contain detailed technical discussion and can be a good resource for understanding the finer points of how Ethereum works. EIPs can be found here: https://eips.ethereum.org/
-
Burning ETH is great for the price, but may be a risk to decentralization (A critique of the ETH burn model and a recommendation for new economics)
Worth looking at: EIP6968: Contract Secured Revenue on an EVM based L2 https://github.com/ethereum/EIPs/pull/6969/files
-
Calling All Devs and Crypto Enthusiasts: A Community-Driven Anti-Scam Registry on the Blockchain
Additionally, I have made an EIP that can help standardise and maintain official contract registry of each DApp. This can help identify official contracts of a protocol vs scammers using fraud contracts but presenting like official protocol. https://github.com/ethereum/EIPs/pull/6807
What are some alternatives?
RegEx-DoS - :cop: :punch: RegEx Denial of Service (ReDos) Scanner
bips - Bitcoin Improvement Proposals
openzeppelin-contracts - OpenZeppelin Contracts is a library for secure smart contract development.
echidna - Ethereum smart contract fuzzer
token-allowance-checker - Control ERC20 token approvals
eattheblocks - Source code for Eat The Blocks, a screencast for Ethereum Dapp Developers
avalanche-wallet - The Avalanche web wallet
yulp - ➕ A low-level, highly efficient extension to Yul, an intermediate language for the Ethereum Virtual Machine.
rocketpool - Decentralised Ethereum Liquid Staking Protocol.
bytecode-verifier - Compile Solidity source code and verify its bytecode matches the blockchain
solidity - Solidity, the Smart Contract Programming Language