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
EllipseMarketMakerLib
EllipseMarketMakerLib.sol
0xc70636e0886ec4a4f2b7e42ac57ccd1b976352d0
Solidity
EllipseMarketMakerLib
contract EllipseMarketMakerLib is TokenOwnable, IEllipseMarketMaker { using SafeMath for uint256; // temp reserves uint256 private l_R1; uint256 private l_R2; modifier notConstructed() { require(mmLib == address(0)); _; } /// @dev Reverts if not operational modifier isOperational...
/// @title Ellipse Market Maker Library. /// @dev market maker, using ellipse equation. /// @dev for more information read the appendix of the CLN white paper: https://cln.network/pdf/cln_whitepaper.pdf /// @author Tal Beja.
NatSpecSingleLine
change
function change(address _toToken) public canTrade223 tokenPayable returns (uint256 returnAmount) { return change(_toToken, 0); }
/// @dev change tokens using erc223\erc677 transfer. /// @param _toToken the token to buy /// @return the return amount of the buying token
NatSpecSingleLine
v0.4.18+commit.9cf6e910
bzzr://e07437398c8063256f4539de2815dd3347816cfbdafa1a03c1a21987495774b0
{ "func_code_index": [ 8733, 8872 ] }
9,300
EllipseMarketMakerLib
EllipseMarketMakerLib.sol
0xc70636e0886ec4a4f2b7e42ac57ccd1b976352d0
Solidity
EllipseMarketMakerLib
contract EllipseMarketMakerLib is TokenOwnable, IEllipseMarketMaker { using SafeMath for uint256; // temp reserves uint256 private l_R1; uint256 private l_R2; modifier notConstructed() { require(mmLib == address(0)); _; } /// @dev Reverts if not operational modifier isOperational...
/// @title Ellipse Market Maker Library. /// @dev market maker, using ellipse equation. /// @dev for more information read the appendix of the CLN white paper: https://cln.network/pdf/cln_whitepaper.pdf /// @author Tal Beja.
NatSpecSingleLine
change
function change(address _toToken, uint256 _minReturn) public canTrade223 tokenPayable returns (uint256 returnAmount) { // get from token and in amount from the tkn object address fromToken = tkn.addr; uint256 inAmount = tkn.value; // exchange the token returnAmount = exchange(fromToken, inAmount, _toToke...
/// @dev change tokens using erc223\erc677 transfer. /// @param _toToken the token to buy /// @param _minReturn the munimum token to buy /// @return the return amount of the buying token
NatSpecSingleLine
v0.4.18+commit.9cf6e910
bzzr://e07437398c8063256f4539de2815dd3347816cfbdafa1a03c1a21987495774b0
{ "func_code_index": [ 9074, 9742 ] }
9,301
EllipseMarketMakerLib
EllipseMarketMakerLib.sol
0xc70636e0886ec4a4f2b7e42ac57ccd1b976352d0
Solidity
EllipseMarketMakerLib
contract EllipseMarketMakerLib is TokenOwnable, IEllipseMarketMaker { using SafeMath for uint256; // temp reserves uint256 private l_R1; uint256 private l_R2; modifier notConstructed() { require(mmLib == address(0)); _; } /// @dev Reverts if not operational modifier isOperational...
/// @title Ellipse Market Maker Library. /// @dev market maker, using ellipse equation. /// @dev for more information read the appendix of the CLN white paper: https://cln.network/pdf/cln_whitepaper.pdf /// @author Tal Beja.
NatSpecSingleLine
exchange
function exchange(address _fromToken, uint256 _inAmount, address _toToken, uint256 _minReturn) private returns (uint256 returnAmount) { // get quote and update temp reserves returnAmount = quoteAndReserves(_fromToken, _inAmount, _toToken); // if the return amount is lower than minimum return, don't buy if (...
/// @dev exchange tokens. /// @param _fromToken the token to sell from /// @param _inAmount the amount to sell /// @param _toToken the token to buy /// @param _minReturn the munimum token to buy /// @return the return amount of the buying token
NatSpecSingleLine
v0.4.18+commit.9cf6e910
bzzr://e07437398c8063256f4539de2815dd3347816cfbdafa1a03c1a21987495774b0
{ "func_code_index": [ 10008, 10482 ] }
9,302
EllipseMarketMakerLib
EllipseMarketMakerLib.sol
0xc70636e0886ec4a4f2b7e42ac57ccd1b976352d0
Solidity
EllipseMarketMakerLib
contract EllipseMarketMakerLib is TokenOwnable, IEllipseMarketMaker { using SafeMath for uint256; // temp reserves uint256 private l_R1; uint256 private l_R2; modifier notConstructed() { require(mmLib == address(0)); _; } /// @dev Reverts if not operational modifier isOperational...
/// @title Ellipse Market Maker Library. /// @dev market maker, using ellipse equation. /// @dev for more information read the appendix of the CLN white paper: https://cln.network/pdf/cln_whitepaper.pdf /// @author Tal Beja.
NatSpecSingleLine
updateReserve
function updateReserve() private { R1 = l_R1; R2 = l_R2; }
/// @dev update token reserves from temp values
NatSpecSingleLine
v0.4.18+commit.9cf6e910
bzzr://e07437398c8063256f4539de2815dd3347816cfbdafa1a03c1a21987495774b0
{ "func_code_index": [ 10536, 10610 ] }
9,303
EllipseMarketMakerLib
EllipseMarketMakerLib.sol
0xc70636e0886ec4a4f2b7e42ac57ccd1b976352d0
Solidity
EllipseMarketMakerLib
contract EllipseMarketMakerLib is TokenOwnable, IEllipseMarketMaker { using SafeMath for uint256; // temp reserves uint256 private l_R1; uint256 private l_R2; modifier notConstructed() { require(mmLib == address(0)); _; } /// @dev Reverts if not operational modifier isOperational...
/// @title Ellipse Market Maker Library. /// @dev market maker, using ellipse equation. /// @dev for more information read the appendix of the CLN white paper: https://cln.network/pdf/cln_whitepaper.pdf /// @author Tal Beja.
NatSpecSingleLine
validateReserves
function validateReserves() public view returns (bool) { return (token1.balanceOf(this) >= R1 && token2.balanceOf(this) >= R2); }
/// @dev validate that the tokens balances don't goes below reserves
NatSpecSingleLine
v0.4.18+commit.9cf6e910
bzzr://e07437398c8063256f4539de2815dd3347816cfbdafa1a03c1a21987495774b0
{ "func_code_index": [ 10685, 10825 ] }
9,304
EllipseMarketMakerLib
EllipseMarketMakerLib.sol
0xc70636e0886ec4a4f2b7e42ac57ccd1b976352d0
Solidity
EllipseMarketMakerLib
contract EllipseMarketMakerLib is TokenOwnable, IEllipseMarketMaker { using SafeMath for uint256; // temp reserves uint256 private l_R1; uint256 private l_R2; modifier notConstructed() { require(mmLib == address(0)); _; } /// @dev Reverts if not operational modifier isOperational...
/// @title Ellipse Market Maker Library. /// @dev market maker, using ellipse equation. /// @dev for more information read the appendix of the CLN white paper: https://cln.network/pdf/cln_whitepaper.pdf /// @author Tal Beja.
NatSpecSingleLine
withdrawExcessReserves
function withdrawExcessReserves() public onlyOwner returns (uint256 returnAmount) { // if there is excess of token 1, transfer it to the owner if (token1.balanceOf(this) > R1) { returnAmount = returnAmount.add(token1.balanceOf(this).sub(R1)); token1.transfer(msg.sender, token1.balanceOf(this).sub(R1)); ...
/// @dev allow admin to withraw excess tokens accumulated due to precision
NatSpecSingleLine
v0.4.18+commit.9cf6e910
bzzr://e07437398c8063256f4539de2815dd3347816cfbdafa1a03c1a21987495774b0
{ "func_code_index": [ 10906, 11499 ] }
9,305
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
name
function name() public view returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 902, 990 ] }
9,306
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 1104, 1196 ] }
9,307
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 1829, 1917 ] }
9,308
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
totalSupply
function totalSupply() public view override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 1977, 2082 ] }
9,309
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 2140, 2264 ] }
9,310
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 2472, 2652 ] }
9,311
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 2710, 2866 ] }
9,312
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 3008, 3182 ] }
9,313
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amou...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 3651, 3977 ] }
9,314
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 4381, 4604 ] }
9,315
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 5102, 5376 ] }
9,316
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sen...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 5861, 6405 ] }
9,317
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfe...
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 6681, 7064 ] }
9,318
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _to...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 7391, 7814 ] }
9,319
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero a...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 8247, 8598 ] }
9,320
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_setupDecimals
function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; }
/** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 8925, 9020 ] }
9,321
ValueVaultProfitSharer
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x7c1c3116c99b7f8a35163331a33a09e2ebd1e862
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://085864682220b518f31f4a2d8935ceb8b807e3cd25dce5015ffaecd05caad3a2
{ "func_code_index": [ 9618, 9715 ] }
9,322
PremiaVesting
contracts/PremiaVesting.sol
0x4ba7c8b012b3edae910ddee79edf9e3f5b1ff68c
Solidity
PremiaVesting
contract PremiaVesting is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // The premia token IERC20 public premia; // The timestamp at which release ends uint256 public endTimestamp; // The length of the release period (Once this period is passed, amount is full...
/// @author Premia /// @title Vesting contract for Premia founder allocations, releasing the allocations over the course of a year
NatSpecSingleLine
withdraw
function withdraw() public onlyOwner { uint256 timestamp = block.timestamp; if (timestamp == lastWithdrawalTimestamp) return; uint256 _lastWithdrawalTimestamp = lastWithdrawalTimestamp; lastWithdrawalTimestamp = timestamp; uint256 balance = premia.balanceOf(address(this)); if (time...
////////////////////////////////////////////////// ////////////////////////////////////////////////// ////////////////////////////////////////////////// /// @notice Withdraw portion of allocation unlocked
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1107, 1841 ] }
9,323
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.send...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 649, 757 ] }
9,324
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.send...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
_transferOwnership
function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
/** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 895, 1073 ] }
9,325
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
Destructible
contract Destructible is Ownable { /** * @dev Transfers the current balance to the owner and terminates the contract. */ function destroy() public onlyOwner { selfdestruct(owner); } function destroyAndSend(address _recipient) public onlyOwner { selfdestruct(_recipient); } }
/** * @title Destructible * @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner. */
NatSpecMultiLine
destroy
function destroy() public onlyOwner { selfdestruct(owner); }
/** * @dev Transfers the current balance to the owner and terminates the contract. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 133, 204 ] }
9,326
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
giftCharacter
function giftCharacter(address receiver, uint8 characterType) payable public onlyUser { _addCharacters(receiver, characterType); assert(config.giftToken().transfer(receiver, config.giftTokenAmount())); }
/** * gifts one character * @param receiver gift character owner * @param characterType type of the character to create as a gift */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 4573, 4792 ] }
9,327
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
addCharacters
function addCharacters(uint8 characterType) payable public onlyUser { _addCharacters(msg.sender, characterType); }
/** * buys as many characters as possible with the transfered value of the given type * @param characterType the type of the character */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 4948, 5073 ] }
9,328
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
addCharacter
function addCharacter(uint32 nId, uint16 nchars) internal { if (nchars < ids.length) ids[nchars] = nId; else ids.push(nId); }
/** * adds a single dragon of the given type to the ids array, which is used to iterate over all characters * @param nId the id the character is about to receive * @param nchars the number of characters currently in the game */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 6886, 7041 ] }
9,329
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
exit
function exit() public { uint32[] memory removed = new uint32[](50); uint8 count; uint32 lastId; uint playerBalance; uint16 nchars = numCharacters; for (uint16 i = 0; i < nchars; i++) { if (characters[ids[i]].owner == msg.sender && characters[ids[i]].purchaseTimestamp + 1 days < now ...
/** * leave the game. * pays out the sender's balance and removes him and his characters from the game * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 7167, 8811 ] }
9,330
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
replaceCharacter
function replaceCharacter(uint16 index, uint16 nchars) internal { uint32 characterId = ids[index]; numCharactersXType[characters[characterId].characterType]--; if (characterId == oldest) oldest = 0; delete characters[characterId]; ids[index] = ids[nchars]; delete ids[nchars]; }
/** * Replaces the character with the given id with the last character in the array * @param index the index of the character in the id array * @param nchars the number of characters * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 9021, 9335 ] }
9,331
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
triggerVolcanoEruption
function triggerVolcanoEruption() public onlyUser { require(now >= lastEruptionTimestamp + config.eruptionThreshold(), "not enough time passed since last eruption"); require(numCharacters > 0, "there are no characters in the game"); lastEruptionTimestamp = now; uint128 pot; uint128 va...
/** * The volcano eruption can be triggered by anybody but only if enough time has passed since the last eription. * The volcano hits up to a certain percentage of characters, but at least one. * The percantage is specified in 'percentageToKill' * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 9610, 11114 ] }
9,332
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
fight
function fight(uint32 characterID, uint16 characterIndex) public onlyUser { if (characterIndex >= numCharacters || characterID != ids[characterIndex]) characterIndex = getCharacterIndex(characterID); Character storage character = characters[characterID]; require(cooldown[characterID] + config.CooldownThre...
/** * Knight can attack a dragon. * Archer can attack only a balloon. * Dragon can attack wizards and archers. * Wizard can attack anyone, except balloon. * Balloon cannot attack. * The value of the loser is transfered to the winner. * @param characterID the ID of the knight to perfrom the attack * @par...
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 11645, 15351 ] }
9,333
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
isValidAdversary
function isValidAdversary(uint8 characterType, uint8 adversaryType) pure returns (bool) { if (characterType >= KNIGHT_MIN_TYPE && characterType <= KNIGHT_MAX_TYPE) { // knight return (adversaryType <= DRAGON_MAX_TYPE); } else if (characterType >= WIZARD_MIN_TYPE && characterType <= WIZARD_MAX_TYPE) { // wiza...
/* * @param characterType * @param adversaryType * @return whether adversaryType is a valid type of adversary for a given character */
Comment
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 15508, 16383 ] }
9,334
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getRandomAdversary
function getRandomAdversary(uint256 nonce, uint8 characterType) internal view returns(uint16) { uint16 randomIndex = uint16(generateRandomNumber(nonce) % numCharacters); // use 7, 11 or 13 as step size. scales for up to 1000 characters uint16 stepSize = numCharacters % 7 == 0 ? (numCharacters % 11 == 0 ? 13 : ...
/** * pick a random adversary. * @param nonce a nonce to make sure there's not always the same adversary chosen in a single block. * @return the index of a random adversary character * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 16593, 17467 ] }
9,335
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
generateRandomNumber
function generateRandomNumber(uint256 nonce) internal view returns(uint) { return uint(keccak256(block.blockhash(block.number - 1), now, numCharacters, nonce)); }
/** * generate a random number. * @param nonce a nonce to make sure there's not always the same number returned in a single block. * @return the random number * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 17655, 17828 ] }
9,336
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
hitCharacter
function hitCharacter(uint16 index, uint16 nchars, uint8 characterType) internal returns(uint128 characterValue) { uint32 id = ids[index]; uint8 knockOffProtections = 1; if (characterType >= WIZARD_MIN_TYPE && characterType <= WIZARD_MAX_TYPE) { knockOffProtections = 2; } if (protection[id] >= knock...
/** * Hits the character of the given type at the given index. * Wizards can knock off two protections. Other characters can do only one. * @param index the index of the character * @param nchars the number of characters * @return the value gained from hitting the characters (zero is the character was protect...
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 18176, 18724 ] }
9,337
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
findOldest
function findOldest() public { uint32 newOldest = noKing; for (uint16 i = 0; i < numCharacters; i++) { if (ids[i] < newOldest && characters[ids[i]].characterType <= DRAGON_MAX_TYPE) newOldest = ids[i]; } oldest = newOldest; }
/** * finds the oldest character * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 18776, 19043 ] }
9,338
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
distribute
function distribute(uint128 totalAmount) internal { uint128 amount; castleTreasury += totalAmount / 20; //5% into castle treasury if (oldest == 0) findOldest(); if (oldest != noKing) { //pay 10% to the oldest dragon characters[oldest].value += totalAmount / 10; amount = totalAmount / 10...
/** * distributes the given amount among the surviving characters * @param totalAmount nthe amount to distribute */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 19174, 20437 ] }
9,339
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
collectFees
function collectFees(uint128 amount) public onlyOwner { uint collectedFees = getFees(); if (amount + 100 finney < collectedFees) { owner.transfer(amount); } }
/** * allows the owner to collect the accumulated fees * sends the given amount to the owner's address if the amount does not exceed the * fees (cannot touch the players' balances) minus 100 finney (ensure that oraclize fees can be paid) * @param amount the amount to be collected * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 20749, 20935 ] }
9,340
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
withdraw
function withdraw() public onlyOwner { uint256 ndcBalance = neverdieToken.balanceOf(this); if(ndcBalance > 0) assert(neverdieToken.transfer(owner, ndcBalance)); uint256 tptBalance = teleportToken.balanceOf(this); if(tptBalance > 0) assert(teleportToken.transfer(owner, tptBalance)); }
/** * withdraw NDC and TPT tokens */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 20984, 21308 ] }
9,341
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
payOut
function payOut() public onlyOwner { for (uint16 i = 0; i < numCharacters; i++) { characters[ids[i]].owner.transfer(characters[ids[i]].value); delete characters[ids[i]]; } delete ids; numCharacters = 0; }
/** * pays out the players. * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 21355, 21599 ] }
9,342
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
stop
function stop() public onlyOwner { withdraw(); payOut(); destroy(); }
/** * pays out the players and kills the game. * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 21665, 21755 ] }
9,343
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
distributeCastleLoot
function distributeCastleLoot(uint32 characterId) public onlyUser { require(castleTreasury > 0, "empty treasury"); Character archer = characters[characterId]; require(archer.characterType >= ARCHER_MIN_TYPE && archer.characterType <= ARCHER_MAX_TYPE, "only archers can access the castle treasury"); if(lastCa...
/* @dev distributes castle loot among archers */
Comment
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 22646, 23925 ] }
9,344
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
sellCharacter
function sellCharacter(uint32 characterId, uint16 characterIndex) public onlyUser { if (characterIndex >= numCharacters || characterId != ids[characterIndex]) characterIndex = getCharacterIndex(characterId); Character storage char = characters[characterId]; require(msg.sender == char.owner, "on...
/** * sell the character of the given id * throws an exception in case of a knight not yet teleported to the game * @param characterId the id of the character * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 24111, 24974 ] }
9,345
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
receiveApproval
function receiveApproval(address sender, uint256 value, address tokenContract, bytes callData) public { require(tokenContract == address(teleportToken), "everything is paid with teleport tokens"); bool forProtection = secondToUint32(callData) == 1 ? true : false; uint32 id; uint256 price; if (!forProtect...
/** * receive approval to spend some tokens. * used for teleport and protection. * @param sender the sender address * @param value the transferred value * @param tokenContract the address of the token contract * @param callData the data passed by the token contract * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 25279, 27563 ] }
9,346
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
teleportCharacter
function teleportCharacter(uint32 id) internal { // ensure we do not teleport twice require(teleported[id] == false, "already teleported"); teleported[id] = true; Character storage character = characters[id]; require(character.characterType > DRAGON_MAX_TYPE, "dragons do not need to b...
/** * Knights, balloons, wizards, and archers are only entering the game completely, when they are teleported to the scene * @param id the character id * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 27738, 28285 ] }
9,347
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
protectCharacter
function protectCharacter(uint32 id, uint8 lifes) internal { protection[id] = lifes; emit NewProtection(id, lifes); }
/** * adds protection to a character * @param id the character id * @param lifes the number of protections * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 28419, 28552 ] }
9,348
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
setLuckRound
function setLuckRound(uint8 rounds) public onlyOwner{ require(rounds >= 1 && rounds <= 100); luckRounds = rounds; }
/** * set the castle loot factor (percent of the luck factor being distributed) * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 28653, 28784 ] }
9,349
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getCharacter
function getCharacter(uint32 characterId) public view returns(uint8, uint128, address) { return (characters[characterId].characterType, characters[characterId].value, characters[characterId].owner); }
/** * returns the character of the given id * @param characterId the character id * @return the type, value and owner of the character * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 29008, 29219 ] }
9,350
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getCharacterIndex
function getCharacterIndex(uint32 characterId) constant public returns(uint16) { for (uint16 i = 0; i < ids.length; i++) { if (ids[i] == characterId) { return i; } } revert(); }
/** * returns the index of a character of the given id * @param characterId the character id * @return the character id * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 29366, 29587 ] }
9,351
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
get10Characters
function get10Characters(uint16 startIndex) constant public returns(uint32[10] characterIds, uint8[10] types, uint128[10] values, address[10] owners) { uint32 endIndex = startIndex + 10 > numCharacters ? numCharacters : startIndex + 10; uint8 j = 0; uint32 id; for (uint16 i = startIndex; i < endIndex; i++) ...
/** * returns 10 characters starting from a certain indey * @param startIndex the index to start from * @return 4 arrays containing the ids, types, values and owners of the characters * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 29798, 30335 ] }
9,352
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getNumDragons
function getNumDragons() constant public returns(uint16 numDragons) { for (uint8 i = DRAGON_MIN_TYPE; i <= DRAGON_MAX_TYPE; i++) numDragons += numCharactersXType[i]; }
/** * returns the number of dragons in the game * @return the number of dragons * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 30438, 30623 ] }
9,353
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getNumWizards
function getNumWizards() constant public returns(uint16 numWizards) { for (uint8 i = WIZARD_MIN_TYPE; i <= WIZARD_MAX_TYPE; i++) numWizards += numCharactersXType[i]; }
/** * returns the number of wizards in the game * @return the number of wizards * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 30726, 30911 ] }
9,354
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getNumArchers
function getNumArchers() constant public returns(uint16 numArchers) { for (uint8 i = ARCHER_MIN_TYPE; i <= ARCHER_MAX_TYPE; i++) numArchers += numCharactersXType[i]; }
/** * returns the number of archers in the game * @return the number of archers * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 31012, 31197 ] }
9,355
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getNumKnights
function getNumKnights() constant public returns(uint16 numKnights) { for (uint8 i = KNIGHT_MIN_TYPE; i <= KNIGHT_MAX_TYPE; i++) numKnights += numCharactersXType[i]; }
/** * returns the number of knights in the game * @return the number of knights * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 31300, 31485 ] }
9,356
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
getFees
function getFees() constant public returns(uint) { uint reserved = castleTreasury; for (uint16 j = 0; j < numCharacters; j++) reserved += characters[ids[j]].value; return address(this).balance - reserved; }
/** * @return the accumulated fees * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 31539, 31773 ] }
9,357
DragonKing
DragonKing.sol
0x8059d8d6b6053f99be81166c9a625fa9db8bf6e2
Solidity
DragonKing
contract DragonKing is Destructible { /** * @dev Throws if called by contract not a user */ modifier onlyUser() { require(msg.sender == tx.origin, "contracts cannot execute this method" ); _; } struct Character { uint8 characterType; uint128 value...
toUint32
function toUint32(bytes b) internal pure returns(uint32) { bytes32 newB; assembly { newB: = mload(0xa0) } return uint32(newB); }
/** * only works for bytes of length < 32 * @param b the byte input * @return the uint * */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://67949d9f96abb63cbad0550203e0ab8cd2695e80d6e3628f574cf82a32544f7a
{ "func_code_index": [ 31935, 32096 ] }
9,358
Mushroom_ZapIn_V1
contracts/Mushroom/Mushroom_ZapIn_V1.sol
0x84b95b8a9566fcb5ca5e6aef7c39b11166fd12c4
Solidity
Mushroom_ZapIn_V1
contract Mushroom_ZapIn_V1 is ZapInBaseV2 { mapping(address => bool) public approvedTargets; event zapIn(address sender, address pool, uint256 tokensRec); constructor(uint256 _goodwill, uint256 _affiliateSplit) public ZapBaseV1(_goodwill, _affiliateSplit) {} /** @no...
ZapIn
function ZapIn( address fromToken, uint256 amountIn, address toVault, uint256 minMVTokens, address intermediateToken, address swapTarget, bytes calldata swapData, address affiliate, bool shouldSellEntireBalance ) external payable stopInEmergency returns (uint256 tokensRecei...
/** @notice This function adds liquidity to Mushroom vaults with ETH or ERC20 tokens @param fromToken The token used for entry (address(0) if ether) @param amountIn The amount of fromToken to invest @param toVault Harvest vault address @param minMVTokens The minimum acceptable quantity vault tokens to receive...
NatSpecMultiLine
v0.5.17+commit.d19bba13
GNU GPLv2
bzzr://3ed888fd9b38624332ec59278c2938bd8fd51dd75b90b5574cf3b094568c1172
{ "func_code_index": [ 1064, 2200 ] }
9,359
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
totalSupply
function totalSupply() constant returns (uint256 supply) {}
/// @return total amount of tokens
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 60, 124 ] }
9,360
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
balanceOf
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @param _owner The address from which the balance will be retrieved /// @return The balance
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 232, 309 ] }
9,361
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
transfer
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 546, 623 ] }
9,362
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 946, 1042 ] }
9,363
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
approve
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 1326, 1407 ] }
9,364
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
Token
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// ...
allowance
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
/// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 1615, 1712 ] }
9,365
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
EtherMoney
contract EtherMoney is StandardToken { // CHANGE THIS. Update the contract name. /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core func...
EtherMoney
function EtherMoney() { balances[msg.sender] = 30000000000000000000000000000; totalSupply = 30000000000000000000000000000; name = "EtherMoney"; decimals = 18; symbol = "EMN"; ...
// This is a constructor function // which means the following function name has to match the contract name declared above
LineComment
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 856, 1350 ] }
9,366
EtherMoney
EtherMoney.sol
0x6f55a4ad49d5580ed9a03a2c4228d8c833401bca
Solidity
EtherMoney
contract EtherMoney is StandardToken { // CHANGE THIS. Update the contract name. /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core func...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually s...
/* Approves and then calls the receiving contract */
Comment
v0.4.24+commit.e67f0147
bzzr://29dc38a3e8df1ff819cabc9d1d569851b2cb2725548b09229daf4de5de1016c6
{ "func_code_index": [ 1951, 2756 ] }
9,367
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
name
function name() public view virtual override returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 779, 884 ] }
9,368
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
symbol
function symbol() public view virtual override returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 998, 1107 ] }
9,369
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decimals
function decimals() public view virtual override returns (uint8) { return 18; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 1741, 1839 ] }
9,370
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
totalSupply
function totalSupply() public view virtual override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 1899, 2012 ] }
9,371
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 2070, 2202 ] }
9,372
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 2410, 2590 ] }
9,373
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 2648, 2804 ] }
9,374
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 2946, 3120 ] }
9,375
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _ap...
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `...
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 3597, 4024 ] }
9,376
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 4428, 4648 ] }
9,377
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - sub...
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 5146, 5528 ] }
9,378
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 sende...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 6013, 6622 ] }
9,379
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 6899, 7242 ] }
9,380
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds ba...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 7570, 8069 ] }
9,381
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero a...
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 8502, 8853 ] }
9,382
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 9451, 9548 ] }
9,383
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
MilionTenshi
contract MilionTenshi is ERC20, Owned { uint256 public minSupply; address public beneficiary; bool public feesEnabled; mapping(address => bool) public isExcludedFromFee; event MinSupplyUpdated(uint256 oldAmount, uint256 newAmount); event BeneficiaryUpdated(address oldBeneficiary, addres...
_transfer
function _transfer( address sender, address recipient, uint256 amount ) internal override { require( recipient != address(this), "Cannot send tokens to token contract" ); if ( !feesEnabled || isExcludedFromFee[sender] || isExcludedFromFee[recip...
/** * @dev if fees are enabled, subtract 2.25% fee and send it to beneficiary * @dev after a certain threshold, try to swap collected fees automatically * @dev if automatic swap fails (or beneficiary does not implement swapTokens function) transfer should still succeed */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 1140, 2084 ] }
9,384
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
MilionTenshi
contract MilionTenshi is ERC20, Owned { uint256 public minSupply; address public beneficiary; bool public feesEnabled; mapping(address => bool) public isExcludedFromFee; event MinSupplyUpdated(uint256 oldAmount, uint256 newAmount); event BeneficiaryUpdated(address oldBeneficiary, addres...
burn
function burn(uint256 value) public { _burn(_msgSender(), value); require(totalSupply() >= minSupply, "total supply exceeds min supply"); }
/** * @notice allows to burn tokens from own balance * @dev only allows burning tokens until minimum supply is reached * @param value amount of tokens to burn */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 2451, 2618 ] }
9,385
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
MilionTenshi
contract MilionTenshi is ERC20, Owned { uint256 public minSupply; address public beneficiary; bool public feesEnabled; mapping(address => bool) public isExcludedFromFee; event MinSupplyUpdated(uint256 oldAmount, uint256 newAmount); event BeneficiaryUpdated(address oldBeneficiary, addres...
setMinSupply
function setMinSupply(uint256 _newMinSupply) public onlyOwner { emit MinSupplyUpdated(minSupply, _newMinSupply); minSupply = _newMinSupply; }
/** * @notice sets minimum supply of the token * @dev only callable by owner * @param _newMinSupply new minimum supply */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 2772, 2941 ] }
9,386
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
MilionTenshi
contract MilionTenshi is ERC20, Owned { uint256 public minSupply; address public beneficiary; bool public feesEnabled; mapping(address => bool) public isExcludedFromFee; event MinSupplyUpdated(uint256 oldAmount, uint256 newAmount); event BeneficiaryUpdated(address oldBeneficiary, addres...
setBeneficiary
function setBeneficiary(address _newBeneficiary) public onlyOwner { setExcludeFromFee(_newBeneficiary, true); emit BeneficiaryUpdated(beneficiary, _newBeneficiary); beneficiary = _newBeneficiary; }
/** * @notice sets recipient of transfer fee * @dev only callable by owner * @param _newBeneficiary new beneficiary */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 3097, 3331 ] }
9,387
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
MilionTenshi
contract MilionTenshi is ERC20, Owned { uint256 public minSupply; address public beneficiary; bool public feesEnabled; mapping(address => bool) public isExcludedFromFee; event MinSupplyUpdated(uint256 oldAmount, uint256 newAmount); event BeneficiaryUpdated(address oldBeneficiary, addres...
setFeesEnabled
function setFeesEnabled(bool _enabled) public onlyOwner { emit FeesEnabledUpdated(_enabled); feesEnabled = _enabled; }
/** * @notice sets whether account collects fees on token transfer * @dev only callable by owner * @param _enabled bool whether fees are enabled */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 3511, 3657 ] }
9,388
MilionTenshi
@openzeppelin/contracts/token/ERC20/IERC20.sol
0x73e87a637bf2ae2565cc07514cf2cf1aaf2fba5a
Solidity
MilionTenshi
contract MilionTenshi is ERC20, Owned { uint256 public minSupply; address public beneficiary; bool public feesEnabled; mapping(address => bool) public isExcludedFromFee; event MinSupplyUpdated(uint256 oldAmount, uint256 newAmount); event BeneficiaryUpdated(address oldBeneficiary, addres...
setExcludeFromFee
function setExcludeFromFee(address _account, bool _excluded) public onlyOwner { isExcludedFromFee[_account] = _excluded; emit ExcludedFromFeeUpdated(_account, _excluded); }
/** * @notice adds or removes an account that is exempt from fee collection * @dev only callable by owner * @param _account account to modify * @param _excluded new value */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://4429f4ad8cb268d65d861cba8496deb3c1952fca23f8aeb8c5ec4c88600ce5cc
{ "func_code_index": [ 3869, 4092 ] }
9,389
UltraToken
contracts/Ultra_IEO.sol
0xd13c7342e1ef687c5ad21b27c2b65d772cab5c8c
Solidity
UltraToken
contract UltraToken is ERC20Pausable, Ownable { using SafeMath for uint256; // using Math for uint256; string private _name = "Ultra Token"; string private _symbol = "UOS"; uint8 private _decimals = 4; // the token precision on UOS mainnet is 4, can be adjusted there as necessary. ...
//import 'openzeppelin-solidity/contracts/math/Math.sol';
LineComment
importBalance
function importBalance(address[] memory buyers, uint256[] memory tokens, string memory contractName) public onlyOwner whenNotPaused returns (bool) { require(buyers.length == tokens.length, "buyers and balances mismatch"); VestingContract storage vestingContract = _vestingContracts[contractName]; ...
// import balance for a group of user with a specific contract terms
LineComment
v0.5.9+commit.e560f70d
bzzr://241dbe33cfdd9eba72a7f16c4cc2eebb12bea4ec9690917c5ee82c6d8b04f9c1
{ "func_code_index": [ 4724, 5616 ] }
9,390
UltraToken
contracts/Ultra_IEO.sol
0xd13c7342e1ef687c5ad21b27c2b65d772cab5c8c
Solidity
UltraToken
contract UltraToken is ERC20Pausable, Ownable { using SafeMath for uint256; // using Math for uint256; string private _name = "Ultra Token"; string private _symbol = "UOS"; uint8 private _decimals = 4; // the token precision on UOS mainnet is 4, can be adjusted there as necessary. ...
//import 'openzeppelin-solidity/contracts/math/Math.sol';
LineComment
claimableToken
function claimableToken() public view returns (uint256) { BuyerInfo storage buyerInfo = _buyerInfos[msg.sender]; if(buyerInfo.claimed < buyerInfo.total) { VestingContract storage vestingContract = _vestingContracts[buyerInfo.contractName]; uint256 currentMonth = block.timestamp.sub(_deploy...
// the number of token can be claimed by the msg.sender at the moment
LineComment
v0.5.9+commit.e560f70d
bzzr://241dbe33cfdd9eba72a7f16c4cc2eebb12bea4ec9690917c5ee82c6d8b04f9c1
{ "func_code_index": [ 6163, 7298 ] }
9,391
FavorUSD
BurnableTokenWithBounds.sol
0xe59d7e8bdc197aaa626e154020e149a14faca03b
Solidity
BurnableTokenWithBounds
abstract contract BurnableTokenWithBounds is ReclaimerToken { /** * @dev Emitted when `value` tokens are burnt from one account (`burner`) * @param burner address which burned tokens * @param value amount of tokens burned */ event Burn(address indexed burner, uint256 value); /** * ...
/** * @title BurnableTokenWithBounds * @dev Burning functions as redeeming money from the system. * The platform will keep track of who burns coins, * and will send them back the equivalent amount of money (rounded down to the nearest cent). */
NatSpecMultiLine
burn
function burn(uint256 amount) external { _burn(msg.sender, amount); }
/** * @dev Destroys `amount` tokens from `msg.sender`, reducing the * total supply. * @param amount amount of tokens to burn * * Emits a {Transfer} event with `to` set to the zero address. * Emits a {Burn} event with `burner` set to `msg.sender` * * Requirements * * - `msg.sender` must have at least `amount` ...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://ab27100e8b3558a4e8d3f0d334f675339a375af40333a549acb1b2f03ffab0a0
{ "func_code_index": [ 968, 1053 ] }
9,392
FavorUSD
BurnableTokenWithBounds.sol
0xe59d7e8bdc197aaa626e154020e149a14faca03b
Solidity
BurnableTokenWithBounds
abstract contract BurnableTokenWithBounds is ReclaimerToken { /** * @dev Emitted when `value` tokens are burnt from one account (`burner`) * @param burner address which burned tokens * @param value amount of tokens burned */ event Burn(address indexed burner, uint256 value); /** * ...
/** * @title BurnableTokenWithBounds * @dev Burning functions as redeeming money from the system. * The platform will keep track of who burns coins, * and will send them back the equivalent amount of money (rounded down to the nearest cent). */
NatSpecMultiLine
setBurnBounds
function setBurnBounds(uint256 _min, uint256 _max) external onlyOwner { require(_min <= _max, "BurnableTokenWithBounds: min > max"); burnMin = _min; burnMax = _max; emit SetBurnBounds(_min, _max); }
/** * @dev Change the minimum and maximum amount that can be burned at once. * Burning may be disabled by setting both to 0 (this will not be done * under normal operation, but we can't add checks to disallow it without * losing a lot of flexibility since burning could also be as good as disabled * by setting the ...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://ab27100e8b3558a4e8d3f0d334f675339a375af40333a549acb1b2f03ffab0a0
{ "func_code_index": [ 1625, 1863 ] }
9,393
FavorUSD
BurnableTokenWithBounds.sol
0xe59d7e8bdc197aaa626e154020e149a14faca03b
Solidity
BurnableTokenWithBounds
abstract contract BurnableTokenWithBounds is ReclaimerToken { /** * @dev Emitted when `value` tokens are burnt from one account (`burner`) * @param burner address which burned tokens * @param value amount of tokens burned */ event Burn(address indexed burner, uint256 value); /** * ...
/** * @title BurnableTokenWithBounds * @dev Burning functions as redeeming money from the system. * The platform will keep track of who burns coins, * and will send them back the equivalent amount of money (rounded down to the nearest cent). */
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual override { require(amount >= burnMin, "BurnableTokenWithBounds: below min burn bound"); require(amount <= burnMax, "BurnableTokenWithBounds: exceeds max burn bound"); super._burn(account, amount); emit Burn(account, amount); }
/** * @dev Checks if amount is within allowed burn bounds and * destroys `amount` tokens from `account`, reducing the * total supply. * @param account account to burn tokens for * @param amount amount of tokens to burn * * Emits a {Burn} event */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://ab27100e8b3558a4e8d3f0d334f675339a375af40333a549acb1b2f03ffab0a0
{ "func_code_index": [ 2156, 2488 ] }
9,394
Minings
J\contracts\Minings(MININGS).sol
0xd108fc421d7e22819ef3307903ee5950fd716415
Solidity
Minings
contract Minings is ERC20 { string public constant name = "Minings"; string public constant symbol = "MININGS"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender,...
renounceOwnership
function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); }
/** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */
NatSpecMultiLine
v0.5.8+commit.23d335f2
MIT
bzzr://4a464ec22eebac100e03dd18189f807780d2bc6e01e39e81d8fa202c76d761ed
{ "func_code_index": [ 960, 1089 ] }
9,395
Minings
J\contracts\Minings(MININGS).sol
0xd108fc421d7e22819ef3307903ee5950fd716415
Solidity
Minings
contract Minings is ERC20 { string public constant name = "Minings"; string public constant symbol = "MININGS"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender,...
transferOwnership
function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.5.8+commit.23d335f2
MIT
bzzr://4a464ec22eebac100e03dd18189f807780d2bc6e01e39e81d8fa202c76d761ed
{ "func_code_index": [ 1254, 1370 ] }
9,396
Minings
J\contracts\Minings(MININGS).sol
0xd108fc421d7e22819ef3307903ee5950fd716415
Solidity
Minings
contract Minings is ERC20 { string public constant name = "Minings"; string public constant symbol = "MININGS"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender,...
_transferOwnership
function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
/** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.5.8+commit.23d335f2
MIT
bzzr://4a464ec22eebac100e03dd18189f807780d2bc6e01e39e81d8fa202c76d761ed
{ "func_code_index": [ 1508, 1719 ] }
9,397
Minings
J\contracts\Minings(MININGS).sol
0xd108fc421d7e22819ef3307903ee5950fd716415
Solidity
Minings
contract Minings is ERC20 { string public constant name = "Minings"; string public constant symbol = "MININGS"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender,...
pause
function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.5.8+commit.23d335f2
MIT
bzzr://4a464ec22eebac100e03dd18189f807780d2bc6e01e39e81d8fa202c76d761ed
{ "func_code_index": [ 2300, 2408 ] }
9,398
Minings
J\contracts\Minings(MININGS).sol
0xd108fc421d7e22819ef3307903ee5950fd716415
Solidity
Minings
contract Minings is ERC20 { string public constant name = "Minings"; string public constant symbol = "MININGS"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender,...
unpause
function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.5.8+commit.23d335f2
MIT
bzzr://4a464ec22eebac100e03dd18189f807780d2bc6e01e39e81d8fa202c76d761ed
{ "func_code_index": [ 2496, 2606 ] }
9,399