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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | 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.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
2748,
3130
]
} | 14,200 | |||
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | stopFunding | function stopFunding() isOwner external {
if (!isFunding) throw;
isFunding = false;
}
| /// 关闭区块异常处理 | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
3153,
3266
]
} | 14,201 | |||
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | setMigrateContract | function setMigrateContract(address _newContractAddr) isOwner external {
if (_newContractAddr == newContractAddr) throw;
newContractAddr = _newContractAddr;
}
| /// 开发了一个新的合同来接收token(或者更新token) | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
3308,
3494
]
} | 14,202 | |||
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | changeOwner | function changeOwner(address _newFundDeposit) isOwner() external {
if (_newFundDeposit == address(0x0)) throw;
ethFundDeposit = _newFundDeposit;
}
| /// 设置新的所有者地址 | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
3517,
3691
]
} | 14,203 | |||
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | 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.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
3716,
4227
]
} | 14,204 | |||
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | transferETH | function transferETH() isOwner external {
if (this.balance == 0) throw;
if (!ethFundDeposit.send(this.balance)) throw;
}
| /// 转账ETH 到EBLToken团队 | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
4258,
4406
]
} | 14,205 | |||
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | 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);
... | /// 将EBL token分配到预处理地址。 | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
4440,
4883
]
} | 14,206 | |||
EBLLToken | EBLLToken.sol | 0x8fbc31c70f6f3cc24d417df9e287806ac6f2ceb0 | Solidity | EBLLToken | contract EBLLToken is StandardToken, SafeMath {
// metadata
string public constant name = "易宝链";
string public constant symbol = "EBL";
uint256 public constant decimals = 18;
string public version = "1.0";
// contracts
address public ethFundDeposit; // ETH存放地址
a... | 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.24+commit.e67f0147 | bzzr://9e87e34acca5d31437ee3a85dfa9e91d9694708ed9df319a414e4530c61d4672 | {
"func_code_index": [
4904,
5391
]
} | 14,207 | ||||
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | totalSupply | function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
| // ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
972,
1093
]
} | 14,208 |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | balanceOf | function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
| // ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
1313,
1442
]
} | 14,209 |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transfer | function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
1786,
2068
]
} | 14,210 |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approve | function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double... | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
2576,
2789
]
} | 14,211 |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transferFrom | function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(from, to, tokens);
r... | // ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - S... | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
3320,
3683
]
} | 14,212 |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | allowance | function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
| // ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
3966,
4122
]
} | 14,213 |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approveAndCall | function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account. The spender contract function
// receiveApproval(...) is then executed
// --------------------------------------------------------------------... | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
4477,
4799
]
} | 14,214 |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | function () public payable {
revert();
}
| // ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
4991,
5050
]
} | 14,215 | |
Msccoin | Msccoin.sol | 0x3115238d428d9d27108abe7aaa991d9714fa5209 | Solidity | Msccoin | contract Msccoin is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// -----------------------------------------... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transferAnyERC20Token | function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
| // ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | None | bzzr://5ab960376abefe9cfe9bd57938e083e1901d3858ee83cbb6b1bb54905a6e3212 | {
"func_code_index": [
5283,
5472
]
} | 14,216 |
Multisend | contracts/token/Multisend.sol | 0x92a9c92c215092720c731c96d4ff508c831a714f | Solidity | Multisend | contract Multisend {
using SafeERC20 for IERC20;
struct Transfer {
address to;
uint256 amount;
}
/**
* @notice Sends tokens as batch
* @param token - token to send
* @param transfers - array of addresses/amounts
*/
function multisend(IERC20 token, Transfer[] calldata transfers) public {... | /**
* @title Multisend
* @author Railgun Contributors
* @notice Sends tokens as batch
*/ | NatSpecMultiLine | multisend | function multisend(IERC20 token, Transfer[] calldata transfers) public {
for (uint256 i = 0; i < transfers.length; i++) {
token.safeTransferFrom(msg.sender, transfers[i].to, transfers[i].amount);
}
}
| /**
* @notice Sends tokens as batch
* @param token - token to send
* @param transfers - array of addresses/amounts
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | {
"func_code_index": [
246,
463
]
} | 14,217 | ||
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uin... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_va... | /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
282,
705
]
} | 14,218 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uin... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
921,
1041
]
} | 14,219 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal 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... | /**
* @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 | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
... | /**
* @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 to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
415,
903
]
} | 14,220 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal 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... | /**
* @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 | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* ... | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
1555,
1761
]
} | 14,221 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal 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... | /**
* @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) {
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.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
2097,
2236
]
} | 14,222 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal 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... | /**
* @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) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
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.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
2493,
2773
]
} | 14,223 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | MintableToken | contract MintableToken {
event Mint(address indexed to, uint256 amount);
/// @dev mints new tokens
function mint(address _to, uint256 _amount) public;
} | /// @title StandardToken which can be minted by another contract. | NatSpecSingleLine | mint | function mint(address _to, uint256 _amount) public;
| /// @dev mints new tokens | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
112,
168
]
} | 14,224 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | MetropolMintableToken | contract MetropolMintableToken is StandardToken, MintableToken {
event Mint(address indexed to, uint256 amount);
function mint(address _to, uint256 _amount) public;//todo propose return value
/**
* Function to mint tokens
* Internal for not forgetting to add access modifier
*
... | /**
* MetropolMintableToken
*/ | NatSpecMultiLine | mintInternal | function mintInternal(address _to, uint256 _amount) internal returns (bool) {
require(_amount>0);
require(_to!=address(0));
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
| /**
* Function to mint tokens
* Internal for not forgetting to add access modifier
*
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
*
* @return A boolean that indicates if the operation was successful.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
529,
884
]
} | 14,225 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | Controlled | contract Controlled {
address public m_controller;
event ControllerSet(address controller);
event ControllerRetired(address was);
modifier onlyController {
require(msg.sender == m_controller);
_;
}
function setController(address _controller) external;
/**... | /**
* Contract which is operated by controller.
*
* Provides a way to set up an entity (typically other contract) entitled to control actions of this contract.
*
* Controller check is performed by onlyController modifier.
*/ | NatSpecMultiLine | setControllerInternal | function setControllerInternal(address _controller) internal {
m_controller = _controller;
ControllerSet(m_controller);
}
| /**
* Sets the controller. Internal for not forgetting to add access modifier
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
411,
560
]
} | 14,226 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | Controlled | contract Controlled {
address public m_controller;
event ControllerSet(address controller);
event ControllerRetired(address was);
modifier onlyController {
require(msg.sender == m_controller);
_;
}
function setController(address _controller) external;
/**... | /**
* Contract which is operated by controller.
*
* Provides a way to set up an entity (typically other contract) entitled to control actions of this contract.
*
* Controller check is performed by onlyController modifier.
*/ | NatSpecMultiLine | detachController | function detachController() external onlyController {
address was = m_controller;
m_controller = address(0);
ControllerRetired(was);
}
| /**
* Ability for controller to step down
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
625,
796
]
} | 14,227 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | MintableControlledToken | contract MintableControlledToken is MetropolMintableToken, Controlled {
/**
* Function to mint tokens
*
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
*
* @return A boolean that indicates if the operation was succes... | /**
* MintableControlledToken
*/ | NatSpecMultiLine | mint | function mint(address _to, uint256 _amount) public onlyController {
super.mintInternal(_to, _amount);
}
| /**
* Function to mint tokens
*
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
*
* @return A boolean that indicates if the operation was successful.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
336,
458
]
} | 14,228 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | BurnableToken | contract BurnableToken is StandardToken {
event Burn(address indexed from, uint256 amount);
function burn(address _from, uint256 _amount) public returns (bool);
/**
* Function to burn tokens
* Internal for not forgetting to add access modifier
*
* @param _from The address to... | /**
* BurnableToken
*/ | NatSpecMultiLine | burnInternal | function burnInternal(address _from, uint256 _amount) internal returns (bool) {
require(_amount>0);
require(_amount<=balances[_from]);
totalSupply = totalSupply.sub(_amount);
balances[_from] = balances[_from].sub(_amount);
Burn(_from, _amount);
Transfer(_from, address(0), _amount);
... | /**
* Function to burn tokens
* Internal for not forgetting to add access modifier
*
* @param _from The address to burn tokens from.
* @param _amount The amount of tokens to burn.
*
* @return A boolean that indicates if the operation was successful.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
484,
858
]
} | 14,229 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | BurnableControlledToken | contract BurnableControlledToken is BurnableToken, Controlled {
/**
* Function to burn tokens
*
* @param _from The address to burn tokens from.
* @param _amount The amount of tokens to burn.
*
* @return A boolean that indicates if the operation was successful.
*/
fu... | /**
* BurnableControlledToken
*/ | NatSpecMultiLine | burn | function burn(address _from, uint256 _amount) public onlyController returns (bool) {
return super.burnInternal(_from, _amount);
}
| /**
* Function to burn tokens
*
* @param _from The address to burn tokens from.
* @param _amount The amount of tokens to burn.
*
* @return A boolean that indicates if the operation was successful.
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
314,
462
]
} | 14,230 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | multiowned | function multiowned(address[] _owners, uint _required)
validNumOwners(_owners.length)
multiOwnedValidRequirement(_required, _owners.length)
{
assert(c_maxOwners <= 255);
m_numOwners = _owners.length;
m_multiOwnedRequired = _required;
for (uint i = 0; i < _owners.length; ++i)
{
a... | // METHODS
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
// as well as the selection of addresses capable of confirming them (msg.sender is not added to the owners!). | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
2542,
3322
]
} | 14,231 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | changeOwner | function changeOwner(address _from, address _to)
external
ownerExists(_from)
ownerDoesNotExist(_to)
onlymanyowners(sha3(msg.data))
{
assertOwnersAreConsistent();
clearPending();
uint ownerIndex = checkOwnerIndex(m_ownerIndex[_from]);
m_owners[ownerIndex] = _to;
m_ownerIndex[_from] = 0;
... | // All pending operations will be canceled! | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
3528,
4014
]
} | 14,232 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | addOwner | function addOwner(address _owner)
external
ownerDoesNotExist(_owner)
validNumOwners(m_numOwners + 1)
onlymanyowners(sha3(msg.data))
{
assertOwnersAreConsistent();
clearPending();
m_numOwners++;
m_owners[m_numOwners] = _owner;
m_ownerIndex[_owner] = checkOwnerIndex(m_numOwners);
as... | // All pending operations will be canceled! | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
4141,
4572
]
} | 14,233 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | removeOwner | function removeOwner(address _owner)
external
ownerExists(_owner)
validNumOwners(m_numOwners - 1)
multiOwnedValidRequirement(m_multiOwnedRequired, m_numOwners - 1)
onlymanyowners(sha3(msg.data))
{
assertOwnersAreConsistent();
clearPending();
uint ownerIndex = checkOwnerIndex(m_ownerIndex[_owner])... | // All pending operations will be canceled! | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
4708,
5349
]
} | 14,234 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | changeRequirement | function changeRequirement(uint _newRequired)
external
multiOwnedValidRequirement(_newRequired, m_numOwners)
onlymanyowners(sha3(msg.data))
{
m_multiOwnedRequired = _newRequired;
clearPending();
RequirementChanged(_newRequired);
}
| // All pending operations will be canceled! | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
5529,
5816
]
} | 14,235 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | getOwner | function getOwner(uint ownerIndex) public constant returns (address) {
return m_owners[ownerIndex + 1];
}
| /// @notice Gets an owner by 0-indexed position
/// @param ownerIndex 0-indexed owner position | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
5924,
6048
]
} | 14,236 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | getOwners | function getOwners() public constant returns (address[]) {
address[] memory result = new address[](m_numOwners);
for (uint i = 0; i < m_numOwners; i++)
result[i] = getOwner(i);
return result;
}
| /// @notice Gets owners
/// @return memory array of owners | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
6120,
6361
]
} | 14,237 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | isOwner | function isOwner(address _addr) public constant returns (bool) {
return m_ownerIndex[_addr] > 0;
}
| /// @notice checks if provided address is an owner address
/// @param _addr address to check
/// @return true if it's an owner | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
6506,
6623
]
} | 14,238 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | amIOwner | function amIOwner() external constant onlyowner returns (bool) {
return true;
}
| // It's advisable to call it by new owner to make sure that the same erroneous address is not copy-pasted to
// addOwner/changeOwner and to isOwner. | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
6880,
6978
]
} | 14,239 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | revoke | function revoke(bytes32 _operation)
external
multiOwnedOperationIsActive(_operation)
onlyowner
{
uint ownerIndexBit = makeOwnerBitmapBit(msg.sender);
var pending = m_multiOwnedPending[_operation];
require(pending.ownersDone & ownerIndexBit > 0);
assertOperationIsConsistent(_operation);
... | /// @notice Revokes a prior confirmation of the given operation
/// @param _operation operation value, typically sha3(msg.data) | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
7119,
7646
]
} | 14,240 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | hasConfirmed | function hasConfirmed(bytes32 _operation, address _owner)
external
constant
multiOwnedOperationIsActive(_operation)
ownerExists(_owner)
returns (bool)
{
return !(m_multiOwnedPending[_operation].ownersDone & makeOwnerBitmapBit(_owner) == 0);
}
| /// @notice Checks if owner confirmed given operation
/// @param _operation operation value, typically sha3(msg.data)
/// @param _owner an owner address | NatSpecSingleLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
7817,
8108
]
} | 14,241 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | confirmAndCheck | function confirmAndCheck(bytes32 _operation)
private
onlyowner
returns (bool)
{
if (512 == m_multiOwnedPendingIndex.length)
// In case m_multiOwnedPendingIndex grows too much we have to shrink it: otherwise at some point
// we won't be able to do it because of block gas limit.
// Yes, pending co... | // INTERNAL METHODS | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
8138,
10399
]
} | 14,242 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | multiowned | contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct MultiOwnedOperationPendingState {
// count of confirmations needed
uint yetNeeded;
// bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
uint ownersDon... | // TODO acceptOwnership | LineComment | reorganizeOwners | function reorganizeOwners() private {
uint free = 1;
while (free < m_numOwners)
{
// iterating to the first free slot from the beginning
while (free < m_numOwners && m_owners[free] != 0) free++;
// iterating to the first occupied slot from the end
while (m_numOwners ... | // Reclaims free slots between valid owners in m_owners.
// TODO given that its called after each removal, it could be simplified. | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
10543,
11423
]
} | 14,243 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | MetropolMultiownedControlled | contract MetropolMultiownedControlled is Controlled, multiowned {
function MetropolMultiownedControlled(address[] _owners, uint256 _signaturesRequired)
multiowned(_owners, _signaturesRequired)
public
{
// nothing here
}
/**
* Sets the controller
*/
function ... | /**
* Contract which is owned by owners and operated by controller.
*
* Provides a way to set up an entity (typically other contract) entitled to control actions of this contract.
* Controller is set up by owners or during construction.
*
*/ | NatSpecMultiLine | setController | function setController(address _controller) external onlymanyowners(sha3(msg.data)) {
super.setControllerInternal(_controller);
}
| /**
* Sets the controller
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
307,
455
]
} | 14,244 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | CirculatingToken | contract CirculatingToken is StandardToken {
event CirculationEnabled();
modifier requiresCirculation {
require(m_isCirculating);
_;
}
// PUBLIC interface
function transfer(address _to, uint256 _value) requiresCirculation returns (bool) {
return super.transf... | /// @title StandardToken which circulation can be delayed and started by another contract.
/// @dev To be used as a mixin contract.
/// The contract is created in disabled state: circulation is disabled. | NatSpecSingleLine | transfer | function transfer(address _to, uint256 _value) requiresCirculation returns (bool) {
return super.transfer(_to, _value);
}
| // PUBLIC interface | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
204,
344
]
} | 14,245 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | CirculatingToken | contract CirculatingToken is StandardToken {
event CirculationEnabled();
modifier requiresCirculation {
require(m_isCirculating);
_;
}
// PUBLIC interface
function transfer(address _to, uint256 _value) requiresCirculation returns (bool) {
return super.transf... | /// @title StandardToken which circulation can be delayed and started by another contract.
/// @dev To be used as a mixin contract.
/// The contract is created in disabled state: circulation is disabled. | NatSpecSingleLine | enableCirculation | function enableCirculation() internal returns (bool) {
if (m_isCirculating)
return false;
m_isCirculating = true;
CirculationEnabled();
return true;
}
| // INTERNAL functions | LineComment | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
702,
909
]
} | 14,246 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | CirculatingControlledToken | contract CirculatingControlledToken is CirculatingToken, Controlled {
/**
* Allows token transfers
*/
function startCirculation() external onlyController {
assert(enableCirculation()); // must be called once
}
} | /**
* CirculatingControlledToken
*/ | NatSpecMultiLine | startCirculation | function startCirculation() external onlyController {
assert(enableCirculation()); // must be called once
}
| /**
* Allows token transfers
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
122,
251
]
} | 14,247 | |
MetropolToken | MetropolToken.sol | 0x985c3d74b91293f0a66812aa32297a299eaa2339 | Solidity | MetropolToken | contract MetropolToken is
StandardToken,
Controlled,
MintableControlledToken,
BurnableControlledToken,
CirculatingControlledToken,
MetropolMultiownedControlled
{
string internal m_name = '';
string internal m_symbol = '';
uint8 public constant decimals = 18;
/**
... | /**
* MetropolToken
*/ | NatSpecMultiLine | MetropolToken | function MetropolToken(address[] _owners)
MetropolMultiownedControlled(_owners, 2)
public
{
require(3 == _owners.length);
}
| /**
* MetropolToken constructor
*/ | NatSpecMultiLine | v0.4.18+commit.9cf6e910 | bzzr://7bd3c14f4df1e897ed8152e9980a7c1840bd6cc407c589c71ba3e165df4ea1d4 | {
"func_code_index": [
360,
525
]
} | 14,248 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | Bolton | function Bolton() public {
symbol = "BFCL";
name = "Bolton";
decimals = 18;
bonusEnds = now + 28 weeks;
endDate = now + 133 weeks;
_totalSupply = 500000000000000000000000000;
balances[0xd0997F80aeA911C01D5D8C7E34e7A937226a360c] = _totalSupply;
Transfer(address(0), 0xd0997F80aeA91... | // ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
535,
942
]
} | 14,249 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | totalSupply | function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
| // ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
1130,
1251
]
} | 14,250 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | balanceOf | function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
| // ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
1473,
1602
]
} | 14,251 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transfer | function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
1948,
2225
]
} | 14,252 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approve | function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval do... | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
2736,
2944
]
} | 14,253 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transferFrom | function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return... | // ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer... | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
3482,
3840
]
} | 14,254 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | allowance | function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
| // ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
4123,
4279
]
} | 14,255 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approveAndCall | function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------... | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
4642,
4959
]
} | 14,256 | |
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 360;
} else {
tokens = msg.value * 300;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSu... | // ------------------------------------------------------------------------
// 100 BFCL Tokens per 1 ETH
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
5158,
5627
]
} | 14,257 | ||
Bolton | Bolton.sol | 0x953ddc4a817d954fbf5cfb33c9454fddd865abed | Solidity | Bolton | contract Bolton is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping... | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transferAnyERC20Token | function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
| // ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://9f80c1613fc963a3332b7f34519b4de699d62e677a2ee951d0ecf9b537f26fd7 | {
"func_code_index": [
5862,
6051
]
} | 14,258 | |
LaunchpadRouter | contracts/launchpad/LaunchpadRouter.sol | 0xbf28b407836fc73624a66994db0df22b33601636 | Solidity | LaunchpadRouter | contract LaunchpadRouter is Ownable, ILaunchpadRouter {
using SafeERC20 for IERC20;
uint256 internal constant MAX_AMOUNT = uint256(-1);
address internal constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
mapping(string => address) public pools;
constructor(address _owner)... | // ============ Safety Purposes, this contract should not hold values ============== | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
515,
548
]
} | 14,259 | ||||||
LaunchpadRouter | contracts/launchpad/LaunchpadRouter.sol | 0xbf28b407836fc73624a66994db0df22b33601636 | Solidity | LaunchpadRouter | contract LaunchpadRouter is Ownable, ILaunchpadRouter {
using SafeERC20 for IERC20;
uint256 internal constant MAX_AMOUNT = uint256(-1);
address internal constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
mapping(string => address) public pools;
constructor(address _owner)... | updatePools | function updatePools(string[] calldata poolIds, address[] calldata poolAddresses)
external
onlyOwner
{
require(poolIds.length == poolAddresses.length, "mismatch length");
for (uint256 i = 0; i < poolIds.length; i++) {
pools[poolIds[i]] = poolAddresses[i];
}
}
| // ============ Admin functions ============== | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
985,
1308
]
} | 14,260 | ||||
LaunchpadRouter | contracts/launchpad/LaunchpadRouter.sol | 0xbf28b407836fc73624a66994db0df22b33601636 | Solidity | LaunchpadRouter | contract LaunchpadRouter is Ownable, ILaunchpadRouter {
using SafeERC20 for IERC20;
uint256 internal constant MAX_AMOUNT = uint256(-1);
address internal constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
mapping(string => address) public pools;
constructor(address _owner)... | getPools | function getPools(string[] calldata poolIds)
external
view
override
returns (address[] memory poolAddresses)
{
poolAddresses = new address[](poolIds.length);
for (uint256 i = 0; i < poolIds.length; i++) {
poolAddresses[i] = pools[poolIds[i]];
}
}
| // ============ Main View Functions ============== | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
1365,
1691
]
} | 14,261 | ||||
LaunchpadRouter | contracts/launchpad/LaunchpadRouter.sol | 0xbf28b407836fc73624a66994db0df22b33601636 | Solidity | LaunchpadRouter | contract LaunchpadRouter is Ownable, ILaunchpadRouter {
using SafeERC20 for IERC20;
uint256 internal constant MAX_AMOUNT = uint256(-1);
address internal constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
mapping(string => address) public pools;
constructor(address _owner)... | _processPayment | function _processPayment(address paymentToken, uint256 paymentAmount) private {
if (paymentToken == NATIVE_TOKEN_ADDRESS) {
require(msg.value == paymentAmount, "payment: wrong received amount");
} else {
require(msg.value == 0, "payment: extra received amount");
IERC20(paymentToken).safe... | // ============ Internal Functions ============== | LineComment | v0.7.6+commit.7338295f | {
"func_code_index": [
3730,
4145
]
} | 14,262 | ||||
LITxMedici | IEIP2981.sol | 0x12770beb72920bcdff7b132e207040691dd27213 | Solidity | IEIP2981 | interface IEIP2981 {
/// ERC165 bytes to add to interface array - set in parent contract
/// implementing this standard
///
/// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
/// @notice Called with the sale price to determine how much royalty
// is owed and to whom.
... | ///
/// @dev Interface for the NFT Royalty Standard
/// | NatSpecSingleLine | royaltyInfo | function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver,uint256 royaltyAmount);
| /// @param _tokenId - the NFT asset queried for royalty information
/// @param _salePrice - the sale price of the NFT asset specified by _tokenId
/// @return receiver - address of who should be sent the royalty payment
/// @return royaltyAmount - the royalty payment amount for _salePrice | NatSpecSingleLine | v0.8.9+commit.e5eed63a | MIT | {
"func_code_index": [
624,
750
]
} | 14,263 | |
LITxMedici | EIP2981.sol | 0x12770beb72920bcdff7b132e207040691dd27213 | Solidity | EIP2981 | contract EIP2981 is IEIP2981, ERC165 {
address internal royaltyAddr;
uint256 internal royaltyPerc; // percentage in basis (out of 10,000)
/**
* @notice constructor
* @dev need inheriting contracts to accept the parameters in their constructor
* @param addr is the royalty payout address
... | supportsInterface | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) {
return interfaceId == type(IEIP2981).interfaceId || super.supportsInterface(interfaceId);
}
| /**
* @notice override ERC 165 implementation of this function
* @dev if using this contract with another contract that suppports ERC 265, will have to override in the inheriting contract
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | {
"func_code_index": [
729,
937
]
} | 14,264 | |||
LITxMedici | EIP2981.sol | 0x12770beb72920bcdff7b132e207040691dd27213 | Solidity | EIP2981 | contract EIP2981 is IEIP2981, ERC165 {
address internal royaltyAddr;
uint256 internal royaltyPerc; // percentage in basis (out of 10,000)
/**
* @notice constructor
* @dev need inheriting contracts to accept the parameters in their constructor
* @param addr is the royalty payout address
... | royaltyInfo | function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) {
require(royaltyAddr != address(0));
return (royaltyAddr, royaltyPerc * _salePrice / 10000);
}
| /**
* @notice EIP 2981 royalty support
* @dev royalty payout made to the owner of the contract and the owner can't be the 0 address
* @dev royalty amount determined when contract is deployed, and then divided by 1000 in this function
* @dev royalty amount not dependent on _tokenId
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | MIT | {
"func_code_index": [
1256,
1498
]
} | 14,265 | |||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | supportsInterface | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
| /**
* @dev See {IERC165-supportsInterface}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
622,
931
]
} | 14,266 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | uri | function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
| /**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with ... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1326,
1433
]
} | 14,267 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
| /**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1571,
1803
]
} | 14,268 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | balanceOfBatch | function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (... | /**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1956,
2468
]
} | 14,269 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | setApprovalForAll | function setApprovalForAll(address operator, bool approved) public virtual override {
require(_msgSender() != operator, "ERC1155: setting approval status for self");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
| /**
* @dev See {IERC1155-setApprovalForAll}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
2532,
2842
]
} | 14,270 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | isApprovedForAll | function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
| /**
* @dev See {IERC1155-isApprovedForAll}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
2905,
3075
]
} | 14,271 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | safeTransferFrom | function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_safeTransferFrom(from, to,... | /**
* @dev See {IERC1155-safeTransferFrom}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
3138,
3531
]
} | 14,272 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | safeBatchTransferFrom | function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: transfer caller is not owner nor approved"
... | /**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
3599,
4033
]
} | 14,273 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _safeTransferFrom | function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, _asSingletonArray(id), ... | /**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC11... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
4479,
5280
]
} | 14,274 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _safeBatchTransferFrom | function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero addres... | /**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
5622,
6671
]
} | 14,275 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _setURI | function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
| /**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI wil... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
7490,
7580
]
} | 14,276 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _mint | function _mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(account != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonA... | /**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
7964,
8551
]
} | 14,277 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _mintBatch | function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgS... | /**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
8892,
9611
]
} | 14,278 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _burn | function _burn(
address account,
uint256 id,
uint256 amount
) internal virtual {
require(account != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
... | /**
* @dev Destroys `amount` tokens of token type `id` from `account`
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens of token type `id`.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
9856,
10517
]
} | 14,279 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _burnBatch | function _burnBatch(
address account,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(account != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
... | /**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
10707,
11605
]
} | 14,280 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | ERC1155 | contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool))... | /**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ | NatSpecMultiLine | _beforeTokenTransfer | function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
| /**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amo... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
12535,
12753
]
} | 14,281 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | tryAdd | function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
| /**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
155,
375
]
} | 14,282 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | trySub | function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
| /**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
517,
710
]
} | 14,283 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | tryMul | function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
... | /**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
854,
1351
]
} | 14,284 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | tryDiv | function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
| /**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1496,
1690
]
} | 14,285 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | tryMod | function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
| /**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1845,
2039
]
} | 14,286 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
2270,
2370
]
} | 14,287 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
2637,
2737
]
} | 14,288 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
| /**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
2980,
3080
]
} | 14,289 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
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.
*
* Requirements:
*
* - The divisor cannot be zero.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
3365,
3465
]
} | 14,290 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming a... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
3914,
4014
]
} | 14,291 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | sub | function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to ... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
4474,
4709
]
} | 14,292 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | div | function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
| /**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invali... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
5189,
5423
]
} | 14,293 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | /**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/ | NatSpecMultiLine | mod | function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* C... | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
6065,
6299
]
} | 14,294 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | Strings | library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence... | /**
* @dev String operations.
*/ | NatSpecMultiLine | toString | function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = ... | /**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
178,
885
]
} | 14,295 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | Strings | library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence... | /**
* @dev String operations.
*/ | NatSpecMultiLine | toHexString | function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
| /**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
986,
1319
]
} | 14,296 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | Strings | library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence... | /**
* @dev String operations.
*/ | NatSpecMultiLine | toHexString | function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
requ... | /**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/ | NatSpecMultiLine | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1438,
1883
]
} | 14,297 | ||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | MoodyApeClub | contract MoodyApeClub is ERC1155, Ownable {
string public constant name = "Moody Ape Club";
string public constant symbol = "MAC";
using SafeMath for uint256;
using Strings for uint256;
string private baseURI;
uint256 public totalSupply = 0;
uint256 public constant MAX_NFT_PUBLIC = 6969;
... | revealNFT | function revealNFT(uint256 _tokenId)
public
{
require(canReveal, 'Reveal option is not active');
require(_ownerOf(msg.sender, _tokenId), 'You are not the owner of this NFT');
revealedNFT[_tokenId] = true;
}
| /*
* Function to reveal a NFT
*/ | Comment | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1098,
1348
]
} | 14,298 | ||||
MoodyApeClub | @openzeppelin/contracts/token/ERC1155/ERC1155.sol | 0xe534bd009274f9b891f80e3e42475f92e439f20c | Solidity | MoodyApeClub | contract MoodyApeClub is ERC1155, Ownable {
string public constant name = "Moody Ape Club";
string public constant symbol = "MAC";
using SafeMath for uint256;
using Strings for uint256;
string private baseURI;
uint256 public totalSupply = 0;
uint256 public constant MAX_NFT_PUBLIC = 6969;
... | _ownerOf | function _ownerOf(address owner, uint256 tokenId) internal view returns (bool) {
return balanceOf(owner, tokenId) != 0;
}
| /*
* Function to validate owner
*/ | Comment | v0.8.7+commit.e28d00a7 | {
"func_code_index": [
1398,
1535
]
} | 14,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.