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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | approve | function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
| /**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1217,
1366
]
} | 12,500 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
| /**
* @dev See `IERC20.transferFrom`.
*
* Emits an `Approval` event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of `ERC20`;
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `value`.
* -... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1819,
2075
]
} | 12,501 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be t... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
2466,
2673
]
} | 12,502 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
| /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be t... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
3156,
3373
]
} | 12,503 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _ba... | /**
* @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.
* - `recipie... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
3843,
4269
]
} | 12,504 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | _mint | function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].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.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
4535,
4841
]
} | 12,505 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | _burn | function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
| /**
* @dev Destoys `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.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
5156,
5460
]
} | 12,506 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | _approve | function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
| /**
* @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 address.
... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
5881,
6214
]
} | 12,507 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | _burnFrom | function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
| /**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See `_burn` and `_approve`.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
6387,
6576
]
} | 12,508 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | Ownable | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTrans... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to ... | NatSpecMultiLine | owner | function owner() public view returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
425,
506
]
} | 12,509 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | Ownable | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTrans... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to ... | NatSpecMultiLine | isOwner | function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
| /**
* @dev Returns true if the caller is the current owner.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
776,
870
]
} | 12,510 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | Ownable | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTrans... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to ... | NatSpecMultiLine | renounceOwnership | function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
| /**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1210,
1351
]
} | 12,511 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | Ownable | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTrans... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to ... | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1496,
1607
]
} | 12,512 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | Ownable | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTrans... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to ... | NatSpecMultiLine | _transferOwnership | function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1704,
1933
]
} | 12,513 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | PooledCDAI | contract PooledCDAI is ERC20, Ownable {
uint256 internal constant PRECISION = 10 ** 18;
address public constant COMPTROLLER_ADDRESS = 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B;
address public constant CDAI_ADDRESS = 0xF5DCe57282A584D2746FaF1593d3121Fcac444dC;
address public constant DAI_ADDRESS = 0x89d24A6b4C... | name | function name() public view returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1629,
1706
]
} | 12,514 | |||
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | PooledCDAI | contract PooledCDAI is ERC20, Ownable {
uint256 internal constant PRECISION = 10 ** 18;
address public constant COMPTROLLER_ADDRESS = 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B;
address public constant CDAI_ADDRESS = 0xF5DCe57282A584D2746FaF1593d3121Fcac444dC;
address public constant DAI_ADDRESS = 0x89d24A6b4C... | symbol | function symbol() public view returns (string memory) {
return _symbol;
}
| /**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1810,
1891
]
} | 12,515 | |||
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | PooledCDAI | contract PooledCDAI is ERC20, Ownable {
uint256 internal constant PRECISION = 10 ** 18;
address public constant COMPTROLLER_ADDRESS = 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B;
address public constant CDAI_ADDRESS = 0xF5DCe57282A584D2746FaF1593d3121Fcac444dC;
address public constant DAI_ADDRESS = 0x89d24A6b4C... | decimals | function decimals() public pure 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.
*
* NOTE: T... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
2423,
2493
]
} | 12,516 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TheAO | contract TheAO {
address public theAO;
address public nameTAOPositionAddress;
// Check whether an address is whitelisted and granted access to transact
// on behalf of others
mapping (address => bool) public whitelist;
constructor() public {
theAO = msg.sender;
}
/**
* @dev Checks if msg.sen... | transferOwnership | function transferOwnership(address _theAO) public {
require (msg.sender == theAO);
require (_theAO != address(0));
theAO = _theAO;
}
| /**
* @dev Transfer ownership of The AO to new address
* @param _theAO The new address to be transferred
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
550,
695
]
} | 12,517 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TheAO | contract TheAO {
address public theAO;
address public nameTAOPositionAddress;
// Check whether an address is whitelisted and granted access to transact
// on behalf of others
mapping (address => bool) public whitelist;
constructor() public {
theAO = msg.sender;
}
/**
* @dev Checks if msg.sen... | setWhitelist | function setWhitelist(address _account, bool _whitelist) public {
require (msg.sender == theAO);
require (_account != address(0));
whitelist[_account] = _whitelist;
}
| /**
* @dev Whitelist `_account` address to transact on behalf of others
* @param _account The address to whitelist
* @param _whitelist Either to whitelist or not
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
877,
1056
]
} | 12,518 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/Op... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting '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;
}
c = a * b;
... | /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
88,
454
]
} | 12,519 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/Op... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
537,
807
]
} | 12,520 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/Op... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
920,
1030
]
} | 12,521 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/Op... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1093,
1215
]
} | 12,522 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public ba... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0));
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1514,
2272
]
} | 12,523 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public ba... | transfer | function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
| /**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2454,
2593
]
} | 12,524 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public ba... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| /**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2841,
3112
]
} | 12,525 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public ba... | approve | function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3352,
3549
]
} | 12,526 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public ba... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
| /**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra in... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3916,
4224
]
} | 12,527 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public ba... | burn | function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
... | /**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
4373,
4716
]
} | 12,528 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public ba... | burnFrom | function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract fro... | /**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
4950,
5518
]
} | 12,529 | |||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAO | contract TAO {
using SafeMath for uint256;
address public vaultAddress;
string public name; // the name for this TAO
address public originId; // the ID of the Name that created this TAO. If Name, it's the eth address
// TAO's data
string public datHash;
string public database;
string public keyV... | /**
* @title TAO
*/ | NatSpecMultiLine | function () external payable {
}
| /**
* Will receive any ETH sent
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1070,
1106
]
} | 12,530 | ||
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAO | contract TAO {
using SafeMath for uint256;
address public vaultAddress;
string public name; // the name for this TAO
address public originId; // the ID of the Name that created this TAO. If Name, it's the eth address
// TAO's data
string public datHash;
string public database;
string public keyV... | /**
* @title TAO
*/ | NatSpecMultiLine | transferEth | function transferEth(address payable _recipient, uint256 _amount) public onlyVault returns (bool) {
_recipient.transfer(_amount);
return true;
}
| /**
* @dev Allows Vault to transfer `_amount` of ETH from this TAO to `_recipient`
* @param _recipient The recipient address
* @param _amount The amount to transfer
* @return true on success
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1320,
1474
]
} | 12,531 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAO | contract TAO {
using SafeMath for uint256;
address public vaultAddress;
string public name; // the name for this TAO
address public originId; // the ID of the Name that created this TAO. If Name, it's the eth address
// TAO's data
string public datHash;
string public database;
string public keyV... | /**
* @title TAO
*/ | NatSpecMultiLine | transferERC20 | function transferERC20(address _erc20TokenAddress, address _recipient, uint256 _amount) public onlyVault returns (bool) {
TokenERC20 _erc20 = TokenERC20(_erc20TokenAddress);
_erc20.transfer(_recipient, _amount);
return true;
}
| /**
* @dev Allows Vault to transfer `_amount` of ERC20 Token from this TAO to `_recipient`
* @param _erc20TokenAddress The address of ERC20 Token
* @param _recipient The recipient address
* @param _amount The amount to transfer
* @return true on success
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1754,
1993
]
} | 12,532 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | isTAO | function isTAO(address _taoId) public view returns (bool) {
return (_taoId != address(0) && bytes(TAO(address(uint160(_taoId))).name()).length > 0 && TAO(address(uint160(_taoId))).originId() != address(0) && TAO(address(uint160(_taoId))).typeId() == 0);
}
| /**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true if yes. false otherwise
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
352,
614
]
} | 12,533 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | isName | function isName(address _nameId) public view returns (bool) {
return (_nameId != address(0) && bytes(TAO(address(uint160(_nameId))).name()).length > 0 && Name(address(uint160(_nameId))).originId() != address(0) && Name(address(uint160(_nameId))).typeId() == 1);
}
| /**
* @dev Check whether or not the given Name ID is a Name
* @param _nameId The ID of the Name
* @return true if yes. false otherwise
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
769,
1039
]
} | 12,534 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | isValidERC20TokenAddress | function isValidERC20TokenAddress(address _tokenAddress) public view returns (bool) {
if (_tokenAddress == address(0)) {
return false;
}
TokenERC20 _erc20 = TokenERC20(_tokenAddress);
return (_erc20.totalSupply() >= 0 && bytes(_erc20.name()).length > 0 && bytes(_erc20.symbol()).length > 0);
}
| /**
* @dev Check if `_tokenAddress` is a valid ERC20 Token address
* @param _tokenAddress The ERC20 Token address to check
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1179,
1492
]
} | 12,535 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | isTheAO | function isTheAO(address _sender, address _theAO, address _nameTAOPositionAddress) public view returns (bool) {
return (_sender == _theAO ||
(
(isTAO(_theAO) || isName(_theAO)) &&
_nameTAOPositionAddress != address(0) &&
INameTAOPosition(_nameTAOPositionAddress).senderIsAdvocate(_sender, _theAO)
)
... | /**
* @dev Checks if the calling contract address is The AO
* OR
* If The AO is set to a Name/TAO, then check if calling address is the Advocate
* @param _sender The address to check
* @param _theAO The AO address
* @param _nameTAOPositionAddress The address of NameTAOPosition
* @return tr... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1843,
2179
]
} | 12,536 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | PERCENTAGE_DIVISOR | function PERCENTAGE_DIVISOR() public pure returns (uint256) {
return _PERCENTAGE_DIVISOR;
}
| /**
* @dev Return the divisor used to correctly calculate percentage.
* Percentage stored throughout AO contracts covers 4 decimals,
* so 1% is 10000, 1.25% is 12500, etc
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2372,
2470
]
} | 12,537 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | MULTIPLIER_DIVISOR | function MULTIPLIER_DIVISOR() public pure returns (uint256) {
return _MULTIPLIER_DIVISOR;
}
| /**
* @dev Return the divisor used to correctly calculate multiplier.
* Multiplier stored throughout AO contracts covers 6 decimals,
* so 1 is 1000000, 0.023 is 23000, etc
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2664,
2762
]
} | 12,538 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | deployTAO | function deployTAO(string memory _name,
address _originId,
string memory _datHash,
string memory _database,
string memory _keyValue,
bytes32 _contentId,
address _nameTAOVaultAddress
) public returns (TAO _tao) {
_tao = new TAO(_name, _originId, _datHash, _database, _keyValue, _contentId, _nameTAOVaultAd... | /**
* @dev deploy a TAO
* @param _name The name of the TAO
* @param _originId The Name ID the creates the TAO
* @param _datHash The datHash of this TAO
* @param _database The database for this TAO
* @param _keyValue The key/value pair to be checked on the database
* @param _contentId The con... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3174,
3515
]
} | 12,539 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | deployName | function deployName(string memory _name,
address _originId,
string memory _datHash,
string memory _database,
string memory _keyValue,
bytes32 _contentId,
address _nameTAOVaultAddress
) public returns (Name _myName) {
_myName = new Name(_name, _originId, _datHash, _database, _keyValue, _contentId, _nameT... | /**
* @dev deploy a Name
* @param _name The name of the Name
* @param _originId The eth address the creates the Name
* @param _datHash The datHash of this Name
* @param _database The database for this Name
* @param _keyValue The key/value pair to be checked on the database
* @param _contentI... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3937,
4287
]
} | 12,540 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | calculateWeightedMultiplier | function calculateWeightedMultiplier(uint256 _currentWeightedMultiplier, uint256 _currentPrimordialBalance, uint256 _additionalWeightedMultiplier, uint256 _additionalPrimordialAmount) public pure returns (uint256) {
if (_currentWeightedMultiplier > 0) {
uint256 _totalWeightedIons = (_currentWeightedMultiplier.mul(... | /**
* @dev Calculate the new weighted multiplier when adding `_additionalPrimordialAmount` at `_additionalWeightedMultiplier` to the current `_currentPrimordialBalance` at `_currentWeightedMultiplier`
* @param _currentWeightedMultiplier Account's current weighted multiplier
* @param _currentPrimordialBalanc... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
4866,
5481
]
} | 12,541 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | calculatePrimordialMultiplier | function calculatePrimordialMultiplier(uint256 _purchaseAmount, uint256 _totalPrimordialMintable, uint256 _totalPrimordialMinted, uint256 _startingMultiplier, uint256 _endingMultiplier) public pure returns (uint256) {
if (_purchaseAmount > 0 && _purchaseAmount <= _totalPrimordialMintable.sub(_totalPrimordialMinted)) ... | /**
* @dev Calculate the primordial ion multiplier on a given lot
* Total Primordial Mintable = T
* Total Primordial Minted = M
* Starting Multiplier = S
* Ending Multiplier = E
* To Purchase = P
* Multiplier for next Lot of Amount = (1 - ((M + P/2) / T)) x (S-E)
*
* @param _pu... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
6182,
7648
]
} | 12,542 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | calculateNetworkBonusPercentage | function calculateNetworkBonusPercentage(uint256 _purchaseAmount, uint256 _totalPrimordialMintable, uint256 _totalPrimordialMinted, uint256 _startingMultiplier, uint256 _endingMultiplier) public pure returns (uint256) {
if (_purchaseAmount > 0 && _purchaseAmount <= _totalPrimordialMintable.sub(_totalPrimordialMinted)... | /**
* @dev Calculate the bonus percentage of network ion on a given lot
* Total Primordial Mintable = T
* Total Primordial Minted = M
* Starting Network Bonus Multiplier = Bs
* Ending Network Bonus Multiplier = Be
* To Purchase = P
* AO Bonus % = B% = (1 - ((M + P/2) / T)) x (Bs-Be)
... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
8371,
9853
]
} | 12,543 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | calculateNetworkBonusAmount | function calculateNetworkBonusAmount(uint256 _purchaseAmount, uint256 _totalPrimordialMintable, uint256 _totalPrimordialMinted, uint256 _startingMultiplier, uint256 _endingMultiplier) public pure returns (uint256) {
uint256 bonusPercentage = calculateNetworkBonusPercentage(_purchaseAmount, _totalPrimordialMintable, _... | /**
* @dev Calculate the bonus amount of network ion on a given lot
* AO Bonus Amount = B% x P
*
* @param _purchaseAmount The amount of primordial ion intended to be purchased
* @param _totalPrimordialMintable Total Primordial ion intable
* @param _totalPrimordialMinted Total Primordial ion min... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
10367,
11041
]
} | 12,544 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | calculateMaximumBurnAmount | function calculateMaximumBurnAmount(uint256 _primordialBalance, uint256 _currentWeightedMultiplier, uint256 _maximumMultiplier) public pure returns (uint256) {
return (_maximumMultiplier.mul(_primordialBalance).sub(_primordialBalance.mul(_currentWeightedMultiplier))).div(_maximumMultiplier);
}
| /**
* @dev Calculate the maximum amount of Primordial an account can burn
* _primordialBalance = P
* _currentWeightedMultiplier = M
* _maximumMultiplier = S
* _amountToBurn = B
* B = ((S x P) - (P x M)) / S
*
* @param _primordialBalance Account's primordial ion balance
* @param ... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
11535,
11836
]
} | 12,545 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | calculateMultiplierAfterBurn | function calculateMultiplierAfterBurn(uint256 _primordialBalance, uint256 _currentWeightedMultiplier, uint256 _amountToBurn) public pure returns (uint256) {
return _primordialBalance.mul(_currentWeightedMultiplier).div(_primordialBalance.sub(_amountToBurn));
}
| /**
* @dev Calculate the new multiplier after burning primordial ion
* _primordialBalance = P
* _currentWeightedMultiplier = M
* _amountToBurn = B
* _newMultiplier = E
* E = (P x M) / (P - B)
*
* @param _primordialBalance Account's primordial ion balance
* @param _currentWeighte... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
12303,
12570
]
} | 12,546 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | calculateMultiplierAfterConversion | function calculateMultiplierAfterConversion(uint256 _primordialBalance, uint256 _currentWeightedMultiplier, uint256 _amountToConvert) public pure returns (uint256) {
return _primordialBalance.mul(_currentWeightedMultiplier).div(_primordialBalance.add(_amountToConvert));
}
| /**
* @dev Calculate the new multiplier after converting network ion to primordial ion
* _primordialBalance = P
* _currentWeightedMultiplier = M
* _amountToConvert = C
* _newMultiplier = E
* E = (P x M) / (P + C)
*
* @param _primordialBalance Account's primordial ion balance
* @... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
13061,
13340
]
} | 12,547 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | AOLibrary | library AOLibrary {
using SafeMath for uint256;
uint256 constant private _MULTIPLIER_DIVISOR = 10 ** 6; // 1000000 = 1
uint256 constant private _PERCENTAGE_DIVISOR = 10 ** 6; // 100% = 1000000
/**
* @dev Check whether or not the given TAO ID is a TAO
* @param _taoId The ID of the TAO
* @return true... | /**
* @title AOLibrary
*/ | NatSpecMultiLine | numDigits | function numDigits(uint256 number) public pure returns (uint8) {
uint8 digits = 0;
while(number != 0) {
number = number.div(10);
digits++;
}
return digits;
}
| /**
* @dev count num of digits
* @param number uint256 of the nuumber to be checked
* @return uint8 num of digits
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
13474,
13655
]
} | 12,548 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address _theAO) public onlyTheAO {
require (_theAO != address(0));
theAO = _theAO;
}
| /**
* @dev Transfer ownership of The AO to new address
* @param _theAO The new address to be transferred
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
1888,
2009
]
} | 12,549 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | setWhitelist | function setWhitelist(address _account, bool _whitelist) public onlyTheAO {
require (_account != address(0));
whitelist[_account] = _whitelist;
}
| /**
* @dev Whitelist `_account` address to transact on behalf of others
* @param _account The address to whitelist
* @param _whitelist Either to whitelist or not
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2191,
2346
]
} | 12,550 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | setNameTAOPositionAddress | function setNameTAOPositionAddress(address _nameTAOPositionAddress) public onlyTheAO {
require (_nameTAOPositionAddress != address(0));
nameTAOPositionAddress = _nameTAOPositionAddress;
}
| /**
* @dev The AO set the NameTAOPosition Address
* @param _nameTAOPositionAddress The address of NameTAOPosition
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2477,
2674
]
} | 12,551 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public inWhitelist isNameOrTAO(_from) isNameOrTAO(_to) returns (bool) {
_transfer(_from, _to, _value);
return true;
}
| /**
* @dev transfer TAOCurrency from other address
*
* Send `_value` TAOCurrency to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2968,
3161
]
} | 12,552 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | mint | function mint(address target, uint256 mintedAmount) public inWhitelist isNameOrTAO(target) returns (bool) {
_mint(target, mintedAmount);
return true;
}
| /**
* @dev Create `mintedAmount` TAOCurrency and send it to `target`
* @param target Address to receive TAOCurrency
* @param mintedAmount The amount of TAOCurrency it will receive
* @return true on success
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3390,
3551
]
} | 12,553 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | whitelistBurnFrom | function whitelistBurnFrom(address _from, uint256 _value) public inWhitelist isNameOrTAO(_from) returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
totalSup... | /**
*
* @dev Whitelisted address remove `_value` TAOCurrency from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3776,
4215
]
} | 12,554 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | _transfer | function _transfer(address _from, address _to, uint256 _value) internal {
require (_to != address(0)); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to].add(_value) >= balanceOf[_to]); // Check for overf... | /**
* @dev Send `_value` TAOCurrency from `_from` to `_to`
* @param _from The address of sender
* @param _to The address of the recipient
* @param _value The amount to send
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
4444,
5131
]
} | 12,555 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrency | contract TAOCurrency is TheAO {
using SafeMath for uint256;
// Public variables of the contract
string public name;
string public symbol;
uint8 public decimals;
// To differentiate denomination of TAO Currency
uint256 public powerOfTen;
uint256 public totalSupply;
// This creates an array with... | /**
* @title TAOCurrency
*/ | NatSpecMultiLine | _mint | function _mint(address target, uint256 mintedAmount) internal {
balanceOf[target] = balanceOf[target].add(mintedAmount);
totalSupply = totalSupply.add(mintedAmount);
emit Transfer(address(0), address(this), mintedAmount);
emit Transfer(address(this), target, mintedAmount);
}
| /**
* @dev Create `mintedAmount` TAOCurrency and send it to `target`
* @param target Address to receive TAOCurrency
* @param mintedAmount The amount of TAOCurrency it will receive
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
5331,
5622
]
} | 12,556 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address _theAO) public onlyTheAO {
require (_theAO != address(0));
theAO = _theAO;
}
| /**
* @dev Transfer ownership of The AO to new address
* @param _theAO The new address to be transferred
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2364,
2485
]
} | 12,557 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | setWhitelist | function setWhitelist(address _account, bool _whitelist) public onlyTheAO {
require (_account != address(0));
whitelist[_account] = _whitelist;
}
| /**
* @dev Whitelist `_account` address to transact on behalf of others
* @param _account The address to whitelist
* @param _whitelist Either to whitelist or not
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2667,
2822
]
} | 12,558 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | setNameTAOPositionAddress | function setNameTAOPositionAddress(address _nameTAOPositionAddress) public onlyTheAO {
require (_nameTAOPositionAddress != address(0));
nameTAOPositionAddress = _nameTAOPositionAddress;
}
| /**
* @dev The AO set the NameTAOPosition Address
* @param _nameTAOPositionAddress The address of NameTAOPosition
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
2953,
3150
]
} | 12,559 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | setNameFactoryAddress | function setNameFactoryAddress(address _nameFactoryAddress) public onlyTheAO {
require (_nameFactoryAddress != address(0));
nameFactoryAddress = _nameFactoryAddress;
_nameFactory = INameFactory(_nameFactoryAddress);
}
| /**
* @dev The AO set the NameFactory Address
* @param _nameFactoryAddress The address of NameFactory
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3269,
3499
]
} | 12,560 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | addDenomination | function addDenomination(bytes8 denominationName, address denominationAddress) public onlyTheAO returns (bool) {
require (denominationName.length > 0);
require (denominationName[0] != 0);
require (denominationAddress != address(0));
require (denominationIndex[denominationName] == 0);
totalDenominations++;
/... | /**
* @dev The AO adds denomination and the contract address associated with it
* @param denominationName The name of the denomination, i.e ao, kilo, mega, etc.
* @param denominationAddress The address of the denomination TAOCurrency
* @return true on success
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
3782,
4730
]
} | 12,561 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | updateDenomination | function updateDenomination(bytes8 denominationName, address denominationAddress) public onlyTheAO isValidDenomination(denominationName) returns (bool) {
require (denominationAddress != address(0));
uint256 _denominationNameIndex = denominationIndex[denominationName];
TAOCurrency _newDenominationTAOCurrency = TAO... | /**
* @dev The AO updates denomination address or activates/deactivates the denomination
* @param denominationName The name of the denomination, i.e ao, kilo, mega, etc.
* @param denominationAddress The address of the denomination TAOCurrency
* @return true on success
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
5022,
6033
]
} | 12,562 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | isDenominationExist | function isDenominationExist(bytes8 denominationName) external view returns (bool) {
return (denominationName.length > 0 &&
denominationName[0] != 0 &&
denominationIndex[denominationName] > 0 &&
denominations[denominationIndex[denominationName]].denominationAddress != address(0)
);
}
| /**
* @dev Check if denomination exist given a name
* @param denominationName The denomination name to check
* @return true if yes. false otherwise
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
6232,
6540
]
} | 12,563 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | getDenominationByName | function getDenominationByName(bytes8 denominationName) public isValidDenomination(denominationName) view returns (bytes8, address, string memory, string memory, uint8, uint256) {
TAOCurrency _tc = TAOCurrency(denominations[denominationIndex[denominationName]].denominationAddress);
return (
denominations[denomin... | /**
* @dev Get denomination info based on name
* @param denominationName The name to be queried
* @return the denomination short name
* @return the denomination address
* @return the denomination public name
* @return the denomination symbol
* @return the denomination num of decimals
* @... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
6913,
7434
]
} | 12,564 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | getDenominationByIndex | function getDenominationByIndex(uint256 index) public view returns (bytes8, address, string memory, string memory, uint8, uint256) {
require (index > 0 && index <= totalDenominations);
require (denominations[index].denominationAddress != address(0));
TAOCurrency _tc = TAOCurrency(denominations[index].denomination... | /**
* @dev Get denomination info by index
* @param index The index to be queried
* @return the denomination short name
* @return the denomination address
* @return the denomination public name
* @return the denomination symbol
* @return the denomination num of decimals
* @return the deno... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
7792,
8300
]
} | 12,565 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | getBaseDenomination | function getBaseDenomination() public view returns (bytes8, address, string memory, string memory, uint8, uint256) {
require (totalDenominations > 0);
return getDenominationByIndex(1);
}
| /**
* @dev Get base denomination info
* @return the denomination short name
* @return the denomination address
* @return the denomination public name
* @return the denomination symbol
* @return the denomination num of decimals
* @return the denomination multiplier (power of ten)
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
8612,
8808
]
} | 12,566 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | toBase | function toBase(uint256 integerAmount, uint256 fractionAmount, bytes8 denominationName) external view returns (uint256) {
uint256 _fractionAmount = fractionAmount;
if (this.isDenominationExist(denominationName) && (integerAmount > 0 || _fractionAmount > 0)) {
Denomination memory _denomination = denominations[den... | /**
* @dev convert TAOCurrency from `denominationName` denomination to base denomination,
* in this case it's similar to web3.toWei() functionality
*
* Example:
* 9.1 Kilo should be entered as 9 integerAmount and 100 fractionAmount
* 9.02 Kilo should be entered as 9 integerAmount and 20 fractio... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
9524,
10368
]
} | 12,567 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | fromBase | function fromBase(uint256 integerAmount, bytes8 denominationName) public view returns (uint256, uint256) {
if (this.isDenominationExist(denominationName)) {
Denomination memory _denomination = denominations[denominationIndex[denominationName]];
TAOCurrency _denominationTAOCurrency = TAOCurrency(_denomination.de... | /**
* @dev convert TAOCurrency from base denomination to `denominationName` denomination,
* in this case it's similar to web3.fromWei() functionality
* @param integerAmount uint256 of the base amount to be converted
* @param denominationName bytes8 name of the target TAOCurrency denomination
* @ret... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
10838,
11500
]
} | 12,568 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | exchangeDenomination | function exchangeDenomination(uint256 amount, bytes8 fromDenominationName, bytes8 toDenominationName) public isValidDenomination(fromDenominationName) isValidDenomination(toDenominationName) {
address _nameId = _nameFactory.ethAddressToNameId(msg.sender);
require (_nameId != address(0));
require (amount > 0);
D... | /**
* @dev exchange `amount` TAOCurrency from `fromDenominationName` denomination to TAOCurrency in `toDenominationName` denomination
* @param amount The amount of TAOCurrency to exchange
* @param fromDenominationName The origin denomination
* @param toDenominationName The target denomination
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
11817,
13592
]
} | 12,569 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | getDenominationExchangeById | function getDenominationExchangeById(bytes32 _exchangeId) public view returns (address, address, address, string memory, string memory, uint256) {
require (denominationExchangeIdLookup[_exchangeId] > 0);
DenominationExchange memory _denominationExchange = denominationExchanges[denominationExchangeIdLookup[_exchange... | /**
* @dev Get DenominationExchange information given an exchange ID
* @param _exchangeId The exchange ID to query
* @return The name ID that performed the exchange
* @return The from denomination address
* @return The to denomination address
* @return The from denomination symbol
* @return ... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
13977,
14639
]
} | 12,570 | |
LogosTreasury | LogosTreasury.sol | 0xbbe40982d356187ef8dbe785bee9d43f16ac9ddd | Solidity | TAOCurrencyTreasury | contract TAOCurrencyTreasury is TheAO, ITAOCurrencyTreasury {
using SafeMath for uint256;
uint256 public totalDenominations;
uint256 public totalDenominationExchanges;
address public nameFactoryAddress;
INameFactory internal _nameFactory;
struct Denomination {
bytes8 name;
address denomination... | /**
* @title TAOCurrency
*
* The purpose of this contract is to list all of the valid denominations of TAOCurrency and do the conversion between denominations
*/ | NatSpecMultiLine | toHighestDenomination | function toHighestDenomination(uint256 amount) public view returns (bytes8, address, uint256, uint256, string memory, string memory, uint8, uint256) {
uint256 integerAmount;
uint256 fractionAmount;
uint256 index;
for (uint256 i=totalDenominations; i>0; i--) {
Denomination memory _denomination = denominations... | /**
* @dev Return the highest possible denomination given a base amount
* @param amount The amount to be converted
* @return the denomination short name
* @return the denomination address
* @return the integer amount at the denomination level
* @return the fraction amount at the denomination lev... | NatSpecMultiLine | v0.5.4+commit.9549d8ff | bzzr://496901032a19caeb4d26f311db54bc2fd70eeea1baa2b4c01aa68b1693bcc093 | {
"func_code_index": [
15148,
16090
]
} | 12,571 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | 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.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
261,
321
]
} | 12,572 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | 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));
emit 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.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
640,
821
]
} | 12,573 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | pause | function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
513,
609
]
} | 12,574 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | unpause | function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
693,
791
]
} | 12,575 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
89,
266
]
} | 12,576 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
350,
630
]
} | 12,577 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
744,
860
]
} | 12,578 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
924,
1054
]
} | 12,579 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| /**
* @dev total number of tokens in existence
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
199,
287
]
} | 12,580 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
| /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
445,
777
]
} | 12,581 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
983,
1087
]
} | 12,582 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
401,
858
]
} | 12,583 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* ... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
1490,
1685
]
} | 12,584 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
2009,
2140
]
} | 12,585 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spend... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
2606,
2875
]
} | 12,586 | |
WestrendCoin | WestrendCoin.sol | 0x2b98ee45a3b692c399332d00af719cf17a82a0ca | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | decreaseApproval | function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approva... | /**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spend... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7bbb48320b183ec395c4ccf0b5eb2a4210a06f660ab4bbbe93fc0050de5f41a4 | {
"func_code_index": [
3346,
3761
]
} | 12,587 | |
NFT | contracts/Nft.sol | 0xcabf0ecc15942e2de60f3824b83d0e24dd274b57 | Solidity | NFT | contract NFT is ERC721Tradable {
string baseURI = "https://us-central1-trophee-support-prod.cloudfunctions.net/v3/";
constructor(address _proxyRegistryAddress)
ERC721Tradable("TropheeCollection", "TPC", _proxyRegistryAddress)
{}
/// @dev Assigns a new address to act as the base URI.... | /**
* @title Creature
* Creature - a contract for my non-fungible creatures.
*/ | NatSpecMultiLine | setBaseURI | function setBaseURI(string memory _baseURI) external onlyOwner {
baseURI = _baseURI;
}
| /// @dev Assigns a new address to act as the base URI. Only available to the current Owner.
/// @param _baseURI The address of the new base URI | NatSpecSingleLine | v0.8.7+commit.e28d00a7 | MIT | ipfs://224a73f41a4908869c0dc5ecce7d7719876732740935e9927c62f1c5ea63ea29 | {
"func_code_index": [
416,
521
]
} | 12,588 |
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | initialize | function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
| // called once by the factory at time of deployment | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
2077,
2292
]
} | 12,589 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | _update | function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow... | // update reserves and, on the first call per block, price accumulators | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
2372,
3237
]
} | 12,590 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | _mintFee | function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul... | // if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k) | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
3322,
4164
]
} | 12,591 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | mint | function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
ui... | // this low-level function should be called from a contract which performs important safety checks | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
4271,
5516
]
} | 12,592 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | burn | function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint ... | // this low-level function should be called from a contract which performs important safety checks | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
5623,
7094
]
} | 12,593 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | swap | function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _rese... | // this low-level function should be called from a contract which performs important safety checks | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
7201,
9095
]
} | 12,594 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | skim | function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
| // force balances to match reserves | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
9139,
9478
]
} | 12,595 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UniswapV2Pair | contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address pu... | sync | function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
| // force reserves to match balances | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
9522,
9685
]
} | 12,596 | ||
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | Math | library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
... | // a library for performing various math operations | LineComment | sqrt | function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
| // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
230,
538
]
} | 12,597 |
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UQ112x112 | library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x,... | // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112 | LineComment | encode | function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
| // encode a uint112 as a UQ112x112 | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
100,
225
]
} | 12,598 |
GoodSwapV2Factory | GoodSwapV2Factory.sol | 0x814921537e9373388f0cb43c2366ca56a8c47a1a | Solidity | UQ112x112 | library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x,... | // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112 | LineComment | uqdiv | function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
| // divide a UQ112x112 by a uint112, returning a UQ112x112 | LineComment | v0.5.16+commit.9c3226ce | None | bzzr://e58929ee5a1d24f267793bd1b5f5a5a95a356bcbf2bd126a99f19e4191fd38ac | {
"func_code_index": [
291,
404
]
} | 12,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.