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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | 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, truncating the quotient.
*/
function div(uin... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
304,
564
]
} | 3,600 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | 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, truncating the quotient.
*/
function div(uin... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than
minuend).
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
671,
775
]
} | 3,601 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | 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, truncating the quotient.
*/
function div(uin... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
831,
945
]
} | 3,602 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @par... | totalSupply | function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| /**
* @dev total number of tokens in existence
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
181,
261
]
} | 3,603 | ||
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @par... | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
| /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
407,
709
]
} | 3,604 | ||
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @par... | balanceOf | function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
903,
999
]
} | 3,605 | ||
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _va... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood:
https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns
(bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sen... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
376,
796
]
} | 3,606 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _va... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood:
https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
require((_value == 0 ) || (allowed[msg.sender][_spender] == 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 thi... | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
1401,
1646
]
} | 3,607 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _va... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood:
https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the
spender.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
1952,
2075
]
} | 3,608 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _va... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood:
https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval(address _spender, uint _addedValue) public returns (bool)
{
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spend... | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
2510,
2764
]
} | 3,609 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _va... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood:
https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | decreaseApproval | function decreaseApproval(address _spender, uint _subtractedValue) public returns
(bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _sp... | /**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spend... | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
3204,
3580
]
} | 3,610 |
LPB | LPB.sol | 0xe2f10801ba34935259dbe73edb756a196279bc3c | Solidity | LPB | contract LPB is StandardToken{
string public constant name = "LPB"; // solium-disable-line uppercase
string public constant symbol = "LPB"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 2100000000000000000000000000;
u... | function() payable public {
revert();
}
| /**
* The fallback function.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | None | bzzr://fb49ca9ca41253408a485ab8cd21ff66618173d4e5f6bbf0e51bff5cd9196cc1 | {
"func_code_index": [
671,
713
]
} | 3,611 | |||
AaveImport | contracts/mcd/close/MCDCloseTaker.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDCloseTaker | contract MCDCloseTaker is MCDSaverProxyHelper {
address public constant SUBSCRIPTION_ADDRESS_NEW = 0xC45d4f6B6bf41b6EdAA58B01c4298B8d9078269a;
address public constant DEFISAVER_LOGGER = 0x5c55B921f590a89C1Ebe84dF170E655a82b62126;
ILendingPool public constant lendingPool = ILendingPool(0x398eC7346DcD622eD... | getMaxDebt | function getMaxDebt(uint256 _cdpId, bytes32 _ilk) public view returns (uint256) {
uint256 price = getPrice(_ilk);
(, uint256 mat) = spotter.ilks(_ilk);
(uint256 collateral, uint256 debt) = getCdpInfo(manager, _cdpId, _ilk);
return sub(wdiv(wmul(collateral, price), mat), debt);
}
| /// @notice Gets the maximum amount of debt available to generate
/// @param _cdpId Id of the CDP
/// @param _ilk Ilk of the CDP | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
2655,
2976
]
} | 3,612 | ||
AaveImport | contracts/mcd/close/MCDCloseTaker.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDCloseTaker | contract MCDCloseTaker is MCDSaverProxyHelper {
address public constant SUBSCRIPTION_ADDRESS_NEW = 0xC45d4f6B6bf41b6EdAA58B01c4298B8d9078269a;
address public constant DEFISAVER_LOGGER = 0x5c55B921f590a89C1Ebe84dF170E655a82b62126;
ILendingPool public constant lendingPool = ILendingPool(0x398eC7346DcD622eD... | getPrice | function getPrice(bytes32 _ilk) public view returns (uint256) {
(, uint256 mat) = spotter.ilks(_ilk);
(, , uint256 spot, , ) = vat.ilks(_ilk);
return rmul(rmul(spot, spotter.par()), mat);
}
| /// @notice Gets a price of the asset
/// @param _ilk Ilk of the CDP | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
3055,
3277
]
} | 3,613 | ||
CurrentCrowdsale | zeppelin-solidity/contracts/ownership/rbac/Roles.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
functio... | /**
* @title Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/ | NatSpecMultiLine | add | function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
| /**
* @dev give an address access to this role
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
141,
244
]
} | 3,614 | |
CurrentCrowdsale | zeppelin-solidity/contracts/ownership/rbac/Roles.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
functio... | /**
* @title Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/ | NatSpecMultiLine | remove | function remove(Role storage role, address addr)
internal
{
role.bearer[addr] = false;
}
| /**
* @dev remove an address' access to this role
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
311,
418
]
} | 3,615 | |
CurrentCrowdsale | zeppelin-solidity/contracts/ownership/rbac/Roles.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
functio... | /**
* @title Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/ | NatSpecMultiLine | check | function check(Role storage role, address addr)
view
internal
{
require(has(role, addr));
}
| /**
* @dev check if an address has this role
* // reverts
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
497,
612
]
} | 3,616 | |
CurrentCrowdsale | zeppelin-solidity/contracts/ownership/rbac/Roles.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
functio... | /**
* @title Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/ | NatSpecMultiLine | has | function has(Role storage role, address addr)
view
internal
returns (bool)
{
return role.bearer[addr];
}
| /**
* @dev check if an address has this role
* @return bool
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
693,
826
]
} | 3,617 | |
CurrentCrowdsale | contracts/CurrentToken.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | CurrentToken | contract CurrentToken is PausableToken {
string constant public name = "CurrentCoin";
string constant public symbol = "CUR";
uint8 constant public decimals = 18;
uint256 constant public INITIAL_TOTAL_SUPPLY = 1e11 * (uint256(10) ** decimals);
/**
* @dev Create CurrentToken contract and... | CurrentToken | function CurrentToken() public {
totalSupply_ = totalSupply_.add(INITIAL_TOTAL_SUPPLY);
balances[msg.sender] = totalSupply_;
Transfer(address(0), msg.sender, totalSupply_);
pause();
}
| /**
* @dev Create CurrentToken contract and set pause
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
340,
571
]
} | 3,618 | |||
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | 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;
}
... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | Ownable | function Ownable() {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
261,
314
]
} | 3,619 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | 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;
}
... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) 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.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
637,
813
]
} | 3,620 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | BasicToken | contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
// allowedAddresses will be able to transfer even when locked
// lockedAddresses will *not* be able to transfer even when *not locked*
mapping(address => bool) public allowedAddresses;
mapp... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Tr... | /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
1176,
1566
]
} | 3,621 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | BasicToken | contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
// allowedAddresses will be able to transfer even when locked
// lockedAddresses will *not* be able to transfer even when *not locked*
mapping(address => bool) public allowedAddresses;
mapp... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
1772,
1888
]
} | 3,622 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
392,
980
]
} | 3,623 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* ... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
1612,
1802
]
} | 3,624 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
2126,
2271
]
} | 3,625 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
2516,
2787
]
} | 3,626 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | BurnableToken | contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_valu... | /**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/ | NatSpecMultiLine | burn | function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
... | /**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
225,
760
]
} | 3,627 | |
Hodlonaut | Hodlonaut.sol | 0x030673db144326f40a29be1b4ae51344d8b91656 | Solidity | Hodlonaut | contract Hodlonaut is BurnableToken {
string public constant name = "Hodlonaut";
string public constant symbol = "HDL";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals));... | Hodlonaut | function Hodlonaut () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
allowedAddresses[owner] = true;
}
| // Constructors | LineComment | v0.4.24+commit.e67f0147 | bzzr://27f0e939ddfdfd9812532e0ef2c1d0b890d8d4491bbb283c1ec4f7af57a55dd0 | {
"func_code_index": [
345,
534
]
} | 3,628 | |||
CurrentCrowdsale | contracts/VariableTimeBonusRate.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | VariableTimeBonusRate | contract VariableTimeBonusRate {
using SafeMath for uint256;
// Struct specifying the stages of rate modification.
struct RateModifier {
// Percentage by which the rate should be modified.
uint256 ratePermilles;
// start time for a given rate
uint256 start;
}
... | /**
* @title VariableTimeRate
* @dev Contract with time dependent token distribution rate variable.
*/ | NatSpecMultiLine | currentModifier | function currentModifier() public view returns (uint256 rateModifier) {
// solium-disable-next-line security/no-block-members
uint256 comparisonVariable = now;
for (uint i = 0; i < modifiers.length; i++) {
if (comparisonVariable >= modifiers[i].start) {
rateModifier = modifiers[i].r... | /**
* @dev Finds currently applicable rate modifier.
* @return Current rate modifier percentage.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
487,
878
]
} | 3,629 | |
CurrentCrowdsale | contracts/VariableTimeBonusRate.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | VariableTimeBonusRate | contract VariableTimeBonusRate {
using SafeMath for uint256;
// Struct specifying the stages of rate modification.
struct RateModifier {
// Percentage by which the rate should be modified.
uint256 ratePermilles;
// start time for a given rate
uint256 start;
}
... | /**
* @title VariableTimeRate
* @dev Contract with time dependent token distribution rate variable.
*/ | NatSpecMultiLine | pushModifier | function pushModifier(RateModifier _rateModifier) internal {
require(modifiers.length == 0 || _rateModifier.start > modifiers[modifiers.length - 1].start);
modifiers.push(_rateModifier);
}
| /**
* @dev Adds rate modifier checking not to add one with a start smaller than the previous.
* @param _rateModifier RateModifier struct.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
1164,
1380
]
} | 3,630 | |
CurrentCrowdsale | contracts/Whitelist.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | Whitelist | contract Whitelist is Ownable {
mapping(address => bool) whitelist;
uint256 public whitelistLength = 0;
/**
* @dev Add wallet to whitelist.
* @dev Accept request from the owner only.
* @param _wallet The address of wallet to add.
*/
function addWallet(address _wallet) onlyO... | /**
* @title Whitelist contract
* @dev Whitelist for wallets.
*/ | NatSpecMultiLine | addWallet | function addWallet(address _wallet) onlyOwner public {
require(_wallet != address(0));
require(!isWhitelisted(_wallet));
whitelist[_wallet] = true;
whitelistLength++;
}
| /**
* @dev Add wallet to whitelist.
* @dev Accept request from the owner only.
* @param _wallet The address of wallet to add.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
275,
489
]
} | 3,631 | |
CurrentCrowdsale | contracts/Whitelist.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | Whitelist | contract Whitelist is Ownable {
mapping(address => bool) whitelist;
uint256 public whitelistLength = 0;
/**
* @dev Add wallet to whitelist.
* @dev Accept request from the owner only.
* @param _wallet The address of wallet to add.
*/
function addWallet(address _wallet) onlyO... | /**
* @title Whitelist contract
* @dev Whitelist for wallets.
*/ | NatSpecMultiLine | removeWallet | function removeWallet(address _wallet) onlyOwner public {
require(_wallet != address(0));
require(isWhitelisted(_wallet));
whitelist[_wallet] = false;
whitelistLength--;
}
| /**
* @dev Remove wallet from whitelist.
* @dev Accept request from the owner only.
* @param _wallet The address of whitelisted wallet to remove.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
668,
885
]
} | 3,632 | |
CurrentCrowdsale | contracts/Whitelist.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | Whitelist | contract Whitelist is Ownable {
mapping(address => bool) whitelist;
uint256 public whitelistLength = 0;
/**
* @dev Add wallet to whitelist.
* @dev Accept request from the owner only.
* @param _wallet The address of wallet to add.
*/
function addWallet(address _wallet) onlyO... | /**
* @title Whitelist contract
* @dev Whitelist for wallets.
*/ | NatSpecMultiLine | isWhitelisted | function isWhitelisted(address _wallet) constant public returns (bool) {
return whitelist[_wallet];
}
| /**
* @dev Check the specified wallet whether it is in the whitelist.
* @param _wallet The address of wallet to check.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
1031,
1151
]
} | 3,633 | |
CurrentCrowdsale | contracts/PausableToken.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | PausableToken | contract PausableToken is StandardToken, Pausable, RBAC {
string public constant ROLE_ADMINISTRATOR = "administrator";
modifier whenNotPausedOrAuthorized() {
require(!paused || hasRole(msg.sender, ROLE_ADMINISTRATOR));
_;
}
/**
* @dev Add an address that can administer th... | addAdministrator | function addAdministrator(address _administrator) onlyOwner public returns (bool) {
if (isAdministrator(_administrator)) {
return false;
} else {
addRole(_administrator, ROLE_ADMINISTRATOR);
return true;
}
}
| /**
* @dev Add an address that can administer the token even when paused.
* @param _administrator Address of the given administrator.
* @return True if the administrator has been added, false if the address was already an administrator.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
531,
814
]
} | 3,634 | |||
CurrentCrowdsale | contracts/PausableToken.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | PausableToken | contract PausableToken is StandardToken, Pausable, RBAC {
string public constant ROLE_ADMINISTRATOR = "administrator";
modifier whenNotPausedOrAuthorized() {
require(!paused || hasRole(msg.sender, ROLE_ADMINISTRATOR));
_;
}
/**
* @dev Add an address that can administer th... | removeAdministrator | function removeAdministrator(address _administrator) onlyOwner public returns (bool) {
if (isAdministrator(_administrator)) {
removeRole(_administrator, ROLE_ADMINISTRATOR);
return true;
} else {
return false;
}
}
| /**
* @dev Remove an administrator.
* @param _administrator Address of the administrator to be removed.
* @return True if the administrator has been removed,
* false if the address wasn't an administrator in the first place.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
1081,
1370
]
} | 3,635 | |||
CurrentCrowdsale | contracts/PausableToken.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | PausableToken | contract PausableToken is StandardToken, Pausable, RBAC {
string public constant ROLE_ADMINISTRATOR = "administrator";
modifier whenNotPausedOrAuthorized() {
require(!paused || hasRole(msg.sender, ROLE_ADMINISTRATOR));
_;
}
/**
* @dev Add an address that can administer th... | isAdministrator | function isAdministrator(address _administrator) public view returns (bool) {
return hasRole(_administrator, ROLE_ADMINISTRATOR);
}
| /**
* @dev Determine if address is an administrator.
* @param _administrator Address of the administrator to be checked.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
1520,
1670
]
} | 3,636 | |||
CurrentCrowdsale | contracts/PausableToken.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | PausableToken | contract PausableToken is StandardToken, Pausable, RBAC {
string public constant ROLE_ADMINISTRATOR = "administrator";
modifier whenNotPausedOrAuthorized() {
require(!paused || hasRole(msg.sender, ROLE_ADMINISTRATOR));
_;
}
/**
* @dev Add an address that can administer th... | transfer | function transfer(address _to, uint256 _value) public whenNotPausedOrAuthorized returns (bool) {
return super.transfer(_to, _value);
}
| /**
* @dev Transfer token for a specified address with pause feature for administrator.
* @dev Only applies when the transfer is allowed by the owner.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
1944,
2097
]
} | 3,637 | |||
CurrentCrowdsale | contracts/PausableToken.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | PausableToken | contract PausableToken is StandardToken, Pausable, RBAC {
string public constant ROLE_ADMINISTRATOR = "administrator";
modifier whenNotPausedOrAuthorized() {
require(!paused || hasRole(msg.sender, ROLE_ADMINISTRATOR));
_;
}
/**
* @dev Add an address that can administer th... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public whenNotPausedOrAuthorized returns (bool) {
return super.transferFrom(_from, _to, _value);
}
| /**
* @dev Transfer tokens from one address to another with pause feature for administrator.
* @dev Only applies when the transfer is allowed by the owner.
* @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 uint2... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
2490,
2673
]
} | 3,638 | |||
CurrentCrowdsale | contracts/TokenRate.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | TokenRate | contract TokenRate is VariableTimeBonusRate {
uint256 constant public REFERRED_BONUS_PERMILLE = 5;
uint256 constant public REFERRAL_BONUS_PERMILLE = 50;
uint256 public rate;
function TokenRate(uint256 _rate) public {
rate = _rate;
}
function getCurrentBuyerRateInPermilles... | _getTokenAmountForBuyer | function _getTokenAmountForBuyer(uint256 _weiAmount, bool isReferred) internal view returns (uint256) {
return _weiAmount.mul(rate).mul(getCurrentBuyerRateInPermilles(isReferred)).div(1000);
}
| /**
* @dev amount for given wei calculation based on rate modifier percentage.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
868,
1079
]
} | 3,639 | |||
CurrentCrowdsale | contracts/TokenRate.sol | 0x778e7132383bfe51d8a3b73d641f959deb3c8f03 | Solidity | TokenRate | contract TokenRate is VariableTimeBonusRate {
uint256 constant public REFERRED_BONUS_PERMILLE = 5;
uint256 constant public REFERRAL_BONUS_PERMILLE = 50;
uint256 public rate;
function TokenRate(uint256 _rate) public {
rate = _rate;
}
function getCurrentBuyerRateInPermilles... | _getWeiValueOfTokens | function _getWeiValueOfTokens(uint256 _tokensLeft, bool isReferred) internal view returns (uint256) {
uint256 permillesRate = getCurrentBuyerRateInPermilles(isReferred);
if (isReferred) {
permillesRate = permillesRate.add(REFERRAL_BONUS_PERMILLE);
}
uint256 tokensToBuy = _tokensLeft.mul(100... | /**
* @dev amount of wei to pay for tokens - calculation based on rate modifier percentage.
* @param _tokensLeft Value in tokens to be converted into wei
* @return Number of wei that you must pay (bonus rate is taken into account)
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://69f0797bf871f56f74bf43c4b4a5e008b055e14afab1758d5b57ce67c4533b67 | {
"func_code_index": [
1604,
2017
]
} | 3,640 | |||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x8f843ca7960575863bedb42d3cafcf02c206fa8e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-line no... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Ad... | NatSpecMultiLine | _delegate | function _delegate(address implementation) internal {
// solhint-disable-next-line no-inline-assembly
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memo... | /**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | {
"func_code_index": [
223,
1114
]
} | 3,641 | ||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x8f843ca7960575863bedb42d3cafcf02c206fa8e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-line no... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Ad... | NatSpecMultiLine | _implementation | function _implementation() internal virtual view returns (address);
| /**
* @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
* and {_fallback} should delegate.
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | {
"func_code_index": [
1293,
1364
]
} | 3,642 | ||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x8f843ca7960575863bedb42d3cafcf02c206fa8e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-line no... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Ad... | NatSpecMultiLine | _fallback | function _fallback() internal {
_beforeFallback();
_delegate(_implementation());
}
| /**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | {
"func_code_index": [
1590,
1696
]
} | 3,643 | ||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x8f843ca7960575863bedb42d3cafcf02c206fa8e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-line no... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Ad... | NatSpecMultiLine | /**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | {
"func_code_index": [
1889,
1950
]
} | 3,644 | ||||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x8f843ca7960575863bedb42d3cafcf02c206fa8e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-line no... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Ad... | NatSpecMultiLine | /**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | {
"func_code_index": [
2106,
2166
]
} | 3,645 | ||||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x8f843ca7960575863bedb42d3cafcf02c206fa8e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-line no... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Ad... | NatSpecMultiLine | _beforeFallback | function _beforeFallback() internal virtual {
}
| /**
* @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
* call, or as part of the Solidity `fallback` or `receive` functions.
*
* If overriden should call `super._beforeFallback()`.
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | {
"func_code_index": [
2444,
2499
]
} | 3,646 | ||
AaveImport | contracts/compound/create/CompoundCreateReceiver.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CompoundCreateReceiver | contract CompoundCreateReceiver is FlashLoanReceiverBase, SaverExchangeCore {
ILendingPoolAddressesProvider public LENDING_POOL_ADDRESS_PROVIDER = ILendingPoolAddressesProvider(0x24a42fD28C976A61Df5D00D0599C34c4f90748c8);
ShifterRegistry public constant shifterRegistry = ShifterRegistry(0x2E82103bD91053C781aaF... | /// @title Contract that receives the FL from Aave for Creating loans | NatSpecSingleLine | executeOperation | function executeOperation(
address _reserve,
uint256 _amount,
uint256 _fee,
bytes calldata _params)
external override {
// Format the call data for DSProxy
(CompCreateData memory compCreate, ExchangeData memory exchangeData)
= packFunctionCall(_amount, _fee, ... | /// @notice Called by Aave when sending back the FL amount
/// @param _reserve The address of the borrowed token
/// @param _amount Amount of FL tokens received
/// @param _fee FL Aave fee
/// @param _params The params that are sent from the original FL caller contract | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
1182,
2541
]
} | 3,647 |
AaveImport | contracts/compound/create/CompoundCreateReceiver.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CompoundCreateReceiver | contract CompoundCreateReceiver is FlashLoanReceiverBase, SaverExchangeCore {
ILendingPoolAddressesProvider public LENDING_POOL_ADDRESS_PROVIDER = ILendingPoolAddressesProvider(0x24a42fD28C976A61Df5D00D0599C34c4f90748c8);
ShifterRegistry public constant shifterRegistry = ShifterRegistry(0x2E82103bD91053C781aaF... | /// @title Contract that receives the FL from Aave for Creating loans | NatSpecSingleLine | packFunctionCall | function packFunctionCall(uint _amount, uint _fee, bytes memory _params) internal pure returns (CompCreateData memory compCreate, ExchangeData memory exchangeData) {
(
uint[4] memory numData, // srcAmount, destAmount, minPrice, price0x
address[6] memory cAddresses, // cCollAddr, cDebtAddr, srcAddr,... | /// @notice Formats function data call so we can call it through DSProxy
/// @param _amount Amount of FL
/// @param _fee Fee of the FL
/// @param _params Saver proxy params | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
2732,
4064
]
} | 3,648 |
AaveImport | contracts/compound/create/CompoundCreateReceiver.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CompoundCreateReceiver | contract CompoundCreateReceiver is FlashLoanReceiverBase, SaverExchangeCore {
ILendingPoolAddressesProvider public LENDING_POOL_ADDRESS_PROVIDER = ILendingPoolAddressesProvider(0x24a42fD28C976A61Df5D00D0599C34c4f90748c8);
ShifterRegistry public constant shifterRegistry = ShifterRegistry(0x2E82103bD91053C781aaF... | /// @title Contract that receives the FL from Aave for Creating loans | NatSpecSingleLine | sendToProxy | function sendToProxy(address payable _proxy, address _reserve) internal {
if (_reserve != ETH_ADDRESS) {
ERC20(_reserve).safeTransfer(_proxy, ERC20(_reserve).balanceOf(address(this)));
} else {
_proxy.transfer(address(this).balance);
}
}
| /// @notice Send the FL funds received to DSProxy
/// @param _proxy DSProxy address
/// @param _reserve Token address | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
4196,
4489
]
} | 3,649 |
AaveImport | contracts/compound/create/CompoundCreateReceiver.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CompoundCreateReceiver | contract CompoundCreateReceiver is FlashLoanReceiverBase, SaverExchangeCore {
ILendingPoolAddressesProvider public LENDING_POOL_ADDRESS_PROVIDER = ILendingPoolAddressesProvider(0x24a42fD28C976A61Df5D00D0599C34c4f90748c8);
ShifterRegistry public constant shifterRegistry = ShifterRegistry(0x2E82103bD91053C781aaF... | /// @title Contract that receives the FL from Aave for Creating loans | NatSpecSingleLine | // solhint-disable-next-line no-empty-blocks | LineComment | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
5285,
5369
]
} | 3,650 | ||
AaveImport | contracts/shifter/LoanShifterTaker.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | LoanShifterTaker | contract LoanShifterTaker is AdminAuth, ProxyPermission, GasBurner {
ILendingPool public constant lendingPool = ILendingPool(0x398eC7346DcD622eDc5ae82352F02bE94C62d119);
address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public constant DAI_ADDRESS = 0x6B175474E89094... | /// @title LoanShifterTaker Entry point for using the shifting operation | NatSpecSingleLine | moveLoan | function moveLoan(
SaverExchangeCore.ExchangeData memory _exchangeData,
LoanShiftData memory _loanShift
) public payable burnGas(20) {
if (_isSameTypeVaults(_loanShift)) {
_forkVault(_loanShift);
logEvent(_exchangeData, _loanShift);
return;
}
_callCloseAndOpen(_exchangeData,... | /// @notice Main entry point, it will move or transform a loan
/// @dev Called through DSProxy | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
1520,
1899
]
} | 3,651 |
AaveImport | contracts/shifter/LoanShifterTaker.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | LoanShifterTaker | contract LoanShifterTaker is AdminAuth, ProxyPermission, GasBurner {
ILendingPool public constant lendingPool = ILendingPool(0x398eC7346DcD622eDc5ae82352F02bE94C62d119);
address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public constant DAI_ADDRESS = 0x6B175474E89094... | /// @title LoanShifterTaker Entry point for using the shifting operation | NatSpecSingleLine | _callCloseAndOpen | function _callCloseAndOpen(
SaverExchangeCore.ExchangeData memory _exchangeData,
LoanShiftData memory _loanShift
) internal {
address protoAddr = shifterRegistry.getAddr(getNameByProtocol(uint8(_loanShift.fromProtocol)));
if (_loanShift.wholeDebt) {
_loanShift.debtAmount = ILoanShifter(protoAdd... | //////////////////////// INTERNAL FUNCTIONS ////////////////////////// | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
1977,
3441
]
} | 3,652 |
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | totalSupply | function totalSupply() constant returns (uint256 supply) {}
| /// @return total amount of tokens | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
60,
124
]
} | 3,653 | |||
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | balanceOf | function balanceOf(address _owner) constant returns (uint256 balance) {}
| /// @param _owner The address from which the balance will be retrieved
/// @return The balance | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
232,
309
]
} | 3,654 | |||
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | transfer | function transfer(address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
546,
623
]
} | 3,655 | |||
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
946,
1042
]
} | 3,656 | |||
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | approve | function approve(address _spender, uint256 _value) returns (bool success) {}
| /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
1326,
1407
]
} | 3,657 | |||
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | allowance | function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
| /// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
1615,
1712
]
} | 3,658 | |||
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | GoldDollar | contract GoldDollar is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to cust... | //name this contract whatever you'd like | LineComment | GoldDollar | function GoldDollar(
) {
balances[msg.sender] = 5000000000; // Give the creator all initial tokens (100000 for example)
totalSupply = 5000000000; // Update total supply (100000 for example)
name = "GoldDollar"; // Set the name fo... | //human 0.1 standard. Just an arbitrary versioning scheme.
//
// CHANGE THESE VALUES FOR YOUR TOKEN
//
//make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token | LineComment | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
1159,
1712
]
} | 3,659 | |
GoldDollar | GoldDollar.sol | 0x3a1fb5c013cdb7dbccff9cfcad1973d23beec941 | Solidity | GoldDollar | contract GoldDollar is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to cust... | //name this contract whatever you'd like | LineComment | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually s... | /* Approves and then calls the receiving contract */ | Comment | v0.4.24+commit.e67f0147 | bzzr://bb85dfc6b024dc567d7407e1b1e6a3ec35212d046107a47143bd83e6ce584330 | {
"func_code_index": [
1773,
2578
]
} | 3,660 | |
AaveImport | contracts/mcd/saver/MCDSaverFlashLoan.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDSaverFlashLoan | contract MCDSaverFlashLoan is MCDSaverProxy, AdminAuth, FlashLoanReceiverBase {
ILendingPoolAddressesProvider public LENDING_POOL_ADDRESS_PROVIDER = ILendingPoolAddressesProvider(0x24a42fD28C976A61Df5D00D0599C34c4f90748c8);
constructor() FlashLoanReceiverBase(LENDING_POOL_ADDRESS_PROVIDER) public {}
stru... | limitLoanAmount | function limitLoanAmount(uint _cdpId, bytes32 _ilk, uint _paybackAmount, address _owner) internal returns (uint256) {
uint debt = getAllDebt(address(vat), manager.urns(_cdpId), manager.urns(_cdpId), _ilk);
if (_paybackAmount > debt) {
ERC20(DAI_ADDRESS).transfer(_owner, (_paybackAmount - debt));
... | /// @notice Handles that the amount is not bigger than cdp debt and not dust | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
4198,
4970
]
} | 3,661 | ||
Stader | contracts/Stader.sol | 0xc7452d6a59a3a38dce2ed44c9586f1e0ccd7bff4 | Solidity | Stader | contract Stader is ERC20, ERC20Burnable, ERC20Permit, ERC20Votes {
constructor() ERC20("Stader", "SD") ERC20Permit("Stader") {
_mint(msg.sender, 150000000 * 10 ** decimals());
}
// The following functions are overrides required by Solidity.
function _afterTokenTransfer(address from, address to... | _afterTokenTransfer | function _afterTokenTransfer(address from, address to, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._afterTokenTransfer(from, to, amount);
}
| // The following functions are overrides required by Solidity. | LineComment | v0.8.2+commit.661d1103 | {
"func_code_index": [
263,
455
]
} | 3,662 | ||||
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | repayFor | function repayFor(
SaverExchangeCore.ExchangeData memory _exchangeData,
uint _cdpId,
uint _nextPrice,
address _joinAddr
) public payable onlyApproved burnGas(REPAY_GAS_TOKEN) {
(bool isAllowed, uint ratioBefore) = canCall(Method.Repay, _cdpId, _nextPrice);
require(isAllowed);
uint gasCost ... | /// @notice Bots call this method to repay for user when conditions are met
/// @dev If the contract ownes gas token it will try and use it for gas price reduction | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
1473,
2515
]
} | 3,663 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | boostFor | function boostFor(
SaverExchangeCore.ExchangeData memory _exchangeData,
uint _cdpId,
uint _nextPrice,
address _joinAddr
) public payable onlyApproved burnGas(BOOST_GAS_TOKEN) {
(bool isAllowed, uint ratioBefore) = canCall(Method.Boost, _cdpId, _nextPrice);
require(isAllowed);
uint gasCost... | /// @notice Bots call this method to boost for user when conditions are met
/// @dev If the contract ownes gas token it will try and use it for gas price reduction | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
2689,
3731
]
} | 3,664 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | returnEth | function returnEth() internal {
// return if some eth left
if (address(this).balance > 0) {
msg.sender.transfer(address(this).balance);
}
}
| /******************* INTERNAL METHODS ********************************/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
3805,
3988
]
} | 3,665 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | getOwner | function getOwner(uint _cdpId) public view returns(address) {
return manager.owns(_cdpId);
}
| /// @notice Returns an address that owns the CDP
/// @param _cdpId Id of the CDP | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
4150,
4258
]
} | 3,666 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | getCdpInfo | function getCdpInfo(uint _cdpId, bytes32 _ilk) public view returns (uint, uint) {
address urn = manager.urns(_cdpId);
(uint collateral, uint debt) = vat.urns(_ilk, urn);
(,uint rate,,,) = vat.ilks(_ilk);
return (collateral, rmul(debt, rate));
}
| /// @notice Gets CDP info (collateral, debt)
/// @param _cdpId Id of the CDP
/// @param _ilk Ilk of the CDP | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
4380,
4666
]
} | 3,667 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | getPrice | function getPrice(bytes32 _ilk) public view returns (uint) {
(, uint mat) = spotter.ilks(_ilk);
(,,uint spot,,) = vat.ilks(_ilk);
return rmul(rmul(spot, spotter.par()), mat);
}
| /// @notice Gets a price of the asset
/// @param _ilk Ilk of the CDP | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
4745,
4954
]
} | 3,668 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | getRatio | function getRatio(uint _cdpId, uint _nextPrice) public view returns (uint) {
bytes32 ilk = manager.ilks(_cdpId);
uint price = (_nextPrice == 0) ? getPrice(ilk) : _nextPrice;
(uint collateral, uint debt) = getCdpInfo(_cdpId, ilk);
if (debt == 0) return 0;
return rdiv(wmul(collateral, price), debt)... | /// @notice Gets CDP ratio
/// @param _cdpId Id of the CDP
/// @param _nextPrice Next price for user | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
5069,
5433
]
} | 3,669 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | canCall | function canCall(Method _method, uint _cdpId, uint _nextPrice) public view returns(bool, uint) {
bool subscribed;
CdpHolder memory holder;
(subscribed, holder) = subscriptionsContract.getCdpHolder(_cdpId);
// check if cdp is subscribed
if (!subscribed) return (false, 0);
// check if using next... | /// @notice Checks if Boost/Repay could be triggered for the CDP
/// @dev Called by MCDMonitor to enforce the min/max check | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
5567,
6519
]
} | 3,670 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | ratioGoodAfter | function ratioGoodAfter(Method _method, uint _cdpId, uint _nextPrice) public view returns(bool, uint) {
CdpHolder memory holder;
(, holder) = subscriptionsContract.getCdpHolder(_cdpId);
uint currRatio = getRatio(_cdpId, _nextPrice);
if (_method == Method.Repay) {
return (currRatio < holder.ma... | /// @dev After the Boost/Repay check if the ratio doesn't trigger another call | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
6604,
7090
]
} | 3,671 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | calcGasCost | function calcGasCost(uint _gasAmount) public view returns (uint) {
uint gasPrice = tx.gasprice <= MAX_GAS_PRICE ? tx.gasprice : MAX_GAS_PRICE;
return mul(gasPrice, _gasAmount);
}
| /// @notice Calculates gas cost (in Eth) of tx
/// @dev Gas price is limited to MAX_GAS_PRICE to prevent attack of draining user CDP
/// @param _gasAmount Amount of gas used for the tx | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
7289,
7492
]
} | 3,672 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | changeBoostGasCost | function changeBoostGasCost(uint _gasCost) public onlyOwner {
require(_gasCost < 3000000);
BOOST_GAS_COST = _gasCost;
}
| /// @notice Allows owner to change gas cost for boost operation, but only up to 3 millions
/// @param _gasCost New gas cost for boost method | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
7721,
7865
]
} | 3,673 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | changeRepayGasCost | function changeRepayGasCost(uint _gasCost) public onlyOwner {
require(_gasCost < 3000000);
REPAY_GAS_COST = _gasCost;
}
| /// @notice Allows owner to change gas cost for repay operation, but only up to 3 millions
/// @param _gasCost New gas cost for repay method | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
8016,
8160
]
} | 3,674 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | changeMaxGasPrice | function changeMaxGasPrice(uint _maxGasPrice) public onlyOwner {
require(_maxGasPrice < 500000000000);
MAX_GAS_PRICE = _maxGasPrice;
}
| /// @notice Allows owner to change max gas price
/// @param _maxGasPrice New max gas price | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
8261,
8420
]
} | 3,675 |
AaveImport | contracts/mcd/automaticV2/MCDMonitorV2.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | MCDMonitorV2 | contract MCDMonitorV2 is DSMath, AdminAuth, GasBurner, StaticV2 {
uint public REPAY_GAS_TOKEN = 25;
uint public BOOST_GAS_TOKEN = 25;
uint public MAX_GAS_PRICE = 500000000000; // 500 gwei
uint public REPAY_GAS_COST = 1800000;
uint public BOOST_GAS_COST = 1800000;
MCDMonitorProxyV2 public mon... | /// @title Implements logic that allows bots to call Boost and Repay | NatSpecSingleLine | changeGasTokenAmount | function changeGasTokenAmount(uint _gasAmount, bool _isRepay) public onlyOwner {
if (_isRepay) {
REPAY_GAS_TOKEN = _gasAmount;
} else {
BOOST_GAS_TOKEN = _gasAmount;
}
}
| /// @notice Allows owner to change the amount of gas token burned per function call
/// @param _gasAmount Amount of gas token
/// @param _isRepay Flag to know for which function we are setting the gas token amount | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
8648,
8873
]
} | 3,676 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | paybackDebt | function paybackDebt(uint _amount, address _cBorrowToken, address _borrowToken, address payable _user) internal {
uint wholeDebt = CTokenInterface(_cBorrowToken).borrowBalanceCurrent(address(this));
if (_amount > wholeDebt) {
if (_borrowToken == ETH_ADDRESS) {
_user.transfer((_amount - whol... | /// @notice Helper method to payback the cream debt
/// @dev If amount is bigger it will repay the whole debt and send the extra to the _user
/// @param _amount Amount of tokens we want to repay
/// @param _cBorrowToken Ctoken address we are repaying
/// @param _borrowToken Token address we are repaying
/// @param _use... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
1147,
1937
]
} | 3,677 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | getFee | function getFee(uint _amount, address _user, uint _gasCost, address _cTokenAddr) internal returns (uint feeAmount) {
uint fee = MANUAL_SERVICE_FEE;
if (BotRegistry(BOT_REGISTRY_ADDRESS).botList(tx.origin)) {
fee = AUTOMATIC_SERVICE_FEE;
}
address tokenAddr = getUnderlyingAddr(_cTokenAddr);
... | /// @notice Calculates the fee amount
/// @param _amount Amount that is converted
/// @param _user Actuall user addr not DSProxy
/// @param _gasCost Ether amount of gas we are spending for tx
/// @param _cTokenAddr CToken addr. of token we are getting for the fee
/// @return feeAmount The amount we took for the fee | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
2280,
3463
]
} | 3,678 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | getGasCost | function getGasCost(uint _amount, uint _gasCost, address _cTokenAddr) internal returns (uint feeAmount) {
address tokenAddr = getUnderlyingAddr(_cTokenAddr);
if (_gasCost != 0) {
address oracle = ComptrollerInterface(COMPTROLLER).oracle();
uint ethTokenPrice = CompoundOracleInterface(oracle).g... | /// @notice Calculates the gas cost of transaction and send it to wallet
/// @param _amount Amount that is converted
/// @param _gasCost Ether amount of gas we are spending for tx
/// @param _cTokenAddr CToken addr. of token we are getting for the fee
/// @return feeAmount The amount we took for the fee | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
3790,
4555
]
} | 3,679 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | enterMarket | function enterMarket(address _cTokenAddrColl, address _cTokenAddrBorrow) internal {
address[] memory markets = new address[](2);
markets[0] = _cTokenAddrColl;
markets[1] = _cTokenAddrBorrow;
ComptrollerInterface(COMPTROLLER).enterMarkets(markets);
}
| /// @notice Enters the market for the collatera and borrow tokens
/// @param _cTokenAddrColl Collateral address we are entering the market in
/// @param _cTokenAddrBorrow Borrow address we are entering the market in | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
4785,
5075
]
} | 3,680 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | approveCToken | function approveCToken(address _tokenAddr, address _cTokenAddr) internal {
if (_tokenAddr != ETH_ADDRESS) {
ERC20(_tokenAddr).safeApprove(_cTokenAddr, uint(-1));
}
}
| /// @notice Approves CToken contract to pull underlying tokens from the DSProxy
/// @param _tokenAddr Token we are trying to approve
/// @param _cTokenAddr Address which will gain the approval | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
5282,
5483
]
} | 3,681 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | getUnderlyingAddr | function getUnderlyingAddr(address _cTokenAddress) internal returns (address) {
if (_cTokenAddress == CETH_ADDRESS) {
return ETH_ADDRESS;
} else {
return CTokenInterface(_cTokenAddress).underlying();
}
}
| /// @notice Returns the underlying address of the cToken asset
/// @param _cTokenAddress cToken address
/// @return Token address of the cToken specified | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
5651,
5910
]
} | 3,682 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | getUserAddress | function getUserAddress() internal view returns (address) {
DSProxy proxy = DSProxy(uint160(address(this)));
return proxy.owner();
}
| /// @notice Returns the owner of the DSProxy that called the contract | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
5986,
6143
]
} | 3,683 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | getMaxCollateral | function getMaxCollateral(address _cCollAddress, address _account) public returns (uint) {
(, uint liquidityInEth, ) = ComptrollerInterface(COMPTROLLER).getAccountLiquidity(_account);
uint usersBalance = CTokenInterface(_cCollAddress).balanceOfUnderlying(_account);
address oracle = ComptrollerInterface(COMP... | /// @notice Returns the maximum amount of collateral available to withdraw
/// @dev Due to rounding errors the result is - 1% wei from the exact amount
/// @param _cCollAddress Collateral we are getting the max value of
/// @param _account Users account
/// @return Returns the max. collateral amount in that token | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
6480,
7471
]
} | 3,684 |
AaveImport | contracts/cream/helpers/CreamSaverHelper.sol | 0x751961666d8605af1c5ee549205f822f47b04168 | Solidity | CreamSaverHelper | contract CreamSaverHelper is DSMath, Exponential {
using SafeERC20 for ERC20;
address payable public constant WALLET_ADDR = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08;
address public constant DISCOUNT_ADDR = 0x1b14E8D511c9A4395425314f849bD737BAF8208F;
uint public constant MANUAL_SERVICE_FEE = 400; //... | /// @title Utlity functions for cream contracts | NatSpecSingleLine | getMaxBorrow | function getMaxBorrow(address _cBorrowAddress, address _account) public returns (uint) {
(, uint liquidityInEth, ) = ComptrollerInterface(COMPTROLLER).getAccountLiquidity(_account);
address oracle = ComptrollerInterface(COMPTROLLER).oracle();
CTokenInterface(_cBorrowAddress).accrueInterest();
if (_cBo... | /// @notice Returns the maximum amount of borrow amount available
/// @dev Due to rounding errors the result is - 1% wei from the exact amount
/// @param _cBorrowAddress Borrow token we are getting the max value of
/// @param _account Users account
/// @return Returns the max. borrow amount in that token | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://34c42220a035234e7357a4f4dce033d4f7741dd29565a8d77139b7fde50d3c09 | {
"func_code_index": [
7799,
8485
]
} | 3,685 |
Create2Deployer | @openzeppelin/contracts/utils/introspection/ERC1820Implementer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | ERC1820Implementer | contract ERC1820Implementer is IERC1820Implementer {
bytes32 private constant _ERC1820_ACCEPT_MAGIC = keccak256("ERC1820_ACCEPT_MAGIC");
mapping(bytes32 => mapping(address => bool)) private _supportedInterfaces;
/**
* @dev See {IERC1820Implementer-canImplementInterfaceForAddress}.
*/
functio... | /**
* @dev Implementation of the {IERC1820Implementer} interface.
*
* Contracts may inherit from this and call {_registerInterfaceForAddress} to
* declare their willingness to be implementers.
* {IERC1820Registry-setInterfaceImplementer} should then be called for the
* registration to be complete.
*/ | NatSpecMultiLine | canImplementInterfaceForAddress | function canImplementInterfaceForAddress(bytes32 interfaceHash, address account)
public
view
virtual
override
returns (bytes32)
{
return _supportedInterfaces[interfaceHash][account] ? _ERC1820_ACCEPT_MAGIC : bytes32(0x00);
}
| /**
* @dev See {IERC1820Implementer-canImplementInterfaceForAddress}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
309,
593
]
} | 3,686 | ||
Create2Deployer | @openzeppelin/contracts/utils/introspection/ERC1820Implementer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | ERC1820Implementer | contract ERC1820Implementer is IERC1820Implementer {
bytes32 private constant _ERC1820_ACCEPT_MAGIC = keccak256("ERC1820_ACCEPT_MAGIC");
mapping(bytes32 => mapping(address => bool)) private _supportedInterfaces;
/**
* @dev See {IERC1820Implementer-canImplementInterfaceForAddress}.
*/
functio... | /**
* @dev Implementation of the {IERC1820Implementer} interface.
*
* Contracts may inherit from this and call {_registerInterfaceForAddress} to
* declare their willingness to be implementers.
* {IERC1820Registry-setInterfaceImplementer} should then be called for the
* registration to be complete.
*/ | NatSpecMultiLine | _registerInterfaceForAddress | function _registerInterfaceForAddress(bytes32 interfaceHash, address account) internal virtual {
_supportedInterfaces[interfaceHash][account] = true;
}
| /**
* @dev Declares the contract as willing to be an implementer of
* `interfaceHash` for `account`.
*
* See {IERC1820Registry-setInterfaceImplementer} and
* {IERC1820Registry-interfaceHash}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
824,
991
]
} | 3,687 | ||
Create2Deployer | @openzeppelin/contracts/utils/introspection/IERC1820Implementer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | IERC1820Implementer | interface IERC1820Implementer {
/**
* @dev Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contract
* implements `interfaceHash` for `account`.
*
* See {IERC1820Registry-setInterfaceImplementer}.
*/
function canImplementInterfaceForAddress(bytes32 interfaceHash, address account... | /**
* @dev Interface for an ERC1820 implementer, as defined in the
* https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[EIP].
* Used by contracts that will be registered as implementers in the
* {IERC1820Registry}.
*/ | NatSpecMultiLine | canImplementInterfaceForAddress | function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32);
| /**
* @dev Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contract
* implements `interfaceHash` for `account`.
*
* See {IERC1820Registry-setInterfaceImplementer}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
237,
354
]
} | 3,688 | ||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | deploy | function deploy(
uint256 value,
bytes32 salt,
bytes memory code
) public whenNotPaused {
Create2.deploy(value, salt, code);
}
| /**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCode`.
*
* Requirements:
* - `bytecode` must not be empty.
* - `salt` m... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
604,
773
]
} | 3,689 | ||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | deployERC1820Implementer | function deployERC1820Implementer(uint256 value, bytes32 salt) public whenNotPaused {
Create2.deploy(value, salt, type(ERC1820Implementer).creationCode);
}
| /**
* @dev Deployment of the {ERC1820Implementer}.
* Further information: https://eips.ethereum.org/EIPS/eip-1820
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
911,
1082
]
} | 3,690 | ||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | computeAddress | function computeAddress(bytes32 salt, bytes32 codeHash) public view returns (address) {
return Create2.computeAddress(salt, codeHash);
}
| /**
* @dev Returns the address where a contract will be stored if deployed via {deploy}.
* Any change in the `bytecodeHash` or `salt` will result in a new destination address.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1282,
1434
]
} | 3,691 | ||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | computeAddressWithDeployer | function computeAddressWithDeployer(
bytes32 salt,
bytes32 codeHash,
address deployer
) public pure returns (address) {
return Create2.computeAddress(salt, codeHash, deployer);
}
| /**
* @dev Returns the address where a contract will be stored if deployed via {deploy} from a
* contract located at `deployer`. If `deployer` is this contract's address, returns the
* same value as {computeAddress}.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
1680,
1902
]
} | 3,692 | ||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | /**
* @dev Contract can receive ether. However, the only way to transfer this ether is
* to call the function `killCreate2Deployer`.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2059,
2092
]
} | 3,693 | ||||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | pause | function pause() public onlyOwner {
_pause();
}
| /**
* @dev Triggers stopped state.
* Requirements: The contract must not be paused.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2200,
2263
]
} | 3,694 | ||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | unpause | function unpause() public onlyOwner {
_unpause();
}
| /**
* @dev Returns to normal state.
* Requirements: The contract must be paused.
*/ | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
2368,
2435
]
} | 3,695 | ||
Create2Deployer | contracts/Create2Deployer.sol | 0x13b0d85ccb8bf860b6b79af3029fca081ae9bef2 | Solidity | Create2Deployer | contract Create2Deployer is Ownable, Pausable {
/**
* @dev Deploys a contract using `CREATE2`. The address where the
* contract will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCod... | /**
* @title CREATE2 Deployer Smart Contract
* @author Pascal Marco Caversaccio, pascal.caversaccio@hotmail.ch
* @dev Helper smart contract to make easier and safer usage of the
* `CREATE2` EVM opcode. `CREATE2` can be used to compute in advance
* the address where a smart contract will be deployed, which allows
... | NatSpecMultiLine | killCreate2Deployer | function killCreate2Deployer(address payable payoutAddress) public onlyOwner {
payoutAddress.transfer(address(this).balance);
selfdestruct(payoutAddress);
}
| /**
* @dev Destroys the Create2Deployer contract and transfers all ether to a pre-defined payout address.
* @notice Using the `CREATE2` EVM opcode always allows to redeploy a new smart contract to a
* previously seldestructed contract address. However, if a contract creation is attempted,
* due to either a creation... | NatSpecMultiLine | v0.8.9+commit.e5eed63a | {
"func_code_index": [
3131,
3311
]
} | 3,696 | ||
SushiInu | SushiInu.sol | 0x54c137667c11c26d13c7bbb7fbfa8b7c50f181a4 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.8.3+commit.8d00100c | None | ipfs://9d6f7d9809392a583e6bc787f803f32f149d7cd1d80334dea0efc8fd2dbbc03b | {
"func_code_index": [
92,
152
]
} | 3,697 |
SushiInu | SushiInu.sol | 0x54c137667c11c26d13c7bbb7fbfa8b7c50f181a4 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.8.3+commit.8d00100c | None | ipfs://9d6f7d9809392a583e6bc787f803f32f149d7cd1d80334dea0efc8fd2dbbc03b | {
"func_code_index": [
233,
306
]
} | 3,698 |
SushiInu | SushiInu.sol | 0x54c137667c11c26d13c7bbb7fbfa8b7c50f181a4 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.8.3+commit.8d00100c | None | ipfs://9d6f7d9809392a583e6bc787f803f32f149d7cd1d80334dea0efc8fd2dbbc03b | {
"func_code_index": [
524,
606
]
} | 3,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.