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
LOP
LOP.sol
0x61db3d747170330978acdaa51641384b2870595a
Solidity
LOP
contract LOP { using SafeMath for uint256; string public constant name = "The land of promise"; string public constant symbol = "LOP"; uint8 public constant decimals = 4; uint256 private constant INITIAL_SUPPLY = 41200000; uint256 public constant totalSupply = INITIAL_SUPPLY * 10 *...
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.5.15+commit.6a57276f
None
bzzr://df52fa93c260c458141870c406a2569c21159079bb72ff9344e83048f6b4f45d
{ "func_code_index": [ 1117, 1229 ] }
57,161
LOP
LOP.sol
0x61db3d747170330978acdaa51641384b2870595a
Solidity
LOP
contract LOP { using SafeMath for uint256; string public constant name = "The land of promise"; string public constant symbol = "LOP"; uint8 public constant decimals = 4; uint256 private constant INITIAL_SUPPLY = 41200000; uint256 public constant totalSupply = INITIAL_SUPPLY * 10 *...
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.5.15+commit.6a57276f
None
bzzr://df52fa93c260c458141870c406a2569c21159079bb72ff9344e83048f6b4f45d
{ "func_code_index": [ 1565, 1704 ] }
57,162
LOP
LOP.sol
0x61db3d747170330978acdaa51641384b2870595a
Solidity
LOP
contract LOP { using SafeMath for uint256; string public constant name = "The land of promise"; string public constant symbol = "LOP"; uint8 public constant decimals = 4; uint256 private constant INITIAL_SUPPLY = 41200000; uint256 public constant totalSupply = INITIAL_SUPPLY * 10 *...
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 t...
/** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.5.15+commit.6a57276f
None
bzzr://df52fa93c260c458141870c406a2569c21159079bb72ff9344e83048f6b4f45d
{ "func_code_index": [ 1876, 2236 ] }
57,163
LOP
LOP.sol
0x61db3d747170330978acdaa51641384b2870595a
Solidity
LOP
contract LOP { using SafeMath for uint256; string public constant name = "The land of promise"; string public constant symbol = "LOP"; uint8 public constant decimals = 4; uint256 private constant INITIAL_SUPPLY = 41200000; uint256 public constant totalSupply = INITIAL_SUPPLY * 10 *...
approve
function approve(address _spender, uint256 _value) public returns (bool) { require(_spender != address(0)); 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 * race...
NatSpecMultiLine
v0.5.15+commit.6a57276f
None
bzzr://df52fa93c260c458141870c406a2569c21159079bb72ff9344e83048f6b4f45d
{ "func_code_index": [ 2880, 3133 ] }
57,164
LOP
LOP.sol
0x61db3d747170330978acdaa51641384b2870595a
Solidity
LOP
contract LOP { using SafeMath for uint256; string public constant name = "The land of promise"; string public constant symbol = "LOP"; uint8 public constant decimals = 4; uint256 private constant INITIAL_SUPPLY = 41200000; uint256 public constant totalSupply = INITIAL_SUPPLY * 10 *...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); ...
/** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */
NatSpecMultiLine
v0.5.15+commit.6a57276f
None
bzzr://df52fa93c260c458141870c406a2569c21159079bb72ff9344e83048f6b4f45d
{ "func_code_index": [ 3425, 3918 ] }
57,165
LOP
LOP.sol
0x61db3d747170330978acdaa51641384b2870595a
Solidity
LOP
contract LOP { using SafeMath for uint256; string public constant name = "The land of promise"; string public constant symbol = "LOP"; uint8 public constant decimals = 4; uint256 private constant INITIAL_SUPPLY = 41200000; uint256 public constant totalSupply = INITIAL_SUPPLY * 10 *...
increaseAllowance
function increaseAllowance(address _spender, uint256 _addedValue) public returns (bool) { require(_spender != address(0)); 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 * Emits an Approval...
NatSpecMultiLine
v0.5.15+commit.6a57276f
None
bzzr://df52fa93c260c458141870c406a2569c21159079bb72ff9344e83048f6b4f45d
{ "func_code_index": [ 4429, 4757 ] }
57,166
LOP
LOP.sol
0x61db3d747170330978acdaa51641384b2870595a
Solidity
LOP
contract LOP { using SafeMath for uint256; string public constant name = "The land of promise"; string public constant symbol = "LOP"; uint8 public constant decimals = 4; uint256 private constant INITIAL_SUPPLY = 41200000; uint256 public constant totalSupply = INITIAL_SUPPLY * 10 *...
decreaseAllowance
function decreaseAllowance(address _spender, uint256 _subtractedValue) public returns (bool) { require(_spender != address(0)); allowed[msg.sender][_spender] = allowed[msg.sender][_spender].sub(_subtractedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * @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 * Emits an Approval...
NatSpecMultiLine
v0.5.15+commit.6a57276f
None
bzzr://df52fa93c260c458141870c406a2569c21159079bb72ff9344e83048f6b4f45d
{ "func_code_index": [ 5273, 5611 ] }
57,167
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
TwoStepOwnable
contract TwoStepOwnable { event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); address private _owner; address private _newPotentialOwner; /** * @dev Initialize contract by setting transaction submitter as initial owner. */ constructor() intern...
/** * @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 functio...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) external onlyOwner { require( newOwner != address(0), "TwoStepOwnable: new potential owner is the zero address." ); _newPotentialOwner = newOwner; }
/** * @dev Allows a new account (`newOwner`) to accept ownership. * Can only be called by the current owner. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 537, 767 ] }
57,168
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
TwoStepOwnable
contract TwoStepOwnable { event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); address private _owner; address private _newPotentialOwner; /** * @dev Initialize contract by setting transaction submitter as initial owner. */ constructor() intern...
/** * @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 functio...
NatSpecMultiLine
cancelOwnershipTransfer
function cancelOwnershipTransfer() external onlyOwner { delete _newPotentialOwner; }
/** * @dev Cancel a transfer of ownership to a new account. * Can only be called by the current owner. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 891, 986 ] }
57,169
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
TwoStepOwnable
contract TwoStepOwnable { event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); address private _owner; address private _newPotentialOwner; /** * @dev Initialize contract by setting transaction submitter as initial owner. */ constructor() intern...
/** * @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 functio...
NatSpecMultiLine
acceptOwnership
function acceptOwnership() external { require( msg.sender == _newPotentialOwner, "TwoStepOwnable: current owner must set caller as new potential owner." ); delete _newPotentialOwner; emit OwnershipTransferred(_owner, msg.sender); _owner = msg.sender; }
/** * @dev Transfers ownership of the contract to the caller. * Can only be called by a new potential owner set by the current owner. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 1141, 1444 ] }
57,170
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
TwoStepOwnable
contract TwoStepOwnable { event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); address private _owner; address private _newPotentialOwner; /** * @dev Initialize contract by setting transaction submitter as initial owner. */ constructor() intern...
/** * @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 functio...
NatSpecMultiLine
owner
function owner() external view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 1514, 1592 ] }
57,171
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
TwoStepOwnable
contract TwoStepOwnable { event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); address private _owner; address private _newPotentialOwner; /** * @dev Initialize contract by setting transaction submitter as initial owner. */ constructor() intern...
/** * @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 functio...
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.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 1669, 1758 ] }
57,172
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
finalizeDaiDeposit
function finalizeDaiDeposit( address smartWallet, address initialUserSigningKey, uint256 daiAmount ) external onlyOwnerOr(Role.DEPOSIT_MANAGER) { // Ensure that the recipient is indeed a smart wallet. require( _isSmartWallet(smartWallet, initialUserSigningKey), "Could not resolve smart wallet using ...
/** * @notice Transfer `daiAmount` Dai to `smartWallet`, providing the initial * user signing key `initialUserSigningKey` as proof that the specified smart * wallet is indeed a Dharma Smart Wallet - this assumes that the address is * derived and deployed using the Dharma Smart Wallet Factory V1. In addition, ...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 4814, 5467 ] }
57,173
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
finalizeDharmaDaiDeposit
function finalizeDharmaDaiDeposit( address smartWallet, address initialUserSigningKey, uint256 dDaiAmount ) external onlyOwnerOr(Role.DEPOSIT_MANAGER) { // Ensure that the recipient is indeed a smart wallet. require( _isSmartWallet(smartWallet, initialUserSigningKey), "Could not resolve smart wallet...
/** * @notice Transfer `dDaiAmount` Dharma Dai to `smartWallet`, providing the * initial user signing key `initialUserSigningKey` as proof that the * specified smart wallet is indeed a Dharma Smart Wallet - this assumes that * the address is derived and deployed using the Dharma Smart Wallet Factory * V1. In ...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 6406, 7443 ] }
57,174
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
mint
function mint( uint256 daiAmount ) external onlyOwnerOr(Role.ADJUSTER) returns (uint256 dDaiMinted) { // Use the specified amount of Dai to mint dDai. dDaiMinted = _DDAI.mint(daiAmount); }
/** * @notice Use `daiAmount` Dai mint Dharma Dai. Only the owner or the * designated adjuster role may call this function. * @param daiAmount uint256 The amount of Dai to supply when minting Dharma * Dai. * @return The amount of Dharma Dai minted. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 7725, 7937 ] }
57,175
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
redeem
function redeem( uint256 dDaiAmount ) external onlyOwnerOr(Role.ADJUSTER) returns (uint256 daiReceived) { // Redeem the specified amount of dDai for Dai. daiReceived = _DDAI.redeem(dDaiAmount); }
/** * @notice Redeem `dDaiAmount` Dharma Dai for Dai. Only the owner or the * designated adjuster role may call this function. * @param dDaiAmount uint256 The amount of Dharma Dai to supply when redeeming * for Dai. * @return The amount of Dai received. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 8225, 8444 ] }
57,176
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
withdrawDai
function withdrawDai( address recipient, uint256 daiAmount ) external onlyOwner { // Transfer the Dai to the specified recipient. require(_DAI.transfer(recipient, daiAmount), "Dai transfer failed."); }
/** * @notice Transfer `daiAmount` Dai to `recipient`. Only the owner may call * this function. * @param recipient address The account to transfer Dai to. * @param daiAmount uint256 The amount of Dai to transfer. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 8686, 8911 ] }
57,177
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
withdrawDharmaDai
function withdrawDharmaDai( address recipient, uint256 dDaiAmount ) external onlyOwner { // Transfer the dDai to the specified recipient. require(_DDAI.transfer(recipient, dDaiAmount), "dDai transfer failed."); }
/** * @notice Transfer `dDaiAmount` Dharma Dai to `recipient`. Only the owner may * call this function. * @param recipient address The account to transfer Dharma Dai to. * @param dDaiAmount uint256 The amount of Dharma Dai to transfer. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 9176, 9412 ] }
57,178
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
withdraw
function withdraw( ERC20Interface token, address recipient, uint256 amount ) external onlyOwner returns (bool success) { // Transfer the token to the specified recipient. success = token.transfer(recipient, amount); }
/** * @notice Transfer `amount` of ERC20 token `token` to `recipient`. Only the * owner may call this function. * @param token ERC20Interface The ERC20 token to transfer. * @param recipient address The account to transfer the tokens to. * @param amount uint256 The amount of tokens to transfer. * @return A b...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 9875, 10116 ] }
57,179
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
call
function call( address payable target, uint256 amount, bytes calldata data ) external onlyOwner returns (bool ok, bytes memory returnData) { // Call the specified target and supply the specified data. (ok, returnData) = target.call.value(amount)(data); }
/** * @notice Call account `target`, supplying value `amount` and data `data`. * Only the owner may call this function. * @param target address The account to call. * @param amount uint256 The amount of ether to include as an endowment. * @param data bytes The data to include along with the call. * @return ...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 10564, 10842 ] }
57,180
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
setLimit
function setLimit(uint256 daiAmount) external onlyOwner { // Set the new limit. _limit = daiAmount; }
/** * @notice Set `daiAmount` as the new limit on the size of finalized deposits. * Only the owner may call this function. * @param daiAmount uint256 The new limit on the size of finalized deposits. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 11066, 11183 ] }
57,181
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
pause
function pause(Role role) external onlyOwnerOr(Role.PAUSER) { RoleStatus storage storedRoleStatus = _roles[uint256(role)]; require(!storedRoleStatus.paused, "Role in question is already paused."); storedRoleStatus.paused = true; emit RolePaused(role); }
/** * @notice Pause a currently unpaused role and emit a `RolePaused` event. Only * the owner or the designated pauser may call this function. Also, bear in * mind that only the owner may unpause a role once paused. * @param role The role to pause. Permitted roles are deposit manager (0), * adjuster (1), and ...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 11538, 11817 ] }
57,182
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
unpause
function unpause(Role role) external onlyOwner { RoleStatus storage storedRoleStatus = _roles[uint256(role)]; require(storedRoleStatus.paused, "Role in question is already unpaused."); storedRoleStatus.paused = false; emit RoleUnpaused(role); }
/** * @notice Unpause a currently paused role and emit a `RoleUnpaused` event. * Only the owner may call this function. * @param role The role to pause. Permitted roles are deposit manager (0), * adjuster (1), and pauser (2). */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 12072, 12342 ] }
57,183
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
setRole
function setRole(Role role, address account) external onlyOwner { require(account != address(0), "Must supply an account."); _setRole(role, account); }
/** * @notice Set a new account on a given role and emit a `RoleModified` event * if the role holder has changed. Only the owner may call this function. * @param role The role that the account will be set for. Permitted roles are * deposit manager (0), adjuster (1), and pauser (2). * @param account The accoun...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 12725, 12892 ] }
57,184
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
removeRole
function removeRole(Role role) external onlyOwner { _setRole(role, address(0)); }
/** * @notice Remove any current role bearer for a given role and emit a * `RoleModified` event if a role holder was previously set. Only the owner * may call this function. * @param role The role that the account will be removed from. Permitted roles * are deposit manager (0), adjuster (1), and pauser (2). ...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 13234, 13326 ] }
57,185
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
isPaused
function isPaused(Role role) external view returns (bool paused) { paused = _isPaused(role); }
/** * @notice External view function to check whether or not the functionality * associated with a given role is currently paused or not. The owner or the * pauser may pause any given role (including the pauser itself), but only the * owner may unpause functionality. Additionally, the owner may call paused * ...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 13944, 14049 ] }
57,186
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
isRole
function isRole(Role role) external view returns (bool hasRole) { hasRole = _isRole(role); }
/** * @notice External view function to check whether the caller is the current * role holder. * @param role The role to check for. Permitted roles are deposit manager (0), * adjuster (1), and pauser (2). * @return A boolean indicating if the caller has the specified role. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 14356, 14459 ] }
57,187
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
isDharmaSmartWallet
function isDharmaSmartWallet( address smartWallet, address initialUserSigningKey ) external view returns (bool dharmaSmartWallet) { dharmaSmartWallet = _isSmartWallet(smartWallet, initialUserSigningKey); }
/** * @notice External view function to check whether a "proof" that a given * smart wallet is actually a Dharma Smart Wallet, based on the initial user * signing key, is valid or not. This proof only works when the Dharma Smart * Wallet in question is derived using V1 of the Dharma Smart Wallet Factory. * @p...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 15192, 15416 ] }
57,188
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
getDepositManager
function getDepositManager() external view returns (address depositManager) { depositManager = _roles[uint256(Role.DEPOSIT_MANAGER)].account; }
/** * @notice External view function to check the account currently holding the * deposit manager role. The deposit manager can process standard deposit * finalization via `finalizeDaiDeposit` and `finalizeDharmaDaiDeposit`, but * must prove that the recipient is a Dharma Smart Wallet and adhere to the * curr...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 15883, 16037 ] }
57,189
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
getAdjuster
function getAdjuster() external view returns (address adjuster) { adjuster = _roles[uint256(Role.ADJUSTER)].account; }
/** * @notice External view function to check the account currently holding the * adjuster role. The adjuster can exchange Dai in reserves for Dharma Dai and * vice-versa via minting or redeeming. * @return The address of the current adjuster, or the null address if none is * set. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 16352, 16481 ] }
57,190
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
getPauser
function getPauser() external view returns (address pauser) { pauser = _roles[uint256(Role.PAUSER)].account; }
/** * @notice External view function to check the account currently holding the * pauser role. The pauser can pause any role from taking its standard action, * though the owner will still be able to call the associated function in the * interim and is the only entity able to unpause the given role once paused. ...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 16913, 17034 ] }
57,191
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
getReserves
function getReserves() external view returns ( uint256 dai, uint256 dDai, uint256 dDaiUnderlying ) { dai = _DAI.balanceOf(address(this)); dDai = _DDAI.balanceOf(address(this)); dDaiUnderlying = _DDAI.balanceOfUnderlying(address(this)); }
/** * @notice External view function to check the current reserves held by this * contract. * @return The Dai and Dharma Dai reserves held by this contract, as well as * the Dai-equivalent value of the Dharma Dai reserves. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 17287, 17553 ] }
57,192
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
getLimit
function getLimit() external view returns ( uint256 daiAmount, uint256 dDaiAmount ) { daiAmount = _limit; dDaiAmount = (daiAmount.mul(1e18)).div(_DDAI.exchangeRateCurrent()); }
/** * @notice External view function to check the current limit on deposit amount * enforced for the deposit manager when finalizing deposits, expressed in Dai * and in Dharma Dai. * @return The Dai and Dharma Dai limit on deposit finalization amount. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 17836, 18039 ] }
57,193
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
_setRole
function _setRole(Role role, address account) internal { RoleStatus storage storedRoleStatus = _roles[uint256(role)]; if (account != storedRoleStatus.account) { storedRoleStatus.account = account; emit RoleModified(role, account); } }
/** * @notice Internal function to set a new account on a given role and emit a * `RoleModified` event if the role holder has changed. * @param role The role that the account will be set for. Permitted roles are * deposit manager (0), adjuster (1), and pauser (2). * @param account The account to set as the de...
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 18404, 18675 ] }
57,194
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
_isRole
function _isRole(Role role) internal view returns (bool hasRole) { hasRole = msg.sender == _roles[uint256(role)].account; }
/** * @notice Internal view function to check whether the caller is the current * role holder. * @param role The role to check for. Permitted roles are deposit manager (0), * adjuster (1), and pauser (2). * @return A boolean indicating if the caller has the specified role. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 18982, 19116 ] }
57,195
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
_isPaused
function _isPaused(Role role) internal view returns (bool paused) { paused = _roles[uint256(role)].paused; }
/** * @notice Internal view function to check whether the given role is paused or * not. * @param role The role to check for. Permitted roles are deposit manager (0), * adjuster (1), and pauser (2). * @return A boolean indicating if the specified role is paused or not. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 19419, 19538 ] }
57,196
DharmaReserveManagerV1Staging
DharmaReserveManagerV1Staging.sol
0xed4095ff24ab3c5f1b920f7a424b4d9016c833eb
Solidity
DharmaReserveManagerV1Staging
contract DharmaReserveManagerV1Staging is DharmaReserveManagerV1Interface, TwoStepOwnable { using SafeMath for uint256; // Maintain a role status mapping with assigned accounts and paused states. mapping(uint256 => RoleStatus) private _roles; // Maintain a maximum allowable transfer size (in Dai) for ...
/** * @title DharmaReserveManagerV1 (staging version) * @author 0age * @notice This contract is owned by the Dharma Reserve Manager multisig and * manages Dharma's reserves. It designates a collection of "roles" - these are * dedicated accounts that can be modified by the owner, and that can trigger * speci...
NatSpecMultiLine
_isSmartWallet
function _isSmartWallet( address smartWallet, address initialUserSigningKey ) internal view returns (bool) { // Derive the keccak256 hash of the smart wallet initialization code. bytes32 initCodeHash = keccak256( abi.encodePacked( _WALLET_CREATION_CODE_HEADER, initialUserSigningKey, ...
/** * @notice Internal view function to enforce that the given initial user signing * key resolves to the given smart wallet when deployed through the Dharma Smart * Wallet Factory V1. * @param smartWallet address The smart wallet. * @param initialUserSigningKey address The initial user signing key. */
NatSpecMultiLine
v0.5.11+commit.c082d0b4
MIT
bzzr://60df779426709ff6ee0b5c4b16a3082701f8a56f9d50f2bf4c5daab344794675
{ "func_code_index": [ 19872, 21429 ] }
57,197
InuToken
InuToken.sol
0x67da3f79d86669c3ff90c125f8ed9444a3921cac
Solidity
Context
contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } }
_msgSender
function _msgSender() internal view returns(address payable) { return msg.sender; }
// solhint-disable-previous-line no-empty-blocks
LineComment
v0.5.17+commit.d19bba13
None
bzzr://7ca365c4af584eefd18053f5c05fd051b16a2872f784838f71ee4b8ddb9fa36d
{ "func_code_index": [ 105, 207 ] }
57,198
Order
Order.sol
0xe197529709d7cbaf31756c6d9b8742718e17fca5
Solidity
Order
contract Order is owned { ERC20 public token; uint public weiPerToken; uint public decimalPlaces; function Order(address _token, uint _weiPerToken, uint _decimalPlaces) { token = ERC20(_token); weiPerToken = _weiPerToken; decimalPlaces = _decimalPlaces; } fun...
_fillOrder
function _fillOrder(address _from, uint numTokens) internal returns (bool) { if (numTokens == 0) throw; if (this.balance < numTokens * weiPerToken / decimalPlaces) throw; if (!token.transferFrom(_from, owner, numTokens)) return false; sendRobust(_from, numTokens * weiPerToken / decimalPlaces); ...
// Fills or partially fills the order.
LineComment
v0.3.0-2016-03-11-1f9578c
{ "func_code_index": [ 1197, 1603 ] }
57,199
Order
Order.sol
0xe197529709d7cbaf31756c6d9b8742718e17fca5
Solidity
Order
contract Order is owned { ERC20 public token; uint public weiPerToken; uint public decimalPlaces; function Order(address _token, uint _weiPerToken, uint _decimalPlaces) { token = ERC20(_token); weiPerToken = _weiPerToken; decimalPlaces = _decimalPlaces; } fun...
fillMyOrder
function fillMyOrder(uint numTokens) public returns (bool) { return _fillOrder(msg.sender, numTokens); }
// Simpler call signature that uses `msg.sender`
LineComment
v0.3.0-2016-03-11-1f9578c
{ "func_code_index": [ 1794, 1917 ] }
57,200
Order
Order.sol
0xe197529709d7cbaf31756c6d9b8742718e17fca5
Solidity
Order
contract Order is owned { ERC20 public token; uint public weiPerToken; uint public decimalPlaces; function Order(address _token, uint _weiPerToken, uint _decimalPlaces) { token = ERC20(_token); weiPerToken = _weiPerToken; decimalPlaces = _decimalPlaces; } fun...
fillTheirOrder
function fillTheirOrder(address who) public returns (bool) { return _fillOrder(who, getTransferableBalance(who)); }
// Simpler call signature that defaults to the account allowance.
LineComment
v0.3.0-2016-03-11-1f9578c
{ "func_code_index": [ 1991, 2125 ] }
57,201
Order
Order.sol
0xe197529709d7cbaf31756c6d9b8742718e17fca5
Solidity
Order
contract Order is owned { ERC20 public token; uint public weiPerToken; uint public decimalPlaces; function Order(address _token, uint _weiPerToken, uint _decimalPlaces) { token = ERC20(_token); weiPerToken = _weiPerToken; decimalPlaces = _decimalPlaces; } fun...
fillOrderAuto
function fillOrderAuto() public returns (bool) { return _fillOrder(msg.sender, getTransferableBalance(msg.sender)); }
// Simpler call signature that uses `msg.sender` and the current approval // value.
LineComment
v0.3.0-2016-03-11-1f9578c
{ "func_code_index": [ 2222, 2358 ] }
57,202
Order
Order.sol
0xe197529709d7cbaf31756c6d9b8742718e17fca5
Solidity
Order
contract Order is owned { ERC20 public token; uint public weiPerToken; uint public decimalPlaces; function Order(address _token, uint _weiPerToken, uint _decimalPlaces) { token = ERC20(_token); weiPerToken = _weiPerToken; decimalPlaces = _decimalPlaces; } fun...
function () { // allow receipt of funds if (msg.value > 0) { return; } else { fillOrderAuto(); } }
// Even simpler call signature that tries to transfer as many as possible.
LineComment
v0.3.0-2016-03-11-1f9578c
{ "func_code_index": [ 2441, 2611 ] }
57,203
Order
Order.sol
0xe197529709d7cbaf31756c6d9b8742718e17fca5
Solidity
Order
contract Order is owned { ERC20 public token; uint public weiPerToken; uint public decimalPlaces; function Order(address _token, uint _weiPerToken, uint _decimalPlaces) { token = ERC20(_token); weiPerToken = _weiPerToken; decimalPlaces = _decimalPlaces; } fun...
cancel
function cancel() onlyowner { selfdestruct(owner); }
// Cancel the order, returning all funds to the owner.
LineComment
v0.3.0-2016-03-11-1f9578c
{ "func_code_index": [ 2674, 2745 ] }
57,204
omexchange
omexchange.sol
0x9c4d051974cdf3deb4d504ec24eac42b5e4e8847
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; } /** * ...
/** * @title FIRS omexchange Project */
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.25+commit.59dbf8f1
bzzr://3ec7554b1644f006022b3963dc9ca6a3ab4d3f0ccc2a8d4f3b0ca296211155df
{ "func_code_index": [ 95, 302 ] }
57,205
omexchange
omexchange.sol
0x9c4d051974cdf3deb4d504ec24eac42b5e4e8847
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; } /** * ...
/** * @title FIRS omexchange Project */
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.25+commit.59dbf8f1
bzzr://3ec7554b1644f006022b3963dc9ca6a3ab4d3f0ccc2a8d4f3b0ca296211155df
{ "func_code_index": [ 392, 692 ] }
57,206
omexchange
omexchange.sol
0x9c4d051974cdf3deb4d504ec24eac42b5e4e8847
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; } /** * ...
/** * @title FIRS omexchange Project */
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.25+commit.59dbf8f1
bzzr://3ec7554b1644f006022b3963dc9ca6a3ab4d3f0ccc2a8d4f3b0ca296211155df
{ "func_code_index": [ 812, 940 ] }
57,207
omexchange
omexchange.sol
0x9c4d051974cdf3deb4d504ec24eac42b5e4e8847
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; } /** * ...
/** * @title FIRS omexchange Project */
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.25+commit.59dbf8f1
bzzr://3ec7554b1644f006022b3963dc9ca6a3ab4d3f0ccc2a8d4f3b0ca296211155df
{ "func_code_index": [ 1010, 1156 ] }
57,208
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
UniStake
function UniStake() public { // add administrators here administrators[keccak256(0xdeadf096d2697013dd98b3dB44B1831816e9A921)] = true; // add the ambassadors here. ambassadors_[0xdeadf096d2697013dd98b3dB44B1831816e9A921] = true; ambassadors_[0xFCd6AD49134A0755923c096382e5fc3b80Cb...
/* * -- APPLICATION ENTRY POINTS -- */
Comment
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 4978, 5351 ] }
57,209
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
buy
function buy(address _referredBy) public payable returns(uint256) { purchaseTokens(msg.value, _referredBy); }
/** * Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 5491, 5651 ] }
57,210
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
function() payable public { purchaseTokens(msg.value, 0x0); }
/** * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 5825, 5928 ] }
57,211
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
reinvest
function reinvest() onlyStronghands() public { // fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividend...
/** * Converts all of caller's dividends to tokens. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 6007, 6779 ] }
57,212
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
exit
function exit() public { // get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); // lambo delivery service withdraw(); }
/** * Alias of sell() and withdraw(). */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 6844, 7169 ] }
57,213
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
withdraw
function withdraw() onlyStronghands() public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); ...
/** * Withdraws all of the callers earnings. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 7237, 7920 ] }
57,214
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
sell
function sell(uint256 _amountOfTokens) onlyBagholders() public { // setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereu...
/** * Liquifies tokens to ethereum. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 7983, 9349 ] }
57,215
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
transfer
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { // setup address _customerAddress = msg.sender; // make sure we have the requested tokens // also disables transfers until ambassador phase is over // ( we dont want ...
/** * Transfer tokens from the caller to a new holder. * Remember, there's a 10% fee here as well. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 9487, 11274 ] }
57,216
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
disableInitialStage
function disableInitialStage() onlyAdministrator() public { onlyAmbassadors = false; }
/** * In case the amassador quota is not met, the administrator can manually disable the ambassador phase. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 11470, 11598 ] }
57,217
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
setAdministrator
function setAdministrator(bytes32 _identifier, bool _status) onlyAdministrator() public { administrators[_identifier] = _status; }
/** * In case one of us dies, we need to replace ourselves. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 11685, 11857 ] }
57,218
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
setStakingRequirement
function setStakingRequirement(uint256 _amountOfTokens) onlyAdministrator() public { stakingRequirement = _amountOfTokens; }
/** * Precautionary measures in case we need to adjust the masternode rate. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 11960, 12126 ] }
57,219
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
setName
function setName(string _name) onlyAdministrator() public { name = _name; }
/** * If we want to rebrand, we can. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 12190, 12307 ] }
57,220
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
setSymbol
function setSymbol(string _symbol) onlyAdministrator() public { symbol = _symbol; }
/** * If we want to rebrand, we can. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 12371, 12496 ] }
57,221
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
totalEthereumBalance
function totalEthereumBalance() public view returns(uint) { return this.balance; }
/** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 12687, 12820 ] }
57,222
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
totalSupply
function totalSupply() public view returns(uint256) { return tokenSupply_; }
/** * Retrieve the total token supply. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 12886, 13013 ] }
57,223
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
myTokens
function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); }
/** * Retrieve the tokens owned by the caller. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 13087, 13274 ] }
57,224
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
myDividends
function myDividends(bool _includeReferralBonus) public view returns(uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; }
/** * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. ...
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 13631, 13946 ] }
57,225
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
balanceOf
function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; }
/** * Retrieve the token balance of any single address. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 14029, 14203 ] }
57,226
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
dividendsOf
function dividendsOf(address _customerAddress) view public returns(uint256) { return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; }
/** * Retrieve the dividend balance of any single address. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 14289, 14548 ] }
57,227
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
sellPrice
function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256...
/** * Return the buy price of 1 individual token. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 14625, 15173 ] }
57,228
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
buyPrice
function buyPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 ...
/** * Return the sell price of 1 individual token. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 15251, 15798 ] }
57,229
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
calculateTokensReceived
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _dividends = SafeMath.div(_ethereumToSpend, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);...
/** * Function for the frontend to dynamically retrieve the price scaling of buy orders. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 15914, 16317 ] }
57,230
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
calculateEthereumReceived
function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(...
/** * Function for the frontend to dynamically retrieve the price scaling of sell orders. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 16434, 16853 ] }
57,231
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
purchaseTokens
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) antiEarlyWhale(_incomingEthereum) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_); uint256 _referralBon...
/*========================================== = INTERNAL FUNCTIONS = ==========================================*/
Comment
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 17016, 20465 ] }
57,232
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
ethereumToTokens_
function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( ...
/** * Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 20756, 21737 ] }
57,233
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
tokensToEthereum_
function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ...
/** * Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 21998, 22726 ] }
57,234
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
UniStake
contract UniStake { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlySt...
/* * Main Net Version * UI at https://unistake.fund */
Comment
sqrt
function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } }
//This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei
LineComment
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 22833, 23036 ] }
57,235
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 95, 308 ] }
57,236
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** ...
/** * @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 c; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 398, 691 ] }
57,237
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** ...
/** * @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 Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 812, 940 ] }
57,238
UniStake
UniStake.sol
0xf5cf97d074f14ca86d64d4f5fd426e446f6042e6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** ...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.20+commit.3155dd80
None
bzzr://c8c32f15ae6ed4f4169443575459251e921e3a767ce6e1b5e38530ca73444035
{ "func_code_index": [ 1010, 1162 ] }
57,239
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
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() { owner = msg.sender; } ...
Ownable
function Ownable() { owner = msg.sender; }
/** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 261, 314 ] }
57,240
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
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() { owner = msg.sender; } ...
transferOwnership
function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 637, 813 ] }
57,241
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
Solidity
HasNoEther
contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this w...
HasNoEther
function HasNoEther() payable { require(msg.value == 0); }
/** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this way we prevent a payable constructor from w...
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 439, 508 ] }
57,242
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
Solidity
HasNoEther
contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this w...
function() external { }
/** * @dev Disallows direct send by settings a default function without the `payable` flag. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 617, 646 ] }
57,243
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
Solidity
HasNoEther
contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this w...
reclaimEther
function reclaimEther() external onlyOwner { assert(owner.send(this.balance)); }
/** * @dev Transfer all Ether held by the contract to the owner. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 728, 819 ] }
57,244
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
Solidity
CanReclaimToken
contract CanReclaimToken is Ownable { using SafeERC20 for ERC20Basic; /** * @dev Reclaim all ERC20Basic compatible tokens * @param token ERC20Basic The address of the token contract */ function reclaimToken(ERC20Basic token) external onlyOwner { uint256 balance = token.balanceOf(this); ...
/** * @title Contracts that should be able to recover tokens * @author SylTi * @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner. * This will prevent any accidental loss of tokens. */
NatSpecMultiLine
reclaimToken
function reclaimToken(ERC20Basic token) external onlyOwner { uint256 balance = token.balanceOf(this); token.safeTransfer(owner, balance); }
/** * @dev Reclaim all ERC20Basic compatible tokens * @param token ERC20Basic The address of the token contract */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 206, 361 ] }
57,245
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
Solidity
HasNoTokens
contract HasNoTokens is CanReclaimToken { /** * @dev Reject all ERC23 compatible tokens * @param from_ address The address that is transferring the tokens * @param value_ uint256 the amount of the specified token * @param data_ Bytes The data passed from the caller. */ function tokenFallback(addre...
/** * @title Contracts that should not own Tokens * @author Remco Bloemen <remco@2π.com> * @dev This blocks incoming ERC23 tokens to prevent accidental loss of tokens. * Should tokens (any ERC20Basic compatible) end up in the contract, it allows the * owner to reclaim the tokens. */
NatSpecMultiLine
tokenFallback
function tokenFallback(address from_, uint256 value_, bytes data_) external { revert(); }
/** * @dev Reject all ERC23 compatible tokens * @param from_ address The address that is transferring the tokens * @param value_ uint256 the amount of the specified token * @param data_ Bytes The data passed from the caller. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 290, 390 ] }
57,246
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
Solidity
Claimable
contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner ad...
transferOwnership
function transferOwnership(address newOwner) onlyOwner public { pendingOwner = newOwner; }
/** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 395, 496 ] }
57,247
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
Solidity
Claimable
contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner ad...
claimOwnership
function claimOwnership() onlyPendingOwner public { OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = 0x0; }
/** * @dev Allows the pendingOwner address to finalize the transfer. */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 582, 741 ] }
57,248
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
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; Pause(); }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 513, 604 ] }
57,249
TokenPaymentGateway
TokenPaymentGateway.sol
0x5e1cdd970e60dce16ced2645f5fb71cfd22080cf
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; Unpause(); }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://31a54ccdacf896570d27f3468238374906402760b9a68fd1ee5c24ef425ae316
{ "func_code_index": [ 688, 781 ] }
57,250
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
getState
function getState() public view returns (address, address) { return (addressOf(ETH_TOKEN), addressOf(BANCOR_CONVERTER_REGISTRY)); }
/** * @dev retrieves the anchor-token and the converter-registry * * @return the anchor-token and the converter-registry */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 604, 754 ] }
57,251
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
isUpdated
function isUpdated(address _anchorToken, address _converterRegistry) public view returns (bool) { return _anchorToken == anchorToken && _converterRegistry == converterRegistry; }
/** * @dev checks if both the anchor-token and the converter-registry are updated * * @param _anchorToken the registered anchor-token * @param _converterRegistry the registered converter-registry * * @return true if both the anchor-token and the converter-registry are updated; false otherwise */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 1108, 1305 ] }
57,252
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
updateState
function updateState() public { (address _anchorToken, address _converterRegistry) = getState(); require(!isUpdated(_anchorToken, _converterRegistry)); (anchorToken, converterRegistry) = (_anchorToken, _converterRegistry); }
/** * @dev updates the anchor-token and/or the converter-registry * * Note that this function needs to be called only when either one of them has been redeployed */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 1505, 1766 ] }
57,253
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
get
function get(address _sourceToken, address _targetToken) public view returns (address[] memory) { (address _anchorToken, address _converterRegistry) = getState(); require(isUpdated(_anchorToken, _converterRegistry)); address[] memory sourcePath = getPath(_sourceToken); address[] memory targetPath = ...
/** * @dev retrieves the conversion path between a given pair of tokens in the Bancor Network * * @param _sourceToken address of the source token * @param _targetToken address of the target token * * @return path from the source token to the target token */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 2081, 2508 ] }
57,254
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
getPath
function getPath(address _token) private view returns (address[] memory) { if (_token == anchorToken) return getInitialArray(_token); address[] memory smartTokens; if (IBancorConverterRegistry(converterRegistry).isSmartToken(_token)) smartTokens = getInitialArray(_token); else ...
/** * @dev retrieves the conversion path between a given token and the anchor token * * @param _token address of the token * * @return path from the input token to the anchor token */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 2742, 3900 ] }
57,255
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
getShortestPath
function getShortestPath(address[] memory _sourcePath, address[] memory _targetPath) private pure returns (address[] memory) { if (_sourcePath.length > 0 && _targetPath.length > 0) { uint256 i = _sourcePath.length; uint256 j = _targetPath.length; while (i > 0 && j > 0 && _sourcePath[i - ...
/** * @dev merges two paths with a common suffix into one * * @param _sourcePath address of the source path * @param _targetPath address of the target path * * @return merged path */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 4140, 5259 ] }
57,256
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
getInitialArray
function getInitialArray(address _item) private pure returns (address[] memory) { address[] memory array = new address[](1); array[0] = _item; return array; }
/** * @dev creates a new array containing a single item * * @param _item item * * @return initial array */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 5416, 5611 ] }
57,257
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
getExtendedArray
function getExtendedArray(address _item0, address _item1, address[] memory _array) private pure returns (address[] memory) { address[] memory array = new address[](2 + _array.length); array[0] = _item0; array[1] = _item1; for (uint256 i = 0; i < _array.length; i++) array[2 + i] = _array[i];...
/** * @dev prepends two items to the beginning of an array * * @param _item0 first item * @param _item1 second item * @param _array initial array * * @return extended array */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 5851, 6226 ] }
57,258
BancorNetworkPathFinder
contracts\BancorNetworkPathFinder.sol
0x6ae013e32a2cf6f2f06d9fcd2d826872863f79d8
Solidity
BancorNetworkPathFinder
contract BancorNetworkPathFinder is ContractRegistryClient { address public anchorToken; address public converterRegistry; /** * @dev initializes a new BancorNetworkPathFinder instance * * @param _registry address of a contract registry contract */ constructor(IContractR...
/** * @dev The BancorNetworkPathFinder contract allows for retrieving the conversion path between any pair of tokens in the Bancor Network. * This conversion path can then be used in various functions on the BancorNetwork contract (see this contract for more details on conversion paths). */
NatSpecMultiLine
getPartialArray
function getPartialArray(address[] memory _array, uint256 _length) private pure returns (address[] memory) { address[] memory array = new address[](_length); for (uint256 i = 0; i < _length; i++) array[i] = _array[i]; return array; }
/** * @dev extracts the prefix of a given array * * @param _array given array * @param _length prefix length * * @return partial array */
NatSpecMultiLine
v0.4.26+commit.4563c3fc
bzzr://fa8660cc59a350dec6afe73b6357217e3a5de7f90d2f07a22de53af3fc84f7f9
{ "func_code_index": [ 6421, 6704 ] }
57,259
GBTToken
GBTToken.sol
0xf9d7c212cb020501fd0991b68d094f80e8b4bdad
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
None
bzzr://11bb640bb38b0495160c97061006fffb4c8ec934b77cf8e75c748f3c8903b93d
{ "func_code_index": [ 89, 266 ] }
57,260