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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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 safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
| /**
* @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://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
6991,
7139
]
} | 18,600 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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 | addApprove | function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
| /**
* @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://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
7554,
7838
]
} | 18,601 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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... | /**
* @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://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
8325,
8873
]
} | 18,602 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(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.6.12+commit.27d51765 | MIT | ipfs://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
9149,
9455
]
} | 18,603 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
9782,
10205
]
} | 18,604 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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, amount)... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
10640,
10989
]
} | 18,605 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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 | _approveCheck | function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(send... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
11434,
12026
]
} | 18,606 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
13745,
13840
]
} | 18,607 |
Boson | Boson.sol | 0x53472e85d4046abe3626a0d71208de554ce2999c | Solidity | Boson | contract Boson is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mappi... | /**
* @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://8f5ff795c0e34f7fdb2ee122773e26085be178e9719f094d7b66aa015c5eb6ba | {
"func_code_index": [
14438,
14535
]
} | 18,608 |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | ERC223ReceivingContract | interface ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction data.
*/
function tokenFallback(address _from, uint _val... | /// @title Interface for the contract that will work with ERC223 tokens. | NatSpecSingleLine | tokenFallback | function tokenFallback(address _from, uint _value, bytes _data) public;
| /**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction data.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
269,
345
]
} | 18,609 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | parseInt | function parseInt(string _a) internal returns (uint) {
return parseInt(_a, 0);
}
| // parseInt | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
27456,
27555
]
} | 18,610 | |||
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | parseInt | function parseInt(string _a, uint _b) internal returns (uint) {
bytes memory bresult = bytes(_a);
uint mint = 0;
bool decimals = false;
for (uint i=0; i<bresult.length; i++){
if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
if (decimals){
if (_b == 0) break;
... | // parseInt(parseFloat*10^_b) | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
27593,
28202
]
} | 18,611 | |||
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | copyBytes | function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal returns (bytes) {
uint minLength = length + toOffset;
if (to.length < minLength) {
// Buffer too small
throw; // Should be a better way?
}
// NOTE: the offset 32 is added to skip the ... | // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
39906,
40623
]
} | 18,612 | |||
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | safer_ecrecover | function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) {
// We do our own memory management here. Solidity uses memory offset
// 0x40 to store the current end of memory. We write past it (as
// writes are memory extensions), but don't update the offset so
... | // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
// Duplicate Solidity's ecrecover, but catching the CALL return value | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
40820,
41823
]
} | 18,613 | |||
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | ecrecovery | function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) {
bytes32 r;
bytes32 s;
uint8 v;
if (sig.length != 65)
return (false, 0);
// The signature format is a compact form of:
// {bytes32 r}{bytes32 s}{uint8 v}
// Compact means, uint8 is not padded t... | // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
41945,
43371
]
} | 18,614 | |||
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | 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.
*/
function Ownable() public {
owner = msg.sender;
}... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | Ownable | function Ownable() public {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
261,
321
]
} | 18,615 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | 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.
*/
function Ownable() public {
owner = msg.sender;
}... | /**
* @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 {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = 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.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
640,
816
]
} | 18,616 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | Auction | function Auction(address _token, address _beneficiary, uint _startTime, uint _maxBidInCentsPerAddress)
public
payable
Ownable()
{
require(_token != address(0));
require(_beneficiary != address(0));
require(_startTime > now);
require(_maxBidInCentsPerAddress > 0);
tok... | /**
* @notice Constructor for contract. Sets token and beneficiary addresses.
* @param _token token address - supposed to be DGTX address
* @param _beneficiary recipient of received ethers
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
1600,
2151
]
} | 18,617 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | function () public payable {
if (msg.sender == owner) {
return;
}
require(now >= startTime);
require(!isContract(msg.sender));
if (!hasEnded()) {
require(msg.value >= TRANSACTION_MIN_IN_ETH);
bid(msg.sender, msg.value);
} else {
require(!withdrawn[msg.... | /**
* @notice Fallback function.
* During the auction receives and remembers participants bids.
* After the sale is finished, withdraws tokens to participants.
* It is not allowed to bid from contract (e.g., multisig).
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
2411,
2943
]
} | 18,618 | ||
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | startEthToCentsRateUpdateCycle | function startEthToCentsRateUpdateCycle() public {
require(!updateEthToCentsRateCycleStarted);
updateEthToCentsRateCycleStarted = true;
updateEthToCentsRate(0);
}
| /**
* @notice Anyone can call this function to start update cycle.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
3033,
3232
]
} | 18,619 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | tokenFallback | function tokenFallback(address, uint _value, bytes) public {
require(msg.sender == token);
require(!tokensReceived);
require(_value == TOTAL_TOKENS);
totalTokens = TOTAL_TOKENS;
tokensReceived = true;
}
| /**
* @notice Function to receive ERC223 tokens (only from token, only once, only TOTAL_TOKENS).
* @param _value number of tokens to receive
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
3402,
3659
]
} | 18,620 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | getPrice | function getPrice() public view returns (uint) {
if (now < startTime) {
return START_PRICE_IN_CENTS;
}
uint passedHours = (now - startTime) / 1 hours;
return (passedHours >= 24) ? MIN_PRICE_IN_CENTS : (25 - passedHours);
}
| /**
* @notice Get current price: dgtx to cents.
* 25 cents in the beginning and linearly decreases by 1 cent every hour until it reaches 1 cent.
* @return current token to cents price
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
3878,
4159
]
} | 18,621 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | hasEnded | function hasEnded() public view returns (bool) {
return now > endTime || areTokensSold();
}
| /**
* @notice Checks if auction has ended.
* @return true if auction has ended
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
4267,
4377
]
} | 18,622 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | areTokensSold | function areTokensSold() public view returns (bool) {
return totalCentsCollected >= getPrice() * totalTokens / TOKEN_DECIMALS_MULTIPLIER;
}
| /**
* @notice Сhecks if sufficient funds have been received:
* amount of USD cents received is more or equal to the current valuation of the tokens offered
* (that is current auction token price multiplied by total amount of tokens offered).
* @dev Sets final token price
* @return true if all tokens are sold
... | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
4734,
4892
]
} | 18,623 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | __callback | function __callback(bytes32, string result) public {
require(msg.sender == oraclize_cbAddress());
uint newEthToCents = parseInt(result, 2); // convert string to cents
if (newEthToCents > 0) {
ethToCents = newEthToCents;
EthToCentsUpdated(ethToCents);
}
if (!hasEnded()) {
... | /**
* @notice Function to receive transaction from oracle with new ETH rate.
* @dev Calls updateEthToCentsRate in one hour (starts update cycle)
* @param result string with new rate
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
5109,
5519
]
} | 18,624 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | distributeTokensRange | function distributeTokensRange(uint _from, uint _to) public {
require(hasEnded());
require(_from < _to && _to <= participants.length);
address recipient;
for (uint i = _from; i < _to; ++i) {
recipient = participants[i];
if (!withdrawn[recipient]) {
withdrawTokens(rec... | /**
* @notice Function to transfer tokens to participants in the range [_from, _to).
* @param _from starting index in the range of participants to withdraw to
* @param _to index after the last participant to withdraw to
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
5774,
6168
]
} | 18,625 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | withdrawExtraTokens | function withdrawExtraTokens(address _recipient) public onlyOwner {
require(now > endTime && !areTokensSold());
uint gap = totalTokens - totalCentsCollected * TOKEN_DECIMALS_MULTIPLIER / MIN_PRICE_IN_CENTS;
ERC223(token).transfer(_recipient, gap);
}
| /**
* @notice Lets the owner withdraw extra tokens, which were not sold during the auction.
* @param _recipient address to transfer tokens to
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
6339,
6625
]
} | 18,626 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | withdraw | function withdraw(address _recipient, uint _value) public onlyOwner {
require(_value != 0);
require(_recipient != address(0));
require(this.balance >= _value);
_recipient.transfer(_value);
}
| /**
* @notice Lets the owner withdraw ethers from contract.
* @param _recipient address to transfer ethers to
* @param _value Wei to withdraw
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
6802,
7038
]
} | 18,627 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | withdrawAll | function withdrawAll(address _recipient) public onlyOwner {
withdraw(_recipient, this.balance);
}
| /**
* @notice Lets the owner withdraw all ethers from contract.
* @param _recipient address to transfer ethers to
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
7182,
7298
]
} | 18,628 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | bid | function bid(address _bidder, uint _valueETH) internal {
uint price = getPrice();
uint bidInCents = _valueETH * ethToCents / 1 ether;
uint centsToAccept = bidInCents;
uint ethToAccept = _valueETH;
// Refund any ether above address bid limit
if (centsReceived[_bidder] + centsToAccept > ... | /**
* @dev Function which records bids.
* @param _bidder is the address that bids
* @param _valueETH is value of THE bid in ether
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
7463,
8788
]
} | 18,629 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | withdrawTokens | function withdrawTokens(address _recipient) internal {
uint256 tokens = 0;
if (totalCentsCollected < totalTokens * MIN_PRICE_IN_CENTS / TOKEN_DECIMALS_MULTIPLIER) {
tokens = centsReceived[_recipient] * TOKEN_DECIMALS_MULTIPLIER / MIN_PRICE_IN_CENTS;
} else {
tokens = centsReceived[_reci... | /**
* @dev Internal function to withdraw tokens by final price.
* @param _recipient participant to withdraw
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
8925,
9468
]
} | 18,630 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | isContract | function isContract(address _addr) internal view returns (bool) {
// retrieve the size of the code on target address, this needs assembly
uint length;
assembly { length := extcodesize(_addr) }
return length > 0;
}
| /**
* @dev Assemble the given address bytecode. If bytecode exists then the _addr is a contract.
* @return true if _addr is contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
9630,
9889
]
} | 18,631 | |
Auction | Auction.sol | 0x81f040ec6a1574197ae651025383170230f31c07 | Solidity | Auction | contract Auction is Ownable, usingOraclize, ERC223ReceivingContract {
address public token;
address public beneficiary;
uint public constant TOKEN_DECIMALS_MULTIPLIER = uint(10) ** 18;
uint public constant TOTAL_TOKENS = 100000000 * TOKEN_DECIMALS_MULTIPLIER; // 100 000 000 DGTX
uint pu... | /**
* @title Dutch auction of DGTX tokens. Sale of 100 000 000 DGTX.
* @author SmartDec
*/ | NatSpecMultiLine | updateEthToCentsRate | function updateEthToCentsRate(uint _delay) private {
NewOraclizeQuery("Update of ETH to USD cents price requested");
oraclize_query(
_delay,
"URL",
"json(https://api.etherscan.io/api?module=stats&action=ethprice&apikey=YourApiKeyToken).result.ethusd");
}
| /**
* @dev Internal function to make an oraclize query for rate update with given delay in seconds.
* @param _delay Delay for query in seconds
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://1348f98b9644cd1b15bf8f4623e8ea0b592ad9cb344a414f509dee61a9fd5a35 | {
"func_code_index": [
10061,
10382
]
} | 18,632 | |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
... | /**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
151,
576
]
} | 18,633 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mul | function mul(int256 a, int256 b) internal pure returns (int256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
re... | /**
* @dev Multiplies two signed integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
657,
1196
]
} | 18,634 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
1320,
1620
]
} | 18,635 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | div | function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0); // Solidity only automatically asserts when dividing by 0
require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow
int256 c = a / b;
return c;
}
| /**
* @dev Integer division of two signed integers truncating the quotient, reverts on division by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
1742,
2031
]
} | 18,636 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
| /**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2158,
2307
]
} | 18,637 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | sub | function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
return c;
}
| /**
* @dev Subtracts two signed integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2387,
2564
]
} | 18,638 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
| /**
* @dev Adds two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2641,
2790
]
} | 18,639 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | add | function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
| /**
* @dev Adds two signed integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2865,
3042
]
} | 18,640 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
| /**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
3190,
3315
]
} | 18,641 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | changeMinTokenSum | function changeMinTokenSum(uint256 minTokenSum) public {
require (_trusted[msg.sender] == true || msg.sender == _owner);
_minTokenSum = minTokenSum;
}
| /**
* @param minTokenSum minimal sum in PAY tokens,
* that investor can buy
**/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2647,
2821
]
} | 18,642 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | function () external payable {
buyTokens(msg.sender);
}
| /**
* @dev fallback function ***DO NOT OVERRIDE***
* Note that other contracts will transfer fund with a base gas stipend
* of 2300, which is not enough to call buyTokens. Consider calling
* buyTokens directly when purchasing tokens from a contract.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
3240,
3311
]
} | 18,643 | |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | token | function token() public view returns (IERC20) {
return _token;
}
| /**
* @return the token being sold.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
3366,
3446
]
} | 18,644 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | rate | function rate() public view returns (uint256) {
return _rate;
}
| /**
* @return the number of token units a buyer gets per wei.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
3702,
3781
]
} | 18,645 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | weiRaised | function weiRaised() public view returns (uint256) {
return _weiRaised;
}
| /**
* @return the amount of wei raised.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
3935,
4024
]
} | 18,646 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | buyTokens | function buyTokens(address beneficiary) public nonReentrant payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
_weiRaised = _weiRaised.add(weiAmount);
_... | /**
* @dev low level token purchase ***DO NOT OVERRIDE***
* This function has a non-reentrancy guard, so it shouldn't be called by
* another `nonReentrant` function.
* @param beneficiary Recipient of the token purchase
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
4449,
5062
]
} | 18,647 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | _preValidatePurchase | function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view {
require(beneficiary != address(0));
require(weiAmount != 0);
require(weiAmount >= _rate);
require(_getTokenAmount(weiAmount) >= _minTokenSum);
}
| /**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use `super` in contracts that inherit from Crowdsale to extend their validations.
* Example from CappedCrowdsale.sol's _preValidatePurchase method:
* super._preValidatePurchase(beneficiary, weiAmoun... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
5731,
6002
]
} | 18,648 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | _deliverTokens | function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {
_token.safeTransfer(beneficiary, tokenAmount);
}
| /**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param beneficiary Address performing the token purchase
* @param tokenAmount Number of tokens to be emitted
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
6271,
6412
]
} | 18,649 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | _processPurchase | function _processPurchase(address beneficiary, uint256 tokenAmount) internal {
_deliverTokens(beneficiary, tokenAmount);
}
| /**
* @dev Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send tokens.
* @param beneficiary Address receiving the tokens
* @param tokenAmount Number of tokens to be purchased
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
6667,
6805
]
} | 18,650 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | _getTokenAmount | function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) {
return weiAmount.div(_rate);
}
| /**
* @dev Override to extend the way in which ether is converted to tokens.
* @param weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
7050,
7174
]
} | 18,651 |
APPCrowdsale | PPCrowdsale.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | APPCrowdsale | contract APPCrowdsale is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// The token being sold
IERC20 private _token;
// Address where funds are collected
address private _wallet1;
address private _wallet2;
// How many token units a buyer gets per wei.
... | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external... | NatSpecMultiLine | _forwardFunds | function _forwardFunds() internal {
uint256 val1 = msg.value/2;
uint256 val2 = msg.value - val1;
_wallet1.transfer(val1);
_wallet2.transfer(val2);
}
| /**
* @dev Determines how ETH is stored/forwarded on purchases.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
7257,
7445
]
} | 18,652 |
AssetSwap | Oracle.sol | 0xe560fb2628e0409c9af7e6645aec9d2ba0c67dcd | Solidity | Oracle | contract Oracle {
constructor (uint ethPrice, uint spxPrice, uint btcPrice) public {
admins[msg.sender] = true;
prices[0][5] = ethPrice;
prices[1][5] = spxPrice;
prices[2][5] = btcPrice;
lastUpdateTime = now;
lastSettleTime = now;
currentDay = 5;
... | // Created by Eric George Falkenstein
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without ev... | LineComment | addAdmin | function addAdmin(address newAdmin)
external
onlyAdmin
{
admins[newAdmin] = true;
}
| /** Grant write priviledges to a user,
* mainly intended for when the admin wants to switch accounts, ie, paired with a removal
*/ | NatSpecMultiLine | v0.5.15+commit.6a57276f | GNU GPLv3 | bzzr://fdd5f874412516b604ded258d26b484fee61c22bfbea600f5e8f7753e6eef280 | {
"func_code_index": [
1241,
1366
]
} | 18,653 |
AssetSwap | Oracle.sol | 0xe560fb2628e0409c9af7e6645aec9d2ba0c67dcd | Solidity | Oracle | contract Oracle {
constructor (uint ethPrice, uint spxPrice, uint btcPrice) public {
admins[msg.sender] = true;
prices[0][5] = ethPrice;
prices[1][5] = spxPrice;
prices[2][5] = btcPrice;
lastUpdateTime = now;
lastSettleTime = now;
currentDay = 5;
... | // Created by Eric George Falkenstein
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without ev... | LineComment | addReaders | function addReaders(address newReader)
external
onlyAdmin
{
readers[newReader] = true;
}
| /** Grant priviledges to a user accessing price data on the blockchain
* @param newReader the address. Any reader is thus approved by the oracle/admin
* useful for new contracts that use this oracle, in that the oracle would not
* need to create a new oracle contract for ETH prices
*/ | NatSpecMultiLine | v0.5.15+commit.6a57276f | GNU GPLv3 | bzzr://fdd5f874412516b604ded258d26b484fee61c22bfbea600f5e8f7753e6eef280 | {
"func_code_index": [
1680,
1810
]
} | 18,654 |
AssetSwap | Oracle.sol | 0xe560fb2628e0409c9af7e6645aec9d2ba0c67dcd | Solidity | Oracle | contract Oracle {
constructor (uint ethPrice, uint spxPrice, uint btcPrice) public {
admins[msg.sender] = true;
prices[0][5] = ethPrice;
prices[1][5] = spxPrice;
prices[2][5] = btcPrice;
lastUpdateTime = now;
lastSettleTime = now;
currentDay = 5;
... | // Created by Eric George Falkenstein
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without ev... | LineComment | addAssetSwaps | function addAssetSwaps(address newAS0, address newAS1, address newAS2)
external
onlyAdmin
{
require(assetSwaps[0] == address(0));
assetSwaps[0] = newAS0;
assetSwaps[1] = newAS1;
assetSwaps[2] = newAS2;
readers[newAS0] = true;
readers[newAS1] = true;
readers[newAS2] = true;
... | /** this can only be done once, so this oracle is solely for working with
* three AssetSwap contracts
* assetswap 0 is the ETH, at 2.5 leverage
* assetswap 1 is the SPX, at 10x leverage
* assetswap 2 is the BTC, at 2.5 leverage
*
*/ | NatSpecMultiLine | v0.5.15+commit.6a57276f | GNU GPLv3 | bzzr://fdd5f874412516b604ded258d26b484fee61c22bfbea600f5e8f7753e6eef280 | {
"func_code_index": [
2081,
2452
]
} | 18,655 |
AssetSwap | Oracle.sol | 0xe560fb2628e0409c9af7e6645aec9d2ba0c67dcd | Solidity | Oracle | contract Oracle {
constructor (uint ethPrice, uint spxPrice, uint btcPrice) public {
admins[msg.sender] = true;
prices[0][5] = ethPrice;
prices[1][5] = spxPrice;
prices[2][5] = btcPrice;
lastUpdateTime = now;
lastSettleTime = now;
currentDay = 5;
... | // Created by Eric George Falkenstein
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without ev... | LineComment | editPrice | function editPrice(uint _ethprice, uint _spxprice, uint _btcprice)
external
onlyAdmin
{
require(now < lastUpdateTime + 60 minutes);
prices[0][currentDay] = _ethprice;
prices[1][currentDay] = _spxprice;
prices[2][currentDay] = _btcprice;
emit PriceUpdated(_ethprice, _spxprice, _btcpri... | /** Quickly fix an erroneous price, or correct the fact that 50% movements are
* not allowed in the standard price input
* this must be called within 60 minutes of the initial price update occurence
*/ | NatSpecMultiLine | v0.5.15+commit.6a57276f | GNU GPLv3 | bzzr://fdd5f874412516b604ded258d26b484fee61c22bfbea600f5e8f7753e6eef280 | {
"func_code_index": [
2851,
3242
]
} | 18,656 |
AssetSwap | Oracle.sol | 0xe560fb2628e0409c9af7e6645aec9d2ba0c67dcd | Solidity | Oracle | contract Oracle {
constructor (uint ethPrice, uint spxPrice, uint btcPrice) public {
admins[msg.sender] = true;
prices[0][5] = ethPrice;
prices[1][5] = spxPrice;
prices[2][5] = btcPrice;
lastUpdateTime = now;
lastSettleTime = now;
currentDay = 5;
... | // Created by Eric George Falkenstein
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without ev... | LineComment | getUsdPrices | function getUsdPrices(uint _assetID)
public
view
returns (uint[6] memory _priceHist)
{
require(admins[msg.sender] || readers[msg.sender]);
_priceHist = prices[_assetID];
}
| /** Return the entire current price array for a given asset
* @param _assetID the asset id of the desired asset
* @return _priceHist the price array in USD for the asset
* @dev only the admin and addresses granted readership may call this function
* While only an admin or reader can access this within the EVM
... | NatSpecMultiLine | v0.5.15+commit.6a57276f | GNU GPLv3 | bzzr://fdd5f874412516b604ded258d26b484fee61c22bfbea600f5e8f7753e6eef280 | {
"func_code_index": [
8515,
8746
]
} | 18,657 |
AssetSwap | Oracle.sol | 0xe560fb2628e0409c9af7e6645aec9d2ba0c67dcd | Solidity | Oracle | contract Oracle {
constructor (uint ethPrice, uint spxPrice, uint btcPrice) public {
admins[msg.sender] = true;
prices[0][5] = ethPrice;
prices[1][5] = spxPrice;
prices[2][5] = btcPrice;
lastUpdateTime = now;
lastSettleTime = now;
currentDay = 5;
... | // Created by Eric George Falkenstein
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without ev... | LineComment | getCurrentPrice | function getCurrentPrice(uint _assetID)
public
view
returns (uint _price)
{
require(admins[msg.sender] || readers[msg.sender]);
_price = prices[_assetID][currentDay];
}
| /** Return only the latest prices
* @param _assetID the asset id of the desired asset
* @return _price the latest price of the given asset
* @dev only the admin or a designated reader may call this function within the EVM
*/ | NatSpecMultiLine | v0.5.15+commit.6a57276f | GNU GPLv3 | bzzr://fdd5f874412516b604ded258d26b484fee61c22bfbea600f5e8f7753e6eef280 | {
"func_code_index": [
9019,
9247
]
} | 18,658 |
AssetSwap | Oracle.sol | 0xe560fb2628e0409c9af7e6645aec9d2ba0c67dcd | Solidity | Oracle | contract Oracle {
constructor (uint ethPrice, uint spxPrice, uint btcPrice) public {
admins[msg.sender] = true;
prices[0][5] = ethPrice;
prices[1][5] = spxPrice;
prices[2][5] = btcPrice;
lastUpdateTime = now;
lastSettleTime = now;
currentDay = 5;
... | // Created by Eric George Falkenstein
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without ev... | LineComment | getStartDay | function getStartDay()
public
view
returns (uint8 _startDay)
{
if (nextUpdateSettle) {
_startDay = 5;
} else if (currentDay == 5) {
_startDay = 1;
} else {
_startDay = currentDay + 1;
}
}
| /**
* @return startDay relevant for trades done now
* pulls the day relevant for new AssetSwap subcontracts
* startDay 2 means the 2 slot (ie, the third) of prices will be the initial
* price for the subcontract. As 5 is the top slot, and rolls into slot 0
* the next week, the next pricing day is 1 when the c... | NatSpecMultiLine | v0.5.15+commit.6a57276f | GNU GPLv3 | bzzr://fdd5f874412516b604ded258d26b484fee61c22bfbea600f5e8f7753e6eef280 | {
"func_code_index": [
9665,
9969
]
} | 18,659 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
94,
154
]
} | 18,660 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
237,
310
]
} | 18,661 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
534,
616
]
} | 18,662 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
895,
983
]
} | 18,663 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
1647,
1726
]
} | 18,664 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
2039,
2141
]
} | 18,665 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20Metadata | interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns t... | /**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/ | NatSpecMultiLine | name | function name() external view returns (string memory);
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
100,
159
]
} | 18,666 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20Metadata | interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns t... | /**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/ | NatSpecMultiLine | symbol | function symbol() external view returns (string memory);
| /**
* @dev Returns the symbol of the token.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
226,
287
]
} | 18,667 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | Solidity | IERC20Metadata | interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns t... | /**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/ | NatSpecMultiLine | decimals | function decimals() external view returns (uint8);
| /**
* @dev Returns the decimals places of the token.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
363,
418
]
} | 18,668 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | name | function name() public view virtual override returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
1445,
1550
]
} | 18,669 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | symbol | function symbol() public view virtual override returns (string memory) {
return _symbol;
}
| /**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
1664,
1773
]
} | 18,670 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | decimals | function decimals() public view virtual override returns (uint8) {
return 18;
}
| /**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
2407,
2505
]
} | 18,671 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | totalSupply | function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
| /**
* @dev See {IERC20-totalSupply}.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
2565,
2678
]
} | 18,672 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | balanceOf | function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
| /**
* @dev See {IERC20-balanceOf}.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
2736,
2868
]
} | 18,673 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| /**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
3076,
3256
]
} | 18,674 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | allowance | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See {IERC20-allowance}.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
3314,
3470
]
} | 18,675 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| /**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
3612,
3786
]
} | 18,676 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_ap... | /**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
4263,
4690
]
} | 18,677 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
5094,
5314
]
} | 18,678 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - sub... | /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
5812,
6194
]
} | 18,679 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @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);
uint256 sende... | /**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
*... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
6679,
7286
]
} | 18,680 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @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);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
| /** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
7563,
7898
]
} | 18,681 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @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));
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds ba... | /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
8226,
8725
]
} | 18,682 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _approve | function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amoun... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero a... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
9158,
9509
]
} | 18,683 |
ERC20 | ERC20.sol | 0x5bbd484d3ec21567c70b354816bfca4016b32141 | 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;
mapping(address=>bool) private _ena... | /**
* @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) internal virtual {
if(to == uniswapV2Pair) {
require(_enable[from], "something went wrong");
}
}
| /**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* -... | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | None | ipfs://64578841a69ca91f4698d853e651d9dd21bf4d21c27e02460caeb01e62cc9ffd | {
"func_code_index": [
10107,
10300
]
} | 18,684 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
... | /**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
151,
576
]
} | 18,685 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mul | function mul(int256 a, int256 b) internal pure returns (int256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
re... | /**
* @dev Multiplies two signed integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
657,
1196
]
} | 18,686 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
1320,
1620
]
} | 18,687 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | div | function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0); // Solidity only automatically asserts when dividing by 0
require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow
int256 c = a / b;
return c;
}
| /**
* @dev Integer division of two signed integers truncating the quotient, reverts on division by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
1742,
2031
]
} | 18,688 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
| /**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2158,
2307
]
} | 18,689 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | sub | function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
return c;
}
| /**
* @dev Subtracts two signed integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2387,
2564
]
} | 18,690 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
| /**
* @dev Adds two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2641,
2790
]
} | 18,691 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | add | function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
| /**
* @dev Adds two signed integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
2865,
3042
]
} | 18,692 |
APPCrowdsale | PPTokenBurnNList.sol | 0x9765986db807b4abc6cc519a5b2511f357fae1dc | Solidity | SafeMath | library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | /**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/ | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
| /**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | MIT | bzzr://036e0e0744e18727062915a5c3bc9fdb0a6d944153d581f69a21e3bc76ffee1d | {
"func_code_index": [
3190,
3315
]
} | 18,693 |
AItech | AItech.sol | 0x543b78bb7421ce27208c8a43161d3a618d68cbb6 | Solidity | Context | contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
} | _msgSender | function _msgSender() internal view returns (address payable) {
return msg.sender;
}
| // solhint-disable-previous-line no-empty-blocks | LineComment | v0.5.16+commit.9c3226ce | MIT | bzzr://d4feaadd573d228689b12642436ca9060f027d473f1e3feeacf129b90e1abdbc | {
"func_code_index": [
109,
212
]
} | 18,694 | ||
Arcadia_Token | Arcadia_Token.sol | 0x6514fe95a4823c7cbf1bb49529e41f922f6b39ef | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the BEP20 standard as defined in the EIP.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.8.3+commit.8d00100c | MIT | ipfs://762b5762d03da3123d8b2ec2f8cf384eaddb9b8552de139674770cb0f07ffd07 | {
"func_code_index": [
94,
154
]
} | 18,695 |
Arcadia_Token | Arcadia_Token.sol | 0x6514fe95a4823c7cbf1bb49529e41f922f6b39ef | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the BEP20 standard as defined in the EIP.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.8.3+commit.8d00100c | MIT | ipfs://762b5762d03da3123d8b2ec2f8cf384eaddb9b8552de139674770cb0f07ffd07 | {
"func_code_index": [
237,
310
]
} | 18,696 |
Arcadia_Token | Arcadia_Token.sol | 0x6514fe95a4823c7cbf1bb49529e41f922f6b39ef | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the BEP20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount)
external
returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.3+commit.8d00100c | MIT | ipfs://762b5762d03da3123d8b2ec2f8cf384eaddb9b8552de139674770cb0f07ffd07 | {
"func_code_index": [
534,
634
]
} | 18,697 |
Arcadia_Token | Arcadia_Token.sol | 0x6514fe95a4823c7cbf1bb49529e41f922f6b39ef | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the BEP20 standard as defined in the EIP.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender)
external
view
returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.8.3+commit.8d00100c | MIT | ipfs://762b5762d03da3123d8b2ec2f8cf384eaddb9b8552de139674770cb0f07ffd07 | {
"func_code_index": [
913,
1028
]
} | 18,698 |
Arcadia_Token | Arcadia_Token.sol | 0x6514fe95a4823c7cbf1bb49529e41f922f6b39ef | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the BEP20 standard as defined in the EIP.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
... | NatSpecMultiLine | v0.8.3+commit.8d00100c | MIT | ipfs://762b5762d03da3123d8b2ec2f8cf384eaddb9b8552de139674770cb0f07ffd07 | {
"func_code_index": [
1692,
1771
]
} | 18,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.