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
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer t...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
allowance
function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 2140, 2289 ] }
3,607
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer t...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
increaseApproval
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 2542, 2836 ] }
3,608
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
Pausable
contract Pausable is StandardToken { event Pause(); event Unpause(); bool public paused = false; address public founder; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused || msg.sender == founder...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
pause
function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 595, 703 ] }
3,609
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
Pausable
contract Pausable is StandardToken { event Pause(); event Unpause(); bool public paused = false; address public founder; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused || msg.sender == founder...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
unpause
function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 791, 901 ] }
3,610
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
PausableToken
contract PausableToken is Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transf...
approve
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); }
//The functions below surve no real purpose. Even if one were to approve another to spend //tokens on their behalf, those tokens will still only be transferable when the token contract //is not paused.
LineComment
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 577, 726 ] }
3,611
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
FSK
contract FSK is PausableToken { string public name; string public symbol; uint8 public decimals; /** * @dev Constructor that gives the founder all of the existing tokens. */ constructor() public { name = "Freesky"; symbol = "FSK"; decimals = 18; ...
getFrozenBalance
function getFrozenBalance(address _owner) view public returns(uint256) { return frozenTokenBalances[_owner]; }
/** * @dev Gets the amount of tokens which belong to the specified address BUT are frozen now. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount of frozen tokens owned by the passed address. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 2596, 2728 ] }
3,612
FSK
FSK.sol
0xfc1078a7bb4521881663df4148434acd991af14c
Solidity
FSK
contract FSK is PausableToken { string public name; string public symbol; uint8 public decimals; /** * @dev Constructor that gives the founder all of the existing tokens. */ constructor() public { name = "Freesky"; symbol = "FSK"; decimals = 18; ...
burnTokens
function burnTokens(uint256 _tokens) public onlyOwner { require(balanceOf(msg.sender) >= _tokens); balances[msg.sender] = balances[msg.sender].sub(_tokens); totalSupply = totalSupply.sub(_tokens); emit TokensBurned(msg.sender, _tokens); }
/* * @dev Token burn function * @param _tokens uint256 amount of tokens to burn */
Comment
v0.5.11+commit.c082d0b4
MIT
bzzr://c1365d92e730965b8fe1b4509be387df4ed648522029f0d8aa5202e89110dc5b
{ "func_code_index": [ 2838, 3122 ] }
3,613
RoadsterMax
RoadsterMax.sol
0x473dece969141b8456569de1dc2fc755a355093c
Solidity
ERC20Interface
contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance); /** ...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://3a26421ae0e48c34a35d27189514e78f2aed270bd153d213d15b3c7683e1f791
{ "func_code_index": [ 101, 154 ] }
3,614
RoadsterMax
RoadsterMax.sol
0x473dece969141b8456569de1dc2fc755a355093c
Solidity
ERC20Interface
contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance); /** ...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
balanceOf
function balanceOf(address tokenOwner) public view returns (uint balance);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://3a26421ae0e48c34a35d27189514e78f2aed270bd153d213d15b3c7683e1f791
{ "func_code_index": [ 233, 310 ] }
3,615
RoadsterMax
RoadsterMax.sol
0x473dece969141b8456569de1dc2fc755a355093c
Solidity
ERC20Interface
contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance); /** ...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
allowance
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
/** * @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.5.17+commit.d19bba13
None
bzzr://3a26421ae0e48c34a35d27189514e78f2aed270bd153d213d15b3c7683e1f791
{ "func_code_index": [ 585, 681 ] }
3,616
RoadsterMax
RoadsterMax.sol
0x473dece969141b8456569de1dc2fc755a355093c
Solidity
ERC20Interface
contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance); /** ...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transfer
function transfer(address to, uint tokens) public returns (bool success);
/** * @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.5.17+commit.d19bba13
None
bzzr://3a26421ae0e48c34a35d27189514e78f2aed270bd153d213d15b3c7683e1f791
{ "func_code_index": [ 901, 977 ] }
3,617
RoadsterMax
RoadsterMax.sol
0x473dece969141b8456569de1dc2fc755a355093c
Solidity
ERC20Interface
contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance); /** ...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
approve
function approve(address spender, uint tokens) public returns (bool success);
/** * @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.5.17+commit.d19bba13
None
bzzr://3a26421ae0e48c34a35d27189514e78f2aed270bd153d213d15b3c7683e1f791
{ "func_code_index": [ 1637, 1717 ] }
3,618
RoadsterMax
RoadsterMax.sol
0x473dece969141b8456569de1dc2fc755a355093c
Solidity
ERC20Interface
contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance); /** ...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transferFrom
function transferFrom(address from, address to, uint tokens) public returns (bool success);
/** * @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.5.17+commit.d19bba13
None
bzzr://3a26421ae0e48c34a35d27189514e78f2aed270bd153d213d15b3c7683e1f791
{ "func_code_index": [ 2027, 2121 ] }
3,619
RoadsterMax
RoadsterMax.sol
0x473dece969141b8456569de1dc2fc755a355093c
Solidity
TokenERC20
contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; address public pool; address public DelegateX = 0x461D0FA21294FB36b052d84002B81C42Eb978E2F; address public DelegateY = 0xa316bfEFC8073655d5...
totalSupply
function totalSupply() public view returns (uint) { return _totalSupply.sub(balances[address(0)]); }
/** * @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
v0.5.17+commit.d19bba13
None
bzzr://3a26421ae0e48c34a35d27189514e78f2aed270bd153d213d15b3c7683e1f791
{ "func_code_index": [ 1882, 1993 ] }
3,620
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
formatDecimals
function formatDecimals(uint256 _value) internal returns (uint256 ) { return _value * 10 ** decimals; }
// 转换
LineComment
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 1150, 1272 ] }
3,621
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
MofoToken
function MofoToken( address _ethFundDeposit, uint256 _currentSupply) { ethFundDeposit = _ethFundDeposit; isFunding = false; //通过控制预CrowdS ale状态 fundingStartBlock = 0; fundingStopBlock = 0; currentSupply = formatDecimals(_currentSupply); totalSuppl...
// constructor
LineComment
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 1296, 1786 ] }
3,622
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
setTokenExchangeRate
function setTokenExchangeRate(uint256 _tokenExchangeRate) isOwner external { if (_tokenExchangeRate == 0) throw; if (_tokenExchangeRate == tokenExchangeRate) throw; tokenExchangeRate = _tokenExchangeRate; }
/// 设置token汇率
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 1884, 2130 ] }
3,623
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
increaseSupply
function increaseSupply (uint256 _value) isOwner external { uint256 value = formatDecimals(_value); if (value + currentSupply > totalSupply) throw; currentSupply = safeAdd(currentSupply, value); IncreaseSupply(value); }
/// @dev 超发token处理
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 2158, 2423 ] }
3,624
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
decreaseSupply
function decreaseSupply (uint256 _value) isOwner external { uint256 value = formatDecimals(_value); if (value + tokenRaised > currentSupply) throw; currentSupply = safeSubtract(currentSupply, value); DecreaseSupply(value); }
/// @dev 被盗token处理
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 2451, 2724 ] }
3,625
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
startFunding
function startFunding (uint256 _fundingStartBlock, uint256 _fundingStopBlock) isOwner external { if (isFunding) throw; if (_fundingStartBlock >= _fundingStopBlock) throw; if (block.number >= _fundingStartBlock) throw; fundingStartBlock = _fundingStartBlock; fundingStopBlock = _fundingStopBlo...
/// 启动区块检测 异常的处理
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 2751, 3133 ] }
3,626
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
stopFunding
function stopFunding() isOwner external { if (!isFunding) throw; isFunding = false; }
/// 关闭区块异常处理
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 3156, 3269 ] }
3,627
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
setMigrateContract
function setMigrateContract(address _newContractAddr) isOwner external { if (_newContractAddr == newContractAddr) throw; newContractAddr = _newContractAddr; }
/// 开发了一个新的合同来接收token(或者更新token)
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 3311, 3497 ] }
3,628
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
changeOwner
function changeOwner(address _newFundDeposit) isOwner() external { if (_newFundDeposit == address(0x0)) throw; ethFundDeposit = _newFundDeposit; }
/// 设置新的所有者地址
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 3520, 3694 ] }
3,629
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
migrate
function migrate() external { if(isFunding) throw; if(newContractAddr == address(0x0)) throw; uint256 tokens = balances[msg.sender]; if (tokens == 0) throw; balances[msg.sender] = 0; tokenMigrated = safeAdd(tokenMigrated, tokens); IMigrationContract newContract = IMigrationCo...
///转移token到新的合约
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 3719, 4230 ] }
3,630
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
transferETH
function transferETH() isOwner external { if (this.balance == 0) throw; if (!ethFundDeposit.send(this.balance)) throw; }
/// 转账ETH 到 一个mofo
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 4258, 4406 ] }
3,631
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
allocateToken
function allocateToken (address _addr, uint256 _eth) isOwner external { if (_eth == 0) throw; if (_addr == address(0x0)) throw; uint256 tokens = safeMult(formatDecimals(_eth), tokenExchangeRate); if (tokens + tokenRaised > currentSupply) throw; tokenRaised = safeAdd(tokenRaised, tokens); ...
/// 将mofo token分配到预处理地址。
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 4441, 4884 ] }
3,632
MofoToken
MofoToken.sol
0x62682c4869187275b1748d1d534ca8ee874250a5
Solidity
MofoToken
contract MofoToken is StandardToken, SafeMath { // metadata string public constant name = "Mofo"; string public constant symbol = "MFCoin"; uint256 public constant decimals = 18; string public version = "1.0"; // contracts address public ethFundDeposit; // ETH存放地址 ...
function () payable { if (!isFunding) throw; if (msg.value == 0) throw; if (block.number < fundingStartBlock) throw; if (block.number > fundingStopBlock) throw; uint256 tokens = safeMult(msg.value, tokenExchangeRate); if (tokens + tokenRaised > currentSupply) throw; tokenRais...
/// 购买token
NatSpecSingleLine
v0.4.21+commit.dfe3193c
None
bzzr://050d9aa937f30b2e395c3ac6d33e80b98cd5a793fb79ad5789c3d60208cc1a43
{ "func_code_index": [ 4905, 5392 ] }
3,633
TimeLockRegistry
contracts/interfaces/IRewardsDistributor.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
IRewardsDistributor
interface IRewardsDistributor { // Structs struct PrincipalPerTimestamp { uint256 principal; uint256 time; uint256 timeListPointer; } function protocolPrincipal() external view returns (uint256); function pid() external view returns (uint256); // solhint-disable-next-l...
/** * @title IRewardsDistributor * @author Babylon Finance * * Interface for the distribute rewards of the BABL Mining Program. */
NatSpecMultiLine
EPOCH_DURATION
function EPOCH_DURATION() external pure returns (uint256);
// solhint-disable-next-line
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 324, 386 ] }
3,634
TimeLockRegistry
contracts/interfaces/IRewardsDistributor.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
IRewardsDistributor
interface IRewardsDistributor { // Structs struct PrincipalPerTimestamp { uint256 principal; uint256 time; uint256 timeListPointer; } function protocolPrincipal() external view returns (uint256); function pid() external view returns (uint256); // solhint-disable-next-l...
/** * @title IRewardsDistributor * @author Babylon Finance * * Interface for the distribute rewards of the BABL Mining Program. */
NatSpecMultiLine
START_TIME
function START_TIME() external view returns (uint256);
// solhint-disable-next-line
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 421, 479 ] }
3,635
TimeLockRegistry
contracts/interfaces/IRewardsDistributor.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
IRewardsDistributor
interface IRewardsDistributor { // Structs struct PrincipalPerTimestamp { uint256 principal; uint256 time; uint256 timeListPointer; } function protocolPrincipal() external view returns (uint256); function pid() external view returns (uint256); // solhint-disable-next-l...
/** * @title IRewardsDistributor * @author Babylon Finance * * Interface for the distribute rewards of the BABL Mining Program. */
NatSpecMultiLine
Q1_REWARDS
function Q1_REWARDS() external pure returns (uint256);
// solhint-disable-next-line
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 514, 572 ] }
3,636
TimeLockRegistry
contracts/interfaces/IRewardsDistributor.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
IRewardsDistributor
interface IRewardsDistributor { // Structs struct PrincipalPerTimestamp { uint256 principal; uint256 time; uint256 timeListPointer; } function protocolPrincipal() external view returns (uint256); function pid() external view returns (uint256); // solhint-disable-next-l...
/** * @title IRewardsDistributor * @author Babylon Finance * * Interface for the distribute rewards of the BABL Mining Program. */
NatSpecMultiLine
DECAY_RATE
function DECAY_RATE() external pure returns (uint256);
// solhint-disable-next-line
LineComment
v0.7.6+commit.7338295f
{ "func_code_index": [ 607, 665 ] }
3,637
TimeLockRegistry
contracts/interfaces/IBabController.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
IBabController
interface IBabController { /* ============ Functions ============ */ function createGarden( address _reserveAsset, string memory _name, string memory _symbol, string memory _tokenURI, uint256 _seed, uint256[] calldata _gardenParams, uint256 _initialContri...
/** * @title IBabController * @author Babylon Finance * * Interface for interacting with BabController */
NatSpecMultiLine
createGarden
function createGarden( address _reserveAsset, string memory _name, string memory _symbol, string memory _tokenURI, uint256 _seed, uint256[] calldata _gardenParams, uint256 _initialContribution, bool[] memory _publicGardenStrategistsStewards ) external payable returns (address);
/* ============ Functions ============ */
Comment
v0.7.6+commit.7338295f
{ "func_code_index": [ 74, 424 ] }
3,638
TimeLockRegistry
contracts/lib/LowGasSafeMath.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
LowGasSafeMath
library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } /// @notice Retur...
/// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
NatSpecSingleLine
add
function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); }
/// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 182, 297 ] }
3,639
TimeLockRegistry
contracts/lib/LowGasSafeMath.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
LowGasSafeMath
library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } /// @notice Retur...
/// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
NatSpecSingleLine
sub
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); }
/// @notice Returns x - y, reverts if underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 457, 572 ] }
3,640
TimeLockRegistry
contracts/lib/LowGasSafeMath.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
LowGasSafeMath
library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } /// @notice Retur...
/// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
NatSpecSingleLine
mul
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(x == 0 || (z = x * y) / x == y); }
/// @notice Returns x * y, reverts if overflows /// @param x The multiplicand /// @param y The multiplier /// @return z The product of x and y
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 733, 862 ] }
3,641
TimeLockRegistry
contracts/lib/LowGasSafeMath.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
LowGasSafeMath
library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } /// @notice Retur...
/// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
NatSpecSingleLine
add
function add(int256 x, int256 y) internal pure returns (int256 z) { require((z = x + y) >= x == (y >= 0)); }
/// @notice Returns x + y, reverts if overflows or underflows /// @param x The augend /// @param y The addend /// @return z The sum of x and y
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1023, 1147 ] }
3,642
TimeLockRegistry
contracts/lib/LowGasSafeMath.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
LowGasSafeMath
library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } /// @notice Retur...
/// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
NatSpecSingleLine
sub
function sub(int256 x, int256 y) internal pure returns (int256 z) { require((z = x - y) <= x == (y >= 0)); }
/// @notice Returns x - y, reverts if overflows or underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1320, 1444 ] }
3,643
TimeLockRegistry
contracts/lib/LowGasSafeMath.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
LowGasSafeMath
library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } /// @notice Retur...
/// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
NatSpecSingleLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, 'SafeMath: division by zero'); return a / b; }
/** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (...
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1904, 2058 ] }
3,644
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
isContract
function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly ...
/** * @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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 606, 1033 ] }
3,645
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 1963, 2365 ] }
3,646
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 3121, 3299 ] }
3,647
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 3524, 3724 ] }
3,648
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 4094, 4325 ] }
3,649
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
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"); require(isContract(target), "Address: call to non-contract"); // solhint-disa...
/** * @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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 4576, 5111 ] }
3,650
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
functionStaticCall
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 5291, 5495 ] }
3,651
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
functionStaticCall
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.stat...
/** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 5682, 6109 ] }
3,652
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
functionDelegateCall
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 6291, 6496 ] }
3,653
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
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 ...
functionDelegateCall
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.deleg...
/** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 6685, 7113 ] }
3,654
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
Clones
library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`. * * This function uses the create opcode, which should never revert. */ function clone(address master) internal returns (address instance) { // solhint-disable-next-li...
clone
function clone(address master) internal returns (address instance) { // solhint-disable-next-line no-inline-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, master)) m...
/** * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`. * * This function uses the create opcode, which should never revert. */
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 212, 782 ] }
3,655
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
Clones
library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`. * * This function uses the create opcode, which should never revert. */ function clone(address master) internal returns (address instance) { // solhint-disable-next-li...
cloneDeterministic
function cloneDeterministic(address master, bytes32 salt) internal returns (address instance) { // solhint-disable-next-line no-inline-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), sh...
/** * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `master` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same add...
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 1145, 1750 ] }
3,656
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
Clones
library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`. * * This function uses the create opcode, which should never revert. */ function clone(address master) internal returns (address instance) { // solhint-disable-next-li...
predictDeterministicAddress
function predictDeterministicAddress(address master, bytes32 salt, address deployer) internal pure returns (address predicted) { // solhint-disable-next-line no-inline-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) ...
/** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 1860, 2591 ] }
3,657
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
Clones
library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`. * * This function uses the create opcode, which should never revert. */ function clone(address master) internal returns (address instance) { // solhint-disable-next-li...
predictDeterministicAddress
function predictDeterministicAddress(address master, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(master, salt, address(this)); }
/** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */
NatSpecMultiLine
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 2701, 2897 ] }
3,658
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
SafeERC20
library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC...
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' require( ...
/** * @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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 793, 1414 ] }
3,659
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
SafeERC20
library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC...
_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.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 2630, 3351 ] }
3,660
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
TransferHelper
contract TransferHelper { using SafeERC20 for IERC20; // Mainnet IWETH internal constant WETH = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); // Kovan // IWETH internal constant WETH = IWETH(0xd0A1E359811322d97991E03f863a0C30C2cF029C); function _safeTransferFrom(address _token, address _s...
_safeTransferFrom
function _safeTransferFrom(address _token, address _sender, uint _amount) internal virtual { require(_amount > 0, "TransferHelper: amount must be > 0"); IERC20(_token).safeTransferFrom(_sender, address(this), _amount); }
// Kovan // IWETH internal constant WETH = IWETH(0xd0A1E359811322d97991E03f863a0C30C2cF029C);
LineComment
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 265, 501 ] }
3,661
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
LendingPair
contract LendingPair is TransferHelper, ReentrancyGuard { // Prevents division by zero and other undesirable behaviour uint private constant MIN_RESERVE = 1000; using Address for address; using Clones for address; mapping (address => mapping (address => uint)) public debtOf; mapping (address => ...
liquidateAccount
function liquidateAccount( address _account, address _repayToken, uint _repayAmount, uint _minSupplyOutput ) external nonReentrant { // Input validation and adjustments _validateToken(_repayToken); address supplyToken = _repayToken == tokenA ? tokenB : tokenA; // Check account is un...
// Sell collateral to reduce debt and increase accountHealth // Set _repayAmount to uint(-1) to repay all debt, inc. pending interest
LineComment
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 5694, 7259 ] }
3,662
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
LendingPair
contract LendingPair is TransferHelper, ReentrancyGuard { // Prevents division by zero and other undesirable behaviour uint private constant MIN_RESERVE = 1000; using Address for address; using Clones for address; mapping (address => mapping (address => uint)) public debtOf; mapping (address => ...
borrowBalance
function borrowBalance( address _account, address _borrowedToken, address _returnToken ) external view returns(uint) { _validateToken(_borrowedToken); _validateToken(_returnToken); return _borrowBalance(_account, _borrowedToken, _returnToken); }
// Get borow balance converted to the units of _returnToken
LineComment
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 7827, 8115 ] }
3,663
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
LendingPair
contract LendingPair is TransferHelper, ReentrancyGuard { // Prevents division by zero and other undesirable behaviour uint private constant MIN_RESERVE = 1000; using Address for address; using Clones for address; mapping (address => mapping (address => uint)) public debtOf; mapping (address => ...
_mintDebtWithOriginFee
function _mintDebtWithOriginFee(address _token, address _account, uint _amount) internal { uint originFee = _originationFee(_token, _amount); _mintSupply(_token, feeRecipient(), originFee); _mintDebt(_token, _account, _amount + originFee); }
// Origination fee is earned entirely by the protocol and is not split with the LPs // The goal is to prevent free flash loans
LineComment
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 11708, 11970 ] }
3,664
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
LendingPair
contract LendingPair is TransferHelper, ReentrancyGuard { // Prevents division by zero and other undesirable behaviour uint private constant MIN_RESERVE = 1000; using Address for address; using Clones for address; mapping (address => mapping (address => uint)) public debtOf; mapping (address => ...
_supplyBalance
function _supplyBalance( address _account, address _suppliedToken, address _returnToken ) internal view returns(uint) { return _convertTokenValues(_suppliedToken, _returnToken, lpToken[_suppliedToken].balanceOf(_account)); }
// Get supply balance converted to the units of _returnToken
LineComment
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 16113, 16368 ] }
3,665
PairFactory
PairFactory.sol
0x23b74796b72f995e14a5e3ff2156dad9653256cf
Solidity
LendingPair
contract LendingPair is TransferHelper, ReentrancyGuard { // Prevents division by zero and other undesirable behaviour uint private constant MIN_RESERVE = 1000; using Address for address; using Clones for address; mapping (address => mapping (address => uint)) public debtOf; mapping (address => ...
_requireAccountNotAccrued
function _requireAccountNotAccrued(address _token, address _account) internal view { if (lastBlockAccrued == block.number && cumulativeInterestRate[_token] > 0) { require( cumulativeInterestRate[_token] > accountInterestSnapshot[_token][_account], "LendingPair: account already accrued" ); ...
// Used in repayAll and repayAllETH to prevent front-running // Potential attack: // Recipient account watches the mempool and takes out a large loan just before someone calls repayAll. // As a result, paying account would end up paying much more than anticipated
LineComment
v0.8.6+commit.11564f7e
None
ipfs://4d03a265a12ba81c0f5a175a2642e8e9fa5be73fda205ebdaf6e808e4fd675db
{ "func_code_index": [ 19470, 19811 ] }
3,666
SakeVoterCalc
contracts/SakeVoterCalc.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeVoterCalc
contract SakeVoterCalc { using SafeMath for uint256; ItMap public voteLpPoolMap; //Voter LP Address // Apply library functions to the data type. using IterableMapping for ItMap; IERC20 public sake; SakeBar public bar; STokenMaster public stoken; SakeMaster public masterV1; ...
balanceOf
function balanceOf(address _voter) external view returns (uint256) { uint256 _votes = 0; uint256 _vCtSakeNum = 0; uint256 _vBarSakeNum = 0; address _vLpTokenAddr; for ( uint256 i = voteLpPoolMap.iterateStart(); voteLpPoolMap.iterateValid(i); i = voteLpPoolMap.iterat...
//sum user deposit sakenum
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 4707, 5571 ] }
3,667
TimeLockRegistry
contracts/lib/AddressArrayUtils.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
AddressArrayUtils
library AddressArrayUtils { /** * Finds the index of the first occurrence of the given element. * @param A The input array to search * @param a The value to find * @return Returns (index and isIn) for the first occurrence starting from index 0 */ function indexOf(address[] memory A, add...
/** * @title AddressArrayUtils * @author Set Protocol * * Utility functions to handle Address Arrays */
NatSpecMultiLine
indexOf
function indexOf(address[] memory A, address a) internal pure returns (uint256, bool) { uint256 length = A.length; for (uint256 i = 0; i < length; i++) { if (A[i] == a) { return (i, true); } } return (uint256(-1), false); }
/** * Finds the index of the first occurrence of the given element. * @param A The input array to search * @param a The value to find * @return Returns (index and isIn) for the first occurrence starting from index 0 */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 276, 579 ] }
3,668
TimeLockRegistry
contracts/lib/AddressArrayUtils.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
AddressArrayUtils
library AddressArrayUtils { /** * Finds the index of the first occurrence of the given element. * @param A The input array to search * @param a The value to find * @return Returns (index and isIn) for the first occurrence starting from index 0 */ function indexOf(address[] memory A, add...
/** * @title AddressArrayUtils * @author Set Protocol * * Utility functions to handle Address Arrays */
NatSpecMultiLine
contains
function contains(address[] memory A, address a) internal pure returns (bool) { (, bool isIn) = indexOf(A, a); return isIn; }
/** * Returns true if the value is present in the list. Uses indexOf internally. * @param A The input array to search * @param a The value to find * @return Returns isIn for the first occurrence starting from index 0 */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 830, 979 ] }
3,669
TimeLockRegistry
contracts/lib/AddressArrayUtils.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
AddressArrayUtils
library AddressArrayUtils { /** * Finds the index of the first occurrence of the given element. * @param A The input array to search * @param a The value to find * @return Returns (index and isIn) for the first occurrence starting from index 0 */ function indexOf(address[] memory A, add...
/** * @title AddressArrayUtils * @author Set Protocol * * Utility functions to handle Address Arrays */
NatSpecMultiLine
hasDuplicate
function hasDuplicate(address[] memory A) internal pure returns (bool) { require(A.length > 0, 'A is empty'); for (uint256 i = 0; i < A.length - 1; i++) { address current = A[i]; for (uint256 j = i + 1; j < A.length; j++) { if (current == A[j]) { return true; ...
/** * Returns true if there are 2 elements that are the same in an array * @param A The input array to search * @return Returns boolean for the first occurrence of a duplicate */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1184, 1594 ] }
3,670
TimeLockRegistry
contracts/lib/AddressArrayUtils.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
AddressArrayUtils
library AddressArrayUtils { /** * Finds the index of the first occurrence of the given element. * @param A The input array to search * @param a The value to find * @return Returns (index and isIn) for the first occurrence starting from index 0 */ function indexOf(address[] memory A, add...
/** * @title AddressArrayUtils * @author Set Protocol * * Utility functions to handle Address Arrays */
NatSpecMultiLine
remove
function remove(address[] memory A, address a) internal pure returns (address[] memory) { (uint256 index, bool isIn) = indexOf(A, a); if (!isIn) { revert('Address not in array.'); } else { (address[] memory _A, ) = pop(A, index); return _A; } }
/** * @param A The input array to search * @param a The address to remove * @return Returns the array with the object removed. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1750, 2070 ] }
3,671
TimeLockRegistry
contracts/lib/AddressArrayUtils.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
AddressArrayUtils
library AddressArrayUtils { /** * Finds the index of the first occurrence of the given element. * @param A The input array to search * @param a The value to find * @return Returns (index and isIn) for the first occurrence starting from index 0 */ function indexOf(address[] memory A, add...
/** * @title AddressArrayUtils * @author Set Protocol * * Utility functions to handle Address Arrays */
NatSpecMultiLine
pop
function pop(address[] memory A, uint256 index) internal pure returns (address[] memory, address) { uint256 length = A.length; require(index < A.length, 'Index must be < A length'); address[] memory newAddresses = new address[](length - 1); for (uint256 i = 0; i < index; i++) { newAddresses[i] =...
/** * Removes specified index from array * @param A The input array to search * @param index The index to remove * @return Returns the new array and the removed entry */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 2271, 2783 ] }
3,672
TimeLockRegistry
contracts/lib/AddressArrayUtils.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
AddressArrayUtils
library AddressArrayUtils { /** * Finds the index of the first occurrence of the given element. * @param A The input array to search * @param a The value to find * @return Returns (index and isIn) for the first occurrence starting from index 0 */ function indexOf(address[] memory A, add...
/** * @title AddressArrayUtils * @author Set Protocol * * Utility functions to handle Address Arrays */
NatSpecMultiLine
extend
function extend(address[] memory A, address[] memory B) internal pure returns (address[] memory) { uint256 aLength = A.length; uint256 bLength = B.length; address[] memory newAddresses = new address[](aLength + bLength); for (uint256 i = 0; i < aLength; i++) { newAddresses[i] = A[i]; } f...
/** * Returns the combination of the two arrays * @param A The first array * @param B The second array * @return Returns A extended by B */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 2954, 3435 ] }
3,673
GermanBakery
/contracts/GermanBakery.sol
0x5721be2b7b1403daaea264daa26c29c51398bc2f
Solidity
GermanBakery
contract GermanBakery is Ownable, ERC721Holder, ReentrancyGuard { Brotchain public brotchain; constructor(address _brotchain) { brotchain = Brotchain(_brotchain); } /** * @dev Remaining allocation for addresses. */ mapping(address => int256) public allocRemaining; /** ...
/** * @dev German bakeries make brot. * * After deployment we discoverd a bug in the Brotchain early-access allocator * that exposed a loophole if someone transferred their Brot after minting, thus * allowing for unlimited mints. This contract is the fix and acts as a proxy * minter with correct allocation limiti...
NatSpecMultiLine
changeAllocations
function changeAllocations(AllocationDelta[] memory deltas) external onlyOwner { for (uint256 i = 0; i < deltas.length; i++) { allocRemaining[deltas[i].addr] += deltas[i].value; } }
/** * @dev Changes the remaining allocation for the specified addresses. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 560, 777 ] }
3,674
GermanBakery
/contracts/GermanBakery.sol
0x5721be2b7b1403daaea264daa26c29c51398bc2f
Solidity
GermanBakery
contract GermanBakery is Ownable, ERC721Holder, ReentrancyGuard { Brotchain public brotchain; constructor(address _brotchain) { brotchain = Brotchain(_brotchain); } /** * @dev Remaining allocation for addresses. */ mapping(address => int256) public allocRemaining; /** ...
/** * @dev German bakeries make brot. * * After deployment we discoverd a bug in the Brotchain early-access allocator * that exposed a loophole if someone transferred their Brot after minting, thus * allowing for unlimited mints. This contract is the fix and acts as a proxy * minter with correct allocation limiti...
NatSpecMultiLine
safeMint
function safeMint() external payable nonReentrant { // CHECKS require(allocRemaining[msg.sender] > 0, "Address allocation exhausted"); // EFFECTS allocRemaining[msg.sender]--; brotchain.safeMint{value: msg.value}(); // INTERACTIONS // As the token is immediately transferred, it will always...
/** * @dev Calls Brotchain.safeMint() and transfers the token to the sender. * * This correctly implements early-access limiting by decrementing the * sender's allocation instead of comparing the balance to the allocation as * the Brotchain contract does. This was vulnerable to tokens be transferred * before mint...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1146, 1683 ] }
3,675
MultiSend
MultiSend.sol
0xb76a20d5d42c041593df95d7d72b74b2543824f9
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); }
/** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://137bf962082d8be697f92afd65582eaa64bdc2a74417dd537adfd766b6e8f074
{ "func_code_index": [ 815, 932 ] }
3,676
MultiSend
MultiSend.sol
0xb76a20d5d42c041593df95d7d72b74b2543824f9
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://137bf962082d8be697f92afd65582eaa64bdc2a74417dd537adfd766b6e8f074
{ "func_code_index": [ 1097, 1205 ] }
3,677
MultiSend
MultiSend.sol
0xb76a20d5d42c041593df95d7d72b74b2543824f9
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
_transferOwnership
function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
/** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://137bf962082d8be697f92afd65582eaa64bdc2a74417dd537adfd766b6e8f074
{ "func_code_index": [ 1343, 1521 ] }
3,678
GermanBakery
/contracts/BMP.sol
0x5721be2b7b1403daaea264daa26c29c51398bc2f
Solidity
BMP
contract BMP { using Base64 for string; /** * @dev Returns an 8-bit grayscale palette for bitmap images. */ function grayscale() public pure returns (bytes memory) { bytes memory palette = new bytes(768); // TODO: investigate a way around using ++ += or + on a bytes1 without ...
/** * @dev 8-bit BMP encoding with arbitrary colour palettes. */
NatSpecMultiLine
grayscale
function grayscale() public pure returns (bytes memory) { bytes memory palette = new bytes(768); // TODO: investigate a way around using ++ += or + on a bytes1 without // having to use a placeholder int8 for incrementing! uint8 j; bytes1 b; for (uint16 i = 0; i < 768; i += 3) { b = bytes...
/** * @dev Returns an 8-bit grayscale palette for bitmap images. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 127, 704 ] }
3,679
GermanBakery
/contracts/BMP.sol
0x5721be2b7b1403daaea264daa26c29c51398bc2f
Solidity
BMP
contract BMP { using Base64 for string; /** * @dev Returns an 8-bit grayscale palette for bitmap images. */ function grayscale() public pure returns (bytes memory) { bytes memory palette = new bytes(768); // TODO: investigate a way around using ++ += or + on a bytes1 without ...
/** * @dev 8-bit BMP encoding with arbitrary colour palettes. */
NatSpecMultiLine
bmp
function bmp(bytes memory pixels, uint32 width, uint32 height, bytes memory palette) public pure returns (bytes memory) { require(width * height == pixels.length, "Invalid dimensions"); require(palette.length == 768, "256 colours required"); // 14 bytes for BITMAPFILEHEADER + 40 for BITMAPINFOHEADER + 1024...
/** * @dev Returns an 8-bit BMP encoding of the pixels. * * Spec: https://www.digicamsoft.com/bmp/bmp.html * * Layout description with offsets: * http://www.ece.ualberta.ca/~elliott/ee552/studentAppNotes/2003_w/misc/bmp_file_format/bmp_file_format.htm * * N.B. Everything is little-endian, hence the assembly for...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 1100, 3551 ] }
3,680
GermanBakery
/contracts/BMP.sol
0x5721be2b7b1403daaea264daa26c29c51398bc2f
Solidity
BMP
contract BMP { using Base64 for string; /** * @dev Returns an 8-bit grayscale palette for bitmap images. */ function grayscale() public pure returns (bytes memory) { bytes memory palette = new bytes(768); // TODO: investigate a way around using ++ += or + on a bytes1 without ...
/** * @dev 8-bit BMP encoding with arbitrary colour palettes. */
NatSpecMultiLine
bmpDataURI
function bmpDataURI(bytes memory bmpBuf) public pure returns (string memory) { return string(abi.encodePacked( 'data:image/bmp;base64,', Base64.encode(bmpBuf) )); }
/** * @dev Returns the buffer, presumably from bmp(), as a base64 data URI. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 3646, 3858 ] }
3,681
GermanBakery
/contracts/BMP.sol
0x5721be2b7b1403daaea264daa26c29c51398bc2f
Solidity
BMP
contract BMP { using Base64 for string; /** * @dev Returns an 8-bit grayscale palette for bitmap images. */ function grayscale() public pure returns (bytes memory) { bytes memory palette = new bytes(768); // TODO: investigate a way around using ++ += or + on a bytes1 without ...
/** * @dev 8-bit BMP encoding with arbitrary colour palettes. */
NatSpecMultiLine
scalePixels
function scalePixels(bytes memory pixels, uint32 width, uint32 height, uint32 scale) public pure returns (bytes memory) { require(width * height == pixels.length, "Invalid dimensions"); bytes memory scaled = new bytes(pixels.length * scale * scale); // Indices in each of the original and scaled buffers, re...
/** * @dev Scale pixels by repetition along both axes. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
{ "func_code_index": [ 3932, 5166 ] }
3,682
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
getRegistrations
function getRegistrations() external view returns (address[] memory) { return registrations; }
/** * Gets registrations * * @return address[] Returns list of registrations */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 3063, 3173 ] }
3,683
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
registerBatch
function registerBatch(Registration[] memory _registrations) external onlyOwner { for (uint256 i = 0; i < _registrations.length; i++) { register( _registrations[i].receiver, _registrations[i].distribution, _registrations[i].investorType, _registrations[i].vest...
/** * PRIVILEGED GOVERNANCE FUNCTION * * @notice Register multiple investors/team in a batch * @param _registrations Registrations to process */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 3408, 3802 ] }
3,684
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
register
function register( address receiver, uint256 distribution, bool investorType, uint256 vestingStartingDate ) public onlyOwner { require(receiver != address(0), 'TimeLockRegistry::register: cannot register the zero address'); require( receiver != address(this), 'TimeLockRegistry::r...
/** * PRIVILEGED GOVERNANCE FUNCTION * * @notice Register new account under vesting conditions (Team, Advisors, Investors e.g. SAFT purchaser) * @param receiver Address belonging vesting conditions * @param distribution Tokens amount that receiver is due to get */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 4103, 5861 ] }
3,685
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
cancelRegistration
function cancelRegistration(address receiver) external onlyOwner returns (bool) { require(registeredDistributions[receiver] != 0, 'Not registered'); // get amount from distributions uint256 amount = registeredDistributions[receiver]; // set distribution mapping to 0 delete registeredDistributions[...
/** * PRIVILEGED GOVERNANCE FUNCTION. Cancel distribution registration in case of mistake and before a claim is done * * @notice Cancel distribution registration * @dev A claim has not to be done earlier * @param receiver Address that should have it's distribution removed * @return Whether or not it succeeded */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 6216, 6921 ] }
3,686
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
cancelDeliveredTokens
function cancelDeliveredTokens(address account) external onlyOwner returns (bool) { uint256 loosingAmount = token.cancelVestedTokens(account); // emit cancel event emit Cancel(account, loosingAmount); return true; }
/** * PRIVILEGED GOVERNANCE FUNCTION. Cancel distribution registration in case of mistake and before a claim is done * * @notice Cancel already delivered tokens. It might only apply when non-completion of vesting period of Team members or Advisors * @dev An automatic override allowance is granted during the claim p...
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 7394, 7650 ] }
3,687
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
transferToOwner
function transferToOwner(uint256 amount) external onlyOwner returns (bool) { SafeERC20.safeTransfer(token, msg.sender, amount); return true; }
/** * PRIVILEGED GOVERNANCE FUNCTION. Recover tokens in Time Lock Registry smartcontract address by the owner * * @notice Send tokens from smartcontract address to the owner. * It might only apply after a cancellation of vested tokens * @param amount Amount to be recovered by the owner of the Time Lock Registry sm...
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 8076, 8242 ] }
3,688
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
claim
function claim(address _receiver) external onlyBABLToken returns (uint256) { require(registeredDistributions[_receiver] != 0, 'Not registered'); // get amount from distributions uint256 amount = registeredDistributions[_receiver]; TokenVested storage claimTokenVested = tokenVested[_receiver]; clai...
/** * PRIVILEGED GOVERNANCE FUNCTION. Claim locked tokens by the registered account * * @notice Claim tokens due amount. * @dev Claim is done by the user in the TimeLocked contract and the contract is the only allowed to call * this function on behalf of the user to make the claim * @return The amount of tokens r...
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 8640, 9746 ] }
3,689
TimeLockRegistry
contracts/token/TimeLockRegistry.sol
0xae171d3e9f8e755bb8547d4165fd79b148be45de
Solidity
TimeLockRegistry
contract TimeLockRegistry is Ownable { using LowGasSafeMath for uint256; using Address for address; using AddressArrayUtils for address[]; /* ============ Events ============ */ event Register(address receiver, uint256 distribution); event Cancel(address receiver, uint256 distribution); ev...
/** * @title TimeLockRegistry * @notice Register Lockups for TimeLocked ERC20 Token BABL (e.g. vesting) * @author Babylon Finance * @dev This contract allows owner to register distributions for a TimeLockedToken * * To register a distribution, register method should be called by the owner. * claim() should be ca...
NatSpecMultiLine
checkVesting
function checkVesting(address address_) external view returns ( bool team, uint256 start, uint256 end, uint256 last ) { TokenVested storage checkTokenVested = tokenVested[address_]; return ( checkTokenVested.team, checkTokenVested.vestingBegin, ...
/* ============ Getter Functions ============ */
Comment
v0.7.6+commit.7338295f
{ "func_code_index": [ 9802, 10272 ] }
3,690
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
add
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } require(lpTokenPID[address(_lpToken)] == 0, "SakeMaster:duplicate add."); uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; tot...
// 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
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 3944, 4647 ] }
3,691
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
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 SAKE allocation point. Can only be called by the owner.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 4738, 5047 ] }
3,692
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
setMigrator
function setMigrator(IMigratorChef _migrator) public onlyOwner { migrator = _migrator; }
// Set the migrator contract. Can only be called by the owner.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 5118, 5225 ] }
3,693
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
handoverSakeMintage
function handoverSakeMintage(address newOwner) public onlyOwner { sake.transferOwnership(newOwner); }
// Handover the saketoken mintage right.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 5274, 5394 ] }
3,694
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
migrate
function migrate(uint256 _pid) public { require(address(migrator) != address(0), "migrate: no migrator"); PoolInfo storage pool = poolInfo[_pid]; IERC20 lpToken = pool.lpToken; uint256 bal = lpToken.balanceOf(address(this)); lpToken.safeApprove(address(migrator), bal); IERC20 newLpToken = ...
// Migrate lp token to another lp contract. Can be called by anyone. We trust that migrator contract is good.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 5512, 6008 ] }
3,695
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
getMultiplier
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { uint256 _toFinal = _to > mintEndBlock ? mintEndBlock : _to; if (_toFinal <= betaTestEndBlock) { return _toFinal.sub(_from); }else if (_from >= mintEndBlock) { return 0; } else if (_toFinal <= bonusE...
// Return reward multiplier over the given _from to _to block.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 6079, 7305 ] }
3,696
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
pendingSake
function pendingSake(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accSakePerShare = pool.accSakePerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (block.number >...
// View function to see pending SAKEs on frontend.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 7364, 8128 ] }
3,697
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
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
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 8206, 8391 ] }
3,698
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
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
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 8462, 9362 ] }
3,699
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
deposit
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); uint256 pending = user.amount.mul(pool.accSakePerShare).div(1e12).sub(user.rewardDebt); user.amount = user.amount.add(_amount); ...
// Deposit LP tokens to SakeMaster for SAKE allocation.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 9426, 10053 ] }
3,700
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
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.accSakePerShare).div(1e12).sub(us...
// Withdraw LP tokens from SakeMaster.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 10100, 10757 ] }
3,701
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
emergencyWithdraw
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount > 0, "emergencyWithdraw: not good"); uint256 _amount = user.amount; user.amount = 0; user.rewardDebt = 0; pool.lpToken.safe...
// Withdraw without caring about rewards. EMERGENCY ONLY.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 10823, 11282 ] }
3,702
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
safeSakeTransfer
function safeSakeTransfer(address _to, uint256 _amount) internal { uint256 sakeBal = sake.balanceOf(address(this)); if (_amount > sakeBal) { sake.transfer(_to, sakeBal); } else { sake.transfer(_to, _amount); } }
// Safe sake transfer function, just in case if rounding error causes pool to not have enough SAKEs.
LineComment
v0.6.12+commit.27d51765
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 11391, 11674 ] }
3,703
SakeVoterCalc
contracts/SakeMaster.sol
0x44d84a9da47fd8f4a06ad66b197d1441fca53f92
Solidity
SakeMaster
contract SakeMaster 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. // // We do s...
// SakeMaster is the master of Sake. He can make Sake and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once SAKE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading...
LineComment
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
None
ipfs://5d4700996a40376e16d7d09f63c9d6b8ef633b28dd8203c5297833f9286dce20
{ "func_code_index": [ 11725, 11859 ] }
3,704
Americo
Americo.sol
0x09eaf7b80ec741fa8a163cd4dde8367fab37e8a0
Solidity
Americo
contract Americo { /* Variables públicas del token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public initialSupply; uint256 public totalSupply; /* Esto crea una matriz con todos los saldos */ mapping (add...
Americo
function Americo() { initialSupply=160000000; name="Americo"; decimals=6; symbol="A"; balanceOf[msg.sender] = initialSupply; // Americo recibe todas las fichas iniciales totalSupply = initialSupply; // Actualizar la oferta total ...
/* Inicializa el contrato con los tokens de suministro inicial al creador del contrato */
Comment
v0.4.19+commit.c4cbbb05
bzzr://2bb40ed958008e5bbe69da40c3b5da723d2539387782f8a45ee0dd3e5e3eb1b4
{ "func_code_index": [ 530, 912 ] }
3,705
Americo
Americo.sol
0x09eaf7b80ec741fa8a163cd4dde8367fab37e8a0
Solidity
Americo
contract Americo { /* Variables públicas del token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public initialSupply; uint256 public totalSupply; /* Esto crea una matriz con todos los saldos */ mapping (add...
transfer
function transfer(address _to, uint256 _value) { if (balanceOf[msg.sender] < _value) throw; // Compruebe si el remitente tiene suficiente if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Verificar desbordamientos balanceOf[msg.sender] -= _value; // Reste del remitente...
/* Send coins */
Comment
v0.4.19+commit.c4cbbb05
bzzr://2bb40ed958008e5bbe69da40c3b5da723d2539387782f8a45ee0dd3e5e3eb1b4
{ "func_code_index": [ 937, 1387 ] }
3,706