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
BBB
BBB.sol
0x4e2de4a45dc765a82d1b58fafa5ca06b37d28667
Solidity
BBB
contract BBB is SafeMath{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; ...
BBB
function BBB( uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol ) { balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens totalSupply = initialSupply; // Update total supply name = tokenNam...
/* Initializes contract with initial supply tokens to the creator of the contract */
Comment
v0.4.16+commit.d7661dd9
None
bzzr://1410a9ac1c98ea46cc93981c59dd5a301783a9d309aef5805dda73856c9cfc2e
{ "func_code_index": [ 988, 1652 ] }
24,800
BBB
BBB.sol
0x4e2de4a45dc765a82d1b58fafa5ca06b37d28667
Solidity
BBB
contract BBB is SafeMath{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; ...
transfer
function transfer(address _to, uint256 _value) { if (_to == 0x0) throw; // Prevent transfer to 0x0 address. Use burn() instead (_value <= 0) throw; if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (balanceOf[_to] + _value < balance...
/* Send coins */
Comment
v0.4.16+commit.d7661dd9
None
bzzr://1410a9ac1c98ea46cc93981c59dd5a301783a9d309aef5805dda73856c9cfc2e
{ "func_code_index": [ 1677, 2440 ] }
24,801
BBB
BBB.sol
0x4e2de4a45dc765a82d1b58fafa5ca06b37d28667
Solidity
BBB
contract BBB is SafeMath{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; ...
approve
function approve(address _spender, uint256 _value) returns (bool success) { (_value <= 0) throw; allowance[msg.sender][_spender] = _value; return true; }
/* Allow another contract to spend some tokens in your behalf */
Comment
v0.4.16+commit.d7661dd9
None
bzzr://1410a9ac1c98ea46cc93981c59dd5a301783a9d309aef5805dda73856c9cfc2e
{ "func_code_index": [ 2513, 2710 ] }
24,802
BBB
BBB.sol
0x4e2de4a45dc765a82d1b58fafa5ca06b37d28667
Solidity
BBB
contract BBB is SafeMath{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; ...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { if (_to == 0x0) throw; // Prevent transfer to 0x0 address. Use burn() instead (_value <= 0) throw; if (balanceOf[_from] < _value) throw; // Check if the sender has enoug...
/* A contract attempts to get the coins */
Comment
v0.4.16+commit.d7661dd9
None
bzzr://1410a9ac1c98ea46cc93981c59dd5a301783a9d309aef5805dda73856c9cfc2e
{ "func_code_index": [ 2770, 3695 ] }
24,803
BBB
BBB.sol
0x4e2de4a45dc765a82d1b58fafa5ca06b37d28667
Solidity
BBB
contract BBB is SafeMath{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; ...
withdrawEther
function withdrawEther(uint256 amount) { if(msg.sender != owner)throw; owner.transfer(amount); }
// transfer balance to owner
LineComment
v0.4.16+commit.d7661dd9
None
bzzr://1410a9ac1c98ea46cc93981c59dd5a301783a9d309aef5805dda73856c9cfc2e
{ "func_code_index": [ 5206, 5312 ] }
24,804
BBB
BBB.sol
0x4e2de4a45dc765a82d1b58fafa5ca06b37d28667
Solidity
BBB
contract BBB is SafeMath{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; ...
function() payable { }
// can accept ether
LineComment
v0.4.16+commit.d7661dd9
None
bzzr://1410a9ac1c98ea46cc93981c59dd5a301783a9d309aef5805dda73856c9cfc2e
{ "func_code_index": [ 5338, 5367 ] }
24,805
KYPool
KYPool.sol
0x78955790885e94c32d63c9bfbb6f886b9a0c6832
Solidity
KYPool
contract KYPool { using SafeMath for uint256; using FrozenValidator for FrozenValidator.Validator; mapping (address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; string public name; string public symbol; uint8 public d...
changeAdmin
function changeAdmin(address newAdmin) public returns (bool) { require(msg.sender == admin); require(newAdmin != address(0)); uint256 balAdmin = balances[admin]; balances[newAdmin] = balances[newAdmin].add(balAdmin); balances[admin] = 0; admin = newAdmin; emit Transfer(admin, newAdmi...
//Admin address
LineComment
v0.4.24+commit.e67f0147
bzzr://c71363db01cd33cceded941b4cff19368943ba550aacba068545c1f291796f6e
{ "func_code_index": [ 427, 822 ] }
24,806
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 94, 154 ] }
24,807
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 237, 310 ] }
24,808
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 534, 616 ] }
24,809
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 895, 983 ] }
24,810
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1647, 1726 ] }
24,811
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 2039, 2141 ] }
24,812
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 259, 445 ] }
24,813
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 723, 864 ] }
24,814
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1162, 1359 ] }
24,815
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
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-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1613, 2089 ] }
24,816
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 2560, 2697 ] }
24,817
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3188, 3471 ] }
24,818
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3931, 4066 ] }
24,819
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 4546, 4717 ] }
24,820
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
isContract
function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codeha...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 606, 1230 ] }
24,821
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 2160, 2562 ] }
24,822
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3318, 3496 ] }
24,823
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3721, 3922 ] }
24,824
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 4292, 4523 ] }
24,825
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 4774, 5095 ] }
24,826
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
safeApprove
function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line ...
/** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 747, 1374 ] }
24,827
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
_callOptionalReturn
function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target ad...
/** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 2393, 3159 ] }
24,828
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 497, 581 ] }
24,829
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1139, 1292 ] }
24,830
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1442, 1691 ] }
24,831
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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 returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 902, 990 ] }
24,832
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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 returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1104, 1196 ] }
24,833
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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 returns (uint8) { return _decimals; }
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1829, 1917 ] }
24,834
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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 override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 1977, 2082 ] }
24,835
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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 override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 2140, 2264 ] }
24,836
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 2472, 2652 ] }
24,837
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 2710, 2866 ] }
24,838
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3008, 3182 ] }
24,839
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
/** * @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 `amou...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3651, 3977 ] }
24,840
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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].add(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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 4381, 4604 ] }
24,841
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 5102, 5376 ] }
24,842
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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); _balances[sen...
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 5861, 6405 ] }
24,843
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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 = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfe...
/** @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 6681, 7064 ] }
24,844
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _to...
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 7391, 7814 ] }
24,845
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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 is 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...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 8249, 8600 ] }
24,846
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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
_setupDecimals
function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; }
/** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 8927, 9022 ] }
24,847
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @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.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 9620, 9717 ] }
24,848
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesToken
contract VotesToken is ERC20("YUGE.money", "VOTES"), Ownable { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (VotesPrinter). function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); } }
// VotesToken with Governance.
LineComment
mint
function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); }
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (VotesPrinter).
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 164, 268 ] }
24,849
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
add
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poolInfo.push(PoolInfo({ ...
// Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3017, 3536 ] }
24,850
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
set
function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; }
// Update the given pool's votes allocation point. Can only be called by the owner.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 3628, 3937 ] }
24,851
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
getMultiplier
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { if (_to <= bonusEndBlock) { return _to.sub(_from).mul(BONUS_MULTIPLIER); } else if (_from >= bonusEndBlock) { return _to.sub(_from); } else { return bonusEndBlock.sub(_from).mul(BONUS_MULTIPLIER)...
// Return reward multiplier over the given _from to _to block.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 4012, 4440 ] }
24,852
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
pendingvotes
function pendingvotes(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accVotesPerShare = pool.accVotesPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (block.numbe...
// View function to see pending votess on frontend.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 4500, 5273 ] }
24,853
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
massUpdatePools
function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } }
// Update reward vairables for all pools. Be careful of gas spending!
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 5351, 5536 ] }
24,854
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
mint
function mint(uint256 amount) public onlyOwner{ votes.mint(devaddr, amount); }
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 5605, 5702 ] }
24,855
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
updatePool
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number; return; } ...
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 5771, 6572 ] }
24,856
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
deposit
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accVotesPerShare).div(1e12).sub(user.rewardDebt); saf...
// Deposit LP tokens to VotesPrinter for votes allocation.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 6639, 7303 ] }
24,857
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
withdraw
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accVotesPerShare).div(1e12).sub(u...
// Withdraw LP tokens from VotesPrinter.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 7352, 8012 ] }
24,858
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
emergencyWithdraw
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; pool.lpToken.safeTransfer(address(msg.sender), user.amount); emit EmergencyWithdraw(msg.sender, _pid, user.amount); user.amount = 0; user.rewardDebt...
// Withdraw without caring about rewards. EMERGENCY ONLY.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 8078, 8439 ] }
24,859
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
safevotesTransfer
function safevotesTransfer(address _to, uint256 _amount) internal { uint256 votesBal = votes.balanceOf(address(this)); if (_amount > votesBal) { votes.transfer(_to, votesBal); } else { votes.transfer(_to, _amount); } }
// Safe votes transfer function, just in case if rounding error causes pool to not have enough votess.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 8550, 8840 ] }
24,860
VotesPrinter
VotesPrinter.sol
0x94880fa867f3d90490088937b29aa40b877370ff
Solidity
VotesPrinter
contract VotesPrinter is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // W...
dev
function dev(address _devaddr) public { require(msg.sender == devaddr, "dev: wut?"); devaddr = _devaddr; }
// Update dev address by the previous dev.
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://b5c018191ebe94557cfbfd3fa0c59ace553bee59be035bd9fcaf943d0c606738
{ "func_code_index": [ 8891, 9025 ] }
24,861
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswapGenerator.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswapGenerator
contract FarmUniswapGenerator is Context, Ownable { using SafeMath for uint256; IFarmFactory public factory; struct FarmParameters { uint256 bonusBlocks; uint256 totalBonusReward; uint256 numBlocks; uint256 endBlock; uint256 requiredAmount; } constructor(IFarmFactory _factory) public { ...
determineEndBlock
function determineEndBlock(uint256 _amount, uint256 _blockReward, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _bonus) public pure returns (uint256, uint256) { FarmParameters memory params; params.bonusBlocks = _bonusEndBlock.sub(_startBlock); params.totalBonusReward = params.bonusBlocks.mul(_bonus).mul(_...
/** * @notice Determine the endBlock based on inputs. Used on the front end to show the exact settings the Farm contract will be deployed with */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 502, 1266 ] }
24,862
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswapGenerator.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswapGenerator
contract FarmUniswapGenerator is Context, Ownable { using SafeMath for uint256; IFarmFactory public factory; struct FarmParameters { uint256 bonusBlocks; uint256 totalBonusReward; uint256 numBlocks; uint256 endBlock; uint256 requiredAmount; } constructor(IFarmFactory _factory) public { ...
determineBlockReward
function determineBlockReward(uint256 _amount, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _bonus, uint256 _endBlock) public pure returns (uint256, uint256) { uint256 bonusBlocks = _bonusEndBlock.sub(_startBlock); uint256 nonBonusBlocks = _endBlock.sub(_bonusEndBlock); uint256 effectiveBlocks = bonusBloc...
/** * @notice Determine the blockReward based on inputs specifying an end date. Used on the front end to show the exact settings the Farm contract will be deployed with */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 1448, 1976 ] }
24,863
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswapGenerator.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswapGenerator
contract FarmUniswapGenerator is Context, Ownable { using SafeMath for uint256; IFarmFactory public factory; struct FarmParameters { uint256 bonusBlocks; uint256 totalBonusReward; uint256 numBlocks; uint256 endBlock; uint256 requiredAmount; } constructor(IFarmFactory _factory) public { ...
createFarmUniswap
function createFarmUniswap(IERC20 _rewardToken, uint256 _amount, IERC20 _lpToken, IUniFactory _swapFactory, uint256 _blockReward, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _bonus) public onlyOwner returns (address){ require(_startBlock > block.number, 'START'); // ideally at least 24 hours more to give far...
/** * @notice Creates a new FarmUniswap contract and registers it in the * .sol. All farming rewards are locked in the FarmUniswap Contract */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 2133, 3687 ] }
24,864
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
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...
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.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 89, 272 ] }
24,865
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
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...
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.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 356, 629 ] }
24,866
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
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...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 744, 860 ] }
24,867
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
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...
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.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 924, 1060 ] }
24,868
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
Solidity
CellTokens
contract CellTokens { using SafeMath for uint256; uint8 private constant MAX_COLS = 64; uint8 private constant MAX_ROWS = 160; uint8 private Reserved_upRow = 8; uint8 private Reserved_downRow = 39; uint8 private max_merge_size = 2; event Bought (uint256 indexed _itemId, address indexed _owner...
setOwner
function setOwner (address _owner) onlyOwner() public { owner = _owner; }
/* Owner */
Comment
v0.4.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 1616, 1700 ] }
24,869
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
Solidity
CellTokens
contract CellTokens { using SafeMath for uint256; uint8 private constant MAX_COLS = 64; uint8 private constant MAX_ROWS = 160; uint8 private Reserved_upRow = 8; uint8 private Reserved_downRow = 39; uint8 private max_merge_size = 2; event Bought (uint256 indexed _itemId, address indexed _owner...
enableERC721
function enableERC721 () onlyOwner() public { erc721Enabled = true; }
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
LineComment
v0.4.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 1973, 2053 ] }
24,870
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
Solidity
CellTokens
contract CellTokens { using SafeMath for uint256; uint8 private constant MAX_COLS = 64; uint8 private constant MAX_ROWS = 160; uint8 private Reserved_upRow = 8; uint8 private Reserved_downRow = 39; uint8 private max_merge_size = 2; event Bought (uint256 indexed _itemId, address indexed _owner...
withdrawAll
function withdrawAll () onlyOwner() public { owner.transfer(this.balance); }
/* */
Comment
v0.4.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 2405, 2492 ] }
24,871
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
Solidity
CellTokens
contract CellTokens { using SafeMath for uint256; uint8 private constant MAX_COLS = 64; uint8 private constant MAX_ROWS = 160; uint8 private Reserved_upRow = 8; uint8 private Reserved_downRow = 39; uint8 private max_merge_size = 2; event Bought (uint256 indexed _itemId, address indexed _owner...
calculateNextPrice
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) { if (_price < increaseLimit1) { return _price.mul(200).div(95); } else if (_price < increaseLimit2) { return _price.mul(135).div(96); } else if (_price < increaseLimit3) { return _price.mul(125).div(97); } ...
/* Buying */
Comment
v0.4.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 2613, 3089 ] }
24,872
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
Solidity
CellTokens
contract CellTokens { using SafeMath for uint256; uint8 private constant MAX_COLS = 64; uint8 private constant MAX_ROWS = 160; uint8 private Reserved_upRow = 8; uint8 private Reserved_downRow = 39; uint8 private max_merge_size = 2; event Bought (uint256 indexed _itemId, address indexed _owner...
implementsERC721
function implementsERC721() public view returns (bool _implements) { return erc721Enabled; }
/* ERC721 */
Comment
v0.4.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 7495, 7598 ] }
24,873
CellTokens
CellTokens.sol
0x7f85141f4c463b194017e849db8973c7961476ce
Solidity
CellTokens
contract CellTokens { using SafeMath for uint256; uint8 private constant MAX_COLS = 64; uint8 private constant MAX_ROWS = 160; uint8 private Reserved_upRow = 8; uint8 private Reserved_downRow = 39; uint8 private max_merge_size = 2; event Bought (uint256 indexed _itemId, address indexed _owner...
isAdmin
function isAdmin (address _admin) public view returns (bool _isAdmin) { return admins[_admin]; }
/* Read */
Comment
v0.4.21-nightly.2018.3.5+commit.cd6ffbdf
bzzr://563929af06958bade4367114d2bc57d1de097b80a0fd38ae278d3ccd5444e2d3
{ "func_code_index": [ 9295, 9410 ] }
24,874
fcYLD
@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol
0xedf9c715c91443405ec059202c9ac107d9d0ca10
Solidity
IERC3156FlashBorrower
interface IERC3156FlashBorrower { /** * @dev Receive a flash loan. * @param initiator The initiator of the loan. * @param token The loan currency. * @param amount The amount of tokens lent. * @param fee The additional amount of tokens to repay. * @param data Arbitrary data structure, i...
/** * @dev Interface of the ERC3156 FlashBorrower, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. * * _Available since v4.1._ */
NatSpecMultiLine
onFlashLoan
function onFlashLoan( address initiator, address token, uint256 amount, uint256 fee, bytes calldata data ) external returns (bytes32);
/** * @dev Receive a flash loan. * @param initiator The initiator of the loan. * @param token The loan currency. * @param amount The amount of tokens lent. * @param fee The additional amount of tokens to repay. * @param data Arbitrary data structure, intended to contain user-defined parameters. * @return The kec...
NatSpecMultiLine
v0.8.11+commit.d7f03943
{ "func_code_index": [ 444, 626 ] }
24,875
POPELON
POPELON.sol
0x91fe3594920f0a00f880791db8fdaa95e2e060a3
Solidity
POPELON
contract POPELON is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => uint256) private _lastTX; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee...
//to recieve ETH from uniswapV2Router when swaping
LineComment
v0.7.6+commit.7338295f
Unlicense
ipfs://96c47a2f2a38919e817374fa3c7541dd6ebf18fb09849081a6bb6f6399ec2d43
{ "func_code_index": [ 7346, 7380 ] }
24,876
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
allowance
function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; }
/** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 3011, 3152 ] }
24,877
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
approve
function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit ...
/** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount Th...
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 3625, 4049 ] }
24,878
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
balanceOf
function balanceOf(address account) external view returns (uint) { return balances[account]; }
/** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 4247, 4360 ] }
24,879
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
transfer
function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Comp::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; }
/** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 4619, 4862 ] }
24,880
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
transferFrom
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-...
/** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 5167, 5844 ] }
24,881
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
delegate
function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); }
/** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 5987, 6094 ] }
24,882
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
delegateBySig
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, exp...
/** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECD...
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 6523, 7317 ] }
24,883
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
getCurrentVotes
function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; }
/** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 7513, 7740 ] }
24,884
SuperstringUnity
SuperstringUnity.sol
0xbfe7a3c15610863a14ace66b8c06cf74c92afa92
Solidity
SuperstringUnity
contract SuperstringUnity { /// @notice EIP-20 token name for this token string public constant name = "SuperstringUnity"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimal...
getPriorVotes
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "Comp::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent ba...
/** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at ...
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://122037da82e48e329b50124346df7fe985e0915d00cb2afc22b4423e9ffd96f1
{ "func_code_index": [ 8166, 9389 ] }
24,885
CogeneroToken
zeppelin-solidity/contracts/token/MintableToken.sol
0x88218eb0756bca01a9f6be0c6eff641e9b4d8101
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that ...
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */
NatSpecMultiLine
mint
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; }
/** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://d92965dada73fa74e32c44ebb7fb17744e18af3e35f39881cac707f2468b79eb
{ "func_code_index": [ 483, 754 ] }
24,886
CogeneroToken
zeppelin-solidity/contracts/token/MintableToken.sol
0x88218eb0756bca01a9f6be0c6eff641e9b4d8101
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that ...
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */
NatSpecMultiLine
finishMinting
function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; }
/** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://d92965dada73fa74e32c44ebb7fb17744e18af3e35f39881cac707f2468b79eb
{ "func_code_index": [ 871, 1013 ] }
24,887
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
init
function init( IERC20 _rewardToken, uint256 _amount, IERC20 _lpToken, uint256 _blockReward, uint256 _startBlock, uint256 _endBlock, uint256 _bonusEndBlock, uint256 _bonus ) public { address msgSender = _msgSender(); require(msgSender == address(farmGenerator), "FORBIDDEN"); ...
/** * @notice initialize the farming contract. This is called only once upon farm creation and the FarmGenerator ensures the farm has the correct paramaters */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 1752, 2810 ] }
24,888
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
getMultiplier
function getMultiplier(uint256 _from_block, uint256 _to) public view returns (uint256) { uint256 _from = _from_block >= farmInfo.startBlock ? _from_block : farmInfo.startBlock; uint256 to = farmInfo.endBlock > _to ? _to : farmInfo.endBlock; // if (to <= farmIn...
/** * @notice Gets the reward multiplier over the given _from_block until _to block * @param _from_block the start of the period to measure rewards for * @param _to the end of the period to measure rewards for * @return The weighted multiplier for the given period */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 3109, 3835 ] }
24,889
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
pendingReward
function pendingReward(address _user) external view returns (uint256) { UserInfo storage user = userInfo[_user]; uint256 accRewardPerShare = farmInfo.accRewardPerShare; uint256 lpSupply = farmInfo.lpToken.balanceOf(address(this)); if (block.number > farmInfo.lastRewardBlock && lpSupply != 0) { u...
/** * @notice function to see accumulated balance of reward token for specified user * @param _user the user for whom unclaimed tokens will be shown * @return total amount of withdrawable reward tokens */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 4066, 4804 ] }
24,890
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
updatePool
function updatePool() public { if (block.number <= farmInfo.lastRewardBlock) { return; } uint256 lpSupply = farmInfo.lpToken.balanceOf(address(this)); if (lpSupply == 0) { farmInfo.lastRewardBlock = block.number < farmInfo.endBlock ? block.number : farmInfo.endBlo...
/** * @notice updates pool information to be up to date to the current block */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 4900, 5715 ] }
24,891
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
deposit
function deposit(uint256 _amount) public { address msgSender = _msgSender(); UserInfo storage user = userInfo[msgSender]; updatePool(); if (user.amount > 0) { uint256 pending = user.amount.mul(farmInfo.accRewardPerShare).div(1e12).sub( user.rewardDebt ); ...
/** * @notice deposit LP token function for msgSender * @param _amount the total deposit amount */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 5835, 6728 ] }
24,892
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
withdraw
function withdraw(uint256 _amount) public { address msgSender = _msgSender(); UserInfo storage user = userInfo[msgSender]; require(user.amount >= _amount, "INSUFFICIENT"); updatePool(); if (user.amount == _amount && _amount > 0) { factory.userLeftFarm(msgSender); farmInfo.numFarmers ...
/** * @notice withdraw LP token function for msgSender * @param _amount the total withdrawable amount */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 6854, 7683 ] }
24,893
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
emergencyWithdraw
function emergencyWithdraw() public { address msgSender = _msgSender(); UserInfo storage user = userInfo[msgSender]; farmInfo.lpToken.safeTransfer(address(msgSender), user.amount); emit EmergencyWithdraw(msgSender, user.amount); if (user.amount > 0) { factory.userLeftFarm(msgSender); ...
/** * @notice emergency functoin to withdraw LP tokens and forego harvest rewards. Important to protect users LP tokens */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 7822, 8294 ] }
24,894
FarmUniswapGenerator
/Users/ivannikov/work/snake-jungle/cosmo-farming/contracts/FarmUniswap.sol
0x73217ee72fdedf763bacd83acf60b4218f6ff8af
Solidity
FarmUniswap
contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all ...
safeRewardTransfer
function safeRewardTransfer(address _to, uint256 _amount) internal { uint256 rewardBal = farmInfo.rewardToken.balanceOf(address(this)); if (_amount > rewardBal) { farmInfo.rewardToken.transfer(_to, rewardBal); } else { farmInfo.rewardToken.transfer(_to, _amount); } }
/** * @notice Safe reward transfer function, just in case a rounding error causes pool to not have enough reward tokens * @param _to the user address to transfer tokens to * @param _amount the total amount of tokens to transfer */
NatSpecMultiLine
v0.6.12+commit.27d51765
{ "func_code_index": [ 8551, 8882 ] }
24,895
WtaERC20
WtaERC20.sol
0xa580853c469fa5edaaf59acc69ef0cacde325af5
Solidity
WtaERC20
contract WtaERC20 { // 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 mapping (address...
_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 >= balanceOf[_to]...
/** * Internal transfer, only can be called by this contract */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://d1ded5cf3702362f8ed90ec229935e9c0b8013b5caf5b0a2e5db56cd2fb2f2a4
{ "func_code_index": [ 1460, 2308 ] }
24,896
WtaERC20
WtaERC20.sol
0xa580853c469fa5edaaf59acc69ef0cacde325af5
Solidity
WtaERC20
contract WtaERC20 { // 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 mapping (address...
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+commit.59dbf8f1
bzzr://d1ded5cf3702362f8ed90ec229935e9c0b8013b5caf5b0a2e5db56cd2fb2f2a4
{ "func_code_index": [ 2514, 2626 ] }
24,897
WtaERC20
WtaERC20.sol
0xa580853c469fa5edaaf59acc69ef0cacde325af5
Solidity
WtaERC20
contract WtaERC20 { // 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 mapping (address...
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` on 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+commit.59dbf8f1
bzzr://d1ded5cf3702362f8ed90ec229935e9c0b8013b5caf5b0a2e5db56cd2fb2f2a4
{ "func_code_index": [ 2901, 3202 ] }
24,898
WtaERC20
WtaERC20.sol
0xa580853c469fa5edaaf59acc69ef0cacde325af5
Solidity
WtaERC20
contract WtaERC20 { // 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 mapping (address...
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 on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://d1ded5cf3702362f8ed90ec229935e9c0b8013b5caf5b0a2e5db56cd2fb2f2a4
{ "func_code_index": [ 3466, 3642 ] }
24,899