contract_name
stringlengths
1
61
file_path
stringlengths
5
50.4k
contract_address
stringlengths
42
42
language
stringclasses
1 value
class_name
stringlengths
1
61
class_code
stringlengths
4
330k
class_documentation
stringlengths
0
29.1k
class_documentation_type
stringclasses
6 values
func_name
stringlengths
0
62
func_code
stringlengths
1
303k
func_documentation
stringlengths
2
14.9k
func_documentation_type
stringclasses
4 values
compiler_version
stringlengths
15
42
license_type
stringclasses
14 values
swarm_source
stringlengths
0
71
meta
dict
__index_level_0__
int64
0
60.4k
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
SafeMathInt
library SafeMathInt { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); /** * @dev Multiplies two int256 variables and fails on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { int256 ...
sub
function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; }
/** * @dev Subtracts two int256 variables and fails on overflow. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 984, 1165 ] }
13,200
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
SafeMathInt
library SafeMathInt { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); /** * @dev Multiplies two int256 variables and fails on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { int256 ...
add
function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; }
/** * @dev Adds two int256 variables and fails on overflow. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 1248, 1429 ] }
13,201
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
SafeMathInt
library SafeMathInt { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); /** * @dev Multiplies two int256 variables and fails on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { int256 ...
abs
function abs(int256 a) internal pure returns (int256) { require(a != MIN_INT256); return a < 0 ? -a : a; }
/** * @dev Converts to absolute value, and fails on overflow. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 1514, 1648 ] }
13,202
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
BeastInu
contract BeastInu is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; address public constant deadAddress = address(0xdead); bool private swapping; address public marketingWallet; address pu...
enableTrading
function enableTrading() external onlyOwner { tradingActive = true; swapEnabled = true; lastLpBurnTime = block.timestamp; }
// once enabled, can never be turned off
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 4907, 5067 ] }
13,203
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
BeastInu
contract BeastInu is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; address public constant deadAddress = address(0xdead); bool private swapping; address public marketingWallet; address pu...
removeLimits
function removeLimits() external onlyOwner returns (bool){ limitsInEffect = false; return true; }
// remove limits after token is stable
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 5118, 5243 ] }
13,204
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
BeastInu
contract BeastInu is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; address public constant deadAddress = address(0xdead); bool private swapping; address public marketingWallet; address pu...
disableTransferDelay
function disableTransferDelay() external onlyOwner returns (bool){ transferDelayEnabled = false; return true; }
// disable Transfer delay - cannot be reenabled
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 5303, 5442 ] }
13,205
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
BeastInu
contract BeastInu is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; address public constant deadAddress = address(0xdead); bool private swapping; address public marketingWallet; address pu...
updateSwapTokensAtAmount
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool){ require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply."); require(newAmount <= totalSupply() * 5 / 1000, "Swap amount cannot be higher than 0.5% total supply."); swapTo...
// change the minimum amount of tokens to sell from fees
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 5512, 5903 ] }
13,206
BeastInu
BeastInu.sol
0x3ba7bd4ca6feba7553521f5ba763b512983a6202
Solidity
BeastInu
contract BeastInu is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; address public constant deadAddress = address(0xdead); bool private swapping; address public marketingWallet; address pu...
updateSwapEnabled
function updateSwapEnabled(bool enabled) external onlyOwner(){ swapEnabled = enabled; }
// only use to disable contract sales if absolutely necessary (emergency use only)
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://6eb2f669bd1e34b27004ebb832721fbc1ba867dc6db9365cdc2c984628976573
{ "func_code_index": [ 6623, 6729 ] }
13,207
FoundersContract
FoundersContract.sol
0xce5e040786513702fa21a36f465d3be77c48930d
Solidity
FoundersContract
contract FoundersContract { using SafeMath for uint256; ROBOToken public token; uint64 public freezOne = 1538352000; uint64 public freezTwo = 1554076800; mapping(address => uint256) public balances_freez_one; mapping(address => uint256) public balances_freez_two; address muhtov ...
FoundersContract
function FoundersContract(address _token) public { token = ROBOToken(_token); balances_freez_one[muhtov] = 6840000 * 1 ether; //13680000 balances_freez_one[scherbakov] = 6840000 * 1 ether;// 13680000 balances_freez_one[sattarova] = 320000 * 1 ether;//720000 balances_freez_one[roma_kiev] = 9...
//emp17 3% 100 000
LineComment
v0.4.21+commit.dfe3193c
bzzr://1cc26be6b25749aea9912a3b4e5b725c56e13315bc6704235c6929ec387466aa
{ "func_code_index": [ 2965, 7451 ] }
13,208
LidoBridgeSwapper
contracts/LidoBridgeSwapper.sol
0xd222a83d4dd5bad5ed5e9430c99661df4c3483da
Solidity
LidoBridgeSwapper
contract LidoBridgeSwapper is ZkSyncBridgeSwapper { // The address of the stEth token address public immutable stEth; // The address of the wrapped stEth token address public immutable wStEth; // The address of the stEth/Eth Curve pool address public immutable stEthPool; // The referral add...
/** * Exchanges between ETH and wStETH * index 0: ETH * index 1: wStETH */
NatSpecMultiLine
swapEthForStEth
function swapEthForStEth(uint256 _amountIn) internal returns (uint256) { // swap Eth for stEth on the Lido contract ILido(stEth).submit{value: _amountIn}(lidoReferral); // approve the wStEth contract to take the stEth IERC20(stEth).approve(wStEth, _amountIn); // wrap to wStEth and return deposited a...
/** * @dev Swaps ETH for wrapped stETH and deposits the resulting wstETH to the ZkSync bridge. * First withdraws ETH from the bridge if there is a pending balance. * @param _amountIn The amount of ETH to swap. */
NatSpecMultiLine
v0.8.3+commit.8d00100c
{ "func_code_index": [ 1756, 2159 ] }
13,209
LidoBridgeSwapper
contracts/LidoBridgeSwapper.sol
0xd222a83d4dd5bad5ed5e9430c99661df4c3483da
Solidity
LidoBridgeSwapper
contract LidoBridgeSwapper is ZkSyncBridgeSwapper { // The address of the stEth token address public immutable stEth; // The address of the wrapped stEth token address public immutable wStEth; // The address of the stEth/Eth Curve pool address public immutable stEthPool; // The referral add...
/** * Exchanges between ETH and wStETH * index 0: ETH * index 1: wStETH */
NatSpecMultiLine
swapStEthForEth
function swapStEthForEth(uint256 _amountIn) internal returns (uint256) { // unwrap to stEth uint256 unwrapped = IWstETH(wStEth).unwrap(_amountIn); // approve pool bool success = IERC20(stEth).approve(stEthPool, unwrapped); require(success, "approve failed"); // swap stEth for ETH on Curve and re...
/** * @dev Swaps wrapped stETH for ETH and deposits the resulting ETH to the ZkSync bridge. * First withdraws wrapped stETH from the bridge if there is a pending balance. * @param _amountIn The amount of wrapped stETH to swap. */
NatSpecMultiLine
v0.8.3+commit.8d00100c
{ "func_code_index": [ 2411, 2878 ] }
13,210
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 89, 272 ] }
13,211
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 356, 629 ] }
13,212
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 743, 859 ] }
13,213
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 923, 1059 ] }
13,214
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
TokenERC20
function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tok...
/** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 890, 1453 ] }
13,215
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
_transfer
function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > bal...
/** * Internal transfer, only can be called by this contract */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 1548, 2422 ] }
13,216
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
transfer
function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); }
/** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 2649, 2765 ] }
13,217
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
/** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 3063, 3374 ] }
13,218
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
approve
function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
/** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 3659, 3843 ] }
13,219
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; ...
/** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some e...
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 4260, 4628 ] }
13,220
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
burn
function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.send...
/** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 4817, 5203 ] }
13,221
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
burnFrom
function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; ...
/** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 5482, 6109 ] }
13,222
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
PACOIN
contract PACOIN is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); ...
/******************************************/
NatSpecMultiLine
PACOIN
function PACOIN( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Initializes contract with initial supply tokens to the creator of the contract */
Comment
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 452, 635 ] }
13,223
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
PACOIN
contract PACOIN is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); ...
/******************************************/
NatSpecMultiLine
_transfer
function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value > ...
/* Internal transfer, only can be called by this contract */
Comment
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 711, 1511 ] }
13,224
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
PACOIN
contract PACOIN is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); ...
/******************************************/
NatSpecMultiLine
mintToken
function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); }
/// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive
NatSpecSingleLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 2246, 2514 ] }
13,225
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
PACOIN
contract PACOIN is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); ...
/******************************************/
NatSpecMultiLine
freezeAccount
function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); }
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not
NatSpecSingleLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 2706, 2873 ] }
13,226
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
PACOIN
contract PACOIN is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); ...
/******************************************/
NatSpecMultiLine
setPrices
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; }
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract
NatSpecSingleLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 3127, 3293 ] }
13,227
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
PACOIN
contract PACOIN is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); ...
/******************************************/
NatSpecMultiLine
buy
function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers }
/// @notice Buy tokens from contract by sending ether
NatSpecSingleLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 3362, 3577 ] }
13,228
PACOIN
PACOIN.sol
0xaf470d6dc7d02c301e3b2b871e63f075be6ce207
Solidity
PACOIN
contract PACOIN is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); ...
/******************************************/
NatSpecMultiLine
sell
function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It's im...
/// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold
NatSpecSingleLine
v0.4.25-nightly.2018.6.14+commit.baeabe1c
bzzr://10e3f690a68caa6e8b1cd1ec13b2edbc7af2621b111d718e8a8f31b97e04d08b
{ "func_code_index": [ 3690, 4086 ] }
13,229
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.beare...
/** * @title Roles * @dev Library for managing addresses assigned to a Role. */
NatSpecMultiLine
add
function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; }
/** * @dev give an account access to this role */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 155, 346 ] }
13,230
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.beare...
/** * @title Roles * @dev Library for managing addresses assigned to a Role. */
NatSpecMultiLine
remove
function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; }
/** * @dev remove an account's access to this role */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 420, 614 ] }
13,231
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.beare...
/** * @title Roles * @dev Library for managing addresses assigned to a Role. */
NatSpecMultiLine
has
function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; }
/** * @dev check if an account has this role * @return bool */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 703, 873 ] }
13,232
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Pausable
contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } /** * @return true if the contract is paused, false otherwise. */ function paused() public vi...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
paused
function paused() public view returns (bool) { return _paused; }
/** * @return true if the contract is paused, false otherwise. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 289, 372 ] }
13,233
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Pausable
contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } /** * @return true if the contract is paused, false otherwise. */ function paused() public vi...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
pause
function pause() public onlyPauser whenNotPaused { _paused = true; emit Paused(msg.sender); }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 825, 946 ] }
13,234
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Pausable
contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } /** * @return true if the contract is paused, false otherwise. */ function paused() public vi...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
unpause
function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(msg.sender); }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1036, 1159 ] }
13,235
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Ownable
contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = m...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
owner
function owner() public view returns (address) { return _owner; }
/** * @return the address of the owner. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 457, 541 ] }
13,236
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Ownable
contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = m...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
isOwner
function isOwner() public view returns (bool) { return msg.sender == _owner; }
/** * @return true if `msg.sender` is the owner of the contract. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 792, 889 ] }
13,237
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Ownable
contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = m...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Allows the current owner to relinquish control of the contract. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. * @notice Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner....
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1247, 1392 ] }
13,238
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Ownable
contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = m...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1564, 1678 ] }
13,239
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
Ownable
contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = m...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
_transferOwnership
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1823, 2015 ] }
13,240
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
mul
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; ...
/** * @dev Multiplies two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 106, 544 ] }
13,241
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 674, 982 ] }
13,242
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
/** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1115, 1270 ] }
13,243
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1353, 1508 ] }
13,244
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
/** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1664, 1793 ] }
13,245
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return _totalSupply; }
/** * @dev Total number of tokens in existence */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 297, 393 ] }
13,246
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
balanceOf
function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; }
/** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 607, 718 ] }
13,247
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1052, 1188 ] }
13,248
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
transfer
function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; }
/** * @dev Transfer token to a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1357, 1502 ] }
13,249
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
approve
function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; }
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 2144, 2297 ] }
13,250
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
transferFrom
function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; }
/** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 2765, 2998 ] }
13,251
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; }
/** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 3519, 3727 ] }
13,252
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; }
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 4253, 4471 ] }
13,253
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_transfer
function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); }
/** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 4693, 4960 ] }
13,254
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_mint
function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); }
/** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 5307, 5581 ] }
13,255
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_burn
function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); }
/** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 5810, 6084 ] }
13,256
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); }
/** * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 6352, 6611 ] }
13,257
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSuppl...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_burnFrom
function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); }
/** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param valu...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 7005, 7192 ] }
13,258
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
BlackList
contract BlackList is Ownable { /////// Getter to allow the same blacklist to be used also by other contracts (including upgraded Deep Network) /////// function getBlackListStatus(address _maker) external view returns (bool) { return isBlackListed[_maker]; } mapping (address => bool) pu...
getBlackListStatus
function getBlackListStatus(address _maker) external view returns (bool) { return isBlackListed[_maker]; }
/////// Getter to allow the same blacklist to be used also by other contracts (including upgraded Deep Network) ///////
NatSpecSingleLine
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 160, 285 ] }
13,259
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
transfer
function transfer(address _to, uint _value) public whenNotPaused returns (bool) { require(!isBlackListed[msg.sender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } }
// Forward ERC20 methods to upgraded contract if this one is deprecated
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 823, 1169 ] }
13,260
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
transferFrom
function transferFrom(address _from, address _to, uint _value) public whenNotPaused returns (bool) { require(!isBlackListed[_from]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value); } else { return super.transferFrom(_...
// Forward ERC20 methods to upgraded contract if this one is deprecated
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1249, 1631 ] }
13,261
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
balanceOf
function balanceOf(address who) public view returns (uint) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).balanceOf(who); } else { return super.balanceOf(who); } }
// Forward ERC20 methods to upgraded contract if this one is deprecated
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 1711, 1956 ] }
13,262
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
oldBalanceOf
function oldBalanceOf(address who) public view returns (uint) { if (deprecated) { return super.balanceOf(who); } }
// Allow checks of balance at time of deprecation
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 2014, 2169 ] }
13,263
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
approve
function approve(address _spender, uint _value) public whenNotPaused returns (bool) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); } else { return super.approve(_spender, _value); } }
// Forward ERC20 methods to upgraded contract if this one is deprecated
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 2249, 2561 ] }
13,264
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
allowance
function allowance(address _owner, address _spender) public view returns (uint remaining) { if (deprecated) { return IERC20(upgradedAddress).allowance(_owner, _spender); } else { return super.allowance(_owner, _spender); } }
// Forward ERC20 methods to upgraded contract if this one is deprecated
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 3372, 3659 ] }
13,265
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
deprecate
function deprecate(address _upgradedAddress) public onlyOwner { require(_upgradedAddress != address(0)); deprecated = true; upgradedAddress = _upgradedAddress; emit Deprecate(_upgradedAddress); }
// deprecate current contract in favour of a new one
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 3720, 3961 ] }
13,266
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
totalSupply
function totalSupply() public view returns (uint) { if (deprecated) { return IERC20(upgradedAddress).totalSupply(); } else { return super.totalSupply(); } }
// deprecate current contract if favour of a new one
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 4022, 4241 ] }
13,267
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
issue
function issue(uint amount) public onlyOwner { require(!deprecated); _mint(owner(), amount); emit Issue(amount); }
// Issue a new amount of tokens // these tokens are deposited into the owner address // // @param _amount Number of tokens to be issued
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 4400, 4551 ] }
13,268
DeepNetworkToken
DeepNetworkToken.sol
0x1ab6d32a52047df43a63b02cbe5a81e83d632572
Solidity
DeepNetworkToken
contract DeepNetworkToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of th...
redeem
function redeem(uint amount) public onlyOwner { require(!deprecated); _burn(owner(), amount); emit Redeem(amount); }
// Redeem tokens. // These tokens are withdrawn from the owner address // if the balance must be enough to cover the redeem // or the call will fail. // @param _amount Number of tokens to be issued
LineComment
v0.5.11+commit.c082d0b4
None
bzzr://5795e39647eb8b430784670332cf0a5d714239ce1c64935180d41f78b80d5ea8
{ "func_code_index": [ 4777, 4930 ] }
13,269
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
name
function name() public view virtual override returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 779, 884 ] }
13,270
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
symbol
function symbol() public view virtual override returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 998, 1107 ] }
13,271
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decimals
function decimals() public view virtual override returns (uint8) { return 18; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 1741, 1839 ] }
13,272
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
totalSupply
function totalSupply() public view virtual override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 1899, 2012 ] }
13,273
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 2070, 2202 ] }
13,274
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 2410, 2590 ] }
13,275
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 2648, 2804 ] }
13,276
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 2946, 3120 ] }
13,277
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _ap...
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 3597, 4024 ] }
13,278
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 4428, 4648 ] }
13,279
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - sub...
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 5146, 5528 ] }
13,280
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 sende...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 6013, 6622 ] }
13,281
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 6899, 7242 ] }
13,282
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds ba...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 7570, 8069 ] }
13,283
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero a...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 8502, 8853 ] }
13,284
Tsuzuki
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x07f05587fe3a3454f4718a4f9e6931d94b13d1c4
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
None
ipfs://4b76405178a2c58ae6ff3dedd535f426a992f39cb01047eed1aa91664673e56b
{ "func_code_index": [ 9451, 9548 ] }
13,285
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
initialize
function initialize(address _token0, address _token1) external { require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check token0 = _token0; token1 = _token1; }
// called once by the factory at time of deployment
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 2077, 2292 ] }
13,286
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
_update
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private { require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW'); uint32 blockTimestamp = uint32(block.timestamp % 2**32); uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow...
// update reserves and, on the first call per block, price accumulators
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 2372, 3237 ] }
13,287
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
_mintFee
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { address feeTo = IUniswapV2Factory(factory).feeTo(); feeOn = feeTo != address(0); uint _kLast = kLast; // gas savings if (feeOn) { if (_kLast != 0) { uint rootK = Math.sqrt(uint(_reserve0).mul...
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 3322, 4164 ] }
13,288
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
mint
function mint(address to) external lock returns (uint liquidity) { (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings uint balance0 = IERC20(token0).balanceOf(address(this)); uint balance1 = IERC20(token1).balanceOf(address(this)); uint amount0 = balance0.sub(_reserve0); ui...
// this low-level function should be called from a contract which performs important safety checks
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 4271, 5516 ] }
13,289
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
burn
function burn(address to) external lock returns (uint amount0, uint amount1) { (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings address _token0 = token0; // gas savings address _token1 = token1; // gas savings uint ...
// this low-level function should be called from a contract which performs important safety checks
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 5623, 7094 ] }
13,290
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
swap
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock { require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT'); (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings require(amount0Out < _reserve0 && amount1Out < _rese...
// this low-level function should be called from a contract which performs important safety checks
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 7201, 9095 ] }
13,291
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
skim
function skim(address to) external lock { address _token0 = token0; // gas savings address _token1 = token1; // gas savings _safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0)); _safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1)); }
// force balances to match reserves
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 9139, 9478 ] }
13,292
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UniswapV2Pair
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 { using SafeMath for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address pu...
sync
function sync() external lock { _update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1); }
// force reserves to match balances
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 9522, 9685 ] }
13,293
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
Math
library Math { function min(uint x, uint y) internal pure returns (uint z) { z = x < y ? x : y; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { ...
// a library for performing various math operations
LineComment
sqrt
function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } }
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 230, 538 ] }
13,294
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UQ112x112
library UQ112x112 { uint224 constant Q112 = 2**112; // encode a uint112 as a UQ112x112 function encode(uint112 y) internal pure returns (uint224 z) { z = uint224(y) * Q112; // never overflows } // divide a UQ112x112 by a uint112, returning a UQ112x112 function uqdiv(uint224 x,...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) // range: [0, 2**112 - 1] // resolution: 1 / 2**112
LineComment
encode
function encode(uint112 y) internal pure returns (uint224 z) { z = uint224(y) * Q112; // never overflows }
// encode a uint112 as a UQ112x112
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 100, 225 ] }
13,295
UniswapV2Pair
UniswapV2Pair.sol
0xea2a4ab74cfb45b70f74451b7ce59e005d2f91d1
Solidity
UQ112x112
library UQ112x112 { uint224 constant Q112 = 2**112; // encode a uint112 as a UQ112x112 function encode(uint112 y) internal pure returns (uint224 z) { z = uint224(y) * Q112; // never overflows } // divide a UQ112x112 by a uint112, returning a UQ112x112 function uqdiv(uint224 x,...
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) // range: [0, 2**112 - 1] // resolution: 1 / 2**112
LineComment
uqdiv
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { z = x / uint224(y); }
// divide a UQ112x112 by a uint112, returning a UQ112x112
LineComment
v0.5.16+commit.9c3226ce
None
bzzr://b3b4ea683536ed2f3002ea2dc787522d1a9264771763e0c8df022fda814a87fb
{ "func_code_index": [ 291, 404 ] }
13,296
Controller
contracts/Controller.sol
0xd5b837a41a0d664ec28aa55b69b352944f741efa
Solidity
Controller
contract Controller is Initializable, Ownable, IControllerInterface { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; using SafeRatioMath for uint256; using SafeMathUpgradeable for uint256; using SafeERC20Upgradeable for IERC20Upgradeable; /// @dev EnumerableSet of all iToke...
/** * @title dForce's lending controller Contract * @author dForce */
NatSpecMultiLine
initialize
function initialize() external initializer { __Ownable_init(); }
/** * @notice Initializes the contract. */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 4316, 4396 ] }
13,297
Controller
contracts/Controller.sol
0xd5b837a41a0d664ec28aa55b69b352944f741efa
Solidity
Controller
contract Controller is Initializable, Ownable, IControllerInterface { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; using SafeRatioMath for uint256; using SafeMathUpgradeable for uint256; using SafeERC20Upgradeable for IERC20Upgradeable; /// @dev EnumerableSet of all iToke...
/** * @title dForce's lending controller Contract * @author dForce */
NatSpecMultiLine
isController
function isController() external view override returns (bool) { return true; }
/** * @notice Ensure this is a Controller contract. */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 4588, 4682 ] }
13,298
Controller
contracts/Controller.sol
0xd5b837a41a0d664ec28aa55b69b352944f741efa
Solidity
Controller
contract Controller is Initializable, Ownable, IControllerInterface { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; using SafeRatioMath for uint256; using SafeMathUpgradeable for uint256; using SafeERC20Upgradeable for IERC20Upgradeable; /// @dev EnumerableSet of all iToke...
/** * @title dForce's lending controller Contract * @author dForce */
NatSpecMultiLine
_addMarket
function _addMarket( address _iToken, uint256 _collateralFactor, uint256 _borrowFactor, uint256 _supplyCapacity, uint256 _borrowCapacity, uint256 _distributionFactor ) external override onlyOwner { require(IiToken(_iToken).isSupported(), "Token is not supported"); // Market must not hav...
/** * @notice Admin function to add iToken into supported markets * Checks if the iToken already exsits * Will `revert()` if any check fails * @param _iToken The _iToken to add * @param _collateralFactor The _collateralFactor of _iToken * @param _borrowFactor The _borrowFactor of _iToken * @param _supplyCapacity...
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 5266, 7002 ] }
13,299