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
14
// Internal Out Of Gas/Throw: revert this transaction too; Call Stack Depth Limit reached: revert this transaction too; Recursive Call: safe, no any changes applied yet, we are inside of modifier.
_safeSend(msg.sender, msg.value);
_safeSend(msg.sender, msg.value);
56,994
256
// Set whether an account can open/close streams. Only callable by the current gov contract account The account to set permissions for. _isSubGov Whether or not this account can manage streams /
function setSubGov(address account, bool _isSubGov) public onlyGov
function setSubGov(address account, bool _isSubGov) public onlyGov
87,511
81
// 24 hours rewards halving
uint256 public _poolHalvingIntervalMinutes = 1440; uint256 public _poolRewardDistributionIntervalMinutes = 5;
uint256 public _poolHalvingIntervalMinutes = 1440; uint256 public _poolRewardDistributionIntervalMinutes = 5;
71,289
155
// Private function to add a token to this extension's ownership-tracking data structures. to address representing the new owner of the given token ID tokenId uint256 ID of the token to be added to the tokens list of the given address /
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; }
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; }
39,231
0
// VARIABLES /
enum State { PRIVATE, PUBLIC }
enum State { PRIVATE, PUBLIC }
40,357
378
// Proposed whitelist
address[] public proposedWhitelist;
address[] public proposedWhitelist;
29,468
87
// swap tokens to eth
function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount)...
function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount)...
25,685
26
// Donate to the developer!
function developerDonate() external payable { payable(DEV_DONATE).transfer(msg.value); }
function developerDonate() external payable { payable(DEV_DONATE).transfer(msg.value); }
15,784
52
// Burns veto priviledges Vetoer function destroying veto power forever /
function _burnVetoPower() public { // Check caller is pendingAdmin and pendingAdmin ≠ address(0) require(msg.sender == vetoer, 'NounsDAO::_burnVetoPower: vetoer only'); _setVetoer(address(0)); }
function _burnVetoPower() public { // Check caller is pendingAdmin and pendingAdmin ≠ address(0) require(msg.sender == vetoer, 'NounsDAO::_burnVetoPower: vetoer only'); _setVetoer(address(0)); }
9,375
217
// calculate vested portion of reward pool
uint256 unlockedRewards = calculateUnlockedRewards( _aludel.rewardSchedules, remainingRewards, _aludel.rewardSharesOutstanding, block.timestamp );
uint256 unlockedRewards = calculateUnlockedRewards( _aludel.rewardSchedules, remainingRewards, _aludel.rewardSharesOutstanding, block.timestamp );
12,130
119
// =================================================================================================================Constants ================================================================================================================= Max amount of known addresses of which will get SRN by 'Grant' method. grantees ...
uint8 public constant MAX_TOKEN_GRANTEES = 10;
uint8 public constant MAX_TOKEN_GRANTEES = 10;
29,224
236
// Validates a swap of borrow rate mode. reserve The reserve state on which the user is swapping the rate userConfig The user reserves configuration stableDebt The stable debt of the user variableDebt The variable debt of the user currentRateMode The rate mode of the borrow /
function validateSwapRateMode( DataTypes.ReserveData storage reserve, DataTypes.UserConfigurationMap storage userConfig, uint256 stableDebt, uint256 variableDebt, DataTypes.InterestRateMode currentRateMode
function validateSwapRateMode( DataTypes.ReserveData storage reserve, DataTypes.UserConfigurationMap storage userConfig, uint256 stableDebt, uint256 variableDebt, DataTypes.InterestRateMode currentRateMode
53,307
27
// allows dev to set mapping contract for valueFor (EIP2362) _addy address of mapping contract /
function setIdMappingContract(address _addy) external{ require(address(idMappingContract) == address(0)); idMappingContract = IMappingContract(_addy); }
function setIdMappingContract(address _addy) external{ require(address(idMappingContract) == address(0)); idMappingContract = IMappingContract(_addy); }
31,704
111
// ADMIN //enables owner to pause / unpause contract /
function setPaused(bool _paused) external requireContractsSet onlyOwner { if (_paused) _pause(); else _unpause(); }
function setPaused(bool _paused) external requireContractsSet onlyOwner { if (_paused) _pause(); else _unpause(); }
65,520
0
// solidly contracts
IVotingEscrow public votingEscrow; IBaseV1Voter public solidlyVoter;
IVotingEscrow public votingEscrow; IBaseV1Voter public solidlyVoter;
36,898
30
// Overrides the `tokenURI()` function from ERC721A to return just the base URI if it is implied to not be a directory.This is to help with ERC721 contracts in which the same token URI is desired for each token, such as when the tokenURI is 'unrevealed'. /
function tokenURI(uint256 tokenId) public view virtual override returns (string memory)
function tokenURI(uint256 tokenId) public view virtual override returns (string memory)
20,338
515
// invariantD = invariantD^(n+1) A = amplification coefficientAn^n S + D = A D n^n + -----------S = sum of balances n^n PP = product of balancesn = number of tokensx/ We support rounding up or down.
uint256 sum = 0; uint256 numTokens = balances.length; for (uint256 i = 0; i < numTokens; i++) { sum = sum.add(balances[i]); }
uint256 sum = 0; uint256 numTokens = balances.length; for (uint256 i = 0; i < numTokens; i++) { sum = sum.add(balances[i]); }
5,800
153
// ------------------------------------------------------------------------ Get the total owed for an entire api for all nonzero buyers ------------------------------------------------------------------------
function totalOwedForApi(uint apiId) public view returns (uint) { APIBalance storage apiBalance = owed[apiId]; uint totalOwed = 0; for (uint i = 0; i < apiBalance.nonzeroAddresses.length; i++) { address buyerAddress = apiBalance.nonzeroAddresses[i]; uint buyerOwes = ...
function totalOwedForApi(uint apiId) public view returns (uint) { APIBalance storage apiBalance = owed[apiId]; uint totalOwed = 0; for (uint i = 0; i < apiBalance.nonzeroAddresses.length; i++) { address buyerAddress = apiBalance.nonzeroAddresses[i]; uint buyerOwes = ...
1,929
15
// For auto liquidity, liquidate half tokens and put in the remaining ones for liquidity.
uint autoLiquidityTokens = tokensForLiquidation * ((transferFees.buyAutoLiquidity + transferFees.sellAutoLiquidity)) / (transferFees.buyTotal + transferFees.sellTotal); uint autoLiquidityTokensToLiquidate = autoLiquidityTokens / 2;
uint autoLiquidityTokens = tokensForLiquidation * ((transferFees.buyAutoLiquidity + transferFees.sellAutoLiquidity)) / (transferFees.buyTotal + transferFees.sellTotal); uint autoLiquidityTokensToLiquidate = autoLiquidityTokens / 2;
22,502
157
// Send any remaining balance to the foundation wallet /
function empty() returns (bool) { return foundationWallet.call.value(this.balance)(); }
function empty() returns (bool) { return foundationWallet.call.value(this.balance)(); }
37,411
116
// If not burned.
if (packed & _BITMASK_BURNED == 0) {
if (packed & _BITMASK_BURNED == 0) {
11,036
3,812
// 1907
entry "nonmatured" : ENG_ADJECTIVE
entry "nonmatured" : ENG_ADJECTIVE
18,519
27
// Emitted when the connected Ante Test's invariant gets verified/checker The address of challenger who called the verification
event TestChecked(address indexed checker);
event TestChecked(address indexed checker);
8,595
49
// Step 4. of IETF draft section 5.3 (pk corresponds to Y, seed to alpha_string)
uint256[2] memory hash = hashToCurve(pk, seed);
uint256[2] memory hash = hashToCurve(pk, seed);
30,392
106
// There are two caveats with this computation: 1. Max value for the number dividend `a` represents is ~10^41, otherwise an intermediate value overflows. 10^41 is stored internally as an int256 10^59. 2. Results that can't be represented exactly are truncated not rounded. E.g., 2 / 3 = 0.6 repeating, which would round ...
return Signed(a.rawValue.mul(SFP_SCALING_FACTOR).div(b.rawValue));
return Signed(a.rawValue.mul(SFP_SCALING_FACTOR).div(b.rawValue));
26,862
26
// Throws if called by any account other than the owner. /
modifier onlyFabric() { require(fabrics[msg.sender].isActive); _; }
modifier onlyFabric() { require(fabrics[msg.sender].isActive); _; }
22,589
23
// Emit the appropriate event
emit Harvested(_upc);
emit Harvested(_upc);
43,297
49
// 0x500 = compressed note coordinate gamma
mstore( 0x500, or( mload(0x20), mul( and(mload(0x40), 0x01), 0x8000000000000000000000000000000000000000000000000000000000000000 ) ) )
mstore( 0x500, or( mload(0x20), mul( and(mload(0x40), 0x01), 0x8000000000000000000000000000000000000000000000000000000000000000 ) ) )
29,438
39
// If opponent has supply
if (op.totalSupply() > 0) {
if (op.totalSupply() > 0) {
35,767
14
// user is already on the leaderboard, remove them first
removeFromLeaderboard(_user, _market, _card);
removeFromLeaderboard(_user, _market, _card);
28,327
45
// Disable the renounceOwnership function
function renounceOwnership() public view override onlyOwner { revert("Disabled!"); }
function renounceOwnership() public view override onlyOwner { revert("Disabled!"); }
56,159
10
// increases liquidity by token amounts desired/ return liquidity new liquidity amount
function _uniSupply(Params memory _uniData) internal returns ( uint128 liquidity, uint256 amount0, uint256 amount1 )
function _uniSupply(Params memory _uniData) internal returns ( uint128 liquidity, uint256 amount0, uint256 amount1 )
22,838
0
// Mined address
address addr;
address addr;
35,480
0
// RLP encoding library
RLPEncode rlp;
RLPEncode rlp;
624
5
// ElasticSupplyERC20 Token ERC20 with an elastic supplyCyril Lapinte - <cyril.lapinte@openfiz.com>SPDX-License-Identifier: MIT Error messagesES01: Elasticity cannot be 0ES02: Address is invalidES03: Approval too lowES04: Not enougth tokens/
contract ElasticSupplyERC20 is IElasticSupplyERC20, Ownable, MintableTokenERC20 { uint256 internal constant ELASTICITY_PRECISION = 10**9; uint256 internal elasticity_ = ELASTICITY_PRECISION; constructor( string memory _name, string memory _symbol, uint256 _decimals, address _initialAccount, ...
contract ElasticSupplyERC20 is IElasticSupplyERC20, Ownable, MintableTokenERC20 { uint256 internal constant ELASTICITY_PRECISION = 10**9; uint256 internal elasticity_ = ELASTICITY_PRECISION; constructor( string memory _name, string memory _symbol, uint256 _decimals, address _initialAccount, ...
52,182
10
// change pass price
function setPassPrice(uint256 price) public onlyOwner { passPrice = price; }
function setPassPrice(uint256 price) public onlyOwner { passPrice = price; }
19,795
10
// requires that the token does not already exist.
require(!_exists(tokenId), "token already minted!");
require(!_exists(tokenId), "token already minted!");
47,164
22
// In this event we are returning underlyiing() which can be used to compute the actual interest generated.
emit Rebased(_oldIndex, _newIndex, _underlying.div(WAD));
emit Rebased(_oldIndex, _newIndex, _underlying.div(WAD));
61,319
139
// Burn the tokens.
_burn(msg.sender, backstopTokenAmount);
_burn(msg.sender, backstopTokenAmount);
49,008
98
// Changes unirouter factory address /
function changeUniRouter(address _router) external onlyAdmin { require(_router != address(0), "Router address cannot be 0"); uniRouter = _router; }
function changeUniRouter(address _router) external onlyAdmin { require(_router != address(0), "Router address cannot be 0"); uniRouter = _router; }
43,991
48
// set the 721 contract address
function set721ContractAddress(WildNFT _nft) public onlyAdmin { nft = _nft; }
function set721ContractAddress(WildNFT _nft) public onlyAdmin { nft = _nft; }
1,952
399
// In case win.
goldRewardGiven = goldReward; expRewardGiven = expReward;
goldRewardGiven = goldReward; expRewardGiven = expReward;
42,712
383
// Active loan that has entered a new period, so return the next newNextDueTime. But never return something after the termEndTime
if (balance > 0 && curTimestamp >= newNextDueTime) { uint256 secondsToAdvance = (curTimestamp.sub(newNextDueTime).div(secondsPerPeriod)).add(1).mul(secondsPerPeriod); newNextDueTime = newNextDueTime.add(secondsToAdvance); return Math.min(newNextDueTime, termEndTime); }
if (balance > 0 && curTimestamp >= newNextDueTime) { uint256 secondsToAdvance = (curTimestamp.sub(newNextDueTime).div(secondsPerPeriod)).add(1).mul(secondsPerPeriod); newNextDueTime = newNextDueTime.add(secondsToAdvance); return Math.min(newNextDueTime, termEndTime); }
61,897
4
// Enables a trusted router contract to override the usual msg.sender address. HardlyDifficult /
abstract contract RouterContext is Context { using AddressUpgradeable for address; address private immutable approvedRouter; constructor(address router) { if (!router.isContract()) { revert RouterContext_Not_A_Contract(); } approvedRouter = router; } /** * @notice Returns the router co...
abstract contract RouterContext is Context { using AddressUpgradeable for address; address private immutable approvedRouter; constructor(address router) { if (!router.isContract()) { revert RouterContext_Not_A_Contract(); } approvedRouter = router; } /** * @notice Returns the router co...
20,125
27
// fired when `holder` transitions `originalAsset` to `newAsset`
event Transitioned( address holder, address originalAsset, address newAsset, uint256[] tokenIds ); mapping(address => address) public transitionMap;
event Transitioned( address holder, address originalAsset, address newAsset, uint256[] tokenIds ); mapping(address => address) public transitionMap;
46,358
509
// Determines whether the pool should rebalance given the provided balances /
function shouldRebalance(uint256 cash, uint256 managed) external view returns (bool);
function shouldRebalance(uint256 cash, uint256 managed) external view returns (bool);
53,552
11
// transfer from l1: tokenSupplyOnL1 -= amount totalSupllyOnL2 += amount globalSupply stay unchanged
tokenSupplyOnL1 = tokenSupplyOnL1.sub(amount); _mint(account, amount); emit BridgeMint(account, amount);
tokenSupplyOnL1 = tokenSupplyOnL1.sub(amount); _mint(account, amount); emit BridgeMint(account, amount);
14,830
164
// Safe xeti transfer function, just in case if rounding error causes pool to not have enough XETIs.
function safeXetiTransfer(address _to, uint256 _amount) internal { uint256 xetiBal = xeti.balanceOf(address(this)); if (_amount > xetiBal) { xeti.transfer(_to, xetiBal); } else { xeti.transfer(_to, _amount); } }
function safeXetiTransfer(address _to, uint256 _amount) internal { uint256 xetiBal = xeti.balanceOf(address(this)); if (_amount > xetiBal) { xeti.transfer(_to, xetiBal); } else { xeti.transfer(_to, _amount); } }
17,918
91
// Returns whether the specified token exists. tokenId uint256 ID of the token to query the existence ofreturn bool whether the token exists /
function _exists(uint256 tokenId) internal view returns (bool) { address owner = _tokenOwner[tokenId]; return owner != address(0); }
function _exists(uint256 tokenId) internal view returns (bool) { address owner = _tokenOwner[tokenId]; return owner != address(0); }
7,873
279
// Reward committer
incentivize(msg.sender, Constants.getAdvanceIncentive());
incentivize(msg.sender, Constants.getAdvanceIncentive());
47,736
168
// Disburse liquidity stake attacks
function disburseLiqStakeAttacks(address[] memory liquidatedAccounts) external
function disburseLiqStakeAttacks(address[] memory liquidatedAccounts) external
74,206
18
// PUBLIC FUNCTIONS /
function mint(uint256 _amount) public payable nonReentrant { require( block.timestamp > publicStart && isPublicLive == true, "Public mint not open yet" ); uint256 total = totalSupply(); require(total + _amount <= MAX_ELEMENTS, "Sold Out!"); require(msg...
function mint(uint256 _amount) public payable nonReentrant { require( block.timestamp > publicStart && isPublicLive == true, "Public mint not open yet" ); uint256 total = totalSupply(); require(total + _amount <= MAX_ELEMENTS, "Sold Out!"); require(msg...
10,069
159
// Update the fee percentage.
feePercent = newFeePercent; emit FeePercentUpdated(msg.sender, newFeePercent);
feePercent = newFeePercent; emit FeePercentUpdated(msg.sender, newFeePercent);
55,401
182
// Returns whether the specified token is minted _id uint256 ID of the token to query the existence ofreturn bool whether the token exists /
function exists(uint256 _id) public view returns (bool) { return _supply[_id] > 0; }
function exists(uint256 _id) public view returns (bool) { return _supply[_id] > 0; }
12,155
152
// should mint 00001, 00002
_mintHero(1); _safeMint(OWNER1_ADDRESS, 1); _mintHero(2); _safeMint(OWNER1_ADDRESS, 2);
_mintHero(1); _safeMint(OWNER1_ADDRESS, 1); _mintHero(2); _safeMint(OWNER1_ADDRESS, 2);
58,284
225
// Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Availabl...
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Availabl...
36,281
36
// make sure that the seller still has that amount to sell
require(getBalance(contractAddress, seller) >= amount);
require(getBalance(contractAddress, seller) >= amount);
48,359
0
// uint public patientCount;
mapping(address => Patient) public patients;
mapping(address => Patient) public patients;
9,339
172
// Abstract function that must be implemented.Calculate the minimumBid allowed for the rebalance._auctionAuction object _currentSet The Set to rebalance from _nextSetThe Set to rebalance toreturnMinimum bid amount /
function calculateMinimumBid( Setup storage _auction, ISetToken _currentSet, ISetToken _nextSet ) internal view returns (uint256);
function calculateMinimumBid( Setup storage _auction, ISetToken _currentSet, ISetToken _nextSet ) internal view returns (uint256);
39,544
6
// Determines how BNB is stored/forwarded on purchases. /
function _forwardFunds() internal { wallet.transfer(msg.value); }
function _forwardFunds() internal { wallet.transfer(msg.value); }
14,382
115
// 투자자의 자산을 업데이트한다
fundersProperty[_beneficiary].reservedFunds += amountFunds; fundersProperty[_beneficiary].reservedApis += reservedApis; fundersProperty[_beneficiary].purchaseTime = now;
fundersProperty[_beneficiary].reservedFunds += amountFunds; fundersProperty[_beneficiary].reservedApis += reservedApis; fundersProperty[_beneficiary].purchaseTime = now;
49,884
230
// Get currently used protocol tokens (cDAI, aDAI, ...) return : array of protocol tokens supported/
function getAllAvailableTokens() external view returns (address[] memory) { return allAvailableTokens; }
function getAllAvailableTokens() external view returns (address[] memory) { return allAvailableTokens; }
19,623
3
// Minimum and Maximun fee deductible for swaps
uint256 public minFee; uint256 public maxFee;
uint256 public minFee; uint256 public maxFee;
29,536
224
// Get all market reward speed info. cTokens The market addressesreturn The list of reward speed info /
function getAllMarketRewardSpeeds(address[] memory cTokens) public view returns (MarketRewardSpeed[] memory) { MarketRewardSpeed[] memory allRewardSpeeds = new MarketRewardSpeed[](cTokens.length); for (uint i = 0; i < cTokens.length; i++) { allRewardSpeeds[i] = getMarketRewardSpeeds(cTok...
function getAllMarketRewardSpeeds(address[] memory cTokens) public view returns (MarketRewardSpeed[] memory) { MarketRewardSpeed[] memory allRewardSpeeds = new MarketRewardSpeed[](cTokens.length); for (uint i = 0; i < cTokens.length; i++) { allRewardSpeeds[i] = getMarketRewardSpeeds(cTok...
28,930
26
// Send rewards to the winners. /
function verdict(uint256 random) public payable onlyVFRC { //check bets from latest betting round, one by one for(uint256 i=lastGameId; i<gameId; i++){ //reset winAmount for current user uint256 winAmount = 0; //if user wins, then receives 2x of their betting amount if((random>=...
function verdict(uint256 random) public payable onlyVFRC { //check bets from latest betting round, one by one for(uint256 i=lastGameId; i<gameId; i++){ //reset winAmount for current user uint256 winAmount = 0; //if user wins, then receives 2x of their betting amount if((random>=...
18,029
88
// Borrow fyDai from Controller and sell it immediately for Dai, for a maximum fyDai debt./ Must have approved the operator with `controller.addDelegate(yieldProxy.address)`./collateral Valid collateral type./maturity Maturity of an added series/to Wallet to send the resulting Dai to./maximumFYDai Maximum amount of FYD...
function borrowDaiForMaximumFYDai( IPool pool, bytes32 collateral, uint256 maturity, address to, uint256 maximumFYDai, uint256 daiToBorrow ) public returns (uint256)
function borrowDaiForMaximumFYDai( IPool pool, bytes32 collateral, uint256 maturity, address to, uint256 maximumFYDai, uint256 daiToBorrow ) public returns (uint256)
29,212
9
// transfers to 0x address will be burned
if (to == address(0)) { this.burn(messageSender, value); return true; }
if (to == address(0)) { this.burn(messageSender, value); return true; }
20,908
87
// Participation caps, according to KYC tiers.
uint256 public constant TIER_1_CAP = 100000 * WEI_PER_USD; uint256 public constant TIER_2_CAP = uint256(-1); // Maximum uint256 value
uint256 public constant TIER_1_CAP = 100000 * WEI_PER_USD; uint256 public constant TIER_2_CAP = uint256(-1); // Maximum uint256 value
44,080
7
// Function to mint a single collection token to a specified recipient
function mintTo(address collection, address recipient) external payable { _batchMint(collection, recipient, 1); }
function mintTo(address collection, address recipient) external payable { _batchMint(collection, recipient, 1); }
4,179
903
// Withdraw underlying tokens from IdleCDO/This function SHOULD be guarded to prevent potential reentrancy/shares shares to withdraw/receiver receiver of underlying tokens withdrawn from IdleCDO/sender sender of tranche shares
function _redeem( uint256 shares, address receiver, address sender
function _redeem( uint256 shares, address receiver, address sender
29,707
189
// an event emitted when somebody redeemed all the FrAactionHub tokens
event Redeem(address indexed redeemer);
event Redeem(address indexed redeemer);
9,665
178
// The YFGEN TOKEN
YFGToken public yfgen; address private devaddr;
YFGToken public yfgen; address private devaddr;
30,255
350
// event => state, state: 0- not open, 1- open
mapping(string => uint256) private _lockEventState;
mapping(string => uint256) private _lockEventState;
10,585
338
// Cache the running mint fee.
RewardsClaimedAt[mintIndex + i] = RunningMintFee; RunningMintFee += rewardSplit / getTotalMinted(); emit Minted(mintIndex + i, msg.sender, mintFees[i]);
RewardsClaimedAt[mintIndex + i] = RunningMintFee; RunningMintFee += rewardSplit / getTotalMinted(); emit Minted(mintIndex + i, msg.sender, mintFees[i]);
4,284
129
// If the source is not whitelisted, try to add it (only admins modifier)
if(!isWhitelisted(_from) && !whitelistUnlocked) addToWhitelist(_from);
if(!isWhitelisted(_from) && !whitelistUnlocked) addToWhitelist(_from);
22,662
168
// reset previous rewards
users[msg.sender][address(bree)].pendingGains = 0;
users[msg.sender][address(bree)].pendingGains = 0;
5,745
0
// adding ERC165 data
ds.supportedInterfaces[type(IERC165).interfaceId] = true; ds.supportedInterfaces[type(IDiamondCut).interfaceId] = true; ds.supportedInterfaces[type(IDiamondLoupe).interfaceId] = true; ds.supportedInterfaces[type(IERC173).interfaceId] = true;
ds.supportedInterfaces[type(IERC165).interfaceId] = true; ds.supportedInterfaces[type(IDiamondCut).interfaceId] = true; ds.supportedInterfaces[type(IDiamondLoupe).interfaceId] = true; ds.supportedInterfaces[type(IERC173).interfaceId] = true;
45,634
2
// fired when an auction is either cancelled, timed out or money from purhcase withdrawn/cancelled if price == 0
event AuctionEnded(uint256 id, uint256 price);
event AuctionEnded(uint256 id, uint256 price);
30,828
13
// Whether `a` is less than `b`. a a uint256. b a FixedPoint.return True if `a < b`, or False. /
function isLessThan(uint256 a, Unsigned memory b) internal pure returns (bool) { return fromUnscaledUint(a).rawValue < b.rawValue; }
function isLessThan(uint256 a, Unsigned memory b) internal pure returns (bool) { return fromUnscaledUint(a).rawValue < b.rawValue; }
5,923
126
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
uniswapV2Router.addLiquidityETH{value: ethAmount}(
986
20
// Change min purchase value/
function setMinPurchaseValue(uint _minPurchase) isOwner
function setMinPurchaseValue(uint _minPurchase) isOwner
37,142
262
// Fraction of interest currently set aside for Fuse fees /
uint public fuseFeeMantissa;
uint public fuseFeeMantissa;
53,539
39
// Private function to execute a backwards linear search to find the most recent registered past value of ahistory based on a given point in time. It will return zero if there is no registered value or if given timeis previous to the first registered value. Note that this function will be more suitable when we already ...
function _backwardsLinearSearch(History storage self, uint64 _time) private view returns (uint256) { // If there was no value registered for the given history return simply zero uint256 length = self.history.length; if (length == 0) { return 0; } uint256 index = ...
function _backwardsLinearSearch(History storage self, uint64 _time) private view returns (uint256) { // If there was no value registered for the given history return simply zero uint256 length = self.history.length; if (length == 0) { return 0; } uint256 index = ...
19,332
2
// See {IERC1155-safeTransferFrom}. In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry. /
function safeTransferFrom( address from, address to, uint256 tokenId, uint256 amount, bytes calldata data ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, amount, data); }
function safeTransferFrom( address from, address to, uint256 tokenId, uint256 amount, bytes calldata data ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, amount, data); }
5,713
29
// Moves `amount` tokens from the caller's account to `recipient`. The transfer operation follows the DAO configuration specifiedby the ERC20_EXT_TRANSFER_TYPE property. recipient The address account that will have the units incremented. amount The amount to increment in the recipient account.return a boolean value ind...
* Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) public override reentrancyGuard(dao) returns (bool) { address senderAddr = dao.getAddressIfDelegated(msg.sender); require( isNotZeroAddress(recipient), ...
* Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) public override reentrancyGuard(dao) returns (bool) { address senderAddr = dao.getAddressIfDelegated(msg.sender); require( isNotZeroAddress(recipient), ...
1,685
169
// string memory _initNotRevealedUri
) ERC721(_name, _symbol) { setBaseURI(_initBaseURI); // setNotRevealedURI(_initNotRevealedUri); }
) ERC721(_name, _symbol) { setBaseURI(_initBaseURI); // setNotRevealedURI(_initNotRevealedUri); }
62,689
107
// Check if address was already airdroppedholder Address of token holder return true if address was airdropped/
function isAirdropped(address holder) view internal returns(bool){ return (airdropped[holder] == currentAirdrop); }
function isAirdropped(address holder) view internal returns(bool){ return (airdropped[holder] == currentAirdrop); }
18,820
80
// ERC20 token with cost basis tracking and restricted loss-taking /
contract Official_BuffDoge is Context, IERC20, Ownable, TimeLock { using SafeMath for uint256; address private constant UNISWAP_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private constant WETH = 0xc778417E063141139Fce010982780140Aa0cD5Ab; mapping (address => uint256) privat...
contract Official_BuffDoge is Context, IERC20, Ownable, TimeLock { using SafeMath for uint256; address private constant UNISWAP_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private constant WETH = 0xc778417E063141139Fce010982780140Aa0cD5Ab; mapping (address => uint256) privat...
43,437
65
// Calculate x / y rounding towards zero, where x and y are unsigned 256-bitinteger numbers.Revert on overflow or when y is zero.x unsigned 256-bit integer number y unsigned 256-bit integer numberreturn signed 64.64-bit fixed point number /
function divu(uint256 x, uint256 y) internal pure returns (int128) { require(y != 0); uint128 result = divuu(x, y); require(result <= uint128(MAX_64x64)); return int128(result); }
function divu(uint256 x, uint256 y) internal pure returns (int128) { require(y != 0); uint128 result = divuu(x, y); require(result <= uint128(MAX_64x64)); return int128(result); }
50,883
45
// don't allow the first 4 races to be removed
require(raceBaseStats.length > 4); delete raceBaseStats[raceBaseStats.length - 1];
require(raceBaseStats.length > 4); delete raceBaseStats[raceBaseStats.length - 1];
25,495
100
// Add new token gauge
function addGauge(address _token) external { require(msg.sender == governance, "!gov"); require(gauges[_token] == address(0x0), "exists"); gauges[_token] = address(new Gauge(_token)); _tokens.push(_token); }
function addGauge(address _token) external { require(msg.sender == governance, "!gov"); require(gauges[_token] == address(0x0), "exists"); gauges[_token] = address(new Gauge(_token)); _tokens.push(_token); }
10,658
41
// Get flight key/
function getFlightKey(address airline, string memory flight, uint256 timestamp) pure internal returns(bytes32) { return keccak256(abi.encodePacked(airline, flight, timestamp)); }
function getFlightKey(address airline, string memory flight, uint256 timestamp) pure internal returns(bytes32) { return keccak256(abi.encodePacked(airline, flight, timestamp)); }
26,480
1
// Presale
address public _signerAddress = 0xF6bA99F2E6ce96B74d4df667C01c5ed2EF249be2; bool public onSaleWhitelist = false; mapping(address => uint256) public mintedWL; uint256 public price = 0.03 ether; uint256 public priceWL = 0.025 ether; uint256 public maxTokensPurchase = 10;
address public _signerAddress = 0xF6bA99F2E6ce96B74d4df667C01c5ed2EF249be2; bool public onSaleWhitelist = false; mapping(address => uint256) public mintedWL; uint256 public price = 0.03 ether; uint256 public priceWL = 0.025 ether; uint256 public maxTokensPurchase = 10;
72,271
25
// Emitted when a node set to in compliant or compliant. /
event IncompliantNode(
event IncompliantNode(
78,943
18
// admin events
event BlockLockSet(uint256 _value); event NewAdmin(address _newAdmin); event NewManager(address _newManager); event NewInvestor(address _newInvestor); event RemovedInvestor(address _investor); event FundAssetsChanged( string indexed tokenSymbol, string assetInfo, uint8 am...
event BlockLockSet(uint256 _value); event NewAdmin(address _newAdmin); event NewManager(address _newManager); event NewInvestor(address _newInvestor); event RemovedInvestor(address _investor); event FundAssetsChanged( string indexed tokenSymbol, string assetInfo, uint8 am...
7,374
29
// Deposit `_value` tokens for `_addr` and lock until `_unlock_time`/_addr Create lock for address/_value Amount to deposit/_unlock_time Epoch time when tokens unlock, rounded down to whole weeks
function create_lock_for(address _addr, uint _value, uint _unlock_time) external nonReentrant onlyOwner { require(_value > 0); // dev: need non-zero value LockedBalance memory _locked = locked[_addr]; require(_locked.amount == 0, "Withdraw old tokens first"); uint unlock_time = (_u...
function create_lock_for(address _addr, uint _value, uint _unlock_time) external nonReentrant onlyOwner { require(_value > 0); // dev: need non-zero value LockedBalance memory _locked = locked[_addr]; require(_locked.amount == 0, "Withdraw old tokens first"); uint unlock_time = (_u...
35,969
768
// Transfer the ownership of the Finder to the new Governor now that all the addresses have been updated.
finder.transferOwnership(newGovernor);
finder.transferOwnership(newGovernor);
1,815
30
// solium-disable-next-line
block.timestamp ); return;
block.timestamp ); return;
2,456
22
// Adds a friend request to the requests mapping/_to To friend address/_from From friend address
function _addRequest(address _to, FriendRequest memory _from) private { requests[_to].push(_from); uint index = requests[_to].length; requestsTracker[_to][_from.sender] = index; requestsTracker[_from.sender][_to] = index; }
function _addRequest(address _to, FriendRequest memory _from) private { requests[_to].push(_from); uint index = requests[_to].length; requestsTracker[_to][_from.sender] = index; requestsTracker[_from.sender][_to] = index; }
42,982
70
// Same as {get}, with a custom error message when `key` is not in the map. CAUTION: This function is deprecated because it requires allocating memory for the errormessage unnecessarily. For custom revert reasons use {tryGet}. /
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) { return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage)))); }
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) { return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage)))); }
30,436