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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
356,
629
]
} | 19,100 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
744,
860
]
} | 19,101 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
924,
1060
]
} | 19,102 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | OracleBase | function OracleBase() public {
oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
}
| /**
* @dev Constructor.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
1297,
1408
]
} | 19,103 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | setGasPrice | function setGasPrice(uint256 priceInWei) public onlyOwner {
require((priceInWei >= MIN_GAS_PRICE) && (priceInWei <= MAX_GAS_PRICE));
gasPrice = priceInWei;
oraclize_setCustomGasPrice(gasPrice);
}
| /**
* @dev Sets gas price.
* @param priceInWei New gas price.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
1499,
1731
]
} | 19,104 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | setGasLimit | function setGasLimit(uint256 _gasLimit) public onlyOwner {
require((_gasLimit >= MIN_GAS_LIMIT) && (_gasLimit <= MAX_GAS_LIMIT));
gasLimit = _gasLimit;
}
| /**
* @dev Sets gas limit.
* @param _gasLimit New gas limit.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
1821,
2002
]
} | 19,105 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | setBank | function setBank(address bank) public onlyOwner {
bankAddress = bank;
BankSet(bankAddress);
}
| /**
* @dev Sets bank address.
* @param bank Address of the bank contract.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
2105,
2226
]
} | 19,106 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | getPrice | function getPrice() public view returns (uint) {
return oraclize_getPrice(oracleConfig.datasource, gasLimit);
}
| /**
* @dev oraclize getPrice.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
2279,
2409
]
} | 19,107 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | updateRate | function updateRate() external onlyBank returns (bool) {
if (getPrice() > this.balance) {
OraclizeError("Not enough ether");
return false;
}
bytes32 queryId = oraclize_query(oracleConfig.datasource, oracleConfig.arguments, gasLimit, priceLimit);
if (queryId == bytes32(0))... | /**
* @dev Requests updating rate from oraclize.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
2481,
3080
]
} | 19,108 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | __callback | function __callback(bytes32 myid, string result, bytes proof) public {
require(validIds[myid] && msg.sender == oraclize_cbAddress());
rate = Helpers.parseIntRound(result, 3); // save it in storage as 1/1000 of $
delete validIds[myid];
callbackTime = now;
waitQuery = false;
PriceTicker(re... | /**
* @dev Oraclize default callback with the proof set.
* @param myid The callback ID.
* @param result The callback data.
* @param proof The oraclize proof bytes.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
3280,
3655
]
} | 19,109 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | __callback | function __callback(bytes32 myid, string result) public {
bytes memory proof = new bytes(1);
__callback(myid, result, proof);
}
| /**
* @dev Oraclize default callback without the proof set.
* @param myid The callback ID.
* @param result The callback data.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
3812,
3967
]
} | 19,110 | |
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBase | contract OracleBase is Ownable, usingOraclize, OracleI {
event NewOraclizeQuery();
event OraclizeError(string desciption);
event PriceTicker(string price, bytes32 queryId, bytes proof);
event BankSet(address bankAddress);
struct OracleConfig {
string datasource;
string argum... | /**
* @title Base contract for Oraclize oracles.
*
* @dev Base contract for oracles. Not abstract.
*/ | NatSpecMultiLine | function () public payable {}
| /**
* @dev Method used for oracle funding
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
4037,
4071
]
} | 19,111 | ||
OracleBitstamp | OracleBitstamp.sol | 0x0479f22c80078e41390b7f6b491d8f771bdc15ef | Solidity | OracleBitstamp | contract OracleBitstamp is OracleBase {
bytes32 constant ORACLE_NAME = "Bitstamp Oraclize Async";
bytes16 constant ORACLE_TYPE = "ETHUSD";
string constant ORACLE_DATASOURCE = "URL";
string constant ORACLE_ARGUMENTS = "json(https://www.bitstamp.net/api/v2/ticker/ethusd).last";
/**
* ... | OracleBitstamp | function OracleBitstamp() public {
oracleName = ORACLE_NAME;
oracleType = ORACLE_TYPE;
oracleConfig = OracleConfig({datasource: ORACLE_DATASOURCE, arguments: ORACLE_ARGUMENTS});
}
| /**
* @dev Constructor.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://095513bc8c3aff7b89607ea7f5fe4933aca78f863099e5e4ecbfacea0ea76ace | {
"func_code_index": [
348,
564
]
} | 19,112 | |||
TestCoin | TestCoin.sol | 0x7f27d71a6236d7694e01a6edce8dbabd2cf6050e | Solidity | TestCoin | contract TestCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 1000000000000 * 10**9; //9 decimal spots after the amount
string private m_Name = "TestCoin";
string private m_Symbol = "TEST";
uint8 private m_Decimals = 9;
uin... | name | function name() public view returns (string memory) {
return m_Name;
}
| // ####################
// ##### DEFAULTS #####
// #################### | LineComment | v0.8.4+commit.c7e474f2 | MIT | ipfs://22ae4e0ec943d34a0fc5509599d20d546d5526a4d5b4f164ffd55badf82f12f2 | {
"func_code_index": [
2510,
2599
]
} | 19,113 | ||
TestCoin | TestCoin.sol | 0x7f27d71a6236d7694e01a6edce8dbabd2cf6050e | Solidity | TestCoin | contract TestCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 1000000000000 * 10**9; //9 decimal spots after the amount
string private m_Name = "TestCoin";
string private m_Symbol = "TEST";
uint8 private m_Decimals = 9;
uin... | totalSupply | function totalSupply() public pure override returns (uint256) {
return TOTAL_SUPPLY;
}
| // #####################
// ##### OVERRIDES #####
// ##################### | LineComment | v0.8.4+commit.c7e474f2 | MIT | ipfs://22ae4e0ec943d34a0fc5509599d20d546d5526a4d5b4f164ffd55badf82f12f2 | {
"func_code_index": [
2870,
2975
]
} | 19,114 | ||
TestCoin | TestCoin.sol | 0x7f27d71a6236d7694e01a6edce8dbabd2cf6050e | Solidity | TestCoin | contract TestCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 1000000000000 * 10**9; //9 decimal spots after the amount
string private m_Name = "TestCoin";
string private m_Symbol = "TEST";
uint8 private m_Decimals = 9;
uin... | _readyToSwap | function _readyToSwap(address _sender) private view returns(bool) {
return !m_IsSwap && _sender != m_UniswapV2Pair && m_SwapEnabled;
}
| // ####################
// ##### PRIVATES #####
// #################### | LineComment | v0.8.4+commit.c7e474f2 | MIT | ipfs://22ae4e0ec943d34a0fc5509599d20d546d5526a4d5b4f164ffd55badf82f12f2 | {
"func_code_index": [
4024,
4177
]
} | 19,115 | ||
TestCoin | TestCoin.sol | 0x7f27d71a6236d7694e01a6edce8dbabd2cf6050e | Solidity | TestCoin | contract TestCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 1000000000000 * 10**9; //9 decimal spots after the amount
string private m_Name = "TestCoin";
string private m_Symbol = "TEST";
uint8 private m_Decimals = 9;
uin... | banCount | function banCount() external view returns (uint256) {
return m_BanCount;
}
| // ####################
// ##### EXTERNAL #####
// #################### | LineComment | v0.8.4+commit.c7e474f2 | MIT | ipfs://22ae4e0ec943d34a0fc5509599d20d546d5526a4d5b4f164ffd55badf82f12f2 | {
"func_code_index": [
11634,
11727
]
} | 19,116 | ||
TestCoin | TestCoin.sol | 0x7f27d71a6236d7694e01a6edce8dbabd2cf6050e | Solidity | TestCoin | contract TestCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 1000000000000 * 10**9; //9 decimal spots after the amount
string private m_Name = "TestCoin";
string private m_Symbol = "TEST";
uint8 private m_Decimals = 9;
uin... | addLiquidity | function addLiquidity() external onlyOwner() {
require(!m_TradingOpened,"trading is already open");
m_Whitelist[_msgSender()] = true;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
m_UniswapV2Router = _uniswapV2Router;
m_Whitelist[address(m... | // ######################
// ##### ONLY OWNER #####
// ###################### | LineComment | v0.8.4+commit.c7e474f2 | MIT | ipfs://22ae4e0ec943d34a0fc5509599d20d546d5526a4d5b4f164ffd55badf82f12f2 | {
"func_code_index": [
12787,
13749
]
} | 19,117 | ||
TestCoin | TestCoin.sol | 0x7f27d71a6236d7694e01a6edce8dbabd2cf6050e | Solidity | TestCoin | contract TestCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 1000000000000 * 10**9; //9 decimal spots after the amount
string private m_Name = "TestCoin";
string private m_Symbol = "TEST";
uint8 private m_Decimals = 9;
uin... | forgiveAddress | function forgiveAddress(address _address) external onlyOwner() {
m_Forgiven[_address] = true;
}
| // This exists in the event an address is falsely banned | LineComment | v0.8.4+commit.c7e474f2 | MIT | ipfs://22ae4e0ec943d34a0fc5509599d20d546d5526a4d5b4f164ffd55badf82f12f2 | {
"func_code_index": [
18444,
18558
]
} | 19,118 | ||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | QNC | function QNC(
) public {
totalSupply = 10000000000000000; // Update total supply with the decimal amount
balanceOf[msg.sender] = 10000000000000000; // Give the creator all initial tokens
name = "Queenie Coin"; // Set ... | /**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
759,
1246
]
} | 19,119 | |||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to])... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
1330,
2172
]
} | 19,120 | |||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | transfer | function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
| /**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
2378,
2490
]
} | 19,121 | |||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| /**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
2765,
3066
]
} | 19,122 | |||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | approve | function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
| /**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
3330,
3506
]
} | 19,123 | |||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
| /**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to s... | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
3900,
4252
]
} | 19,124 | |||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | burn | function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _val... | /**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
4422,
4796
]
} | 19,125 | |||
QNC | QNC.sol | 0x658d45e88e62ac0efcbdf5ddf222b1bb51015851 | Solidity | QNC | contract QNC {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 8;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uin... | burnFrom | function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Sub... | /**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://4d573ef18f252e0996ff59068231cc1160489b67bea9c79ff0db0601f78d74a9 | {
"func_code_index": [
5054,
5665
]
} | 19,126 | |||
GotingToken | GotingToken.sol | 0x617b5744a63e436ab54a9f6efc4e91e6fce233f7 | Solidity | SafeMath | library SafeMath {
/**
* 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;
}
/**
* Integ... | /**
* @title SafeMath
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
| /**
* Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://89cf9295b9f774eba6dabba0ae3a0120f95027b77f7e0b3085470b151f6b9117 | {
"func_code_index": [
90,
297
]
} | 19,127 | |
GotingToken | GotingToken.sol | 0x617b5744a63e436ab54a9f6efc4e91e6fce233f7 | Solidity | SafeMath | library SafeMath {
/**
* 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;
}
/**
* Integ... | /**
* @title SafeMath
*/ | 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;
}
| /**
* Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://89cf9295b9f774eba6dabba0ae3a0120f95027b77f7e0b3085470b151f6b9117 | {
"func_code_index": [
382,
682
]
} | 19,128 | |
GotingToken | GotingToken.sol | 0x617b5744a63e436ab54a9f6efc4e91e6fce233f7 | Solidity | SafeMath | library SafeMath {
/**
* 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;
}
/**
* Integ... | /**
* @title SafeMath
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://89cf9295b9f774eba6dabba0ae3a0120f95027b77f7e0b3085470b151f6b9117 | {
"func_code_index": [
797,
925
]
} | 19,129 | |
GotingToken | GotingToken.sol | 0x617b5744a63e436ab54a9f6efc4e91e6fce233f7 | Solidity | SafeMath | library SafeMath {
/**
* 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;
}
/**
* Integ... | /**
* @title SafeMath
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://89cf9295b9f774eba6dabba0ae3a0120f95027b77f7e0b3085470b151f6b9117 | {
"func_code_index": [
990,
1136
]
} | 19,130 | |
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) ret... | transfer | function transfer(address _to, uint256 _value) returns (bool) {
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
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 | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
268,
606
]
} | 19,131 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) ret... | balanceOf | function balanceOf(address _owner) 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.23+commit.124ca40d | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
812,
921
]
} | 19,132 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | Solidity | Ownable | contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onl... | Ownable | function Ownable() {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
169,
222
]
} | 19,133 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | Solidity | Ownable | contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onl... | transferOwnership | function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
545,
670
]
} | 19,134 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | 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
... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
require(_to != address(0));
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balan... | /**
* @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 | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
392,
930
]
} | 19,135 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | 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
... | approve | function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs... | /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
1166,
1714
]
} | 19,136 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | 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
... | allowance | function allowance(address _owner, address _spender) 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.23+commit.124ca40d | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
2038,
2176
]
} | 19,137 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | 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
... | 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.23+commit.124ca40d | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
2421,
2692
]
} | 19,138 | |||
OZTToken | OZTToken.sol | 0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5 | Solidity | OZTToken | contract OZTToken is StandardToken, Ownable {
/* Overriding some ERC20 variables */
string public constant name = "OZTToken";
string public constant symbol = "OZT";
uint256 public constant decimals = 18;
uint256 public constant MAX_NUM_OZT_TOKENS = 730000000 * 10 ** decimals;
// Freeze dur... | batchAssignTokens | function batchAssignTokens(address[] _vaddr, uint[] _vamounts, uint[] _vDefrostClass ) onlyOwner {
require ( batchAssignStopped == false );
require ( _vaddr.length == _vamounts.length && _vaddr.length == _vDefrostClass.length);
//Looping into input arrays to assign target amount to each given address
for (uin... | /**
* @dev Transfer tokens in batches (of adresses)
* @param _vaddr address The address which you want to send tokens from
* @param _vamounts address The address which you want to transfer to
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://59bb823b2a3795c26528e8ca3f35dde2685379d54cc41d07ac71b66e87534984 | {
"func_code_index": [
2120,
3188
]
} | 19,139 | |||
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | // To receive ETH from compound and WETH contract | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
2383,
2417
]
} | 19,140 | ||
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | setDyDx | function setDyDx(bool _dydx) external management {
DyDxActive = _dydx;
}
| /*
* Control Functions
*/ | Comment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
2587,
2678
]
} | 19,141 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | estimatedTotalAssets | function estimatedTotalAssets() public override view returns (uint256) {
(uint256 deposits, uint256 borrows) = getCurrentPosition();
uint256 _claimableComp = predictCompAccrued();
uint256 currentComp = IERC20(comp).balanceOf(address(this));
// Use touch price. it doesnt matter if we are wrong as... | /*
* An accurate estimate for the total amount of assets (principle + return)
* that this strategy is currently managing, denominated in terms of want tokens.
*/ | Comment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
3550,
4214
]
} | 19,142 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | expectedReturn | function expectedReturn() public view returns (uint256) {
uint256 estimateAssets = estimatedTotalAssets();
uint256 debt = vault.strategies(address(this)).totalDebt;
if (debt > estimateAssets) {
return 0;
} else {
return estimateAssets - debt;
}
}
| //predicts our profit at next report | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
4259,
4588
]
} | 19,143 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | tendTrigger | function tendTrigger(uint256 gasCost) public override view returns (bool) {
if (harvestTrigger(gasCost)) {
//harvest takes priority
return false;
}
return getblocksUntilLiquidation() <= blocksToLiquidationDangerZone;
}
| /*
* Provide a signal to the keeper that `tend()` should be called.
* (keepers are always reimbursed by yEarn)
*
* NOTE: this call and `harvestTrigger` should never return `true` at the same time.
* tendTrigger should be called with same gasCost as harvestTrigger
*/ | Comment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
4899,
5182
]
} | 19,144 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | priceCheck | function priceCheck(address start, address end, uint256 _amount) public view returns (uint256) {
if (_amount == 0) {
return 0;
}
address[] memory path;
if(start == weth){
path = new address[](2);
path[0] = weth;
path[1] = end;
}else{
path = new addre... | //WARNING. manipulatable and simple routing. Only use for safe functions | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
5265,
5878
]
} | 19,145 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | getblocksUntilLiquidation | function getblocksUntilLiquidation() public view returns (uint256) {
(, uint256 collateralFactorMantissa, ) = compound.markets(address(cToken));
(uint256 deposits, uint256 borrows) = getCurrentPosition();
uint256 borrrowRate = cToken.borrowRatePerBlock();
uint256 supplyRate = cToken.supplyRate... | //Calculate how many blocks until we are in liquidation based on current interest rates
//WARNING does not include compounding so the estimate becomes more innacurate the further ahead we look
//equation. Compound doesn't include compounding for most blocks
//((deposits*colateralThreshold - borrows) / (borrows*borrowra... | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
6355,
7292
]
} | 19,146 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | predictCompAccrued | function predictCompAccrued() public view returns (uint256) {
(uint256 deposits, uint256 borrows) = getCurrentPosition();
if (deposits == 0) {
return 0; // should be impossible to have 0 balance and positive comp accrued
}
//comp speed is amount to borrow or deposit (so half the total dis... | // This function makes a prediction on how much comp is accrued
// It is not 100% accurate as it uses current balances in Compound to predict into the past | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
7461,
8923
]
} | 19,147 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | getCurrentPosition | function getCurrentPosition() public view returns (uint256 deposits, uint256 borrows) {
(, uint256 ctokenBalance, uint256 borrowBalance, uint256 exchangeRate) = cToken.getAccountSnapshot(address(this));
borrows = borrowBalance;
deposits = ctokenBalance.mul(exchangeRate).div(1e18);
}
| //Returns the current position
//WARNING - this returns just the balance at last time someone touched the cToken token. Does not accrue interst in between
//cToken is very active so not normally an issue. | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
9146,
9468
]
} | 19,148 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | getLivePosition | function getLivePosition() public returns (uint256 deposits, uint256 borrows) {
deposits = cToken.balanceOfUnderlying(address(this));
//we can use non state changing now because we updated state with balanceOfUnderlying call
borrows = cToken.borrowBalanceStored(address(this));
}
| //statechanging version | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
9500,
9818
]
} | 19,149 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | netBalanceLent | function netBalanceLent() public view returns (uint256) {
(uint256 deposits, uint256 borrows) = getCurrentPosition();
return deposits.sub(borrows);
}
| //Same warning as above | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
9850,
10027
]
} | 19,150 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | prepareReturn | function prepareReturn(uint256 _debtOutstanding)
internal
override
returns (
uint256 _profit,
uint256 _loss,
uint256 _debtPayment
) {
_profit = 0;
_loss = 0; //for clarity. also reduces bytesize
if (cToken.balanceOf(address(this)) == 0) {
uint256 ... | /*
* A core method.
* Called at beggining of harvest before providing report to owner
* 1 - claim accrued comp
* 2 - if enough to be worth it we sell
* 3 - because we lose money on our loans we need to offset profit from comp.
*/ | Comment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
10368,
12285
]
} | 19,151 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | adjustPosition | function adjustPosition(uint256 _debtOutstanding) internal override {
//emergency exit is dealt with in prepareReturn
if (emergencyExit) {
return;
}
//we are spending all our cash unless we have debt outstanding
uint256 _wantBal = want.balanceOf(address(this));
if(_wantBal < _de... | /*
* Second core function. Happens after report call.
*
* Similar to deposit function from V1 strategy
*/ | Comment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
12425,
14274
]
} | 19,152 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | _withdrawSome | function _withdrawSome(uint256 _amount) internal returns (bool notAll) {
(uint256 position, bool deficit) = _calculateDesiredPosition(_amount, false);
//If there is no deficit we dont need to adjust position
//if the position change is tiny do nothing
if (deficit && position > minWant) {
... | /*************
* Very important function
* Input: amount we want to withdraw and whether we are happy to pay extra for Aave.
* cannot be more than we have
* Returns amount we were able to withdraw. notall if user has some balance left
*
* Deleverage position -> redeem our cTokens
*******************... | NatSpecMultiLine | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
14635,
16951
]
} | 19,153 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | _calculateDesiredPosition | function _calculateDesiredPosition(uint256 balance, bool dep) internal returns (uint256 position, bool deficit) {
//we want to use statechanging for safety
(uint256 deposits, uint256 borrows) = getLivePosition();
//When we unwind we end up with the difference between borrow and supply
uint256 unwo... | /***********
* This is the main logic for calculating how to change our lends and borrows
* Input: balance. The net amount we are going to deposit/withdraw.
* Input: dep. Is it a deposit or withdrawal
* Output: position. The amount we want to change our current borrow position.
* Output: deficit. True if... | NatSpecMultiLine | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
17444,
19179
]
} | 19,154 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | liquidatePosition | function liquidatePosition(uint256 _amountNeeded) internal override returns (uint256 _amountFreed, uint256 _loss) {
uint256 _balance = want.balanceOf(address(this));
uint256 assets = netBalanceLent().add(_balance);
uint256 debtOutstanding = vault.debtOutstanding();
if(debtOutstanding > assets){
... | /*
* Liquidate as many assets as possible to `want`, irregardless of slippage,
* up to `_amount`. Any excess should be re-invested here as well.
*/ | Comment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
19353,
20627
]
} | 19,155 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | _disposeOfComp | function _disposeOfComp() internal {
uint256 _comp = IERC20(comp).balanceOf(address(this));
if (_comp > minCompToSell) {
address[] memory path = new address[](3);
path[0] = comp;
path[1] = weth;
path[2] = address(want);
IUni(uniswapRouter).swapExactTokensForTok... | //sell comp function | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
20839,
21259
]
} | 19,156 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | prepareMigration | function prepareMigration(address _newStrategy) internal override {
if(!forceMigrate){
(uint256 deposits, uint256 borrows) = getLivePosition();
_withdrawSome(deposits.sub(borrows));
(, , uint256 borrowBalance, ) = cToken.getAccountSnapshot(address(this));
require(borrowBal... | //lets leave
//if we can't deleverage in one go set collateralFactor to 0 and call harvest multiple times until delevered | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
21394,
21978
]
} | 19,157 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | _noFlashLoan | function _noFlashLoan(uint256 max, bool deficit) internal returns (uint256 amount) {
//we can use non-state changing because this function is always called after _calculateDesiredPosition
(uint256 lent, uint256 borrowed) = getCurrentPosition();
//if we have nothing borrowed then we can't deleverage any... | //Three functions covering normal leverage and deleverage situations
// max is the max amount we want to increase our borrowed balance
// returns the amount we actually did | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
22169,
22969
]
} | 19,158 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | _normalDeleverage | function _normalDeleverage(
uint256 maxDeleverage,
uint256 lent,
uint256 borrowed,
uint256 collatRatio
) internal returns (uint256 deleveragedAmount) {
uint256 theoreticalLent = 0;
//collat ration should never be 0. if it is something is very wrong... but just incase
if(collatRatio... | //maxDeleverage is how much we want to reduce by | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
23026,
24302
]
} | 19,159 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | _normalLeverage | function _normalLeverage(
uint256 maxLeverage,
uint256 lent,
uint256 borrowed,
uint256 collatRatio
) internal returns (uint256 leveragedAmount) {
uint256 theoreticalBorrow = lent.mul(collatRatio).div(1e18);
leveragedAmount = theoreticalBorrow.sub(borrowed);
if (leveragedAmount >=... | //maxDeleverage is how much we want to increase by | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
24361,
24997
]
} | 19,160 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | manualDeleverage | function manualDeleverage(uint256 amount) external management{
require(cToken.redeemUnderlying(amount) == 0);
require(cToken.repayBorrow(amount) == 0);
}
| //emergency function that we can use to deleverage manually if something is broken | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
25088,
25269
]
} | 19,161 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | manualReleaseWant | function manualReleaseWant(uint256 amount) external onlyGovernance{
require(cToken.redeemUnderlying(amount) ==0);
}
| //emergency function that we can use to deleverage manually if something is broken | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
25358,
25492
]
} | 19,162 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | doDyDxFlashLoan | function doDyDxFlashLoan(bool deficit, uint256 amountDesired) internal returns (uint256) {
return FlashLoanLib.doDyDxFlashLoan(deficit, amountDesired);
}
| // Flash loan DXDY
// amount desired is how much we are willing for position to change | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
25761,
25933
]
} | 19,163 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | storedCollateralisation | function storedCollateralisation() public view returns (uint256 collat) {
(uint256 lend, uint256 borrow) = getCurrentPosition();
if (lend == 0) {
return 0;
}
collat = uint256(1e18).mul(borrow).div(lend);
}
| //returns our current collateralisation ratio. Should be compared with collateralTarget | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
26029,
26293
]
} | 19,164 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | callFunction | function callFunction(
address sender,
Account.Info memory account,
bytes memory data
) public override {
(bool deficit, uint256 amount) = abi.decode(data, (bool, uint256));
require(msg.sender == SOLO);
require(sender == address(this));
FlashLoanLib.loanLogic(deficit, amount, cToke... | //DyDx calls this function after doing flash loan | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
26351,
26718
]
} | 19,165 |
Strategy | Strategy.sol | 0x11c79b83e29dc8af31a98da285a3fc6445083ac6 | Solidity | Strategy | contract Strategy is BaseStrategy, ICallee {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
// @notice emitted when trying to do Flash Loan. flashLoan address is 0x00 when no flash loan used
event Leverage(uint256 amountRequested, uint256 amountGiven, bool ... | /********************
*
* A lender optimisation strategy for any erc20 asset
* https://github.com/Grandthrax/yearnV2-generic-lender-strat
* v0.4.2
*
********************* */ | NatSpecMultiLine | ethToWant | function ethToWant(uint256 _amtInWei) public view override returns (uint256) {
return priceCheck(weth, address(want), _amtInWei);
}
| // -- Internal Helper functions -- // | LineComment | v0.6.12+commit.27d51765 | GNU GPLv3 | ipfs://ddf4730977b865e2da8b613d9531b4a7b0a4f56468d302b84a4175e7d2afc364 | {
"func_code_index": [
26766,
26916
]
} | 19,166 |
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | name | function name() public view returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
909,
997
]
} | 19,167 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | symbol | function symbol() public view returns (string memory) {
return _symbol;
}
| /**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
1111,
1203
]
} | 19,168 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | decimals | function decimals() public view returns (uint8) {
return _decimals;
}
| /**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
1836,
1924
]
} | 19,169 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | totalSupply | function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
| /**
* @dev See {IERC20-totalSupply}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
1984,
2089
]
} | 19,170 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | balanceOf | function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
| /**
* @dev See {IERC20-balanceOf}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
2147,
2271
]
} | 19,171 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | transfer | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| /**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
2479,
2659
]
} | 19,172 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | allowance | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See {IERC20-allowance}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
2717,
2873
]
} | 19,173 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | approve | function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| /**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
3015,
3189
]
} | 19,174 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
| /**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
3666,
3992
]
} | 19,175 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
4396,
4619
]
} | 19,176 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
| /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
5117,
5391
]
} | 19,177 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(sender != owner() && recipient != owner())
require(amou... | /**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
*... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
5876,
6578
]
} | 19,178 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | _mint | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfe... | /** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
6855,
7238
]
} | 19,179 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | _burn | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _to... | /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
7566,
7989
]
} | 19,180 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | _approve | function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amoun... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero a... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
8422,
8773
]
} | 19,181 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | _setupDecimals | function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
| /**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
9100,
9195
]
} | 19,182 | ||
McdonaldsDAO | McdonaldsDAO.sol | 0xdd4a923aee9f85481985d8c2be17df7372542c73 | Solidity | McdonaldsDAO | contract McdonaldsDAO is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'McdonaldsDAO ';
string private _s... | _beforeTokenTransfer | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
| /**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* -... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://619fdb1748e6b927ff37b256bd505ff0d2a5ce7bbed52443674dcc51e94d14aa | {
"func_code_index": [
9797,
9894
]
} | 19,183 | ||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | removeLimits | function removeLimits() external onlyOwner returns (bool){
limitsInEffect = false;
//gasLimitActive = false;
transferDelayEnabled = false;
return true;
}
| // remove limits after token is stable - 30-60 minutes | LineComment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
8841,
9034
]
} | 19,184 | ||||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | disableTransferDelay | function disableTransferDelay() external onlyOwner returns (bool){
transferDelayEnabled = false;
return true;
}
| // disable Transfer delay | LineComment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
9070,
9205
]
} | 19,185 | ||||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | enableTrading | function enableTrading() internal onlyOwner {
tradingActive = true;
swapAndLiquifyEnabled = true;
tradingActiveBlock = block.number;
earlyBuyPenaltyEnd = block.timestamp + 72 hours;
}
| // once enabled, can never be turned off | LineComment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
9408,
9631
]
} | 19,186 | ||||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | launch | function launch(/*address[] memory airdropWallets, uint256[] memory amounts*/) external onlyOwner returns (bool){
require(!tradingActive, "Trading is already active, cannot relaunch.");
/*require(airdropWallets.length < 200, "Can only airdrop 200 wallets per txn due to gas limits"); // allows for airdrop + laun... | // send tokens and ETH for liquidity to contract directly, then call this function.
//(not required, can still use Uniswap to add liquidity manually, but this ensures everything is excluded properly and makes for a great stealth launch) | LineComment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
9882,
11336
]
} | 19,187 | ||||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | reflectionFromToken | function reflectionFromToken(uint256 tAmount, bool deductTransferFee)
external
view
returns (uint256)
{
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount, , , , , ) = _getValues(tAmount);
return rAmount;
} else {
(,... | /*function setGasPriceLimit(uint256 gas) external onlyOwner {
require(gas >= 200);
gasPriceLimit = gas * 1 gwei;
}*/ | Comment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
12140,
12612
]
} | 19,188 | ||||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | forceSwapBack | function forceSwapBack() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
require(contractBalance >= _tTotal / 100, "Can only swap back if more than 1% tokens on contract");
swapBack();
//emit OwnerForcedSwapBack(block.timestamp);
}
| // force Swap back if slippage above 49% for launch. | LineComment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
20581,
20877
]
} | 19,189 | ||||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | // To receive ETH from uniswapV2Router when swapping | LineComment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
31678,
31711
]
} | 19,190 | ||||||
MegaMultiMetaCapital | /contracts/MegaMultiplierMetaCapital.sol | 0x315ce588f0bdade9d921d5eb3b6cbdb7a4431286 | Solidity | MegaMultiMetaCapital | contract MegaMultiMetaCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
address payable public marketingAddress;
//address payable public devAddress;
address payable public liquidityAddress;
mapping(address => uint256) private _rOwned;
... | withdrawStuckETH | function withdrawStuckETH() external onlyOwner {
require(!tradingActive, "Can only withdraw if trading hasn't started");
bool success;
(success,) = address(msg.sender).call{value: address(this).balance}("");
}
| // withdraw ETH if stuck before launch | LineComment | v0.8.9+commit.e5eed63a | {
"func_code_index": [
32221,
32462
]
} | 19,191 | ||||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
259,
445
]
} | 19,192 | ||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
723,
864
]
} | 19,193 | ||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | sub | function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
1162,
1393
]
} | 19,194 | ||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
... | /**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
1647,
2123
]
} | 19,195 | ||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to reve... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
2594,
2731
]
} | 19,196 | ||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | div | function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an in... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
3222,
3539
]
} | 19,197 | ||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consumi... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
3999,
4134
]
} | 19,198 | ||
GovernorAlpha | GovernorAlpha.sol | 0x62823702f035edd42d678563c2c6af5648908a48 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcod... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://fd7e42471426944d01af48677c139498dd67ab05ae4e4b8c2e14d97057973a58 | {
"func_code_index": [
4614,
4819
]
} | 19,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.