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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | SmarcToken | contract SmarcToken is ERC677, Ownable {
// mapping for locking certain addresses
mapping(address => uint256) public lockups;
event LockedTokens(address indexed _holder, uint256 _lockup);
// burnable address
address public burnable;
/**
* @dev Smarc constructor just parametri... | finishMinting | function finishMinting(address _burnable) public onlyController() {
require(_burnable != address(0x0)); // burnable address must be set
assert(totalSupply() <= maxSupply); // ensure hard cap
enableTransfers(true); // turn-on transfers
changeController(address(0x0)); // ensure no new tokens will be c... | /**
* @notice Finishes minting process and throws out the controller.
* @dev Owner can not finish minting without setting up address for burning tokens.
* @param _burnable The address to burn tokens from
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
2108,
2517
]
} | 3,000 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | SmarcToken | contract SmarcToken is ERC677, Ownable {
// mapping for locking certain addresses
mapping(address => uint256) public lockups;
event LockedTokens(address indexed _holder, uint256 _lockup);
// burnable address
address public burnable;
/**
* @dev Smarc constructor just parametri... | transfer | function transfer(address _to, uint256 _amount) public notLocked(msg.sender) returns (bool success) {
return super.transfer(_to, _amount);
}
| /**
* @notice Send `_amount` tokens to `_to` from `msg.sender`
* @dev We override transfer function to add lockup check
* @param _to The address of the recipient
* @param _amount The amount of tokens to be transferred
* @return Whether the transfer was successful or not
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
2938,
3097
]
} | 3,001 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | SmarcToken | contract SmarcToken is ERC677, Ownable {
// mapping for locking certain addresses
mapping(address => uint256) public lockups;
event LockedTokens(address indexed _holder, uint256 _lockup);
// burnable address
address public burnable;
/**
* @dev Smarc constructor just parametri... | transferFrom | function transferFrom(address _from, address _to, uint256 _amount) public notLocked(_from) returns (bool success) {
return super.transferFrom(_from, _to, _amount);
}
| /**
* @notice Send `_amount` tokens to `_to` from `_from` on the condition it is approved by `_from`
* @dev We override transfer function to add lockup check
* @param _from The address holding the tokens being transferred
* @param _to The address of the recipient
* @param _amount The amount of tokens to be tr... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
3516,
3700
]
} | 3,002 | |||
SmarcToken | SmarcToken.sol | 0x5ae655088e79fa0ced7b472d3bacd215ef796ccc | Solidity | SmarcToken | contract SmarcToken is ERC677, Ownable {
// mapping for locking certain addresses
mapping(address => uint256) public lockups;
event LockedTokens(address indexed _holder, uint256 _lockup);
// burnable address
address public burnable;
/**
* @dev Smarc constructor just parametri... | burn | function burn(uint256 _amount) public onlyOwner returns (bool) {
require(burnable != address(0x0)); // burnable address must be set
uint256 currTotalSupply = totalSupply();
uint256 previousBalance = balanceOf(burnable);
require(currTotalSupply >= _amount);
require(previousBalance >= _amount... | /**
* @notice Burns `_amount` tokens from pre-defined "burnable" address.
* @param _amount The amount of tokens to burn
* @return True if the tokens are burned correctly
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://bc5b66ddafec8d21bbbed131eef8898516da669ea8eb0f2115329fd071c2783e | {
"func_code_index": [
3905,
4489
]
} | 3,003 | |||
OptionsPool | contracts/TimeLock.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Timelock | contract Timelock {
using SafeMath for uint;
event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint indexed newDelay);
event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, ui... | // import "hardhat/console.sol"; | LineComment | // XXX: function() external payable { } | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
2019,
2053
]
} | 3,004 | ||||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | add | function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner {
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
totalAllocPoint = totalAllocPoint.add(_allocPoint);
poolInfo.push(PoolInfo({
... | // Add a new lp to the pool. Can only be called by the owner.
// XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
2629,
3133
]
} | 3,005 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | set | function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner {
if (_withUpdate) {
massUpdatePools();
}
totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint);
poolInfo[_pid].allocPoint = _allocPoint;
}
| // Update the given pool's CHK allocation point. Can only be called by the owner. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
3221,
3523
]
} | 3,006 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | pendingChk | function pendingChk(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accChkPerShare = pool.accChkPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
// console.log("lpSupply: ... | // View function to see pending CHKs on frontend. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
3724,
5011
]
} | 3,007 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | massUpdatePools | function massUpdatePools() public {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
updatePool(pid);
}
}
| // Update reward variables for all pools. Be careful of gas spending! | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
5087,
5266
]
} | 3,008 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | updatePool | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;
return;
}
uint2... | // Update reward variables of the given pool to be up-to-date. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
5335,
6098
]
} | 3,009 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | deposit | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
// console.log("user.amount: ", user.amount);
if (user.amount > 0) {
// console.log("pool.accChkPerShare: ", pool.accChkPerSh... | // Deposit LP tokens to MasterChef for Chk allocation. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
6159,
7139
]
} | 3,010 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | withdraw | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accChkPerShare).div(1e18).sub(user.rew... | // Withdraw LP tokens from MasterChef. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
7184,
7910
]
} | 3,011 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | emergencyWithdraw | function emergencyWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
pool.lpToken.safeTransfer(address(msg.sender), user.amount);
emit EmergencyWithdraw(msg.sender, _pid, user.amount);
user.amount = 0;
user.rewardDebt = 0;
... | // Withdraw without caring about rewards. EMERGENCY ONLY. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
7974,
8327
]
} | 3,012 | ||
OptionsPool | contracts/rewards/Queen.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | Queen | contract Queen is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy ... | /** Queen is Masterchef but without the migrate, without the dev addr
without the multiplier. But adds in an end block. to minting.
*/ | NatSpecMultiLine | chkSafeTransfer | function chkSafeTransfer(address _to, uint256 _amount) internal {
uint256 chkBal = chk.balanceOf(address(this));
// console.log("bal: ", chkBal);
if (_amount > chkBal) {
chk.transfer(_to, chkBal);
} else {
chk.transfer(_to, _amount);
}
}
| // Safe chk transfer function, just in case if rounding error causes pool to not have enough CHKs. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
8432,
8741
]
} | 3,013 | ||
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() internal {
owner = msg.sender;
}
... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | Ownable | function Ownable() internal {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
257,
319
]
} | 3,014 | |
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() internal {
owner = msg.sender;
}
... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
642,
818
]
} | 3,015 | |
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | pause | function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
513,
604
]
} | 3,016 | |
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | unpause | function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
688,
781
]
} | 3,017 | |
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | 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) pub... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0x0));
// 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);
retur... | /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
268,
615
]
} | 3,018 | |
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | 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) pub... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
821,
937
]
} | 3,019 | |
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken, Pausable {
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 trans... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
require(_to != address(0x0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
402,
967
]
} | 3,020 | |
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | Solidity | JubsICO | contract JubsICO is StandardToken {
using SafeMath for uint256;
//Information coin
string public name = "Honor";
string public symbol = "HNR";
uint256 public decimals = 18;
uint256 public totalSupply = 100000000 * (10 ** decimals); //100 000 000 HNR
//Adress informated in white pa... | JubsICO | function JubsICO ()public {
//Address
walletETH = 0x6eA3ec9339839924a520ff57a0B44211450A8910;
icoWallet = 0x357ace6312BF8B519424cD3FfdBB9990634B8d3E;
preIcoWallet = 0x7c54dC4F3328197AC89a53d4b8cDbE35a56656f7;
teamWallet = 0x06BC5305016E9972F4cB3F6a3Ef2C734D417788a;
bountyMktWallet = 0... | // =================================== Constructor ============================================= | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
3267,
4884
]
} | 3,021 | |||
JubsICO | JubsICO.sol | 0x108116d36907223e13ba244b5bde5893cd5e730b | Solidity | JubsICO | contract JubsICO is StandardToken {
using SafeMath for uint256;
//Information coin
string public name = "Honor";
string public symbol = "HNR";
uint256 public decimals = 18;
uint256 public totalSupply = 100000000 * (10 ** decimals); //100 000 000 HNR
//Adress informated in white pa... | function () PauseEmergence nonZeroBuy acceptsFunds payable public {
uint256 amount = msg.value.mul(rate);
assignTokens(msg.sender, amount);
totalRaised = totalRaised.add(msg.value);
forwardFundsToWallet();
}
| /// fallback function to buy tokens | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://9d90d728973c5a4ea720eb7ae7fafc49fe5cfc954a98e65af75fd6c7761d0423 | {
"func_code_index": [
6317,
6577
]
} | 3,022 | ||||
IiinoCoin | contracts/BasicToken.sol | 0x48c71990d24f18a441b881e13983e4621fcd812f | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev ... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| /**
* @dev total number of tokens in existence
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://6743e49142cb6d45b5afd276952c40d63d4477401d2a03306bb949f6d6477ef6 | {
"func_code_index": [
205,
301
]
} | 3,023 | |
IiinoCoin | contracts/BasicToken.sol | 0x48c71990d24f18a441b881e13983e4621fcd812f | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev ... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transferInternal | function transferInternal(address _to, uint256 _value) internal returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_t... | /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://6743e49142cb6d45b5afd276952c40d63d4477401d2a03306bb949f6d6477ef6 | {
"func_code_index": [
459,
897
]
} | 3,024 | |
IiinoCoin | contracts/BasicToken.sol | 0x48c71990d24f18a441b881e13983e4621fcd812f | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev ... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view 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.21+commit.dfe3193c | bzzr://6743e49142cb6d45b5afd276952c40d63d4477401d2a03306bb949f6d6477ef6 | {
"func_code_index": [
1103,
1223
]
} | 3,025 | |
IiinoCoin | contracts/MintableToken.sol | 0x48c71990d24f18a441b881e13983e4621fcd812f | Solidity | MintableToken | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
address public icoContractAddress;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev... | /**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/ | NatSpecMultiLine | mint | function mint(address _to, uint256 _amount) onlyIcoContract canMint external returns (bool) {
//return true;
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
| /**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://6743e49142cb6d45b5afd276952c40d63d4477401d2a03306bb949f6d6477ef6 | {
"func_code_index": [
744,
1083
]
} | 3,026 | |
IiinoCoin | contracts/MintableToken.sol | 0x48c71990d24f18a441b881e13983e4621fcd812f | Solidity | MintableToken | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
address public icoContractAddress;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev... | /**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/ | NatSpecMultiLine | finishMinting | function finishMinting() onlyOwner canMint external returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
| /**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://6743e49142cb6d45b5afd276952c40d63d4477401d2a03306bb949f6d6477ef6 | {
"func_code_index": [
1208,
1373
]
} | 3,027 | |
Ping | Ping.sol | 0x86b1431988ce038589d96fb462e5c96d3b482ae0 | Solidity | Ping | contract Ping is ReserveRetriever {
int8 ZZZinLP;
ReserveRetriever ZZZETH;
/*********
Step 2: Deploy Ping, giving it the address of Pong.
*********/
constructor (ReserveRetriever _ZZZETHAddress)
{
ZZZinLP = -1;
ZZZETH = _ZZZETHAddress;
}
/*********
... | getZZZinPool | function getZZZinPool()
{
(reserve0, reserve1, blockTimestampLast) = ZZZETH.getReserves();
}
| /*********
Step 3: Transactionally retrieve pongval from Pong.
*********/ | NatSpecMultiLine | v0.4.26+commit.4563c3fc | None | bzzr://f462742911980ea6e17f2dc465c75b94480d9ad20495f192d9401a15a542e535 | {
"func_code_index": [
394,
496
]
} | 3,028 | ||
Ping | Ping.sol | 0x86b1431988ce038589d96fb462e5c96d3b482ae0 | Solidity | Ping | contract Ping is ReserveRetriever {
int8 ZZZinLP;
ReserveRetriever ZZZETH;
/*********
Step 2: Deploy Ping, giving it the address of Pong.
*********/
constructor (ReserveRetriever _ZZZETHAddress)
{
ZZZinLP = -1;
ZZZETH = _ZZZETHAddress;
}
/*********
... | getPongvalConstant | function getPongvalConstant() constant returns (uint112)
{
return reserve0;
}
| /*********
Step 5: Get pongval (which was previously retrieved from Pong via transaction)
*********/ | NatSpecMultiLine | v0.4.26+commit.4563c3fc | None | bzzr://f462742911980ea6e17f2dc465c75b94480d9ad20495f192d9401a15a542e535 | {
"func_code_index": [
622,
720
]
} | 3,029 | ||
Ping | Ping.sol | 0x86b1431988ce038589d96fb462e5c96d3b482ae0 | Solidity | Ping | contract Ping is ReserveRetriever {
int8 ZZZinLP;
ReserveRetriever ZZZETH;
/*********
Step 2: Deploy Ping, giving it the address of Pong.
*********/
constructor (ReserveRetriever _ZZZETHAddress)
{
ZZZinLP = -1;
ZZZETH = _ZZZETHAddress;
}
/*********
... | setZZZETHAddress | function setZZZETHAddress(ReserveRetriever _ZZZETHAddress)
ZETH = _ZZZETHAddress;
| /*********
Functions to get and set pongAddress just in case
*********/ | NatSpecMultiLine | v0.4.26+commit.4563c3fc | None | bzzr://f462742911980ea6e17f2dc465c75b94480d9ad20495f192d9401a15a542e535 | {
"func_code_index": [
942,
1041
]
} | 3,030 | ||
svb | svb.sol | 0x0fcf5c6b20577d48ba209e077975b9f2eac55798 | Solidity | svb | contract svb {
// totalSupply is zero by default, owner can issue and destroy coins any amount any time
uint constant totalSupplyDefault = 0;
string public constant symbol = "SVB";
string public constant name = "Silver";
uint8 public constant decimals = 5;
// minimum fee is 0.00001
... | //contract svb is svb_ { | LineComment | svb | function svb(uint supply) {
if (supply > 0) {
totalSupply = supply;
} else {
totalSupply = totalSupplyDefault;
}
owner = msg.sender;
demurringFeeOwner = owner;
transferFeeOwner = owner;
balances[this] = totalSupply;
}
| // if supply provided is 0, then default assigned | LineComment | v0.4.15+commit.bbb8e64f | bzzr://0478f2575bea87511e4ddc553e292146a9d87bb776cafd843d185838d1e66766 | {
"func_code_index": [
1766,
2082
]
} | 3,031 | |
svb | svb.sol | 0x0fcf5c6b20577d48ba209e077975b9f2eac55798 | Solidity | svb | contract svb {
// totalSupply is zero by default, owner can issue and destroy coins any amount any time
uint constant totalSupplyDefault = 0;
string public constant symbol = "SVB";
string public constant name = "Silver";
uint8 public constant decimals = 5;
// minimum fee is 0.00001
... | //contract svb is svb_ { | LineComment | chargeDemurringFee | function chargeDemurringFee(address addr) internal {
if (addr != owner && addr != transferFeeOwner && addr != demurringFeeOwner && balances[addr] > 0 && now > timestamps[addr] + 60) {
var mins = (now - timestamps[addr]) / 60;
var fee = balances[addr] * mins * demurringFeeNum / demurringFeeDenum;
... | // charge demurring fee for previuos period
// fee is not applied to owners | LineComment | v0.4.15+commit.bbb8e64f | bzzr://0478f2575bea87511e4ddc553e292146a9d87bb776cafd843d185838d1e66766 | {
"func_code_index": [
2489,
3234
]
} | 3,032 | |
svb | svb.sol | 0x0fcf5c6b20577d48ba209e077975b9f2eac55798 | Solidity | svb | contract svb {
// totalSupply is zero by default, owner can issue and destroy coins any amount any time
uint constant totalSupplyDefault = 0;
string public constant symbol = "SVB";
string public constant name = "Silver";
uint8 public constant decimals = 5;
// minimum fee is 0.00001
... | //contract svb is svb_ { | LineComment | chargeTransferFee | function chargeTransferFee(address addr, uint amount) internal returns (uint) {
if (addr != owner && addr != transferFeeOwner && addr != demurringFeeOwner && balances[addr] > 0) {
var fee = amount * transferFeeNum / transferFeeDenum;
if (fee < minFee) {
fee = minFee;
} else ... | // fee is not applied to owners | LineComment | v0.4.15+commit.bbb8e64f | bzzr://0478f2575bea87511e4ddc553e292146a9d87bb776cafd843d185838d1e66766 | {
"func_code_index": [
3274,
3953
]
} | 3,033 | |
svb | svb.sol | 0x0fcf5c6b20577d48ba209e077975b9f2eac55798 | Solidity | svb | contract svb {
// totalSupply is zero by default, owner can issue and destroy coins any amount any time
uint constant totalSupplyDefault = 0;
string public constant symbol = "SVB";
string public constant name = "Silver";
uint8 public constant decimals = 5;
// minimum fee is 0.00001
... | //contract svb is svb_ { | LineComment | issue | function issue(uint amount) onlyOwner {
if (totalSupply + amount > totalSupply) {
totalSupply += amount;
balances[this] += amount;
}
}
| // issue new coins | LineComment | v0.4.15+commit.bbb8e64f | bzzr://0478f2575bea87511e4ddc553e292146a9d87bb776cafd843d185838d1e66766 | {
"func_code_index": [
7176,
7368
]
} | 3,034 | |
svb | svb.sol | 0x0fcf5c6b20577d48ba209e077975b9f2eac55798 | Solidity | svb | contract svb {
// totalSupply is zero by default, owner can issue and destroy coins any amount any time
uint constant totalSupplyDefault = 0;
string public constant symbol = "SVB";
string public constant name = "Silver";
uint8 public constant decimals = 5;
// minimum fee is 0.00001
... | //contract svb is svb_ { | LineComment | destroy | function destroy(uint amount) onlyOwner {
require(amount>0 && balances[this] >= amount);
balances[this] -= amount;
totalSupply -= amount;
}
| // destroy existing coins | LineComment | v0.4.15+commit.bbb8e64f | bzzr://0478f2575bea87511e4ddc553e292146a9d87bb776cafd843d185838d1e66766 | {
"func_code_index": [
7402,
7584
]
} | 3,035 | |
svb | svb.sol | 0x0fcf5c6b20577d48ba209e077975b9f2eac55798 | Solidity | svb | contract svb {
// totalSupply is zero by default, owner can issue and destroy coins any amount any time
uint constant totalSupplyDefault = 0;
string public constant symbol = "SVB";
string public constant name = "Silver";
uint8 public constant decimals = 5;
// minimum fee is 0.00001
... | //contract svb is svb_ { | LineComment | kill | function kill() onlyOwner {
require (totalSupply == 0);
selfdestruct(owner);
}
| // kill contract only if all wallets are empty | LineComment | v0.4.15+commit.bbb8e64f | bzzr://0478f2575bea87511e4ddc553e292146a9d87bb776cafd843d185838d1e66766 | {
"func_code_index": [
7639,
7745
]
} | 3,036 | |
svb | svb.sol | 0x0fcf5c6b20577d48ba209e077975b9f2eac55798 | Solidity | svb | contract svb {
// totalSupply is zero by default, owner can issue and destroy coins any amount any time
uint constant totalSupplyDefault = 0;
string public constant symbol = "SVB";
string public constant name = "Silver";
uint8 public constant decimals = 5;
// minimum fee is 0.00001
... | //contract svb is svb_ { | LineComment | function () payable {
revert();
}
| // payments ar reverted back | LineComment | v0.4.15+commit.bbb8e64f | bzzr://0478f2575bea87511e4ddc553e292146a9d87bb776cafd843d185838d1e66766 | {
"func_code_index": [
7782,
7834
]
} | 3,037 | ||
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | 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... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) returns (bool) {
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.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
268,
507
]
} | 3,038 |
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | 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... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | 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.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
714,
823
]
} | 3,039 |
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
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);
balances[_from] = balances[_from].sub(... | /**
* @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.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
392,
895
]
} | 3,040 |
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
1131,
1314
]
} | 3,041 |
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) 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.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
1638,
1776
]
} | 3,042 |
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/ | Comment | v0.4.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
2025,
2297
]
} | 3,043 |
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | ERC677Token | contract ERC677Token is ERC677 {
/**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
func... | transferAndCall | function transferAndCall(address _to, uint _value, bytes _data)
public
returns (bool success)
{
super.transfer(_to, _value);
Transfer(msg.sender, _to, _value, _data);
if (isContract(_to)) {
contractFallback(_to, _value, _data);
}
return true;
}
| /**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
314,
609
]
} | 3,044 | ||
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | ERC677Token | contract ERC677Token is ERC677 {
/**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
func... | contractFallback | function contractFallback(address _to, uint _value, bytes _data)
private
{
ERC677Receiver receiver = ERC677Receiver(_to);
receiver.onTokenTransfer(msg.sender, _value, _data);
}
| // PRIVATE | LineComment | v0.4.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
630,
830
]
} | 3,045 | ||
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | GYBToken | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... | transferAndCall | function transferAndCall(address _to, uint _value, bytes _data)
public
validRecipient(_to)
returns (bool success)
{
return super.transferAndCall(_to, _value, _data);
}
| /**
* @dev transfer token to a specified address with additional data if the recipient is a contract.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
613,
809
]
} | 3,046 | ||
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | GYBToken | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... | transfer | function transfer(address _to, uint _value)
public
validRecipient(_to)
returns (bool success)
{
return super.transfer(_to, _value);
}
| /**
* @dev transfer token to a specified address.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
967,
1129
]
} | 3,047 | ||
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | GYBToken | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... | approve | function approve(address _spender, uint256 _value)
public
validRecipient(_spender)
returns (bool)
{
return super.approve(_spender, _value);
}
| /**
* @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.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
1365,
1536
]
} | 3,048 | ||
GYBToken | GYBToken.sol | 0x8a5c9d88c03a9722be267614b0c0004acc43ff21 | Solidity | GYBToken | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... | transferFrom | function transferFrom(address _from, address _to, uint256 _value)
public
validRecipient(_to)
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
| /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | None | bzzr://1532c37a9c54cfc4fc7961ddd20a4299bd0367e269513036df92d55963c80f3f | {
"func_code_index": [
1816,
2003
]
} | 3,049 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | rebase | function rebase(uint256 epoch_, int256 supplyDelta)
external
onlyOwner
returns (uint256)
{
// console.log(symbol(), ": starting total supply ", epoch, _totalSupply.div(10**18));
// console.log("gonsPerFragment: ", epoch, _gonsPerFragment);
epoch = epoch_;
if (supplyDelta == 0) {
... | /**
* @dev Notifies Fragments contract about a new rebase cycle.
* @param supplyDelta The number of new fragment tokens to add into circulation via expansion.
* @return The total number of fragments after the supply adjustment.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3024,
4397
]
} | 3,050 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | name | function name() public view override returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
6370,
6464
]
} | 3,051 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | symbol | function symbol() public view override 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 | {
"func_code_index": [
6660,
6758
]
} | 3,052 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | decimals | function decimals() public view override 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 the v... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
7377,
7471
]
} | 3,053 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | totalSupply | function totalSupply()
public
view
override
returns (uint256)
{
return _totalSupply;
}
| /**
* @return The total number of fragments.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
7535,
7673
]
} | 3,054 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | balanceOf | function balanceOf(address who)
public
view
override
returns (uint256)
{
return _gonBalances[_currentBalances][who].div(_gonsPerFragment);
}
| /**
* @param who The address to query.
* @return The balance of the specified address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
7784,
7977
]
} | 3,055 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | transfer | function transfer(address to, uint256 value)
public
override
validRecipient(to)
returns (bool)
{
uint256 gonValue = value.mul(_gonsPerFragment);
_gonBalances[_currentBalances][msg.sender] = _gonBalances[_currentBalances][msg.sender].sub(gonValue);
_gonBalances[_currentBalances][to] = _gonBal... | /**
* @dev Transfer tokens to a specified address.
* @param to The address to transfer to.
* @param value The amount to be transferred.
* @return True on success, false otherwise.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8191,
8767
]
} | 3,056 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | allowance | function allowance(address owner_, address spender)
public
view
override
returns (uint256)
{
return _allowedFragments[owner_][spender];
}
| /**
* @dev Function to check the amount of tokens that an owner has allowed to a spender.
* @param owner_ The address which owns the funds.
* @param spender The address which will spend the funds.
* @return The number of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
9062,
9251
]
} | 3,057 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | transferFrom | function transferFrom(address from, address to, uint256 value)
public
validRecipient(to)
notSettling(from)
override
returns (bool)
{
_allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(value);
return _transferFrom(from, to, value);
}
| /**
* @dev Transfer tokens from one address to another.
* @param from The address you want to send tokens from.
* @param to The address you want to transfer to.
* @param value The amount of tokens to be transferred.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
9501,
9828
]
} | 3,058 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | approve | function approve(address spender, uint256 value)
public
override
returns (bool)
{
_allowedFragments[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of
* msg.sender. This method is included for ERC20 compatibility.
* increaseAllowance and decreaseAllowance should be used instead.
* Changing an allowance with this method brings the risk that someone may transfer both
* the o... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
10889,
11136
]
} | 3,059 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
_allowedFragments[msg.sender][spender] =
_allowedFragments[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]);
return true;
}
| /**
* @dev Increase the amount of tokens that an owner has allowed to a spender.
* This method should be used instead of approve() to avoid the double approval vulnerability
* described above.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowanc... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
11496,
11835
]
} | 3,060 | ||
OptionsPool | contracts/RebaseableToken.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | RebaseableToken | contract RebaseableToken is IERC20Nameable, Ownable {
// PLEASE READ BEFORE CHANGING ANY ACCOUNTING OR MATH
// Anytime there is division, there is a risk of numerical instability from rounding errors. In
// order to minimize this risk, we adhere to the following guidelines:
// 1) The conversion rate ado... | /**
* @title uFragments ERC20 token
* @dev This is part of an implementation of the uFragments Ideal Money protocol.
* uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and
* combining tokens proportionally across all wallets.
*
* uFragment balances are internally repr... | NatSpecMultiLine | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
uint256 oldValue = _allowedFragments[msg.sender][spender];
if (subtractedValue >= oldValue) {
_allowedFragments[msg.sender][spender] = 0;
} else {
_allowedFragments[msg.sender][spender] = old... | /**
* @dev Decrease the amount of tokens that an owner has allowed to a spender.
*
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
12085,
12589
]
} | 3,061 | ||
ZNCoin | ZNCoin.sol | 0x7aeace15f7d9a8e0ae3a1418d8360c6f41927552 | 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.
... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | Ownable | function Ownable() {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.13+commit.fb4cb1a | bzzr://f14ccdcc204b1692d159a19f1dedc5a5ef0500237a1c0db4cadb988a96a4adfb | {
"func_code_index": [
179,
240
]
} | 3,062 | |
ZNCoin | ZNCoin.sol | 0x7aeace15f7d9a8e0ae3a1418d8360c6f41927552 | 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.
... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) onlyOwner {
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.13+commit.fb4cb1a | bzzr://f14ccdcc204b1692d159a19f1dedc5a5ef0500237a1c0db4cadb988a96a4adfb | {
"func_code_index": [
589,
726
]
} | 3,063 | |
ZNCoin | ZNCoin.sol | 0x7aeace15f7d9a8e0ae3a1418d8360c6f41927552 | Solidity | ZNCoin | contract ZNCoin is ERC20,ZNCoinStandard,Ownable {
using SafeMath for uint256;
string public name = "ZNCoin";
string public symbol = "ZNC";
uint public decimals = 18;
uint public chainStartTime; //chain start time
uint public chainStartBlockNumber; //chain start block number
uint p... | batchTransfer | function batchTransfer(address[] _recipients, uint[] _values) onlyOwner returns (bool) {
require( _recipients.length > 0 && _recipients.length == _values.length);
uint total = 0;
for(uint i = 0; i < _values.length; i++){
total = total.add(_values[i]);
}
require(total <= balances[msg.... | /* Batch token transfer. Used by contract creator to distribute initial tokens to holders */ | Comment | v0.4.13+commit.fb4cb1a | bzzr://f14ccdcc204b1692d159a19f1dedc5a5ef0500237a1c0db4cadb988a96a4adfb | {
"func_code_index": [
7035,
8033
]
} | 3,064 | |||
OptionsPool | contracts/OptionsPool.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | OptionsPool | contract OptionsPool {
using SafeMath for uint256;
using SafeMathInt for int256;
uint256 public upsLiquidated;
uint256 public downsLiquidated;
RebaseableToken public up;
RebaseableToken public down;
address private owner;
IPriceOracleGetter public oracle;
/**
This is the... | // import "hardhat/console.sol"; | LineComment | initialize | function initialize(
address owner_,
address payoutToken_,
uint256 epochLength_,
uint8 multiplier_,
address oracle_,
address underlying_
) public isOwner {
owner = owner_;
payoutToken = IERC20(payoutToken_);
oracle = IPriceOracleGetter(oracle_);
epochStart = block.number;
epo... | // following the pattern of uniswap so there can be a pool factory | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
2325,
2891
]
} | 3,065 | ||
OptionsPool | contracts/OptionsPool.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | OptionsPool | contract OptionsPool {
using SafeMath for uint256;
using SafeMathInt for int256;
uint256 public upsLiquidated;
uint256 public downsLiquidated;
RebaseableToken public up;
RebaseableToken public down;
address private owner;
IPriceOracleGetter public oracle;
/**
This is the... | // import "hardhat/console.sol"; | LineComment | percentChangeMax100 | function percentChangeMax100(uint256 diff, uint256 base)
internal
view
returns (uint256)
{
if (base == 0) {
return 0; // ignore zero price
}
uint256 percent = (diff * 10**18).mul(10**18).div(base.mul(10**18)).mul(uint256(multiplier));
if (percent >= 10**18) {
percent = uint25... | /**
calculate the percent change defined as an 18 precision decimal (1e18 is 100%)
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3342,
3763
]
} | 3,066 | ||
OptionsPool | contracts/OptionsPool.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | OptionsPool | contract OptionsPool {
using SafeMath for uint256;
using SafeMathInt for int256;
uint256 public upsLiquidated;
uint256 public downsLiquidated;
RebaseableToken public up;
RebaseableToken public down;
address private owner;
IPriceOracleGetter public oracle;
/**
This is the... | // import "hardhat/console.sol"; | LineComment | liquidationAdjustments | function liquidationAdjustments(
uint256 pool_,
uint256 upBal,
uint256 downBal
) internal view returns (uint256 adjustedUp, uint256 adjustedDown) {
if (upsLiquidated == 0 && downsLiquidated == 0) {
return (upBal, downBal);
}
if (upBal == 0 && downBal == 0) {
return (0,0);
}
... | // function logPool() internal view {
// uint256 pool_ = payoutToken.balanceOf(address(this));
// console.log("pool: ", pool_, pool_.div(10**18));
// console.log("ups: ", up.totalSupply());
// console.log("downs: ", down.totalSupply());
// int256 upDownDiff = int256(pool_.mul(200))
// .sub(i... | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
4377,
5957
]
} | 3,067 | ||
OptionsPool | contracts/OptionsPool.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | OptionsPool | contract OptionsPool {
using SafeMath for uint256;
using SafeMathInt for int256;
uint256 public upsLiquidated;
uint256 public downsLiquidated;
RebaseableToken public up;
RebaseableToken public down;
address private owner;
IPriceOracleGetter public oracle;
/**
This is the... | // import "hardhat/console.sol"; | LineComment | settle | function settle() public checkEpoch {
// TODO: set lockedAt and only allow a liquidate then
up.settle(msg.sender);
down.settle(msg.sender);
}
| /**
The user wants out of the pool and so at the end of this epoch we will
let them cash out.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8293,
8466
]
} | 3,068 | ||
OptionsPool | contracts/OptionsPool.sol | 0xfd6c25608c05c85dd4e7f798eb8893a6a8a5624c | Solidity | OptionsPool | contract OptionsPool {
using SafeMath for uint256;
using SafeMathInt for int256;
uint256 public upsLiquidated;
uint256 public downsLiquidated;
RebaseableToken public up;
RebaseableToken public down;
address private owner;
IPriceOracleGetter public oracle;
/**
This is the... | // import "hardhat/console.sol"; | LineComment | liquidate | function liquidate() public checkEpoch {
// TODO: only allow this after the lockout period
address user_ = msg.sender;
uint256 upBal = up.balanceOf(user_);
uint256 downBal = down.balanceOf(user_);
up.liquidate(address(user_));
down.liquidate(address(user_));
upsLiquidated += upBal;
do... | // TODO: this provides an arbitrage opportunity to withdraw
// before the end of a period. This should be a lockup. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
8592,
9723
]
} | 3,069 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | committeeMembershipWillChange | function committeeMembershipWillChange(address guardian, bool inCommittee, bool isCertified, bool nextCertification, uint generalCommitteeSize, uint certifiedCommitteeSize) external override onlyWhenActive onlyCommitteeContract {
_updateGuardianFeesAndBootstrap(guardian, inCommittee, isCertified, nextCertification... | /// Triggers update of the guardian rewards
/// @dev Called by: the Committee contract
/// @dev called upon expected change in the committee membership of the guardian
/// @param guardian is the guardian who's committee membership is updated
/// @param inCommittee indicates whether the guardian is in the committee prio... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
3306,
3690
]
} | 3,070 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | getFeesAndBootstrapBalance | function getFeesAndBootstrapBalance(address guardian) external override view returns (uint256 feeBalance, uint256 bootstrapBalance) {
(FeesAndBootstrap memory guardianFeesAndBootstrap,) = getGuardianFeesAndBootstrap(guardian, block.timestamp);
return (guardianFeesAndBootstrap.feeBalance, guardianFeesAndBootst... | /// Returns the fees and bootstrap balances of a guardian
/// @dev calculates the up to date balances (differ from the state)
/// @return feeBalance the guardian's fees balance
/// @return bootstrapBalance the guardian's bootstrap balance | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
3952,
4314
]
} | 3,071 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | estimateFutureFeesAndBootstrapRewards | function estimateFutureFeesAndBootstrapRewards(address guardian, uint256 duration) external override view returns (uint256 estimatedFees, uint256 estimatedBootstrapRewards) {
(FeesAndBootstrap memory guardianFeesAndBootstrapNow,) = getGuardianFeesAndBootstrap(guardian, block.timestamp);
(FeesAndBootstrap memo... | /// Returns an estimation of the fees and bootstrap a guardian will be entitled to for a duration of time
/// The estimation is based on the current system state and there for only provides an estimation
/// @param guardian is the guardian address
/// @param duration is the amount of time in seconds for which the estim... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
4852,
5547
]
} | 3,072 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | withdrawFees | function withdrawFees(address guardian) external override onlyWhenActive {
updateGuardianFeesAndBootstrap(guardian);
uint256 amount = feesAndBootstrap[guardian].feeBalance;
feesAndBootstrap[guardian].feeBalance = 0;
uint96 withdrawnFees = feesAndBootstrap[guardian].withdrawnFees.add(amount);
... | /// Transfers the guardian Fees balance to their account
/// @dev One may withdraw for another guardian
/// @param guardian is the guardian address | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
5713,
6288
]
} | 3,073 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | withdrawBootstrapFunds | function withdrawBootstrapFunds(address guardian) external override onlyWhenActive {
updateGuardianFeesAndBootstrap(guardian);
uint256 amount = feesAndBootstrap[guardian].bootstrapBalance;
feesAndBootstrap[guardian].bootstrapBalance = 0;
uint96 withdrawnBootstrap = feesAndBootstrap[guardian].withdra... | /// Transfers the guardian bootstrap balance to their account
/// @dev One may withdraw for another guardian
/// @param guardian is the guardian address | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
6459,
7106
]
} | 3,074 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | getFeesAndBootstrapState | function getFeesAndBootstrapState() external override view returns (
uint256 certifiedFeesPerMember,
uint256 generalFeesPerMember,
uint256 certifiedBootstrapPerMember,
uint256 generalBootstrapPerMember,
uint256 lastAssigned
) {
(uint generalCommitteeSize, uint certifiedCommitteeSize, ) = ... | /// Returns the current global Fees and Bootstrap rewards state
/// @dev calculated to the latest block, may differ from the state read
/// @return certifiedFeesPerMember represents the fees a certified committee member from day 0 would have receive
/// @return generalFeesPerMember represents the fees a non-certified ... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
7870,
8944
]
} | 3,075 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | getFeesAndBootstrapData | function getFeesAndBootstrapData(address guardian) external override view returns (
uint256 feeBalance,
uint256 lastFeesPerMember,
uint256 bootstrapBalance,
uint256 lastBootstrapPerMember,
uint256 withdrawnFees,
uint256 withdrawnBootstrap,
bool certified
) {
FeesAndBootstrap mem... | /// Returns the current guardian Fees and Bootstrap rewards state
/// @dev calculated to the latest block, may differ from the state read
/// @return feeBalance is the guardian fees balance
/// @return lastFeesPerMember is the FeesPerMember on the last update based on the guardian certification state
/// @return boot... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
9474,
10365
]
} | 3,076 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | activateRewardDistribution | function activateRewardDistribution(uint startTime) external override onlyMigrationManager {
require(!settings.rewardAllocationActive, "reward distribution is already activated");
feesAndBootstrapState.lastAssigned = uint32(startTime);
settings.rewardAllocationActive = true;
emit RewardDistribut... | /// Activates fees and bootstrap allocation
/// @dev governance function called only by the initialization admin
/// @dev On migrations, startTime should be set as the previous contract deactivation time.
/// @param startTime sets the last assignment time | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
10692,
11064
]
} | 3,077 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | deactivateRewardDistribution | function deactivateRewardDistribution() external override onlyMigrationManager {
require(settings.rewardAllocationActive, "reward distribution is already deactivated");
updateFeesAndBootstrapState();
settings.rewardAllocationActive = false;
emit RewardDistributionDeactivated();
}
| /// Deactivates fees and bootstrap allocation
/// @dev governance function called only by the migration manager
/// @dev guardians updates remain active based on the current perMember value | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
11272,
11604
]
} | 3,078 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | isRewardAllocationActive | function isRewardAllocationActive() external override view returns (bool) {
return settings.rewardAllocationActive;
}
| /// Returns the rewards allocation activation status
/// @return rewardAllocationActive is the activation status | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
11730,
11866
]
} | 3,079 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | setGeneralCommitteeAnnualBootstrap | function setGeneralCommitteeAnnualBootstrap(uint256 annualAmount) external override onlyFunctionalManager {
updateFeesAndBootstrapState();
_setGeneralCommitteeAnnualBootstrap(annualAmount);
}
| /// Sets the annual rate for the general committee bootstrap
/// @dev governance function called only by the functional manager
/// @dev updates the global bootstrap and fees state before updating
/// @param annualAmount is the annual general committee bootstrap award | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
12160,
12379
]
} | 3,080 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | getGeneralCommitteeAnnualBootstrap | function getGeneralCommitteeAnnualBootstrap() external override view returns (uint256) {
return settings.generalCommitteeAnnualBootstrap;
}
| /// Returns the general committee annual bootstrap award
/// @return generalCommitteeAnnualBootstrap is the general committee annual bootstrap | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
12535,
12693
]
} | 3,081 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | setCertifiedCommitteeAnnualBootstrap | function setCertifiedCommitteeAnnualBootstrap(uint256 annualAmount) external override onlyFunctionalManager {
updateFeesAndBootstrapState();
_setCertifiedCommitteeAnnualBootstrap(annualAmount);
}
| /// Sets the annual rate for the certified committee bootstrap
/// @dev governance function called only by the functional manager
/// @dev updates the global bootstrap and fees state before updating
/// @param annualAmount is the annual certified committee bootstrap award | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
12991,
13214
]
} | 3,082 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | getCertifiedCommitteeAnnualBootstrap | function getCertifiedCommitteeAnnualBootstrap() external override view returns (uint256) {
return settings.certifiedCommitteeAnnualBootstrap;
}
| /// Returns the certified committee annual bootstrap reward
/// @return certifiedCommitteeAnnualBootstrap is the certified committee additional annual bootstrap | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
13388,
13550
]
} | 3,083 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | migrateRewardsBalance | function migrateRewardsBalance(address[] calldata guardians) external override {
require(!settings.rewardAllocationActive, "Reward distribution must be deactivated for migration");
IFeesAndBootstrapRewards currentRewardsContract = IFeesAndBootstrapRewards(getFeesAndBootstrapRewardsContract());
require(... | /// Migrates the rewards balance to a new FeesAndBootstrap contract
/// @dev The new rewards contract is determined according to the contracts registry
/// @dev No impact of the calling contract if the currently configured contract in the registry
/// @dev may be called also while the contract is locked
/// @param guar... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
13940,
15804
]
} | 3,084 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | acceptRewardsBalanceMigration | function acceptRewardsBalanceMigration(address[] memory guardians, uint256[] memory fees, uint256 totalFees, uint256[] memory bootstrap, uint256 totalBootstrap) external override {
uint256 _totalFees = 0;
uint256 _totalBootstrap = 0;
for (uint i = 0; i < guardians.length; i++) {
_totalFees = _... | /// Accepts guardian's balance migration from a previous rewards contract
/// @dev the function may be called by any caller that approves the amounts provided for transfer
/// @param guardians is the list of migrated guardians
/// @param fees is the list of received guardian fees balance
/// @param totalFees is the tot... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
16479,
18082
]
} | 3,085 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | emergencyWithdraw | function emergencyWithdraw(address erc20) external override onlyMigrationManager {
IERC20 _token = IERC20(erc20);
emit EmergencyWithdrawal(msg.sender, address(_token));
require(_token.transfer(msg.sender, _token.balanceOf(address(this))), "Rewards::emergencyWithdraw - transfer failed");
}
| /// Performs emergency withdrawal of the contract balance
/// @dev called with a token to withdraw, should be called twice with the fees and bootstrap tokens
/// @dev governance function called only by the migration manager
/// @param erc20 is the ERC20 token to withdraw | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
18377,
18703
]
} | 3,086 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | getSettings | function getSettings() external override view returns (
uint generalCommitteeAnnualBootstrap,
uint certifiedCommitteeAnnualBootstrap,
bool rewardAllocationActive
) {
Settings memory _settings = settings;
generalCommitteeAnnualBootstrap = _settings.generalCommitteeAnnualBootstrap;
certifie... | /// Returns the contract's settings
/// @return generalCommitteeAnnualBootstrap is the general committee annual bootstrap
/// @return certifiedCommitteeAnnualBootstrap is the certified committee additional annual bootstrap
/// @return rewardAllocationActive indicates the rewards allocation activation state | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
19035,
19535
]
} | 3,087 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | _getFeesAndBootstrapState | function _getFeesAndBootstrapState(uint generalCommitteeSize, uint certifiedCommitteeSize, uint256 collectedGeneralFees, uint256 collectedCertifiedFees, uint256 currentTime, Settings memory _settings) private view returns (FeesAndBootstrapState memory _feesAndBootstrapState, uint256 allocatedGeneralBootstrap, uint256 a... | /// Returns the current global Fees and Bootstrap rewards state
/// @dev receives the relevant committee and general state data
/// @param generalCommitteeSize is the current number of members in the certified committee
/// @param certifiedCommitteeSize is the current number of members in the general committee
/// @pa... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
20316,
22242
]
} | 3,088 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | _updateFeesAndBootstrapState | function _updateFeesAndBootstrapState(uint generalCommitteeSize, uint certifiedCommitteeSize) private returns (FeesAndBootstrapState memory _feesAndBootstrapState) {
Settings memory _settings = settings;
if (!_settings.rewardAllocationActive) {
return feesAndBootstrapState;
}
uint256 coll... | /// Updates the global Fees and Bootstrap rewards state
/// @dev utilizes _getFeesAndBootstrapState to calculate the global state
/// @param generalCommitteeSize is the current number of members in the certified committee
/// @param certifiedCommitteeSize is the current number of members in the general committee
/// @... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
22677,
24017
]
} | 3,089 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | updateFeesAndBootstrapState | function updateFeesAndBootstrapState() private returns (FeesAndBootstrapState memory _feesAndBootstrapState) {
(uint generalCommitteeSize, uint certifiedCommitteeSize, ) = committeeContract.getCommitteeStats();
return _updateFeesAndBootstrapState(generalCommitteeSize, certifiedCommitteeSize);
}
| /// Updates the global Fees and Bootstrap rewards state
/// @dev utilizes _updateFeesAndBootstrapState
/// @return _feesAndBootstrapState is a FeesAndBootstrapState struct with the updated state | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
24230,
24553
]
} | 3,090 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | _getGuardianFeesAndBootstrap | function _getGuardianFeesAndBootstrap(address guardian, bool inCommittee, bool isCertified, bool nextCertification, FeesAndBootstrapState memory _feesAndBootstrapState) private view returns (FeesAndBootstrap memory guardianFeesAndBootstrap, uint256 addedBootstrapAmount, uint256 addedFeesAmount) {
guardianFeesAndBo... | /// Returns the current guardian Fees and Bootstrap rewards state
/// @dev receives the relevant guardian committee membership data and the global state
/// @param guardian is the guardian to query
/// @param inCommittee indicates whether the guardian is currently in the committee
/// @param isCertified indicates whet... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
25435,
26835
]
} | 3,091 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | _updateGuardianFeesAndBootstrap | function _updateGuardianFeesAndBootstrap(address guardian, bool inCommittee, bool isCertified, bool nextCertification, uint generalCommitteeSize, uint certifiedCommitteeSize) private {
uint256 addedBootstrapAmount;
uint256 addedFeesAmount;
FeesAndBootstrapState memory _feesAndBootstrapState = _updateFe... | /// Updates a guardian Fees and Bootstrap rewards state
/// @dev receives the relevant guardian committee membership data
/// @dev updates the global Fees and Bootstrap state prior to calculating the guardian's
/// @dev utilizes _getGuardianFeesAndBootstrap
/// @param guardian is the guardian to update
/// @param inCom... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
27626,
28766
]
} | 3,092 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | getGuardianFeesAndBootstrap | function getGuardianFeesAndBootstrap(address guardian, uint256 currentTime) private view returns (FeesAndBootstrap memory guardianFeesAndBootstrap, bool certified) {
ICommittee _committeeContract = committeeContract;
(uint generalCommitteeSize, uint certifiedCommitteeSize, ) = _committeeContract.getCommitteeS... | /// Returns the guardian Fees and Bootstrap rewards state for a given time
/// @dev if the time to estimate is in the future, estimates the fees and rewards for the given time
/// @dev for future time estimation assumes no change in the guardian committee membership and certification
/// @param guardian is the guardian... | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
29368,
30232
]
} | 3,093 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | updateGuardianFeesAndBootstrap | function updateGuardianFeesAndBootstrap(address guardian) private {
ICommittee _committeeContract = committeeContract;
(uint generalCommitteeSize, uint certifiedCommitteeSize, ) = _committeeContract.getCommitteeStats();
(bool inCommittee, , bool isCertified,) = _committeeContract.getMemberInfo(guardian);... | /// Updates a guardian Fees and Bootstrap rewards state
/// @dev query the relevant guardian and committee data from the committee contract
/// @dev utilizes _updateGuardianFeesAndBootstrap
/// @param guardian is the guardian to update | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
30491,
30972
]
} | 3,094 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | _setGeneralCommitteeAnnualBootstrap | function _setGeneralCommitteeAnnualBootstrap(uint256 annualAmount) private {
require(uint256(uint96(annualAmount)) == annualAmount, "annualAmount must fit in uint96");
settings.generalCommitteeAnnualBootstrap = uint96(annualAmount);
emit GeneralCommitteeAnnualBootstrapChanged(annualAmount);
}
| /// Sets the annual rate for the general committee bootstrap
/// @param annualAmount is the annual general committee bootstrap award | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
31149,
31481
]
} | 3,095 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | _setCertifiedCommitteeAnnualBootstrap | function _setCertifiedCommitteeAnnualBootstrap(uint256 annualAmount) private {
require(uint256(uint96(annualAmount)) == annualAmount, "annualAmount must fit in uint96");
settings.certifiedCommitteeAnnualBootstrap = uint96(annualAmount);
emit CertifiedCommitteeAnnualBootstrapChanged(annualAmount);
}
| /// Sets the annual rate for the certified committee bootstrap
/// @param annualAmount is the annual certified committee bootstrap award | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
31631,
31969
]
} | 3,096 | ||
FeesAndBootstrapRewards | contracts/FeesAndBootstrapRewards.sol | 0xda7e381544fc73cad7d9e63c86e561452b9b9e9c | Solidity | FeesAndBootstrapRewards | contract FeesAndBootstrapRewards is IFeesAndBootstrapRewards, ManagedContract {
using SafeMath for uint256;
using SafeMath96 for uint96;
uint256 constant PERCENT_MILLIE_BASE = 100000;
uint256 constant TOKEN_BASE = 1e18;
struct Settings {
uint96 generalCommitteeAnnualBootstrap;
... | refreshContracts | function refreshContracts() external override {
committeeContract = ICommittee(getCommitteeContract());
generalFeesWallet = IFeesWallet(getGeneralFeesWallet());
certifiedFeesWallet = IFeesWallet(getCertifiedFeesWallet());
bootstrapRewardsWallet = IProtocolWallet(getBootstrapRewardsWallet());
}
| /// Refreshes the address of the other contracts the contract interacts with
/// @dev called by the registry contract upon an update of a contract in the registry | NatSpecSingleLine | v0.6.12+commit.27d51765 | MIT | ipfs://ca7f2529f56054280eeeb86b39c30e8c839f5ddb6846120be619df37eaa803e8 | {
"func_code_index": [
32368,
32708
]
} | 3,097 | ||
maddencoin | maddencoin.sol | 0x84ad9b68533e5eefac045c39f306fd3fcc6bc440 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://githu... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a... | /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://216fdb4c2b24239b5f5b98721f0615109947591774c3c60bec2a7b4ff002bfad | {
"func_code_index": [
89,
476
]
} | 3,098 | |
maddencoin | maddencoin.sol | 0x84ad9b68533e5eefac045c39f306fd3fcc6bc440 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://githu... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://216fdb4c2b24239b5f5b98721f0615109947591774c3c60bec2a7b4ff002bfad | {
"func_code_index": [
560,
840
]
} | 3,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.