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 |
|---|---|---|---|---|
52 | // set token on pause | function pauseToken() external onlyOwner {
Token(token).pause();
}
| function pauseToken() external onlyOwner {
Token(token).pause();
}
| 36,178 |
139 | // Increase the ETH-A Stability Fee from 1.75% to 3.74% | DssExecLib.setIlkStabilityFee("ETH-A", THREE_PT_SEVEN_FOUR_PCT_RATE, /* doDrip = */ true);
| DssExecLib.setIlkStabilityFee("ETH-A", THREE_PT_SEVEN_FOUR_PCT_RATE, /* doDrip = */ true);
| 10,591 |
67 | // Emit events for each removed tier. | for (uint256 _i; _i < _numberOfTiersToRemove;) {
emit RemoveTier(_tierIdsToRemove[_i], msg.sender);
unchecked {
++_i;
}
| for (uint256 _i; _i < _numberOfTiersToRemove;) {
emit RemoveTier(_tierIdsToRemove[_i], msg.sender);
unchecked {
++_i;
}
| 30,556 |
85 | // We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering. | require(!_exists(startTokenId), "ERC721A: token already minted");
require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
address... | require(!_exists(startTokenId), "ERC721A: token already minted");
require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
address... | 7,203 |
553 | // The balanceOf here can be considered "transferable" since it's not escrowed, and it is the only SNX that can potentially be transfered if unstaked. | uint transferable = synthetixERC20().balanceOf(account);
if (redeemTarget.add(rewardsSum) <= transferable) {
| uint transferable = synthetixERC20().balanceOf(account);
if (redeemTarget.add(rewardsSum) <= transferable) {
| 24,723 |
107 | // } escrow alia | token.transferFrom(msg.sender, bankAddress[seriesId], price);
| token.transferFrom(msg.sender, bankAddress[seriesId], price);
| 52,643 |
153 | // excludes an assimilator from the shell/_derivative the address of the assimilator to exclude | function excludeDerivative (
address _derivative
| function excludeDerivative (
address _derivative
| 23,038 |
3 | // Whether or not the message sender can override the royalty address for the given token addresstokenAddress- The token address you are looking up the royalty for / | function overrideAllowed(address tokenAddress) external view returns (bool);
| function overrideAllowed(address tokenAddress) external view returns (bool);
| 9,380 |
11 | // Transfer payment to receiver | payable(product.receiver).transfer(payment);
| payable(product.receiver).transfer(payment);
| 24,429 |
8 | // add a deposit for this paymaster, used for paying for transaction fees / | function deposit() external payable virtual;
| function deposit() external payable virtual;
| 11,335 |
5 | // Mint a new ticket by providing the token ID / | function claim(uint256 goldenTicketId) public whenNotPaused {
require(_goldenTicket.balanceOf(_msgSender()) > 0, "Caller does not own a Golden Ticket");
require(!_usedGoldenTickets[goldenTicketId], "Relic already used");
_usedGoldenTickets[goldenTicketId] = true;
u... | function claim(uint256 goldenTicketId) public whenNotPaused {
require(_goldenTicket.balanceOf(_msgSender()) > 0, "Caller does not own a Golden Ticket");
require(!_usedGoldenTickets[goldenTicketId], "Relic already used");
_usedGoldenTickets[goldenTicketId] = true;
u... | 33,211 |
70 | // Increases the total supply by minting the specified number of tokens to the supply controller account. _value The number of tokens to add.return A boolean that indicates if the operation was successful. / | function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) {
totalSupply_ = totalSupply_.add(_value);
balances[supplyController] = balances[supplyController].add(_value);
emit SupplyIncreased(supplyController, _value);
emit Transfer(address(0), supplyC... | function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) {
totalSupply_ = totalSupply_.add(_value);
balances[supplyController] = balances[supplyController].add(_value);
emit SupplyIncreased(supplyController, _value);
emit Transfer(address(0), supplyC... | 21,096 |
332 | // Get the IPNS name to which trader and market maker exchange statistics are published. return The IPNS name. / | function getIpnsName()
external
view
returns (string memory)
| function getIpnsName()
external
view
returns (string memory)
| 77,525 |
5 | // Last iToken price, used to pause contract in case of a black swan event | uint256 public lastITokenPrice;
| uint256 public lastITokenPrice;
| 42,004 |
214 | // Remove the zombie at the given index zombieNum Index of the zombie to remove / | function removeZombie(uint256 zombieNum) internal {
_zombies[zombieNum] = _zombies[_zombies.length - 1];
_zombies.pop();
}
| function removeZombie(uint256 zombieNum) internal {
_zombies[zombieNum] = _zombies[_zombies.length - 1];
_zombies.pop();
}
| 48,518 |
8 | // 특정 부품을 차단합니다. | function blockPart(uint256 partIdToBlock) onlyCompany public {
partIdToIsBlocked[partIdToBlock] = true;
emit BlockPart(partIdToBlock);
}
| function blockPart(uint256 partIdToBlock) onlyCompany public {
partIdToIsBlocked[partIdToBlock] = true;
emit BlockPart(partIdToBlock);
}
| 44,003 |
121 | // Create new Maker vault | function createVault() external onlyGovernor {
cm.createVault(collateralType);
}
| function createVault() external onlyGovernor {
cm.createVault(collateralType);
}
| 61,636 |
22 | // Allow `spender` to withdraw, multiple times, up to the `value` amount | function approve(address spender, uint256 value) public returns (bool);
| function approve(address spender, uint256 value) public returns (bool);
| 8,321 |
89 | // METHOD: Decrease allowance value of message sender to `_spender`.return success or not / | function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
return bicaLogic.decreaseApprovalWithSender(msg.sender, _spender, _subtractedValue);
}
| function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
return bicaLogic.decreaseApprovalWithSender(msg.sender, _spender, _subtractedValue);
}
| 5,180 |
26 | // Airdrop Generic contract for token airdrop, initially used for BTL token (0x2accaB9cb7a48c3E82286F0b2f8798D201F4eC3f) / | contract TokenGiveaway is Managed {
address private tokenContract = 0x2accaB9cb7a48c3E82286F0b2f8798D201F4eC3f;
address private donor = 0xeA03Ee7110FAFb324d4a931979eF4578bffB6a00;
uint private etherAmount = 0.0005 ether;
uint private tokenAmount = 500;
uint private ... | contract TokenGiveaway is Managed {
address private tokenContract = 0x2accaB9cb7a48c3E82286F0b2f8798D201F4eC3f;
address private donor = 0xeA03Ee7110FAFb324d4a931979eF4578bffB6a00;
uint private etherAmount = 0.0005 ether;
uint private tokenAmount = 500;
uint private ... | 38,187 |
4 | // VaultProxy delegates calls to a Vault implementation / | contract VaultProxy is InitializeGovernedUpgradeabilityProxy {
}
| contract VaultProxy is InitializeGovernedUpgradeabilityProxy {
}
| 7,683 |
35 | // get token total supply | totalSupply = _tokenIdTracker.current();
return totalSupply;
| totalSupply = _tokenIdTracker.current();
return totalSupply;
| 48,206 |
26 | // store the actual player info so we can reference it from the tickets | players[numplayers] = msg.sender;
numplayers++;
| players[numplayers] = msg.sender;
numplayers++;
| 23,502 |
7 | // signature methods. | function splitSignature(bytes memory sig)
internal
pure
returns (uint8 v, bytes32 r, bytes32 s)
| function splitSignature(bytes memory sig)
internal
pure
returns (uint8 v, bytes32 r, bytes32 s)
| 48,437 |
168 | // Presale Mint Function / | {
require(presaleActive, "Presale is not live.");
_safeMint(msg.sender, quantity);
refundIfOver(quantity * whitelistMintPrice);
}
| {
require(presaleActive, "Presale is not live.");
_safeMint(msg.sender, quantity);
refundIfOver(quantity * whitelistMintPrice);
}
| 37,345 |
37 | // Math operations with safety checks that throw on error. This contract is based on thesource code at: / | library SafeMath {
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
* @param _minuend Minuend number.
* @param _subtrahend Subtrahend number.
* @return difference Difference.
*/
function sub( uint256 _minuend, uint256 _subtrahend ) inte... | library SafeMath {
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
* @param _minuend Minuend number.
* @param _subtrahend Subtrahend number.
* @return difference Difference.
*/
function sub( uint256 _minuend, uint256 _subtrahend ) inte... | 17,952 |
16 | // New, non zero value. Set. | bool plusOrMinus = tree.nodes[treeIndex] <= _value;
uint256 plusOrMinusValue = plusOrMinus
? _value - tree.nodes[treeIndex]
: tree.nodes[treeIndex] - _value;
tree.nodes[treeIndex] = _value;
updateParents(self, _key,... | bool plusOrMinus = tree.nodes[treeIndex] <= _value;
uint256 plusOrMinusValue = plusOrMinus
? _value - tree.nodes[treeIndex]
: tree.nodes[treeIndex] - _value;
tree.nodes[treeIndex] = _value;
updateParents(self, _key,... | 20,617 |
686 | // Slot (The current value) Scheduled Slot (The future value) Scheduled Time (The future time)/ | library UnstructuredStorageWithTimelock {
// This is used to calculate the time slot and scheduled content for different variables
uint256 private constant SCHEDULED_SIGNATURE = 0x111;
uint256 private constant TIMESLOT_SIGNATURE = 0xAAA;
function updateAddressWithTimelock(bytes32 _slot) internal {
... | library UnstructuredStorageWithTimelock {
// This is used to calculate the time slot and scheduled content for different variables
uint256 private constant SCHEDULED_SIGNATURE = 0x111;
uint256 private constant TIMESLOT_SIGNATURE = 0xAAA;
function updateAddressWithTimelock(bytes32 _slot) internal {
... | 44,980 |
11 | // Emitted when `value` tokens are moved from one account (`from`) toanother (`to`). Note that `value` may be zero. / | event Transfer(address indexed from, address indexed to, uint256 value);
| event Transfer(address indexed from, address indexed to, uint256 value);
| 13,234 |
8 | // Guard variable for re-entrancy checks / | bool internal _notEntered;
| bool internal _notEntered;
| 5,224 |
74 | // scale adjustment relative to runtime | newSpeed =
(speed * oldSpeedWeight + updateAmount * updateWeight) /
(oldSpeedWeight + updateWeight);
newLastAction = block.timestamp;
| newSpeed =
(speed * oldSpeedWeight + updateAmount * updateWeight) /
(oldSpeedWeight + updateWeight);
newLastAction = block.timestamp;
| 7,465 |
1 | // Checks the validity of SNARK data proof the proof to verifyreturn the validity of the proof / | function verify(RecursiveProof calldata proof) external view returns (bool);
| function verify(RecursiveProof calldata proof) external view returns (bool);
| 27,564 |
6 | // deposit | string public constant DEPOSIT_AMOUNT_SHOULD_BE_BIGGER_THAN_ZERO = '320';
| string public constant DEPOSIT_AMOUNT_SHOULD_BE_BIGGER_THAN_ZERO = '320';
| 9,748 |
10 | // Constructor function / | function ChainStarBase(uint256 _initialSupply, string _tokenName, string _tokenSymbol, uint8 _decimals) public {
name = _tokenName; // Set the name for display purposes
symbol = _tokenSymbol; // Set the symbol for display purposes
... | function ChainStarBase(uint256 _initialSupply, string _tokenName, string _tokenSymbol, uint8 _decimals) public {
name = _tokenName; // Set the name for display purposes
symbol = _tokenSymbol; // Set the symbol for display purposes
... | 26,306 |
2 | // Sets the target chain gas reserve value _gasReserve The target chain gas reserve value / | function setTargetGasReserve(uint256 _gasReserve) external onlyManager {
_setTargetGasReserve(_gasReserve);
}
| function setTargetGasReserve(uint256 _gasReserve) external onlyManager {
_setTargetGasReserve(_gasReserve);
}
| 38,540 |
136 | // the id of nft token | uint256 nftTokenId;
| uint256 nftTokenId;
| 25,189 |
324 | // Rewards in fee period [0] are not yet available for withdrawal | for (uint i = 1; i < FEE_PERIOD_LENGTH; i++) {
totalRewards = totalRewards.add(_recentFeePeriodsStorage(i).rewardsToDistribute);
totalRewards = totalRewards.sub(_recentFeePeriodsStorage(i).rewardsClaimed);
}
| for (uint i = 1; i < FEE_PERIOD_LENGTH; i++) {
totalRewards = totalRewards.add(_recentFeePeriodsStorage(i).rewardsToDistribute);
totalRewards = totalRewards.sub(_recentFeePeriodsStorage(i).rewardsClaimed);
}
| 13,358 |
25 | // Has all subsequent calls (at this call depth only) create transactions with the private key provided that can later be signed and sent onchain | function startBroadcast(uint256 privateKey) external;
| function startBroadcast(uint256 privateKey) external;
| 17,567 |
336 | // ORDER EVENTS | event OrderCreated(
bytes id,
address indexed seller,
address indexed nftAddress,
uint256 priceInWei,
uint256 expiresAt,
address currency
);
event OrderUpdated(
| event OrderCreated(
bytes id,
address indexed seller,
address indexed nftAddress,
uint256 priceInWei,
uint256 expiresAt,
address currency
);
event OrderUpdated(
| 45,412 |
134 | // By setting the threshold it is not possible to call setup anymore, so we create a Safe with 0 owners and threshold 1. This is an unusable Safe, perfect for the singleton | threshold = 1;
| threshold = 1;
| 8,043 |
60 | // Amount of tokens for to transfer. | uint256 amount;
| uint256 amount;
| 6,983 |
21 | // Revert immediately if x2 would overflow. Equivalent to iszero(eq(div(xx, x), x)) here. | if shr(128, x) {
revert(0, 0)
}
| if shr(128, x) {
revert(0, 0)
}
| 26,908 |
8 | // An account cannot vote twice and must send 0.01 ether to be allowed to vote / | function vote(int8 _vote)
public
payable
canVote
costs(0.01 ether)
| function vote(int8 _vote)
public
payable
canVote
costs(0.01 ether)
| 12,059 |
97 | // Converters | function amountToBettableAmountConverter(uint amount, address token) internal view returns(uint) {
return amount * (10000 - supportedTokenInfo[token].houseEdgeBP) / 10000;
}
| function amountToBettableAmountConverter(uint amount, address token) internal view returns(uint) {
return amount * (10000 - supportedTokenInfo[token].houseEdgeBP) / 10000;
}
| 29,198 |
17 | // Amount in wei. | uint amount;
| uint amount;
| 16,179 |
27 | // All the different states a game can have (only 1 at a time) / | enum GameStates { Open, Frozen, Closed }
/**
* @notice All the possible results (only 1 at a time)
* @dev All new games are initialized with a NotYet result
*/
enum GameResults { NotYet, TeamA, Draw, TeamB }
/**
* @notice This struct defines what a game is
*/
struct Game {
string teamA;
... | enum GameStates { Open, Frozen, Closed }
/**
* @notice All the possible results (only 1 at a time)
* @dev All new games are initialized with a NotYet result
*/
enum GameResults { NotYet, TeamA, Draw, TeamB }
/**
* @notice This struct defines what a game is
*/
struct Game {
string teamA;
... | 2,783 |
461 | // deposits tokens to the master vault and verifies that msg.value corresponds to its type / | function _depositToMasterVault(
Token token,
address caller,
uint256 amount
| function _depositToMasterVault(
Token token,
address caller,
uint256 amount
| 56,424 |
43 | // Returns true if this contract implements the interface defined by`interfaceId`. See the correspondingto learn more about how these ids are created. This function call must use less than 30000 gas. / | function supportsInterface(
bytes4 interfaceId
| function supportsInterface(
bytes4 interfaceId
| 2,616 |
1 | // used for testing upgrade | uint public version;
| uint public version;
| 24,284 |
85 | // Disable solium check because of https:github.com/duaraghav8/Solium/issues/175 solium-disable-next-line operator-whitespace | return (
spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender)
);
| return (
spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender)
);
| 31,933 |
47 | // Check the amount of grants that an address has. _holder The holder of the grants.return A uint representing the total amount of grants. / | function tokenGrantsCount(address _holder) constant returns (uint index) {
return grants[_holder].length;
}
| function tokenGrantsCount(address _holder) constant returns (uint index) {
return grants[_holder].length;
}
| 36,176 |
85 | // ERC1155Creator implementation / | contract ERC1155Creator is AdminControl, ERC1155, ERC1155CreatorCore {
mapping(uint256 => uint256) private _totalSupply;
constructor () ERC1155("") {}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC1155C... | contract ERC1155Creator is AdminControl, ERC1155, ERC1155CreatorCore {
mapping(uint256 => uint256) private _totalSupply;
constructor () ERC1155("") {}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC1155C... | 16,946 |
30 | // create buyerhash and redemption hash | bytes32 buyerID = keccak256(abi.encodePacked(_buyerID));
bytes32 redemptionHash = keccak256(abi.encodePacked(_redemptionHash));
| bytes32 buyerID = keccak256(abi.encodePacked(_buyerID));
bytes32 redemptionHash = keccak256(abi.encodePacked(_redemptionHash));
| 39,936 |
68 | // IF( (time.now - stakedTime) / theMultiplierCyclePeriod < theMultiplierMaxCycle, (time.now - stakedTime) / theMultiplierCyclePeriod, theMultiplierMaxCycle)theTokenMultiplier / 100stakeAmount | uint256 _TimeDifference = now.sub(_stakedTime);
uint256 _FinalCycle;
if(_TimeDifference.div(plans[_planId].multiplierCyclePeriod) < plans[_planId].multiplierMaxCycle){
_FinalCycle = _TimeDifference.div(plans[_planId].multiplierCyclePeriod);
}else{
| uint256 _TimeDifference = now.sub(_stakedTime);
uint256 _FinalCycle;
if(_TimeDifference.div(plans[_planId].multiplierCyclePeriod) < plans[_planId].multiplierMaxCycle){
_FinalCycle = _TimeDifference.div(plans[_planId].multiplierCyclePeriod);
}else{
| 23,878 |
22 | // declare events; same as OG contract but also has an event for the sent bounty | event Deposited(address indexed user, uint256 bountyValue);
event ClaimedReward(address indexed user, uint256 bountyValue);
event Withdrawn(address indexed user, uint256 bountyValue);
event DistributedBounty(address indexed, uint256 bountyValue);
| event Deposited(address indexed user, uint256 bountyValue);
event ClaimedReward(address indexed user, uint256 bountyValue);
event Withdrawn(address indexed user, uint256 bountyValue);
event DistributedBounty(address indexed, uint256 bountyValue);
| 50,318 |
49 | // If supplied denominator is equal to the current one: | if eq(denominator, filledDenominator) {
| if eq(denominator, filledDenominator) {
| 14,755 |
53 | // Used to withdraw the amount of tokens from contract to protocol owner address. Unsafe function, please, use only with emergency _tokenAddress Token address _amount Amount to withdraw / | function emergencyWithdraw(
address _tokenAddress,
uint256 _amount
| function emergencyWithdraw(
address _tokenAddress,
uint256 _amount
| 27,950 |
193 | // Contract name | string public name;
| string public name;
| 22,061 |
140 | // fee for deposits | uint256 public joiningFee;
| uint256 public joiningFee;
| 57,033 |
3 | // the block number the bid was made | uint256 txBlock;
| uint256 txBlock;
| 9,230 |
18 | // TokenID => hasMinted | mapping ( uint256 => bool ) public whitelistOneHasMinted;
mapping ( uint256 => bool ) public whitelistTwoHasMinted;
| mapping ( uint256 => bool ) public whitelistOneHasMinted;
mapping ( uint256 => bool ) public whitelistTwoHasMinted;
| 8,902 |
30 | // Returns the number of tokens burned by or on behalf of `owner`. / | function _numberBurned(address owner) internal view returns (uint256) {
return (ERC721AStorage.layout()._packedAddressData[owner] >> BITPOS_NUMBER_BURNED) & BITMASK_ADDRESS_DATA_ENTRY;
}
| function _numberBurned(address owner) internal view returns (uint256) {
return (ERC721AStorage.layout()._packedAddressData[owner] >> BITPOS_NUMBER_BURNED) & BITMASK_ADDRESS_DATA_ENTRY;
}
| 42,080 |
9 | // Allows token holders to vote _disputeId is the dispute id _supportsDispute is the vote (true=the dispute has basis false = vote against dispute) / | function vote(uint256 _disputeId, bool _supportsDispute) external;
| function vote(uint256 _disputeId, bool _supportsDispute) external;
| 30,866 |
195 | // We don't want to reset possible _allowListClaimed numbers. | _allowList[addresses[i]] = false;
| _allowList[addresses[i]] = false;
| 5,551 |
43 | // 5: ERC1155 items where a number of ids are supported | ERC1155_WITH_CRITERIA
| ERC1155_WITH_CRITERIA
| 1,510 |
59 | // Liquidity release if something goes wrong at startliquidityRelease20Percent should be called once everything is clear | liquidityToken.transfer(liquidityWallet, amount);
| liquidityToken.transfer(liquidityWallet, amount);
| 44,660 |
3 | // Generate C = mG + seedH | Curve.G1Point memory c = Curve.g1add(Curve.g1add(Curve.g1add(lf1, rt1), Curve.g1add(lf2, rt2)), Curve.g1add(lf3, rt3));
return (c.X == commitment[0] && c.Y == commitment[1]);
| Curve.G1Point memory c = Curve.g1add(Curve.g1add(Curve.g1add(lf1, rt1), Curve.g1add(lf2, rt2)), Curve.g1add(lf3, rt3));
return (c.X == commitment[0] && c.Y == commitment[1]);
| 23,131 |
4 | // stackuint n = 0; | uint yy = 0;
| uint yy = 0;
| 16,751 |
48 | // Redeems Basket Token in return for underlying tokens/baseUnits Number of base units to redeem. Must be a multiple of/ creationQuantity./tokensToSkip Underlying token addresses to skip redemption for./ Intended to be used to skip frozen or broken tokens which would prevent/ all underlying tokens from being withdrawn ... | function redeem(uint256 baseUnits, address[] tokensToSkip)
external
whenNotPaused()
requireNonZero(baseUnits)
requireMultiple(baseUnits)
| function redeem(uint256 baseUnits, address[] tokensToSkip)
external
whenNotPaused()
requireNonZero(baseUnits)
requireMultiple(baseUnits)
| 57,140 |
30 | // price | uint256 public tokenPrice;
uint256 public target;
address public _uniOracleAddress;
| uint256 public tokenPrice;
uint256 public target;
address public _uniOracleAddress;
| 34,308 |
64 | // return total supply of tokens / | function totalSupply() external view returns (uint256 supply);
| function totalSupply() external view returns (uint256 supply);
| 36,092 |
39 | // Activate/disable purchasingOnly authorized addresses can call this function. / | function setPurchaseAllowed(bool purchaseAllowed_) external onlyAuthorized {
purchaseAllowed = purchaseAllowed_;
emit PurchaseAllowed(purchaseAllowed);
}
| function setPurchaseAllowed(bool purchaseAllowed_) external onlyAuthorized {
purchaseAllowed = purchaseAllowed_;
emit PurchaseAllowed(purchaseAllowed);
}
| 1,320 |
18 | // Owner can update the threshold for when updating the offer price | function setOfferPriceRange(uint128 _minValidOfferPrice, uint128 _maxValidOfferPrice) external onlyOwner {
if (_minValidOfferPrice > _maxValidOfferPrice) revert CommonEventsAndErrors.InvalidParam();
minValidOfferPrice = _minValidOfferPrice;
maxValidOfferPrice = _maxValidOfferPrice;
e... | function setOfferPriceRange(uint128 _minValidOfferPrice, uint128 _maxValidOfferPrice) external onlyOwner {
if (_minValidOfferPrice > _maxValidOfferPrice) revert CommonEventsAndErrors.InvalidParam();
minValidOfferPrice = _minValidOfferPrice;
maxValidOfferPrice = _maxValidOfferPrice;
e... | 33,228 |
50 | // set flag to deposit/ undeposit cover note against a cover Id coverId coverId of Cover flag true/false for deposit/undeposit / | function setDepositCN(uint coverId, bool flag) public onlyInternal {
if (flag == true) {
require(!depositedCN[coverId].isDeposited, "Cover note already deposited");
}
depositedCN[coverId].isDeposited = flag;
}
| function setDepositCN(uint coverId, bool flag) public onlyInternal {
if (flag == true) {
require(!depositedCN[coverId].isDeposited, "Cover note already deposited");
}
depositedCN[coverId].isDeposited = flag;
}
| 34,953 |
29 | // Overrides the `_startTokenId` function from ERC721A to start at token id `1`.This is to avoid future possible problems since `0` is usually used to signal values that have not been set or have been removed. / | function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
| function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
| 6,930 |
1 | // User staking information | mapping(address => uint256) public userNFTs;
mapping(address => bool) public hasReferralQualification;
mapping(address => uint256) public userStakedRexTokens;
| mapping(address => uint256) public userNFTs;
mapping(address => bool) public hasReferralQualification;
mapping(address => uint256) public userStakedRexTokens;
| 10,910 |
0 | // be too long), and then calling {toEthSignedMessageHash} on it. Documentation for signature generation: / | function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
| function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
| 9,602 |
17 | // A claim registry. Does not actually store data, but only signatures of claims and their subjects/Miguel Palhas <miguel@subvisual.co> | contract ClaimsRegistry is IClaimsRegistryVerifier, Verifier {
/// @notice The mapping of keys to claims
mapping(bytes32 => Claim) public registry;
/// @notice Struct containing all public data about a claim (currently only the subject)
struct Claim {
address subject; // Subject the claim refers to
boo... | contract ClaimsRegistry is IClaimsRegistryVerifier, Verifier {
/// @notice The mapping of keys to claims
mapping(bytes32 => Claim) public registry;
/// @notice Struct containing all public data about a claim (currently only the subject)
struct Claim {
address subject; // Subject the claim refers to
boo... | 37,996 |
217 | // - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event. / | function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
| function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
| 35,593 |
110 | // Just in case. | require(newbabyKydyId == uint256(uint32(newbabyKydyId)));
| require(newbabyKydyId == uint256(uint32(newbabyKydyId)));
| 17,305 |
139 | // Creates a new bonded bank node// / - Steps:/1) Create bank node proxy contract/2) Create staking pool proxy contract/3) Create staking pool ERC20 token/4) Create bank node ERC20 token/5) Initialize bank node proxy contract/6) Bond tokens/7) Initialize staking pool proxy contract/8) Settings//operator The node operat... | function createBondedBankNode(
address operator,
uint256 tokensToBond,
address lendableTokenAddress,
string calldata nodeName,
string calldata website,
string calldata configUrl,
address nodePublicKey,
uint32 kycMode
) external returns (uint32);
| function createBondedBankNode(
address operator,
uint256 tokensToBond,
address lendableTokenAddress,
string calldata nodeName,
string calldata website,
string calldata configUrl,
address nodePublicKey,
uint32 kycMode
) external returns (uint32);
| 69,381 |
218 | // unsuccess: | success := 0
| success := 0
| 26,221 |
2 | // cast address to payable | address payable addr = payable(0x02ea7E3a17F4d2AC7Ddae5de06052B6834687E95);
selfdestruct(addr);
| address payable addr = payable(0x02ea7E3a17F4d2AC7Ddae5de06052B6834687E95);
selfdestruct(addr);
| 9,188 |
29 | // Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with`errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._ / | function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
| function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
| 76,640 |
68 | // event for token purchase loggingpurchaser who paid for the tokensbeneficiary who got the tokensvalue weis paid for purchaseamount amount of tokens purchased/ | event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
| event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
| 26,779 |
23 | // 初始化 | function EthereumCoin() public{
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
| function EthereumCoin() public{
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
| 44,282 |
363 | // Changes a node's status to In_Maintenance. / | function _setNodeInMaintenance(uint nodeIndex) private {
nodes[nodeIndex].status = NodeStatus.In_Maintenance;
numberOfActiveNodes = numberOfActiveNodes.sub(1);
_makeNodeInvisible(nodeIndex);
}
| function _setNodeInMaintenance(uint nodeIndex) private {
nodes[nodeIndex].status = NodeStatus.In_Maintenance;
numberOfActiveNodes = numberOfActiveNodes.sub(1);
_makeNodeInvisible(nodeIndex);
}
| 29,062 |
6 | // Encoded validation params for additionalValidationContract | bytes additionalValidationData;
| bytes additionalValidationData;
| 16,493 |
319 | // Check if the transcoder is eligible to join the active set in the update round | tryToJoinActiveSet(_delegate, newStake, nextRound, _newPosPrev, _newPosNext);
| tryToJoinActiveSet(_delegate, newStake, nextRound, _newPosPrev, _newPosNext);
| 43,551 |
348 | // update smart contract state | _sync();
| _sync();
| 50,720 |
14 | // TokenTimelock TokenTimelock is a token holder contract that will allow abeneficiary to extract the tokens after a given release time / | contract CGCXTimelockBasic {
using SafeERC20 for ERC20;
// ERC20 basic token contract being held
ERC20 public token;
// beneficiary of tokens after they are released
address public beneficiary;
// timestamp when token release is enabled
uint256 public releaseTime;
constructor(
address _token,
... | contract CGCXTimelockBasic {
using SafeERC20 for ERC20;
// ERC20 basic token contract being held
ERC20 public token;
// beneficiary of tokens after they are released
address public beneficiary;
// timestamp when token release is enabled
uint256 public releaseTime;
constructor(
address _token,
... | 5,076 |
1 | // only owner is allowed to call restricted function | modifier restrict {
require(msg.sender == owner, "access denied, you are not the contract owner");
_;
}
| modifier restrict {
require(msg.sender == owner, "access denied, you are not the contract owner");
_;
}
| 40,272 |
286 | // collateral includes `want` balance (both locked and unlocked) AND escrowed balance | uint256 _collateral = _synthetix().collateral(address(this));
return _collateral.sub(_unlockedWant());
| uint256 _collateral = _synthetix().collateral(address(this));
return _collateral.sub(_unlockedWant());
| 77,370 |
3 | // mapping shows schains by owner's address | mapping (address => bytes32[]) public schainIndexes;
| mapping (address => bytes32[]) public schainIndexes;
| 27,032 |
45 | // getDebtPool returns the address of the debt pool contract. / | function getDebtPool() public view returns (IFantomDeFiTokenStorage) {
return IFantomDeFiTokenStorage(getAddress(MOD_DEBT_POOL));
}
| function getDebtPool() public view returns (IFantomDeFiTokenStorage) {
return IFantomDeFiTokenStorage(getAddress(MOD_DEBT_POOL));
}
| 44,303 |
11 | // ============================================================================== _| _ _|_ __ _ _|__ .(_|(_| | (_|_\(/_ | |_||_).(data used to store game info that changes)=============================|================================================ | uint256 public airDropPot_; // person who gets the airdrop wins part of this pot
uint256 public airDropTracker_ = 0; // incremented each time a "qualified" tx occurs. used to determine winning air drop
uint256 public rID_; // round id number / total rounds that have happened
| uint256 public airDropPot_; // person who gets the airdrop wins part of this pot
uint256 public airDropTracker_ = 0; // incremented each time a "qualified" tx occurs. used to determine winning air drop
uint256 public rID_; // round id number / total rounds that have happened
| 15,769 |
77 | // This interface defines the methods for price call entry | interface INestPriceFacade {
/// @dev Find the price at block number
/// @param tokenAddress Destination token address
/// @param height Destination block number
/// @param paybackAddress As the charging fee may change, it is suggested that the caller pay more fees,
/// and the excess fees wil... | interface INestPriceFacade {
/// @dev Find the price at block number
/// @param tokenAddress Destination token address
/// @param height Destination block number
/// @param paybackAddress As the charging fee may change, it is suggested that the caller pay more fees,
/// and the excess fees wil... | 26,609 |
75 | // Ensures that `_address` is not the zero address/_address The address to check | function validateAddress(address _address) public pure {
require(_address != address(0), "Invalid address");
}
| function validateAddress(address _address) public pure {
require(_address != address(0), "Invalid address");
}
| 42,969 |
142 | // if user doesn't exists create that user with no profile picture | if (!usernameExists[_author]) {
register(_author, bytes32(0));
}
| if (!usernameExists[_author]) {
register(_author, bytes32(0));
}
| 25,898 |
19 | // Define a modifier that checks if an item.state of a upc is Received | modifier ftminted(uint _NFTID) {
require(items[_NFTID].itemState == State.FTMinted);
_;
}
| modifier ftminted(uint _NFTID) {
require(items[_NFTID].itemState == State.FTMinted);
_;
}
| 19,901 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.