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 |
|---|---|---|---|---|
51 | // Moves `amount` of tokens from `sender` to `recipient`. | * This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` can... | * This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` can... | 9,476 |
151 | // account : the address to check the balance of return uint256 : The amount of token in the wallet of the given account/ | function balanceOf(address account) public view override returns (uint256) {
return tokenFromGift(_rBank[account]);
}
| function balanceOf(address account) public view override returns (uint256) {
return tokenFromGift(_rBank[account]);
}
| 6,474 |
197 | // σ-usdt0.00021368波动率,每个币种独立设置(年化120%) | uint constant SIGMA_SQ = 45659142400;
| uint constant SIGMA_SQ = 45659142400;
| 42,680 |
292 | // make sure that it HASNT yet been linked. | require(address(otherF3D_) == address(0), "silly dev, you already did that");
| require(address(otherF3D_) == address(0), "silly dev, you already did that");
| 78,713 |
77 | // Remove original exchange from the reflections. We set the address as exchange too. | wallets[pcsV2Pair].isExcludedFromTaxAndReflections = true;
wallets[pcsV2Pair].walletIsExchange = true;
| wallets[pcsV2Pair].isExcludedFromTaxAndReflections = true;
wallets[pcsV2Pair].walletIsExchange = true;
| 26,522 |
8 | // Allow another contract to spend some tokens in your behalf /function approve(address _spender, uint256 _value) public | //returns (bool success) {
//require(_value > 0);
//allowance[msg.sender][_spender] = _value;
//return true;
//}
| //returns (bool success) {
//require(_value > 0);
//allowance[msg.sender][_spender] = _value;
//return true;
//}
| 53,904 |
28 | // события, которые необходимы для передачи уведомлений о режиме мультипликатора | event MultiplierModeOn();
event MultiplierModeOff();
event MultiplierSentEth();
| event MultiplierModeOn();
event MultiplierModeOff();
event MultiplierSentEth();
| 16,347 |
2 | // 908643 | stake_price_by_day.push((100000 * scale) / 908643);
fix_applied = true;
| stake_price_by_day.push((100000 * scale) / 908643);
fix_applied = true;
| 12,316 |
19 | // Update the state | credits[0] = _credits[0];
credits[1] = _credits[1];
withdrawals[0] = _withdrawals[0];
withdrawals[1] = _withdrawals[1];
amount = _amount;
hash = _hash;
expiry = _expiry;
bestRound = r;
EventUpdate(r);
| credits[0] = _credits[0];
credits[1] = _credits[1];
withdrawals[0] = _withdrawals[0];
withdrawals[1] = _withdrawals[1];
amount = _amount;
hash = _hash;
expiry = _expiry;
bestRound = r;
EventUpdate(r);
| 43,978 |
332 | // Transfer approved withdrawal amount from the contract to the caller. | collateralCurrency.safeTransfer(msg.sender, amountWithdrawn.rawValue);
emit RequestWithdrawalExecuted(msg.sender, amountWithdrawn.rawValue);
| collateralCurrency.safeTransfer(msg.sender, amountWithdrawn.rawValue);
emit RequestWithdrawalExecuted(msg.sender, amountWithdrawn.rawValue);
| 26,819 |
247 | // Executes a number of call scripts_script [ specId (uint32) ] many calls with this structure ->[ to (address: 20 bytes) ] [ calldataLength (uint32: 4 bytes) ] [ calldata (calldataLength bytes) ]_input Input is ignored in callscript_blacklist Addresses the script cannot call to, or will revert. return always returns e... | function execScript(bytes _script, bytes _input, address[] _blacklist) external returns (bytes) {
uint256 location = SCRIPT_START_LOCATION; // first 32 bits are spec id
while (location < _script.length) {
address contractAddress = _script.addressAt(location);
// Check address... | function execScript(bytes _script, bytes _input, address[] _blacklist) external returns (bytes) {
uint256 location = SCRIPT_START_LOCATION; // first 32 bits are spec id
while (location < _script.length) {
address contractAddress = _script.addressAt(location);
// Check address... | 36,846 |
416 | // Burns a specific ERC721 token, and removes the data from our mappings tokenId uint256 id of the ERC721 token to be burned. / | function burn(uint256 tokenId) external virtual override whenNotPaused {
TokenInfo memory token = _getTokenInfo(tokenId);
bool canBurn = _isApprovedOrOwner(_msgSender(), tokenId);
bool fromTokenPool = _validPool(_msgSender()) && token.pool == _msgSender();
address owner = ownerOf(tokenId);
require... | function burn(uint256 tokenId) external virtual override whenNotPaused {
TokenInfo memory token = _getTokenInfo(tokenId);
bool canBurn = _isApprovedOrOwner(_msgSender(), tokenId);
bool fromTokenPool = _validPool(_msgSender()) && token.pool == _msgSender();
address owner = ownerOf(tokenId);
require... | 64,598 |
197 | // check for zero to prevent unnecessary write | e.locked_amount = 0;
| e.locked_amount = 0;
| 34,845 |
54 | // Sender borrows assets from the protocol to their own addressborrowAmount The amount of the underlying asset to borrow/ | function borrowInternal(uint borrowAmount) internal nonReentrant {
accrueInterest();
// borrowFresh emits borrow-specific logs on errors, so we don't need to
borrowFresh(payable(msg.sender), borrowAmount);
}
| function borrowInternal(uint borrowAmount) internal nonReentrant {
accrueInterest();
// borrowFresh emits borrow-specific logs on errors, so we don't need to
borrowFresh(payable(msg.sender), borrowAmount);
}
| 7,059 |
209 | // symbol of this token (ERC20) | bytes32 private _symbol;
| bytes32 private _symbol;
| 23,771 |
4 | // fire an event on transfer of tokens | emit Transfer(address(this),_owner,_totalSupply);
| emit Transfer(address(this),_owner,_totalSupply);
| 18,486 |
2 | // Hash table size. - Size should be prime for a good average distribution. - Space is preallocated, for efficiency. - Specific value was selected based on gas and averageof collisions. | uint256 constant HASH_TABLE_SIZE = 313;
| uint256 constant HASH_TABLE_SIZE = 313;
| 53,465 |
336 | // checkResurrected(pepeId); | _transfer(msg.sender, _auction, pepeId);// transfer pepe to auction
AuctionBase auction = AuctionBase(_auction);
auction.startAuctionDirect(pepeId, _beginPrice, _endPrice, _duration, msg.sender);
| _transfer(msg.sender, _auction, pepeId);// transfer pepe to auction
AuctionBase auction = AuctionBase(_auction);
auction.startAuctionDirect(pepeId, _beginPrice, _endPrice, _duration, msg.sender);
| 48,671 |
15 | // crossmint/ Mint tokens to a given address (payable for crossmint)/to The address to mint tokens to/tokenId The token ID to mint/amount The number of tokens to mint | function mintToPayable(
address to,
uint256 tokenId,
uint256 amount
| function mintToPayable(
address to,
uint256 tokenId,
uint256 amount
| 15,192 |
0 | // The oracle wrapper contract interface | interface IOracleWrapper {
function oracle() external view returns (address);
function deployer() external view returns (address);
// #### Functions
/**
* @notice Returns the current price for the asset in question
* @return The latest price
*/
function getPrice() external view ret... | interface IOracleWrapper {
function oracle() external view returns (address);
function deployer() external view returns (address);
// #### Functions
/**
* @notice Returns the current price for the asset in question
* @return The latest price
*/
function getPrice() external view ret... | 47,543 |
0 | // Supply and pricing | uint256 public constant MAX_SUPPLY = 6969;
uint8 public constant MAX_PUBLIC_MINT = 10;
uint256 private _mintPrice = 0.04 ether;
| uint256 public constant MAX_SUPPLY = 6969;
uint8 public constant MAX_PUBLIC_MINT = 10;
uint256 private _mintPrice = 0.04 ether;
| 23,223 |
15 | // Set tokens to rarity groups | _tokenRarityGroups[COMMON] = [FLASK, FAN, UMBRELLA];
_tokenRarityGroups[UNCOMMON] = [COIN, LANTERN, TEA];
_tokenRarityGroups[RARE] = [FROG, CAT, PANDA];
_tokenRarityGroups[EPIC] = [MASCOT, THE_LOTUS, THE_BUDDHA];
_tokenRarityGroups[LEGENDARY] = [YING, THE_DRAGON, JADE_BUDDHA];
| _tokenRarityGroups[COMMON] = [FLASK, FAN, UMBRELLA];
_tokenRarityGroups[UNCOMMON] = [COIN, LANTERN, TEA];
_tokenRarityGroups[RARE] = [FROG, CAT, PANDA];
_tokenRarityGroups[EPIC] = [MASCOT, THE_LOTUS, THE_BUDDHA];
_tokenRarityGroups[LEGENDARY] = [YING, THE_DRAGON, JADE_BUDDHA];
| 4,783 |
0 | // The public keyword here creates getter methods i.e. initiator() { return initiator } | address public initiator;
address public respondent;
string public initiatorSkill;
string public respondentSkill;
| address public initiator;
address public respondent;
string public initiatorSkill;
string public respondentSkill;
| 49,747 |
191 | // this function delivers token according to the information of the current round... beneficiary The address of the account that should receive tokens in reality tokenAmountToBeSent The amount of token sent to the destination addression. roundNumber Round number where tokens shall be purchased... / | function sendToCorrectAddress(
address beneficiary,
uint256 tokenAmountToBeSent,
uint256 roundNumber
)
private
vaultAddressesSet
| function sendToCorrectAddress(
address beneficiary,
uint256 tokenAmountToBeSent,
uint256 roundNumber
)
private
vaultAddressesSet
| 17,674 |
5 | // Sends a message to another mock xdomain messenger. _target Target for the message. _message Message to send. _gasLimit Amount of gas to send with the call. / | function sendMessage(
address _target,
bytes memory _message,
uint32 _gasLimit
)
override
public
| function sendMessage(
address _target,
bytes memory _message,
uint32 _gasLimit
)
override
public
| 20,978 |
24 | // Withdraw an ERC20 token payment sent to a stealth address This method must be directly called by the stealth address _acceptor Address where withdrawn funds should be sent _tokenAddr Address of the ERC20 token being withdrawn _hook Contract that will be called after the token withdrawal has completed _data Arbitrary... | function withdrawTokenAndCall(
address _acceptor,
address _tokenAddr,
IUmbraHookReceiver _hook,
bytes memory _data
| function withdrawTokenAndCall(
address _acceptor,
address _tokenAddr,
IUmbraHookReceiver _hook,
bytes memory _data
| 12,983 |
14 | // ========== RESTRICTED FUNCTIONS ========== / | function _authorizeUpgrade(address newImplementation) internal override {}
}
| function _authorizeUpgrade(address newImplementation) internal override {}
}
| 28,478 |
79 | // We use "Actual end" so that if a user tries to withdraw their BPD early they don't get the shares | uint256 bpdAmount =
calcBPD(start, actualEnd < end ? actualEnd : end, shares);
amountOut = amountOut.add(bpdAmount);
| uint256 bpdAmount =
calcBPD(start, actualEnd < end ? actualEnd : end, shares);
amountOut = amountOut.add(bpdAmount);
| 49,972 |
109 | // validate dirrect listing sale (1) Check if quantity is valid (2) Check if the `_buyer` has enough fund in their bank account _listingListing - the target listing being validated _buyeraddress - the address who is paying for the sale _quantityToBuyuint256 - the desired quantity to buy _currency address - the address ... | function validateDirectListingSale(
Listing memory _listing,
address _buyer,
uint256 _quantityToBuy,
address _currency,
uint256 settledTotalPrice
| function validateDirectListingSale(
Listing memory _listing,
address _buyer,
uint256 _quantityToBuy,
address _currency,
uint256 settledTotalPrice
| 25,358 |
27 | // ------------------------------------------------------------------------ Stakers can claim their pending rewards using this function ------------------------------------------------------------------------ | function ClaimArbitrageReward() public {
if(totalDividends >= stakers[msg.sender].fromTotalDividend){
uint256 needed = pendingReward(msg.sender);
needed = needed.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
... | function ClaimArbitrageReward() public {
if(totalDividends >= stakers[msg.sender].fromTotalDividend){
uint256 needed = pendingReward(msg.sender);
needed = needed.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
... | 17,939 |
28 | // Set threshold amount to trigger adding liquidity when balance of liquidityReceiver goes above this threshold amount provide the threshold amount / | function setMinAmountToAddLiquidity(uint256 amount) external onlyOwner {
_minAmountToAddLiquidity = amount.mul(_gonsPerFragment);
}
| function setMinAmountToAddLiquidity(uint256 amount) external onlyOwner {
_minAmountToAddLiquidity = amount.mul(_gonsPerFragment);
}
| 31,333 |
16 | // next we handle the checks needed for this bid to skip ahead of an existing commission | if (_commissionToBeat > 0){
| if (_commissionToBeat > 0){
| 10,375 |
1 | // Emitted when the Manager role status for the account is renounced account The account address / | event RenounceManagerRole(address indexed account);
| event RenounceManagerRole(address indexed account);
| 37,135 |
15 | // neeed to transfer the loan amount now to the first market !!!! |
IERC20 borrowedToken = IERC20(paths[0]);
|
IERC20 borrowedToken = IERC20(paths[0]);
| 9,573 |
6 | // resulted perscriptoin info after function call | uint res_p_id;
string res_medicine;
string res_symptoms;
uint res_d_id;
string res_timestamp_prescribed;
| uint res_p_id;
string res_medicine;
string res_symptoms;
uint res_d_id;
string res_timestamp_prescribed;
| 37,903 |
54 | // transfer token for a specified address _to The address to transfer to. _value The amount to be transferred. / | function transfer(address _to, uint256 _value) public returns (bool) {
require(msg.sender == owner || transferLocked == false || transferWhitelist[msg.sender] == true);
bool result = super.transfer(_to , _value);
return result;
}
| function transfer(address _to, uint256 _value) public returns (bool) {
require(msg.sender == owner || transferLocked == false || transferWhitelist[msg.sender] == true);
bool result = super.transfer(_to , _value);
return result;
}
| 37,512 |
11 | // transfers `_tokenId` from `msg.sender` to `_to` | function transferNFT(uint256 _tokenId, address _to) external {
// validating whether the tokenId matches the owner
require(NFTidToOwner[_tokenId] == msg.sender, "Not the owner of the NFT");
_transfer(msg.sender, _to, _tokenId);
// update the ownership of NFT in the map
NFTi... | function transferNFT(uint256 _tokenId, address _to) external {
// validating whether the tokenId matches the owner
require(NFTidToOwner[_tokenId] == msg.sender, "Not the owner of the NFT");
_transfer(msg.sender, _to, _tokenId);
// update the ownership of NFT in the map
NFTi... | 19,428 |
48 | // INTERNAL |
function _build(string memory _signature, address _addressArgument, bool _transferOwnership, bool _transferProxyOwnership)
internal
returns (address)
|
function _build(string memory _signature, address _addressArgument, bool _transferOwnership, bool _transferProxyOwnership)
internal
returns (address)
| 24,302 |
19 | // A mapping of address to their pending withdrawal | mapping (address => uint) public addressToPendingWithdrawal;
| mapping (address => uint) public addressToPendingWithdrawal;
| 22,394 |
3 | // stuffInfo memory tmp= stuffInfo(num,_name,_description,_cost,_owner,false); | stuffArray[num]=stuffInfo(num,_name,_description,_cost,_owner,false);
num+=1;
return true;
| stuffArray[num]=stuffInfo(num,_name,_description,_cost,_owner,false);
num+=1;
return true;
| 961 |
182 | // Set the governance address after confirming contract identity _governanceAddress - Incoming governance address / | function _updateGovernanceAddress(address _governanceAddress) internal {
require(
Governance(_governanceAddress).isGovernanceAddress() == true,
"Staking: _governanceAddress is not a valid governance contract"
);
governanceAddress = _governanceAddress;
}
| function _updateGovernanceAddress(address _governanceAddress) internal {
require(
Governance(_governanceAddress).isGovernanceAddress() == true,
"Staking: _governanceAddress is not a valid governance contract"
);
governanceAddress = _governanceAddress;
}
| 7,412 |
114 | // First, find out how much the sender has allowed us to spend. This is the amount of Sprk we're allowed to move. Sender can set this value by calling increaseApproval on the old contract. | uint256 amountToTransfer = oldSprk.allowance(msg.sender, address(this));
require(amountToTransfer > 0, "Amount==0");
| uint256 amountToTransfer = oldSprk.allowance(msg.sender, address(this));
require(amountToTransfer > 0, "Amount==0");
| 40,841 |
194 | // Cost of minting in wei | uint256 public cost = 80000000000000000 wei;
| uint256 public cost = 80000000000000000 wei;
| 51,007 |
7 | // See {IERC721Listings-delistTokens}. / | function delistTokens(DelistTokenInput[] calldata listings) external {
for (uint256 i; i < listings.length; i++) {
address erc721Address = listings[i].erc721Address;
uint256 tokenId = listings[i].tokenId;
(bool isValid, string memory message) = _checkDelistAction(
... | function delistTokens(DelistTokenInput[] calldata listings) external {
for (uint256 i; i < listings.length; i++) {
address erc721Address = listings[i].erc721Address;
uint256 tokenId = listings[i].tokenId;
(bool isValid, string memory message) = _checkDelistAction(
... | 20,300 |
35 | // Returns the state of a payment. If payment is in ASSET_TRANSFERRING, it may be worth checking acceptsRefunds to check if it has gone beyond expirationTime. paymentId The unique ID that identifies the payment.return the state of the payment. / | function paymentState(bytes32 paymentId) external view returns (State);
| function paymentState(bytes32 paymentId) external view returns (State);
| 26,480 |
33 | // Curve second layer Lp token address (e.g Crv pool for MimCrv token) | address immutable public curveSecondLayerTokenAddress;
| address immutable public curveSecondLayerTokenAddress;
| 20,564 |
8 | // Duration of timelock per address | uint256 public redemption_locktime = 1 hours;
| uint256 public redemption_locktime = 1 hours;
| 37,767 |
72 | // Whitelist Minting | bool internal _whitelistMintEnabled; uint256 public _whitelistMintTime;
| bool internal _whitelistMintEnabled; uint256 public _whitelistMintTime;
| 51,546 |
63 | // get prior votes for staking (stakers get full pool power) | votes = SafeMath.add(votes, Incentivizer(incentivizers[i]).getPriorVotes(account, blockNumber));
| votes = SafeMath.add(votes, Incentivizer(incentivizers[i]).getPriorVotes(account, blockNumber));
| 52,067 |
609 | // Claim SDVD reward to this address | (uint256 totalNetReward,,) = _claimReward(msg.sender, address(this));
| (uint256 totalNetReward,,) = _claimReward(msg.sender, address(this));
| 74,154 |
133 | // Temporarily remove fees to transfer to burn address | _taxFee = 0;
_liquidityFee = 0;
_fundingFee = 0;
| _taxFee = 0;
_liquidityFee = 0;
_fundingFee = 0;
| 30,830 |
4 | // triggered when the rate between two tokens in the converter changesnote that the event might be dispatched for rate updates between any two tokens in the converter _token1 address of the first token_token2 address of the second token_rateNrate of 1 unit of `_token1` in `_token2` (numerator)_rateDrate of 1 unit of `_... | event TokenRateUpdate(address indexed _token1, address indexed _token2, uint256 _rateN, uint256 _rateD);
| event TokenRateUpdate(address indexed _token1, address indexed _token2, uint256 _rateN, uint256 _rateD);
| 28,646 |
15 | // Removes an auction from the list of open auctions./_tokenId - ID of NFT on auction. | function _removeAuction(uint256 _tokenId) internal {
delete tokenIdToAuction[_tokenId];
}
| function _removeAuction(uint256 _tokenId) internal {
delete tokenIdToAuction[_tokenId];
}
| 16,211 |
15 | // Advisers,Consultants | uint256 advisersConsultantTokens=15000000;
address advisersConsultantsAddress;
| uint256 advisersConsultantTokens=15000000;
address advisersConsultantsAddress;
| 20,957 |
285 | // round 4 | ark(i, q, 20360807315276763881209958738450444293273549928693737723235350358403012458514);
sbox_partial(i, q);
mix(i, q);
| ark(i, q, 20360807315276763881209958738450444293273549928693737723235350358403012458514);
sbox_partial(i, q);
mix(i, q);
| 32,566 |
248 | // Helper to get the price/ return the price to mint | function getPrice() external pure returns (uint256) {
return PRICE;
}
| function getPrice() external pure returns (uint256) {
return PRICE;
}
| 49,514 |
15 | // Erste Char != '0' | return uint256(bytes(_username)[0]) != 48;
| return uint256(bytes(_username)[0]) != 48;
| 4,767 |
2 | // deposits with fromDepositID < ID <= toDepositID are funded | uint256 fromDepositID;
uint256 toDepositID;
uint256 recordedFundedDepositAmount;
uint256 recordedMoneyMarketIncomeIndex;
uint256 creationTimestamp; // Unix timestamp at time of deposit, in seconds
| uint256 fromDepositID;
uint256 toDepositID;
uint256 recordedFundedDepositAmount;
uint256 recordedMoneyMarketIncomeIndex;
uint256 creationTimestamp; // Unix timestamp at time of deposit, in seconds
| 27,948 |
38 | // if the balance of this contract is not empty, release all balance to the owner | function releaseRestBalance() onlyOwner onlyTokenInitialized public {
require(releasedRoundCount > 3);
uint256 balance = token.balanceOf(this);
require(balance > 0);
token.safeTransfer(owner, balance);
emit Release(owner, balance);
}
| function releaseRestBalance() onlyOwner onlyTokenInitialized public {
require(releasedRoundCount > 3);
uint256 balance = token.balanceOf(this);
require(balance > 0);
token.safeTransfer(owner, balance);
emit Release(owner, balance);
}
| 18,270 |
0 | // Info of each user that can buy seeds. | mapping (address => FarmUserInfo) public userInfo;
BambooToken public bamboo;
ZooKeeper public zooKeeper;
| mapping (address => FarmUserInfo) public userInfo;
BambooToken public bamboo;
ZooKeeper public zooKeeper;
| 26,159 |
1,191 | // Depending on the _seed number, it will be one of {20, 40, 60, 80, 100} | uint256 randomFactor = (_seed.mod(2).mul(20))
.add((_seed.mod(3).mul(40)))
.mul(_maxDeviation)
.div(100);
value_ = __calcDeviatedValue(_meanValue, randomFactor, _maxDeviation);
return value_;
| uint256 randomFactor = (_seed.mod(2).mul(20))
.add((_seed.mod(3).mul(40)))
.mul(_maxDeviation)
.div(100);
value_ = __calcDeviatedValue(_meanValue, randomFactor, _maxDeviation);
return value_;
| 83,187 |
8 | // If the Crowdsale is finalized or not | bool private _finalized;
| bool private _finalized;
| 20,764 |
16 | // Sales configuration has been changed/To access new sales configuration, use getter function./changedBy Changed by user | event SalesConfigChanged(address indexed changedBy);
| event SalesConfigChanged(address indexed changedBy);
| 273 |
56 | // Checks if the address is an admin. / | function isAdmin(address account) public view returns (bool) {
return _admins.has(account);
}
| function isAdmin(address account) public view returns (bool) {
return _admins.has(account);
}
| 25,937 |
25 | // According to EIP-1052, 0x0 is the value returned for not-yet created accounts and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned for accounts without code, i.e. `keccak256('')` | bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
| bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
| 173 |
19 | // Requires that the game was started, and has completed based on current timestamp. Can be bypassed by contract owner. | modifier onlyGameOver() {
if (msg.sender != owner() && getGameConfig(ConfigType.GameEnd) > block.timestamp) {
revert GameInProgress();
}
_;
}
| modifier onlyGameOver() {
if (msg.sender != owner() && getGameConfig(ConfigType.GameEnd) > block.timestamp) {
revert GameInProgress();
}
_;
}
| 6,691 |
5 | // Mints vault tokens/_depositAmount The amount of vault tokens to collateralize/_onBehalfOf The recipient of the minted tokens | function deposit(uint256 _depositAmount, address _onBehalfOf)
external
nonReentrant
| function deposit(uint256 _depositAmount, address _onBehalfOf)
external
nonReentrant
| 23,884 |
1 | // break the int down to a single digit | uint8 line = uint8(PIndex / Length);
uint8 position = uint8(PIndex % Length);
uint256 number = PI[line];
uint256 divisor = 10**uint256(Length - position); //-position or else we will read the array right to left
uint256 truncated = number / divisor;
uint8 rng = uint8(truncated % 1... | uint8 line = uint8(PIndex / Length);
uint8 position = uint8(PIndex % Length);
uint256 number = PI[line];
uint256 divisor = 10**uint256(Length - position); //-position or else we will read the array right to left
uint256 truncated = number / divisor;
uint8 rng = uint8(truncated % 1... | 6,171 |
211 | // We checked reduceAmount <= totalReserves above, so this should never revert. | require(totalReservesNew <= totalReserves, "reduce reserves unexpected underflow");
| require(totalReservesNew <= totalReserves, "reduce reserves unexpected underflow");
| 9,311 |
23 | // initial buy, sell fee till first 15 buys | uint256 private _initialBuyTax=30;
uint256 private _initialSellTax=80;
| uint256 private _initialBuyTax=30;
uint256 private _initialSellTax=80;
| 17,038 |
65 | // internal functions to call our sorted list | function treeRootNode(uint256 _poolID) public view returns (uint256) {
return poolInfo[_poolID].blockRank.root;
}
| function treeRootNode(uint256 _poolID) public view returns (uint256) {
return poolInfo[_poolID].blockRank.root;
}
| 33,671 |
6 | // @inheritdoc IRoyaltyInfo / | function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount)
| function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount)
| 11,695 |
141 | // Balance has changed so PlanManager's expire time must be either increased or reduced./ | {
uint256 expiry = _newBalance.div(_newPerSec).add(block.timestamp);
IPlanManager(getModule("PLAN")).updateExpireTime(_user, expiry);
}
| {
uint256 expiry = _newBalance.div(_newPerSec).add(block.timestamp);
IPlanManager(getModule("PLAN")).updateExpireTime(_user, expiry);
}
| 31,376 |
5 | // allows anybody to execute given they have a signed message from an executor signature bytes32 ethereum signature nonce the address' nonce (in a specific `_channel`), obtained via `getNonce(...)`. Used to prevent replay attack payload obtained via encodeABI() in web3return the data being returned by the ERC725 Accoun... | function executeRelayCall(
| function executeRelayCall(
| 16,347 |
163 | // Set Uniswap Dai-Weth Pair contract address This function can only be carreid out by the owner of this contract. / | function setDaiWethPair(address _daiWethPair) public onlyOwner {
daiWethPair = _daiWethPair;
}
| function setDaiWethPair(address _daiWethPair) public onlyOwner {
daiWethPair = _daiWethPair;
}
| 79,595 |
36 | // Do reclaim. Parameters ---------------- |coin|: The JohnLawCoin contract. The ownership needs to be transferred to this contract. |sender|: The voter's account. Returns ---------------- A tuple of two values:- uint: The amount of the reclaimed coins. This becomes a positive valuewhen the voter is eligible to reclaim... | function reclaim(address sender, JohnLawCoin_v2 coin)
| function reclaim(address sender, JohnLawCoin_v2 coin)
| 10,516 |
31 | // =================================/The address of the EtherDungeonCore contract. | PoWTFInterface public poWtfContract = PoWTFInterface(0x702392282255f8c0993dBBBb148D80D2ef6795b1);
| PoWTFInterface public poWtfContract = PoWTFInterface(0x702392282255f8c0993dBBBb148D80D2ef6795b1);
| 10,961 |
8 | // PIGGY-MODIFY: Validates borrow and reverts on rejection. May emit logs. pToken Asset whose underlying is being borrowed borrower The address borrowing the underlying borrowAmount The amount of the underlying asset requested to borrow / | function borrowVerify(
| function borrowVerify(
| 4,998 |
402 | // Burn tokens from address token holder address amount uint256 amount of tokens to burn data bytes extra information provided by the token holder operatorData bytes extra information provided by the operator (if any) / |
function _burn(
address from,
uint256 amount,
bytes memory data,
bytes memory operatorData
|
function _burn(
address from,
uint256 amount,
bytes memory data,
bytes memory operatorData
| 88 |
105 | // Do not mint directly using toMintAllocations check with totalRedeemd | uint256[] memory tempAllocations = new uint256[](toMintAllocations.length);
for (uint256 i = 0; i < toMintAllocations.length; i++) {
| uint256[] memory tempAllocations = new uint256[](toMintAllocations.length);
for (uint256 i = 0; i < toMintAllocations.length; i++) {
| 22,836 |
42 | // reward rate 275.00% per year | uint public constant rewardRate = 27500;
uint public constant rewardInterval = 365 days;
| uint public constant rewardRate = 27500;
uint public constant rewardInterval = 365 days;
| 53,909 |
44 | // Claim tokens for `receiver_address` after the auction has ended./Claims Presale and Auction tokens for `receiver_address` after auction has ended./ Requires that the address has either bids or presale balance and sets both to 0 with claim./_receiver_address Tokens will be assigned to this address if eligible. | function proxyClaimTokens(address _receiver_address) public whenNotPaused atStage(Stages.AuctionEnded) returns (bool) {
// Waiting period after the end of the auction, before anyone can claim tokens
// Ensures enough time to check if auction was finalized correctly
// before users start tran... | function proxyClaimTokens(address _receiver_address) public whenNotPaused atStage(Stages.AuctionEnded) returns (bool) {
// Waiting period after the end of the auction, before anyone can claim tokens
// Ensures enough time to check if auction was finalized correctly
// before users start tran... | 38,559 |
47 | // _isRunning return successupdating isSellPossible -- only Wolk Inc can set this | function updateSellPossible(bool _isRunning) onlyOwner returns (bool success){
if (_isRunning){
require(sellWolkEstimate(10**decimals, exchangeFormula) > 0);
require(purchaseWolkEstimate(10**decimals, exchangeFormula) > 0);
}
isSellPossible = _isRunning;
re... | function updateSellPossible(bool _isRunning) onlyOwner returns (bool success){
if (_isRunning){
require(sellWolkEstimate(10**decimals, exchangeFormula) > 0);
require(purchaseWolkEstimate(10**decimals, exchangeFormula) > 0);
}
isSellPossible = _isRunning;
re... | 2,384 |
41 | // Constant field with token full name solium-disable-next-line uppercase | string constant public name = "MainCoin";
| string constant public name = "MainCoin";
| 44,289 |
4 | // representing the decimals of the token | uint8 internal constant DECIMALS = 18;
| uint8 internal constant DECIMALS = 18;
| 67,814 |
246 | // Are the NFTs revealed yet ? | bool public revealed = false;
| bool public revealed = false;
| 44,177 |
8 | // the System has received fresh money, it will survive at least 8h more | lastTimeOfNewCredit = now;
| lastTimeOfNewCredit = now;
| 12,487 |
204 | // Inspired by OraclizeAPI's implementation - MIT license https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol | if (value == 0) {
return '0';
}
| if (value == 0) {
return '0';
}
| 11,782 |
34 | // oods_coefficients[24]/ mload(add(context, 0x6de0)), res += c_25(f_1(x) - f_1(g^448z)) / (x - g^448z). | res := add(
res,
mulmod(mulmod(/*(x - g^448 * z)^(-1)*/ mload(add(denominatorsPtr, 0x8a0)),
| res := add(
res,
mulmod(mulmod(/*(x - g^448 * z)^(-1)*/ mload(add(denominatorsPtr, 0x8a0)),
| 77,450 |
5 | // log itemsold message | event MarketItemCreated (
uint indexed itemId,
address indexed nftContract,
uint indexed tokenId,
address seller,
address owner,
uint price,
bool sold
);
| event MarketItemCreated (
uint indexed itemId,
address indexed nftContract,
uint indexed tokenId,
address seller,
address owner,
uint price,
bool sold
);
| 33,879 |
2 | // address address_of_rto=address(0); | address address_of_rto=0xEC3848CD0C31A4d5e0B36aEe553f24Bda49e9De1;
| address address_of_rto=0xEC3848CD0C31A4d5e0B36aEe553f24Bda49e9De1;
| 12,725 |
4 | // NFTid => Bid[] | mapping(uint256 => BidDetail[]) public Bids;
| mapping(uint256 => BidDetail[]) public Bids;
| 19,229 |
19 | // Signal the intention to leave the pool as a junior/User will join the exit queue and his junior tokens will be transferred back to the pool./Their tokens will be burned when the epoch is finalized and the underlying due will be set aside./Users can increase their queue amount but can't exit the queue/amountJuniorTok... | function exitJunior(uint256 amountJuniorTokens) public {
advanceEpoch();
uint256 balance = juniorToken.balanceOf(msg.sender);
require(balance >= amountJuniorTokens, "not enough balance");
queuedJuniorTokensBurn += amountJuniorTokens;
QueuePosition storage pos = juniorExitQ... | function exitJunior(uint256 amountJuniorTokens) public {
advanceEpoch();
uint256 balance = juniorToken.balanceOf(msg.sender);
require(balance >= amountJuniorTokens, "not enough balance");
queuedJuniorTokensBurn += amountJuniorTokens;
QueuePosition storage pos = juniorExitQ... | 33,129 |
109 | // call oracle | latestOracleRequestID = fundValueOracle.requestValue.value(_oracleFee)(address(this), _oracleFee);
| latestOracleRequestID = fundValueOracle.requestValue.value(_oracleFee)(address(this), _oracleFee);
| 43,467 |
175 | // emitted when a user stakes xETH to receieve wxETH | event Stake(
address indexed user,
uint256 xETHAmount,
uint256 wxETHReceived
);
| event Stake(
address indexed user,
uint256 xETHAmount,
uint256 wxETHReceived
);
| 38,501 |
4 | // An account's total vested reward per token | mapping(address => mapping(IERC20Ext => uint256)) public accountVestedBalance;
| mapping(address => mapping(IERC20Ext => uint256)) public accountVestedBalance;
| 67,699 |
196 | // safe to enter more than we have | function withdrawSome(uint256 _amount) internal returns (uint256 _liquidatedAmount, uint256 _loss) {
uint256 wantBalanceBefore = want.balanceOf(address(this));
//let's take the amount we need if virtual price is real. Let's add the
uint256 virtualPrice = virtualPriceToWant();
uint... | function withdrawSome(uint256 _amount) internal returns (uint256 _liquidatedAmount, uint256 _loss) {
uint256 wantBalanceBefore = want.balanceOf(address(this));
//let's take the amount we need if virtual price is real. Let's add the
uint256 virtualPrice = virtualPriceToWant();
uint... | 49,017 |
63 | // get address of pool for puchase ticket and get tokens / | function getbuyerPoolAddress() external view returns(address){
return _buyerPoolAddress;
}
| function getbuyerPoolAddress() external view returns(address){
return _buyerPoolAddress;
}
| 44,162 |
38 | // eg. MIC - USDT | address bridge0 = bridgeFor(token0);
address bridge1 = bridgeFor(token1);
if (bridge0 == token1) {
| address bridge0 = bridgeFor(token0);
address bridge1 = bridgeFor(token1);
if (bridge0 == token1) {
| 31,784 |
18 | // Batch Transfer | function batchTransferOut(address[] memory recipients, Coin[] memory coins, string[] memory memos) public payable {
for(uint i = 0; i < coins.length; i++){
transferOut(payable(recipients[i]), coins[i].asset, coins[i].amount, memos[i]);
}
}
| function batchTransferOut(address[] memory recipients, Coin[] memory coins, string[] memory memos) public payable {
for(uint i = 0; i < coins.length; i++){
transferOut(payable(recipients[i]), coins[i].asset, coins[i].amount, memos[i]);
}
}
| 12,773 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.