Unnamed: 0
int64 0
7.36k
| comments
stringlengths 3
35.2k
| code_string
stringlengths 1
527k
| code
stringlengths 1
527k
| __index_level_0__
int64 0
88.6k
|
---|---|---|---|---|
8 | // The call for the private function is needed to bypass a deep stack issues | return _forgeOrg(
_orgName,
_tokenName,
_tokenSymbol,
_founders,
_foundersTokenAmount,
_foundersReputationAmount,
_cap);
| return _forgeOrg(
_orgName,
_tokenName,
_tokenSymbol,
_founders,
_foundersTokenAmount,
_foundersReputationAmount,
_cap);
| 23,358 |
36 | // Whitelists an Investor _investor - Address of the investor _investorInfo - Inforeturn True if success / | function addNewInvestor(address _investor, string memory _investorInfo)
public
onlyAdmin
returns (bool)
| function addNewInvestor(address _investor, string memory _investorInfo)
public
onlyAdmin
returns (bool)
| 27,974 |
0 | // List of revert message codes. Implementing dApp should handle showing the correct message. / | string constant ZERO_ADDRESS = "003001";
string constant NOT_VALID_NFT = "003002";
string constant NOT_OWNER_OR_OPERATOR = "003003";
string constant NOT_OWNER_APPROWED_OR_OPERATOR = "003004";
string constant NOT_ABLE_TO_RECEIVE_NFT = "003005";
string constant NFT_ALREADY_EXISTS = "003006";
string constant NOT_OWNER = "003007";
string constant IS_OWNER = "003008";
string constant EMPTY_SYMBOL = "003009";
string constant EMPTY_NAME = "003010";
| string constant ZERO_ADDRESS = "003001";
string constant NOT_VALID_NFT = "003002";
string constant NOT_OWNER_OR_OPERATOR = "003003";
string constant NOT_OWNER_APPROWED_OR_OPERATOR = "003004";
string constant NOT_ABLE_TO_RECEIVE_NFT = "003005";
string constant NFT_ALREADY_EXISTS = "003006";
string constant NOT_OWNER = "003007";
string constant IS_OWNER = "003008";
string constant EMPTY_SYMBOL = "003009";
string constant EMPTY_NAME = "003010";
| 28,028 |
7 | // The information of a subscriptionsubscriptionId uint256 - the uid of a subscription.clubId uint256 - the uid of the subscripted club.tierId uint256 - the uid of the subscripted tier.subscriber address - the address of the subscriber.dateStartuint256 - the unix timestamp to keep track of start date.nextPaymentuint256 - the unix timestamp to keep track of when the next payment is due. Always equal dateStart + 2629743 seconds (30.44 days - 1 month) param passedDuebool - true if the subscriber doesn't pay TierFee within the right Tier period/ | struct Subscription {
uint256 subscriptionId;
uint256 clubId;
uint256 tierId;
address subscriber;
uint256 dateStart;
uint256 nextPayment;
// bool passedDue;
}
| struct Subscription {
uint256 subscriptionId;
uint256 clubId;
uint256 tierId;
address subscriber;
uint256 dateStart;
uint256 nextPayment;
// bool passedDue;
}
| 16,330 |
2 | // key: line number maps to val: weaver address | mapping(uint256 => address) public weaverByLine;
| mapping(uint256 => address) public weaverByLine;
| 22,803 |
14 | // Gets total balance of this contract in terms of the underlying This excludes the value of the current message, if anyreturn The quantity of underlying tokens owned by this contract / | function getCashOnChain() internal view returns (uint) {
EIP20Interface token = EIP20Interface(underlying);
return token.balanceOf(address(this));
}
| function getCashOnChain() internal view returns (uint) {
EIP20Interface token = EIP20Interface(underlying);
return token.balanceOf(address(this));
}
| 60,048 |
111 | // Get the active bid id and index by a bidder and an specific token. If the bidder has not a valid bid, the transaction will be reverted._tokenAddress - address of the ERC721 token_tokenId - uint256 of the token id_bidder - address of the bidder return uint256 of the bid index to be used within bidsByToken mapping return bytes32 of the bid id return address of the bidder address return uint256 of the bid price return uint256 of the expiration time/ | function getBidByBidder(address _tokenAddress, uint256 _tokenId, address _bidder)
public
view
returns (
uint256 bidIndex,
bytes32 bidId,
address bidder,
uint256 price,
uint256 expiresAt
)
| function getBidByBidder(address _tokenAddress, uint256 _tokenId, address _bidder)
public
view
returns (
uint256 bidIndex,
bytes32 bidId,
address bidder,
uint256 price,
uint256 expiresAt
)
| 51,837 |
2 | // 每秒静态收益 | uint256 public staticRewardPerSecond = uint256(eachDayRelase).mul(40).div(86400).div(100);
| uint256 public staticRewardPerSecond = uint256(eachDayRelase).mul(40).div(86400).div(100);
| 30,992 |
17 | // Token-eth related | uint256 public totalRaised; //eth collected in wei
uint256 public PreSaleDistributed; //presale tokens distributed
uint256 public PreSaleLimit = 75000000 * (10 ** 18);
uint256 public totalDistributed; //Whole sale tokens distributed
ERC20Basic public tokenReward; //Token contract address
uint256 public softCap = 50000000 * (10 ** 18); //50M Tokens
uint256 public hardCap = 600000000 * (10 ** 18); // 600M tokens
bool public claimed;
| uint256 public totalRaised; //eth collected in wei
uint256 public PreSaleDistributed; //presale tokens distributed
uint256 public PreSaleLimit = 75000000 * (10 ** 18);
uint256 public totalDistributed; //Whole sale tokens distributed
ERC20Basic public tokenReward; //Token contract address
uint256 public softCap = 50000000 * (10 ** 18); //50M Tokens
uint256 public hardCap = 600000000 * (10 ** 18); // 600M tokens
bool public claimed;
| 22,998 |
113 | // 32 is the length in bytes of hash, enforced by the type signature above | return
keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
| return
keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
| 33,044 |
3 | // Scheme for upgrading an upgradable contract to new impl see openzeppelin upgradables / | contract UpgradeImplScheme {
address public newImpl;
address public proxy;
address public proxyAdmin;
bytes public callData;
uint public timeLockHours;
/* @dev constructor.
*/
constructor(address _newImpl, address _proxy, address _proxyAdmin, bytes memory _callData, uint _timeLockHours) public {
newImpl = _newImpl;
proxy = _proxy;
proxyAdmin = _proxyAdmin;
callData = _callData;
timeLockHours = _timeLockHours;
}
}
| contract UpgradeImplScheme {
address public newImpl;
address public proxy;
address public proxyAdmin;
bytes public callData;
uint public timeLockHours;
/* @dev constructor.
*/
constructor(address _newImpl, address _proxy, address _proxyAdmin, bytes memory _callData, uint _timeLockHours) public {
newImpl = _newImpl;
proxy = _proxy;
proxyAdmin = _proxyAdmin;
callData = _callData;
timeLockHours = _timeLockHours;
}
}
| 37,864 |
7 | // blueprint blob, formatted as {tokenId}:{blueprint} blueprint gets passed on L2 mint-time | bytes calldata mintingBlob
) external override {
| bytes calldata mintingBlob
) external override {
| 9,578 |
62 | // Return bid id return uint256 of the bid id/ | function _getBidId() private view returns (uint256) {
return totalBids;
}
| function _getBidId() private view returns (uint256) {
return totalBids;
}
| 43,579 |
3 | // Compute hashes in empty sparse Merkle tree | constructor() public {
for (uint height = 0; height < DEPOSIT_CONTRACT_TREE_DEPTH - 1; height++)
zero_hashes[height + 1] = sha256(abi.encodePacked(zero_hashes[height], zero_hashes[height]));
}
| constructor() public {
for (uint height = 0; height < DEPOSIT_CONTRACT_TREE_DEPTH - 1; height++)
zero_hashes[height + 1] = sha256(abi.encodePacked(zero_hashes[height], zero_hashes[height]));
}
| 37,652 |
65 | // the withdraw flag, when withdraw at first, set true | bool public withdrawFlag;
| bool public withdrawFlag;
| 7,394 |
58 | // if empty | if (o.unitPrice == 0 || o.amount < 10) {
return idx;
}else if (o.unitPrice < lowestPrice) {
| if (o.unitPrice == 0 || o.amount < 10) {
return idx;
}else if (o.unitPrice < lowestPrice) {
| 43,217 |
9 | // Registers a new implementation, and starts new session. / | function _upgrade(address _implementation) private {
(bool result, ) = _implementation.delegatecall(abi.encodeWithSignature("initialize(address,string,string)", owner(), "NewDollar", "NWD"));
require(result, "NewDollar: Failed to upgrade!");
StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = _implementation;
sessionEndTime = block.timestamp + 30 days;
emit NewSessionStarted(_implementation, sessionEndTime);
}
| function _upgrade(address _implementation) private {
(bool result, ) = _implementation.delegatecall(abi.encodeWithSignature("initialize(address,string,string)", owner(), "NewDollar", "NWD"));
require(result, "NewDollar: Failed to upgrade!");
StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = _implementation;
sessionEndTime = block.timestamp + 30 days;
emit NewSessionStarted(_implementation, sessionEndTime);
}
| 49,669 |
534 | // Emitted when asset manager is rebalanced / | event Rebalance(bytes32 poolId);
| event Rebalance(bytes32 poolId);
| 25,049 |
62 | // Number of blocks to lock user remaining balances (25x = ~1 year) | uint public USER_LOCK_BLOCKS;
| uint public USER_LOCK_BLOCKS;
| 27,418 |
25 | // Return Memory Variable Address / | function getMemoryAddr() internal pure returns (address) {
return 0x8a5419CfC711B2343c17a6ABf4B2bAFaBb06957F; // InstaMemory Address
}
| function getMemoryAddr() internal pure returns (address) {
return 0x8a5419CfC711B2343c17a6ABf4B2bAFaBb06957F; // InstaMemory Address
}
| 14,022 |
38 | // when tx count = 0, there is no hash! string len: [13]{milliseconds}-[1]{0}-[8]{sizeOfData}-[64]{hash}-[64]{root} | uint256 posTxSize = 7 + posTs;
uint256 posRoot = 11 + posTs;
assembly {
batchTime := shr(204, calldataload(posTs))
txSize := shr(224, calldataload(posTxSize))
root := calldataload(posRoot)
}
| uint256 posTxSize = 7 + posTs;
uint256 posRoot = 11 + posTs;
assembly {
batchTime := shr(204, calldataload(posTs))
txSize := shr(224, calldataload(posTxSize))
root := calldataload(posRoot)
}
| 47,023 |
7 | // Probably Unecessary | function getUploadPacket(string memory _packetId)
public
view
returns (UploadPacket memory)
| function getUploadPacket(string memory _packetId)
public
view
returns (UploadPacket memory)
| 44,546 |
52 | // A function modifier which limits how often a function can be executed | mapping (bytes4 => uint) internal _lastExecuted;
| mapping (bytes4 => uint) internal _lastExecuted;
| 39,011 |
97 | // Gets CDP info (collateral, debt)/_cdpId Id of the CDP/_ilk Ilk of the CDP | function getCdpInfo(uint256 _cdpId, bytes32 _ilk) public view returns (uint256, uint256) {
address urn = manager.urns(_cdpId);
(uint256 collateral, uint256 debt) = vat.urns(_ilk, urn);
(, uint256 rate, , , ) = vat.ilks(_ilk);
return (collateral, rmul(debt, rate));
}
| function getCdpInfo(uint256 _cdpId, bytes32 _ilk) public view returns (uint256, uint256) {
address urn = manager.urns(_cdpId);
(uint256 collateral, uint256 debt) = vat.urns(_ilk, urn);
(, uint256 rate, , , ) = vat.ilks(_ilk);
return (collateral, rmul(debt, rate));
}
| 54,251 |
18 | // To change the approve amount you first have to reduce the addresses`allowance to zero by calling `approve(_spender, 0)` if it is notalready 0 to mitigate the race condition described here:https:github.com/ethereum/EIPs/issues/20issuecomment-263524729 | require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
| require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
| 49,691 |
565 | // res += valcoefficients[135]. | res := addmod(res,
mulmod(val, /*coefficients[135]*/ mload(0x14e0), PRIME),
PRIME)
| res := addmod(res,
mulmod(val, /*coefficients[135]*/ mload(0x14e0), PRIME),
PRIME)
| 19,705 |
58 | // exclude from rewards | _isExcluded[_burnAddress] = true;
_isExcluded[uniswapV2Pair] = true;
_owner = _msgSender();
emit Transfer(address(0), _msgSender(), _tTotal);
| _isExcluded[_burnAddress] = true;
_isExcluded[uniswapV2Pair] = true;
_owner = _msgSender();
emit Transfer(address(0), _msgSender(), _tTotal);
| 46,686 |
133 | // Withdraw when there is no budget plans. / | function withdrawOnNoAvailablePlan() onlyOwner inWithdrawState public {
require(address(this).balance >= MIN_WITHDRAW_WEI);
// Check the last result.
tryFinializeLastProposal();
require(state == State.TeamWithdraw);
// Check if someone proposed a tap voting.
require(!_isThereAnOnGoingTapProposal());
// There is no passed budget plan.
require(!isNextBudgetPlanMade());
// Validate the time.
BudgetPlan storage currentPlan = budgetPlans[currentBudgetPlanId];
require(now > currentPlan.endTime);
// Create plan.
uint256 planId = budgetPlans.length++;
BudgetPlan storage plan = budgetPlans[planId];
plan.proposalId = NON_UINT256;
plan.budgetInWei = MIN_WITHDRAW_WEI;
plan.withdrawnWei = 0;
plan.startTime = now;
(plan.endTime, plan.officalVotingTime) = _budgetEndAndOfficalVotingTime(now);
++currentBudgetPlanId;
// Withdraw the weis.
_withdraw(MIN_WITHDRAW_WEI);
}
| function withdrawOnNoAvailablePlan() onlyOwner inWithdrawState public {
require(address(this).balance >= MIN_WITHDRAW_WEI);
// Check the last result.
tryFinializeLastProposal();
require(state == State.TeamWithdraw);
// Check if someone proposed a tap voting.
require(!_isThereAnOnGoingTapProposal());
// There is no passed budget plan.
require(!isNextBudgetPlanMade());
// Validate the time.
BudgetPlan storage currentPlan = budgetPlans[currentBudgetPlanId];
require(now > currentPlan.endTime);
// Create plan.
uint256 planId = budgetPlans.length++;
BudgetPlan storage plan = budgetPlans[planId];
plan.proposalId = NON_UINT256;
plan.budgetInWei = MIN_WITHDRAW_WEI;
plan.withdrawnWei = 0;
plan.startTime = now;
(plan.endTime, plan.officalVotingTime) = _budgetEndAndOfficalVotingTime(now);
++currentBudgetPlanId;
// Withdraw the weis.
_withdraw(MIN_WITHDRAW_WEI);
}
| 71,505 |
29 | // transfer token to a contract address with additional data if the recipient is a contact._to The address to transfer to._value The amount to be transferred._data The extra data to be passed to the receiving contract./ | function transferAndCall(address _to, uint _value, bytes _data)
public
returns (bool success)
| function transferAndCall(address _to, uint _value, bytes _data)
public
returns (bool success)
| 29,522 |
471 | // Returns all the relevant information about a specific Pony./_id The ID of the Pony of interest. | function getPony(uint256 _id)
external
view
returns (
bool isGestating,
bool isReady,
uint256 cooldownIndex,
uint256 nextActionAt,
uint256 siringWithId,
uint256 birthTime,
| function getPony(uint256 _id)
external
view
returns (
bool isGestating,
bool isReady,
uint256 cooldownIndex,
uint256 nextActionAt,
uint256 siringWithId,
uint256 birthTime,
| 2,482 |
11 | // Claims the reward for the specified token of the given token type for the caller._tokenType The type of the token for which the reward is claimed (0 for TMHC, 1 for MOMO)._tokenId The ID of the token for which the reward is claimed./ | function claim(uint _tokenType, uint16 _tokenId) external nonReentrant {
require(!PauseClaim, "The claim is currently paused.");
_claim(msg.sender, _tokenType, _tokenId);
}
| function claim(uint _tokenType, uint16 _tokenId) external nonReentrant {
require(!PauseClaim, "The claim is currently paused.");
_claim(msg.sender, _tokenType, _tokenId);
}
| 26,571 |
94 | // Calculates the amount of unclaimed super rewards per token since last update,and sums with stored to give the new cumulative reward per token _lp true=lpStaking, false=tokenStakingreturn 'Reward' per staked token / | function currentSuperRewardPerTokenStored(bool _lp) public view returns (uint256) {
StakingData memory sd = _lp ? lpStaking : tokenStaking;
uint256 stakedSuperTokens = sd.stakedSuperTokens;
uint256 superRewardPerTokenStored = sd.superRewardPerTokenStored;
// If there is no staked tokens, avoid div(0)
if (stakedSuperTokens == 0) {
return (superRewardPerTokenStored);
}
// new reward units to distribute = superRewardRate * timeSinceLastSuperUpdate
uint256 timeDelta = lastTimeSuperRewardApplicable() - sd.lastSuperUpdateTime;
uint256 rewardUnitsToDistribute = sd.superRewardRate * timeDelta;
// new reward units per token = (rewardUnitsToDistribute * 1e18) / totalSuperTokens
uint256 unitsToDistributePerToken = rewardUnitsToDistribute.divPrecisely(stakedSuperTokens);
// return summed rate
return (superRewardPerTokenStored + unitsToDistributePerToken);
}
| function currentSuperRewardPerTokenStored(bool _lp) public view returns (uint256) {
StakingData memory sd = _lp ? lpStaking : tokenStaking;
uint256 stakedSuperTokens = sd.stakedSuperTokens;
uint256 superRewardPerTokenStored = sd.superRewardPerTokenStored;
// If there is no staked tokens, avoid div(0)
if (stakedSuperTokens == 0) {
return (superRewardPerTokenStored);
}
// new reward units to distribute = superRewardRate * timeSinceLastSuperUpdate
uint256 timeDelta = lastTimeSuperRewardApplicable() - sd.lastSuperUpdateTime;
uint256 rewardUnitsToDistribute = sd.superRewardRate * timeDelta;
// new reward units per token = (rewardUnitsToDistribute * 1e18) / totalSuperTokens
uint256 unitsToDistributePerToken = rewardUnitsToDistribute.divPrecisely(stakedSuperTokens);
// return summed rate
return (superRewardPerTokenStored + unitsToDistributePerToken);
}
| 49,763 |
109 | // speed up realtime request to balance functions by periodic call this gas cost operation | _requestInterestPayoutToTotalSupply();
_requestInterestPayoutToAccountBalance(contractOwner); // do interest payout before changing balances
| _requestInterestPayoutToTotalSupply();
_requestInterestPayoutToAccountBalance(contractOwner); // do interest payout before changing balances
| 48,593 |
10 | // suppliers keyed by their public address | mapping(address => uint256) public suppliersByAddress;
| mapping(address => uint256) public suppliersByAddress;
| 15,883 |
16 | // Access modifier for CMO-only functionality | modifier onlyCMO() {
require(msg.sender == cmoAddress);
_;
}
| modifier onlyCMO() {
require(msg.sender == cmoAddress);
_;
}
| 22,693 |
3 | // Mirror tributary registry | address public tributaryRegistry;
constructor(
address owner_,
address implementation_,
address tributaryRegistry_
| address public tributaryRegistry;
constructor(
address owner_,
address implementation_,
address tributaryRegistry_
| 39,137 |
49 | // discover the crime | uint256 suspect = random(6);
uint256 weapon = random(6) + 6;
uint256 room = random(9) + 12;
Crime memory crime = Crime(suspect, weapon, room);
games[_gameId].crime = crime;
| uint256 suspect = random(6);
uint256 weapon = random(6) + 6;
uint256 room = random(9) + 12;
Crime memory crime = Crime(suspect, weapon, room);
games[_gameId].crime = crime;
| 41,282 |
165 | // Deposit variant with proof for merkle guest list | function deposit(uint256 _amount, bytes32[] memory proof) public whenNotPaused {
_defend();
_blockLocked();
_lockForBlock(msg.sender);
_depositWithAuthorization(_amount, proof);
}
| function deposit(uint256 _amount, bytes32[] memory proof) public whenNotPaused {
_defend();
_blockLocked();
_lockForBlock(msg.sender);
_depositWithAuthorization(_amount, proof);
}
| 16,281 |
139 | // check for sufficient Hypervisor stake amount if this check fails, there is a bug in stake accounting | assert(_hypervisor.totalStake >= amount);
| assert(_hypervisor.totalStake >= amount);
| 72,032 |
79 | // Bool if limits are in effect | bool public limitsInEffect = true;
| bool public limitsInEffect = true;
| 13,218 |
1 | // Quotation block, token address, all handling charges of token, my handling charges, number of tokens | event miningLog(uint256 blockNum, address tokenAddress, uint256 miningEthAll, uint256 miningEthSelf, uint256 tokenNum);
| event miningLog(uint256 blockNum, address tokenAddress, uint256 miningEthAll, uint256 miningEthSelf, uint256 tokenNum);
| 4,945 |
81 | // Used to add new symbol to the bytes array | function _addHorse(bytes32 newHorse) internal {
all_horses.push(newHorse);
}
| function _addHorse(bytes32 newHorse) internal {
all_horses.push(newHorse);
}
| 50,602 |
523 | // Claims all rewarded tokens from a pool.// The pool and stake MUST be updated before calling this function.//_poolId The pool to claim rewards from.//use this function to claim the tokens from a corresponding pool by ID. | function _claim(uint256 _poolId) internal {
Stake.Data storage _stake = _stakes[msg.sender][_poolId];
uint256 _claimAmount = _stake.totalUnclaimed;
_stake.totalUnclaimed = 0;
reward.mint(msg.sender, _claimAmount);
emit TokensClaimed(msg.sender, _poolId, _claimAmount);
}
| function _claim(uint256 _poolId) internal {
Stake.Data storage _stake = _stakes[msg.sender][_poolId];
uint256 _claimAmount = _stake.totalUnclaimed;
_stake.totalUnclaimed = 0;
reward.mint(msg.sender, _claimAmount);
emit TokensClaimed(msg.sender, _poolId, _claimAmount);
}
| 38,481 |
66 | // Mapping from owner to number of owned token | mapping (address => uint256) internal ownedTokensCount;
| mapping (address => uint256) internal ownedTokensCount;
| 1,393 |
11 | // ============ Constants ============ / 500K BABL allocated to this BABL Mining Program, the first quarter is Q1_REWARDS and the following quarters will follow the supply curve using a decay rate | uint256 private constant Q1_REWARDS = 53_571_428_571_428_600e6; // First quarter (epoch) BABL rewards
| uint256 private constant Q1_REWARDS = 53_571_428_571_428_600e6; // First quarter (epoch) BABL rewards
| 31,653 |
1 | // Send _value amount of tokens to address _to | function transfer(address _to, uint256 _value) public returns (bool success);
| function transfer(address _to, uint256 _value) public returns (bool success);
| 30,959 |
115 | // Called by a Keeper to close a contract. This is irreversible. / | function close() internal whenNotClosed {
_closed = true;
emit Closed(msg.sender);
}
| function close() internal whenNotClosed {
_closed = true;
emit Closed(msg.sender);
}
| 49,952 |
203 | // For lenders that never incur debt, we use this flag to skip the free collateral check. | bytes1 hasDebt;
| bytes1 hasDebt;
| 29,160 |
223 | // Divide denominator by power of two | assembly {
denominator := div(denominator, twos)
}
| assembly {
denominator := div(denominator, twos)
}
| 5,270 |
52 | // Withdraw tokens to receiver address if withdraw params are correct. _recipient address to receive tokens. _transitAddress transit address provided to receiver by the airdropper _keyV ECDSA signature parameter v. Signed by the airdrop transit key. _keyR ECDSA signature parameters r. Signed by the airdrop transit key. _keyS ECDSA signature parameters s. Signed by the airdrop transit key. _recipientV ECDSA signature parameter v. Signed by the link key. _recipientR ECDSA signature parameters r. Signed by the link key. _recipientS ECDSA signature parameters s. Signed by the link key.return True if tokens (and ether) were successfully sent to receiver. / | function withdraw(
address _recipient,
address _referralAddress,
address _transitAddress,
uint8 _keyV,
bytes32 _keyR,
bytes32 _keyS,
uint8 _recipientV,
bytes32 _recipientR,
bytes32 _recipientS
| function withdraw(
address _recipient,
address _referralAddress,
address _transitAddress,
uint8 _keyV,
bytes32 _keyR,
bytes32 _keyS,
uint8 _recipientV,
bytes32 _recipientR,
bytes32 _recipientS
| 53,363 |
18 | // Approve infinite tokens to defi protocols in order to save gas / | function _approveTokens() internal virtual;
| function _approveTokens() internal virtual;
| 38,793 |
224 | // IMPORTANT: Contracts derived from {GSNRecipient} should never use `msg.data`, and use {_msgData} instead. / | function _msgData() internal view returns (bytes memory) {
if (msg.sender != _relayHub) {
return msg.data;
} else {
| function _msgData() internal view returns (bytes memory) {
if (msg.sender != _relayHub) {
return msg.data;
} else {
| 16,401 |
20 | // Modifier ensuring that certain function can only be called by pool or crosschain pool | modifier onlyPool() {
require(msg.sender == _pool || msg.sender == _crossChainPool, "!pool");
_;
}
| modifier onlyPool() {
require(msg.sender == _pool || msg.sender == _crossChainPool, "!pool");
_;
}
| 33,822 |
1 | // Always round to negative infinity | if (tickCumulativesDelta < 0 && (tickCumulativesDelta % int56(uint56(secondsAgo)) != 0))
arithmeticMeanTick--;
| if (tickCumulativesDelta < 0 && (tickCumulativesDelta % int56(uint56(secondsAgo)) != 0))
arithmeticMeanTick--;
| 17,445 |
43 | // onlyOwner external |
function setFee(
uint256 taxFeeOnBuy,
uint256 taxFeeOnSell
|
function setFee(
uint256 taxFeeOnBuy,
uint256 taxFeeOnSell
| 41,353 |
26 | // 免费领取白名单 | function setClaimListMerkleRoot(bytes32 merkleRoot) external onlyOwner {
claimListMerkleRoot = merkleRoot;
}
| function setClaimListMerkleRoot(bytes32 merkleRoot) external onlyOwner {
claimListMerkleRoot = merkleRoot;
}
| 15,574 |
130 | // store updated deposit info | depositorInfo[msg.sender] = DepositInfo({
value: value_.sub( valueUsed_ ),
payoutRemaining: payoutRemaining_.sub( payout_ ),
lastBlock: block.number,
vestingPeriod: vestingPeriod_.sub( blocksSinceLast_ )
});
| depositorInfo[msg.sender] = DepositInfo({
value: value_.sub( valueUsed_ ),
payoutRemaining: payoutRemaining_.sub( payout_ ),
lastBlock: block.number,
vestingPeriod: vestingPeriod_.sub( blocksSinceLast_ )
});
| 72,938 |
46 | // ERC20-compliant interface with addedfunction for burning tokens from addresses | * See {IERC20}
*/
interface IBurnableERC20 is IERC20 {
/**
* @dev Allows burning tokens from an address
*
* @dev Should have restricted access
*/
function burn(address _from, uint256 _amount) external;
}
| * See {IERC20}
*/
interface IBurnableERC20 is IERC20 {
/**
* @dev Allows burning tokens from an address
*
* @dev Should have restricted access
*/
function burn(address _from, uint256 _amount) external;
}
| 74,797 |
0 | // Minimal interface for minting StETH | interface ILido {
/// @dev Adds eth to the pool
/// @param _referral optional address for referrals
/// @return StETH Amount of shares generated
function submit(address _referral) external payable returns (uint256 StETH);
/// @dev Retrieve the current pooled ETH representation of the shares amount
/// @param _sharesAmount amount of shares
/// @return amount of pooled ETH represented by the shares amount
function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);
}
| interface ILido {
/// @dev Adds eth to the pool
/// @param _referral optional address for referrals
/// @return StETH Amount of shares generated
function submit(address _referral) external payable returns (uint256 StETH);
/// @dev Retrieve the current pooled ETH representation of the shares amount
/// @param _sharesAmount amount of shares
/// @return amount of pooled ETH represented by the shares amount
function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);
}
| 14,788 |
71 | // set processing fee - amount that have to be paid on other chain to claimTokenBehalf. Set in amount of native coins (BNB or ETH) | function setProcessingFee(uint256 _fee) external onlySystem returns(bool) {
processingFee = _fee;
return true;
}
| function setProcessingFee(uint256 _fee) external onlySystem returns(bool) {
processingFee = _fee;
return true;
}
| 18,971 |
1 | // Address Blacklist This is a Blacklist for addresses. The owner contract can Blacklist addresses./ | contract AddressBlacklist is AddressWhitelist {
/** @dev Return true if the address is allowed.
* @param _value The address we want to know if allowed.
* @return allowed True if the address is allowed, false otherwize.
*/
function isPermitted(address _value) public returns (bool allowed) {
return !super.isPermitted(_value);
}
} | contract AddressBlacklist is AddressWhitelist {
/** @dev Return true if the address is allowed.
* @param _value The address we want to know if allowed.
* @return allowed True if the address is allowed, false otherwize.
*/
function isPermitted(address _value) public returns (bool allowed) {
return !super.isPermitted(_value);
}
} | 48,420 |
135 | // Post-mint freeze settings | function setPostMintFreeze(uint256 _frozenForSeconds) public onlyTeamOrOwner {
freezePostMintForSeconds = _frozenForSeconds;
}
| function setPostMintFreeze(uint256 _frozenForSeconds) public onlyTeamOrOwner {
freezePostMintForSeconds = _frozenForSeconds;
}
| 11,010 |
15 | // return Returns the getUintVar variable named after the function name.This variable tracks the highest api/timestamp PayoutPool. / | function currentTotalTips() external view returns (uint256) {
return proxy.getUintVar(keccak256("currentTotalTips"));
}
| function currentTotalTips() external view returns (uint256) {
return proxy.getUintVar(keccak256("currentTotalTips"));
}
| 10,268 |
101 | // ERC721 token receiver interface Interface for any contract that wants to support safeTransfersfrom ERC721 asset contracts. / | interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
external returns (bytes4);
}
| interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
external returns (bytes4);
}
| 156 |
124 | // Event emitted to notify about the creation of a SKU. sku The identifier of the created SKU. totalSupply The initial total supply for sale. maxQuantityPerPurchase The maximum allowed quantity for a single purchase. notificationsReceiver If not the zero address, the address of a contract on which `onPurchaseNotificationReceived` will be called after each purchase, If this is the zero address, the call is not enabled. / | event SkuCreation(bytes32 sku, uint256 totalSupply, uint256 maxQuantityPerPurchase, address notificationsReceiver);
| event SkuCreation(bytes32 sku, uint256 totalSupply, uint256 maxQuantityPerPurchase, address notificationsReceiver);
| 39,400 |
10 | // See {IERC20-transferFrom}.s The sender r The recipient a The amount to transfer Emits an {Approval} event indicating the updated allowance. This is notrequired by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address.- `sender` must have a balance of at least `amount`.- the caller must have allowance for ``sender``'s tokens of at least`amount`. / | function transferFrom(address s, address r, uint256 a) public virtual override returns (bool) {
_transfer(s, r, a);
uint256 currentAllowance = allowances[s][msg.sender];
require(currentAllowance >= a, "erc20 transfer amount exceeds allowance");
_approve(s, msg.sender, currentAllowance - a);
return true;
}
| function transferFrom(address s, address r, uint256 a) public virtual override returns (bool) {
_transfer(s, r, a);
uint256 currentAllowance = allowances[s][msg.sender];
require(currentAllowance >= a, "erc20 transfer amount exceeds allowance");
_approve(s, msg.sender, currentAllowance - a);
return true;
}
| 15,233 |
11 | // Получение количества операторов. / | function getOperatorsLengh() public view returns(uint) {
return operators.length;
}
| function getOperatorsLengh() public view returns(uint) {
return operators.length;
}
| 41,145 |
111 | // setting up user provided approved proposalTypes | if (_proposalTypes.length > 0) {
require(
_proposalTypes.length == _ProposalTypeDescriptions.length,
"Proposal types and descriptions do not match"
);
for (uint256 i = 0; i < _proposalTypes.length; i++)
proposalTypes[_ProposalTypeDescriptions[i]] = _proposalTypes[i];
}
| if (_proposalTypes.length > 0) {
require(
_proposalTypes.length == _ProposalTypeDescriptions.length,
"Proposal types and descriptions do not match"
);
for (uint256 i = 0; i < _proposalTypes.length; i++)
proposalTypes[_ProposalTypeDescriptions[i]] = _proposalTypes[i];
}
| 50,247 |
2 | // Dummy verifier at index 0 | verifiers.push(address(0));
for (uint256 i = 0; i < _verifiers.length; i++) {
verifiers.push(_verifiers[i]);
verifierAddressToIndex[_verifiers[i]] = i.add(1);
}
| verifiers.push(address(0));
for (uint256 i = 0; i < _verifiers.length; i++) {
verifiers.push(_verifiers[i]);
verifierAddressToIndex[_verifiers[i]] = i.add(1);
}
| 49,746 |
10 | // Initialize the contract with this master's address | LiteSig(deployedAddress).init(_owners, _requiredSignatures, chainId);
| LiteSig(deployedAddress).init(_owners, _requiredSignatures, chainId);
| 48,552 |
26 | // Initiate ownership transfer by setting nextOwner. / | function transferOwnership(address nextOwner_) external onlyOwner {
require(nextOwner_ != address(0), "Next owner is the zero address.");
nextOwner = nextOwner_;
}
| function transferOwnership(address nextOwner_) external onlyOwner {
require(nextOwner_ != address(0), "Next owner is the zero address.");
nextOwner = nextOwner_;
}
| 44,805 |
2 | // emitted when a user claims | event Claim(uint256 indexed round, uint256 indexed amount, address indexed user, address vestingContract);
| event Claim(uint256 indexed round, uint256 indexed amount, address indexed user, address vestingContract);
| 3,381 |
187 | // internal minting function | function _mint(uint256 _numToMint) internal {
require(_numToMint <= MAX_MINTABLE_AT_ONCE, "Minting too many at once.");
uint256 updatedNumAvailableTokens = _numAvailableTokens;
for (uint256 i = 0; i < _numToMint; i++) {
uint256 newTokenId = useRandomAvailableToken(_numToMint, i);
_safeMint(msg.sender, newTokenId);
updatedNumAvailableTokens--;
}
_numAvailableTokens = updatedNumAvailableTokens;
}
| function _mint(uint256 _numToMint) internal {
require(_numToMint <= MAX_MINTABLE_AT_ONCE, "Minting too many at once.");
uint256 updatedNumAvailableTokens = _numAvailableTokens;
for (uint256 i = 0; i < _numToMint; i++) {
uint256 newTokenId = useRandomAvailableToken(_numToMint, i);
_safeMint(msg.sender, newTokenId);
updatedNumAvailableTokens--;
}
_numAvailableTokens = updatedNumAvailableTokens;
}
| 28,758 |
10 | // Claim accumulated rewards./ | function claimRewards() external;
| function claimRewards() external;
| 30,389 |
0 | // {baseStorageHash}{joiner}{tokenId} e.g. ipfs:ipfs/Qmd9xQFBfqMZLG7RA2rXor7SA7qyJ1Pk2F2mSYzRQ2siMv/1234 | return string(abi.encodePacked(baseStorageHash, joiner, _tokenId.toString()));
| return string(abi.encodePacked(baseStorageHash, joiner, _tokenId.toString()));
| 44,641 |
67 | // Check end time not before start time and that end is in the future | require(_endTimestamp > _startTimestamp, "ArtGrailAuction.createAuction: End time must be greater than start");
require(_endTimestamp > _getNow(), "ArtGrailAuction.createAuction: End time passed. Nobody can bid.");
| require(_endTimestamp > _startTimestamp, "ArtGrailAuction.createAuction: End time must be greater than start");
require(_endTimestamp > _getNow(), "ArtGrailAuction.createAuction: End time passed. Nobody can bid.");
| 27,989 |
20 | // Zero address is used here to represent that this multiplier will beapplied to all accounts. / | if (account != address(0)) revert InvalidAccount();
super.setAmountMultiplier(account, amountMultiplier);
| if (account != address(0)) revert InvalidAccount();
super.setAmountMultiplier(account, amountMultiplier);
| 19,930 |
57 | // Returns true if the caller is the next owner. / | function isNextOwner() public view returns (bool) {
return msg.sender == nextOwner;
}
| function isNextOwner() public view returns (bool) {
return msg.sender == nextOwner;
}
| 19,455 |
344 | // Return RoundsManager interface / | function roundsManager() internal view returns (IRoundsManager) {
return IRoundsManager(controller.getContract(keccak256("RoundsManager")));
}
| function roundsManager() internal view returns (IRoundsManager) {
return IRoundsManager(controller.getContract(keccak256("RoundsManager")));
}
| 2,199 |
37 | // Add a new reward token to be distributed to stakers | function addReward(address _rewardsToken, address _distributor) external onlyOwner {
require(rewardData[_rewardsToken].lastUpdateTime == 0, "Reward already exists");
require(_rewardsToken != address(stakingToken), "Cannot add StakingToken as reward");
require(rewardTokens.length < 5, "Max rewards length");
rewardTokens.push(_rewardsToken);
rewardData[_rewardsToken].lastUpdateTime = uint32(block.timestamp);
rewardData[_rewardsToken].periodFinish = uint32(block.timestamp);
rewardDistributors[_rewardsToken][_distributor] = true;
}
| function addReward(address _rewardsToken, address _distributor) external onlyOwner {
require(rewardData[_rewardsToken].lastUpdateTime == 0, "Reward already exists");
require(_rewardsToken != address(stakingToken), "Cannot add StakingToken as reward");
require(rewardTokens.length < 5, "Max rewards length");
rewardTokens.push(_rewardsToken);
rewardData[_rewardsToken].lastUpdateTime = uint32(block.timestamp);
rewardData[_rewardsToken].periodFinish = uint32(block.timestamp);
rewardDistributors[_rewardsToken][_distributor] = true;
}
| 10,388 |
1 | // Internal pure function to retrieve and return the name of this contract. return The name of this contract. / | function _name() internal pure override returns (string memory) {
| function _name() internal pure override returns (string memory) {
| 14,013 |
35 | // ICO tokensIs calcluated as: initialICOCap + preSaleCap - soldPreSaleTokens | uint256 public icoCap;
uint256 public icoSoldTokens;
bool public icoEnded = false;
| uint256 public icoCap;
uint256 public icoSoldTokens;
bool public icoEnded = false;
| 39,358 |
735 | // Stores the tokens locked by the Claim Assessors during voting of a given claim. _claimId Claim Id. _vote 1 for accept and increases the tokens of claim as accept,-1 for deny and increases the tokens of claim as deny. _tokens Number of tokens. / | function setClaimTokensCA(uint _claimId, int8 _vote, uint _tokens) external onlyInternal {
if (_vote == 1)
claimTokensCA[_claimId].accept = claimTokensCA[_claimId].accept.add(_tokens);
if (_vote == - 1)
claimTokensCA[_claimId].deny = claimTokensCA[_claimId].deny.add(_tokens);
}
| function setClaimTokensCA(uint _claimId, int8 _vote, uint _tokens) external onlyInternal {
if (_vote == 1)
claimTokensCA[_claimId].accept = claimTokensCA[_claimId].accept.add(_tokens);
if (_vote == - 1)
claimTokensCA[_claimId].deny = claimTokensCA[_claimId].deny.add(_tokens);
}
| 28,837 |
95 | // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata. RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])] | function requireCorrectReceipt(uint offset) view private {
uint leafHeaderByte; assembly { leafHeaderByte := byte(0, calldataload(offset)) }
require (leafHeaderByte >= 0xf7, "Receipt leaf longer than 55 bytes.");
offset += leafHeaderByte - 0xf6;
uint pathHeaderByte; assembly { pathHeaderByte := byte(0, calldataload(offset)) }
if (pathHeaderByte <= 0x7f) {
offset += 1;
} else {
require (pathHeaderByte >= 0x80 && pathHeaderByte <= 0xb7, "Path is an RLP string.");
offset += pathHeaderByte - 0x7f;
}
uint receiptStringHeaderByte; assembly { receiptStringHeaderByte := byte(0, calldataload(offset)) }
require (receiptStringHeaderByte == 0xb9, "Receipt string is always at least 256 bytes long, but less than 64k.");
offset += 3;
uint receiptHeaderByte; assembly { receiptHeaderByte := byte(0, calldataload(offset)) }
require (receiptHeaderByte == 0xf9, "Receipt is always at least 256 bytes long, but less than 64k.");
offset += 3;
uint statusByte; assembly { statusByte := byte(0, calldataload(offset)) }
require (statusByte == 0x1, "Status should be success.");
offset += 1;
uint cumGasHeaderByte; assembly { cumGasHeaderByte := byte(0, calldataload(offset)) }
if (cumGasHeaderByte <= 0x7f) {
offset += 1;
} else {
require (cumGasHeaderByte >= 0x80 && cumGasHeaderByte <= 0xb7, "Cumulative gas is an RLP string.");
offset += cumGasHeaderByte - 0x7f;
}
uint bloomHeaderByte; assembly { bloomHeaderByte := byte(0, calldataload(offset)) }
require (bloomHeaderByte == 0xb9, "Bloom filter is always 256 bytes long.");
offset += 256 + 3;
uint logsListHeaderByte; assembly { logsListHeaderByte := byte(0, calldataload(offset)) }
require (logsListHeaderByte == 0xf8, "Logs list is less than 256 bytes long.");
offset += 2;
uint logEntryHeaderByte; assembly { logEntryHeaderByte := byte(0, calldataload(offset)) }
require (logEntryHeaderByte == 0xf8, "Log entry is less than 256 bytes long.");
offset += 2;
uint addressHeaderByte; assembly { addressHeaderByte := byte(0, calldataload(offset)) }
require (addressHeaderByte == 0x94, "Address is 20 bytes long.");
uint logAddress; assembly { logAddress := and(calldataload(sub(offset, 11)), 0xffffffffffffffffffffffffffffffffffffffff) }
require (logAddress == uint(address(this)));
}
| function requireCorrectReceipt(uint offset) view private {
uint leafHeaderByte; assembly { leafHeaderByte := byte(0, calldataload(offset)) }
require (leafHeaderByte >= 0xf7, "Receipt leaf longer than 55 bytes.");
offset += leafHeaderByte - 0xf6;
uint pathHeaderByte; assembly { pathHeaderByte := byte(0, calldataload(offset)) }
if (pathHeaderByte <= 0x7f) {
offset += 1;
} else {
require (pathHeaderByte >= 0x80 && pathHeaderByte <= 0xb7, "Path is an RLP string.");
offset += pathHeaderByte - 0x7f;
}
uint receiptStringHeaderByte; assembly { receiptStringHeaderByte := byte(0, calldataload(offset)) }
require (receiptStringHeaderByte == 0xb9, "Receipt string is always at least 256 bytes long, but less than 64k.");
offset += 3;
uint receiptHeaderByte; assembly { receiptHeaderByte := byte(0, calldataload(offset)) }
require (receiptHeaderByte == 0xf9, "Receipt is always at least 256 bytes long, but less than 64k.");
offset += 3;
uint statusByte; assembly { statusByte := byte(0, calldataload(offset)) }
require (statusByte == 0x1, "Status should be success.");
offset += 1;
uint cumGasHeaderByte; assembly { cumGasHeaderByte := byte(0, calldataload(offset)) }
if (cumGasHeaderByte <= 0x7f) {
offset += 1;
} else {
require (cumGasHeaderByte >= 0x80 && cumGasHeaderByte <= 0xb7, "Cumulative gas is an RLP string.");
offset += cumGasHeaderByte - 0x7f;
}
uint bloomHeaderByte; assembly { bloomHeaderByte := byte(0, calldataload(offset)) }
require (bloomHeaderByte == 0xb9, "Bloom filter is always 256 bytes long.");
offset += 256 + 3;
uint logsListHeaderByte; assembly { logsListHeaderByte := byte(0, calldataload(offset)) }
require (logsListHeaderByte == 0xf8, "Logs list is less than 256 bytes long.");
offset += 2;
uint logEntryHeaderByte; assembly { logEntryHeaderByte := byte(0, calldataload(offset)) }
require (logEntryHeaderByte == 0xf8, "Log entry is less than 256 bytes long.");
offset += 2;
uint addressHeaderByte; assembly { addressHeaderByte := byte(0, calldataload(offset)) }
require (addressHeaderByte == 0x94, "Address is 20 bytes long.");
uint logAddress; assembly { logAddress := and(calldataload(sub(offset, 11)), 0xffffffffffffffffffffffffffffffffffffffff) }
require (logAddress == uint(address(this)));
}
| 19,319 |
82 | // avoid negative numbers for unsigned ints, so set this to 0 which by the requirement that lowerLimit be > 0 will cause this to freeze the price to the lowerLimit | newInverseRate = 0;
| newInverseRate = 0;
| 52,497 |
7 | // Allows owner to mint tokens to a specified address | function airdrop(address to, uint collectionId, uint count) external onlyOwner {
Collection memory collection = _collections[collectionId];
require(collection.id != 0, "APEUA: Invalid collectionId");
require(_tokenIds.current() + count <= collection.size, "Request exceeds collection size");
_mintTokens(to, count, collection);
}
| function airdrop(address to, uint collectionId, uint count) external onlyOwner {
Collection memory collection = _collections[collectionId];
require(collection.id != 0, "APEUA: Invalid collectionId");
require(_tokenIds.current() + count <= collection.size, "Request exceeds collection size");
_mintTokens(to, count, collection);
}
| 9,548 |
438 | // 3. Team vesting | _mint(_multisigAddress, _10_MILLION.mul(20)); // Allocate 200 million to team vesting.
| _mint(_multisigAddress, _10_MILLION.mul(20)); // Allocate 200 million to team vesting.
| 23,425 |
134 | // set admin role for pcoin by constructor account/ | constructor () ERC20(NAME, SYMBOL) {
//_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_accountCounts = 0;
}
| constructor () ERC20(NAME, SYMBOL) {
//_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_accountCounts = 0;
}
| 28,151 |
2 | // Changes the price of the subscription for new subscribers | function changePrice(uint256 price) external onlyOwner {
subscriptionPrice_ = price;
}
| function changePrice(uint256 price) external onlyOwner {
subscriptionPrice_ = price;
}
| 50,154 |
10 | // Safe reward token transfer function, just in case if rounding error causes pool to not have enough tokens. | function safeAtlantisTransfer(address _to, uint256 _amount) public onlyOwner {
uint256 tokenBalance = atlantis.balanceOf(address(this));
if (_amount > tokenBalance) {
atlantis.transfer(_to, tokenBalance);
} else {
atlantis.transfer(_to, _amount);
}
}
| function safeAtlantisTransfer(address _to, uint256 _amount) public onlyOwner {
uint256 tokenBalance = atlantis.balanceOf(address(this));
if (_amount > tokenBalance) {
atlantis.transfer(_to, tokenBalance);
} else {
atlantis.transfer(_to, _amount);
}
}
| 5,781 |
59 | // last time any user took action | uint256 public lastUpdateTime;
| uint256 public lastUpdateTime;
| 21,994 |
444 | // This gets the address of the stablecoin./ return the address of the stablecoin contract. | function _stablecoin() internal view returns (address) {
return ITokenWhitelist(_ensResolve(_tokenWhitelistNode)).stablecoin();
}
| function _stablecoin() internal view returns (address) {
return ITokenWhitelist(_ensResolve(_tokenWhitelistNode)).stablecoin();
}
| 43,841 |
448 | // Returns the ABI associated with an ENS node.Defined in EIP205. node The ENS node to query contentTypes A bitwise OR of the ABI formats accepted by the caller.return contentType The content type of the return valuereturn data The ABI data / | function ABI(bytes32 node, uint256 contentTypes) public view returns (uint256 contentType, bytes data) {
Record storage record = records[node];
for (contentType = 1; contentType <= contentTypes; contentType <<= 1) {
if ((contentType & contentTypes) != 0 && record.abis[contentType].length > 0) {
data = record.abis[contentType];
return;
}
}
contentType = 0;
}
| function ABI(bytes32 node, uint256 contentTypes) public view returns (uint256 contentType, bytes data) {
Record storage record = records[node];
for (contentType = 1; contentType <= contentTypes; contentType <<= 1) {
if ((contentType & contentTypes) != 0 && record.abis[contentType].length > 0) {
data = record.abis[contentType];
return;
}
}
contentType = 0;
}
| 22,493 |
196 | // set our max gas price | maxGasPrice = 100 * 1e9;
| maxGasPrice = 100 * 1e9;
| 27,408 |
0 | // interface of governance module to manage governance (main) token of the controller/interface assumes single governance token that is a default token for voting and proceed distribution/governance token is optional, it's possible to setup a controller without any token | contract IControllerGovernanceToken {
////////////////////////
// Governance Module Id
////////////////////////
bytes32 internal constant ControllerGovernanceTokenId = 0x156c4a2914517b2fdbf2f694bac9d69e03910b75d3298033e1f4f431b517703d;
uint256 internal constant ControllerGovernanceTokenV = 0;
////////////////////////
// Events
////////////////////////
// logged when transferability of given token was changed
event LogTransfersStateChanged(
bytes32 indexed resolutionId,
address equityToken,
bool transfersEnabled
);
////////////////////////
// Interface methods
////////////////////////
function governanceToken()
public
constant
returns (
IControlledToken token,
Gov.TokenType tokenType,
Gov.TokenState tokenState,
ITokenholderRights holderRights,
bool tokenTransferable
);
}
| contract IControllerGovernanceToken {
////////////////////////
// Governance Module Id
////////////////////////
bytes32 internal constant ControllerGovernanceTokenId = 0x156c4a2914517b2fdbf2f694bac9d69e03910b75d3298033e1f4f431b517703d;
uint256 internal constant ControllerGovernanceTokenV = 0;
////////////////////////
// Events
////////////////////////
// logged when transferability of given token was changed
event LogTransfersStateChanged(
bytes32 indexed resolutionId,
address equityToken,
bool transfersEnabled
);
////////////////////////
// Interface methods
////////////////////////
function governanceToken()
public
constant
returns (
IControlledToken token,
Gov.TokenType tokenType,
Gov.TokenState tokenState,
ITokenholderRights holderRights,
bool tokenTransferable
);
}
| 41,702 |
95 | // Record invocation as separate call so we don't rollback in case we are called with STATICCALL | (, bytes memory r) = address(this).call.gas(100000)(abi.encodeWithSignature("updateInvocationCount(bytes4,bytes)", methodId, msg.data));
assert(r.length == 0);
assembly {
return(add(0x20, result), mload(result))
}
| (, bytes memory r) = address(this).call.gas(100000)(abi.encodeWithSignature("updateInvocationCount(bytes4,bytes)", methodId, msg.data));
assert(r.length == 0);
assembly {
return(add(0x20, result), mload(result))
}
| 19,613 |
8 | // Proposes a price value on another address' behalf. Note: this address will receive any rewards that comefrom this proposal. However, any bonds are pulled from the caller. proposer address to set as the proposer. requester sender of the initial price request. identifier price identifier to identify the existing request. timestamp timestamp to identify the existing request. ancillaryData ancillary data of the price being requested. proposedPrice price being proposed.return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned tothe proposer once settled if the proposal is correct. / | function proposePriceFor(
| function proposePriceFor(
| 27,949 |
26 | // Gets the hash of the NFT data used to create it. Payload is used for verification. tokenId The Id of the token.return bytes32 The hash. / | function payloadHash(uint256 tokenId) external view returns (bytes32) {
return _tokenData[tokenId].payloadHash;
}
| function payloadHash(uint256 tokenId) external view returns (bytes32) {
return _tokenData[tokenId].payloadHash;
}
| 27,055 |
172 | // Dev, event, and Buyback address. | address public devaddr;
address public eventaddr;
address public buybackaddr;
| address public devaddr;
address public eventaddr;
address public buybackaddr;
| 17,289 |
302 | // Storage of map keys and values | MapEntry[] _entries;
| MapEntry[] _entries;
| 1,906 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.