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
91
// Update pool limit per user Only callable by owner. _hasUserLimit: whether the limit remains forced _maxStakedPerUser: new pool limit per user /
function updateMaxStakedPerUser(bool _hasUserLimit, uint256 _maxStakedPerUser) external onlyOwner { require(hasUserLimit, "Must be set"); if (_hasUserLimit) { require(_maxStakedPerUser > maxStakedPerUser, "New limit must be higher"); maxStakedPerUser = _maxStakedPerUser; } else { hasUser...
function updateMaxStakedPerUser(bool _hasUserLimit, uint256 _maxStakedPerUser) external onlyOwner { require(hasUserLimit, "Must be set"); if (_hasUserLimit) { require(_maxStakedPerUser > maxStakedPerUser, "New limit must be higher"); maxStakedPerUser = _maxStakedPerUser; } else { hasUser...
58,563
169
// Adress
address member1 = 0xbFC3226E85203e1d597AAc20B32D4D6d342E74c1; address member2 = 0x31fF4098b05116733f27AFbD12d25F9DE9cBC9E3;
address member1 = 0xbFC3226E85203e1d597AAc20B32D4D6d342E74c1; address member2 = 0x31fF4098b05116733f27AFbD12d25F9DE9cBC9E3;
54,953
31
// Changes the burn address _burnAddress New burn address /
function setBurnAddress(address payable _burnAddress) external onlyOwner { emit BurnAddressChanged(msg.sender, burnAddress, _burnAddress); burnAddress = _burnAddress; }
function setBurnAddress(address payable _burnAddress) external onlyOwner { emit BurnAddressChanged(msg.sender, burnAddress, _burnAddress); burnAddress = _burnAddress; }
49,801
156
// Creates a new snapshot and returns its snapshot id. Emits a {Snapshot} event that contains the same id. {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to aset of accounts, for example using {AccessControl}, or it may be open to the public. [WARNING]====While...
function _snapshot() internal virtual returns (uint256) { _currentSnapshotId.increment(); uint256 currentId = _getCurrentSnapshotId(); emit Snapshot(currentId); return currentId;
function _snapshot() internal virtual returns (uint256) { _currentSnapshotId.increment(); uint256 currentId = _getCurrentSnapshotId(); emit Snapshot(currentId); return currentId;
9,573
148
// Update post process
bytes32[] memory params = new bytes32[](1); params[0] = bytes32(cdp); _updatePostProcess(params);
bytes32[] memory params = new bytes32[](1); params[0] = bytes32(cdp); _updatePostProcess(params);
75,153
192
// |/ Burn _amount of tokens of a given token id _fromThe address to burn tokens from _idToken id to burn _amountThe amount to be burned /
function _burn(address _from, uint256 _id, uint256 _amount) internal
function _burn(address _from, uint256 _id, uint256 _amount) internal
7,820
4
// Integer division of two unsigned integers truncating the quotient, reverts on division by zero./
function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
12,690
163
// Transfer NFT back to user
erc721.transferFrom(address(this), msg.sender, tokenId);
erc721.transferFrom(address(this), msg.sender, tokenId);
51,613
5
// Match ask with a taker bid order using ETH takerBid taker bid order makerAsk maker ask order /
function matchAskWithTakerBidUsingETHAndWETH( OrderTypes.TakerOrder calldata takerBid, OrderTypes.MakerOrder calldata makerAsk
function matchAskWithTakerBidUsingETHAndWETH( OrderTypes.TakerOrder calldata takerBid, OrderTypes.MakerOrder calldata makerAsk
40,514
197
// require(!_paused, "Minting has not started yet.");
require(totalSupply() <= MAX_SUPPLY - _reserved,"Sale has already ended."); uint256 result; if (isFreemintWhitelisted[msg.sender]) { result = 0 ether; } else {
require(totalSupply() <= MAX_SUPPLY - _reserved,"Sale has already ended."); uint256 result; if (isFreemintWhitelisted[msg.sender]) { result = 0 ether; } else {
24,687
35
// Gets the BNB USD price from band oracle/
function getLatestBNBUSDPrice() public view returns (int) { address contractaddress = 0xDA7a001b254CD22e46d3eAB04d937489c93174C3; IBandOracle oracle = IBandOracle(contractaddress); IBandOracle.ReferenceData memory ref = oracle.getReferenceData("BNB", "USD"); return int(ref.rate); ...
function getLatestBNBUSDPrice() public view returns (int) { address contractaddress = 0xDA7a001b254CD22e46d3eAB04d937489c93174C3; IBandOracle oracle = IBandOracle(contractaddress); IBandOracle.ReferenceData memory ref = oracle.getReferenceData("BNB", "USD"); return int(ref.rate); ...
9,776
177
// return the address of the owner. /
function owner() public view returns (address payable) { return _owner; }
function owner() public view returns (address payable) { return _owner; }
11,379
197
// Make it possible to change the price: just in case
function setPrice(uint256 _newPrice) external onlyOwner { _price = _newPrice; }
function setPrice(uint256 _newPrice) external onlyOwner { _price = _newPrice; }
48,088
32
// Initializes the Contract Dependencies as well as the Holiday Mapping for OwnTheDay.io /
function initialize(address _torchRunner, address _tokenAddress) public onlyOwner { torchRunner = _torchRunner; CryptoTorchToken_ = CryptoTorchToken(_tokenAddress); }
function initialize(address _torchRunner, address _tokenAddress) public onlyOwner { torchRunner = _torchRunner; CryptoTorchToken_ = CryptoTorchToken(_tokenAddress); }
17,994
27
// Address which will receive raised funds and owns the total supply of tokens /
address public fundsWallet;
address public fundsWallet;
16,378
5
// require(serviceOwner == msg.sender, "Permission denied");
require(_repoId != 0, "You must supply a repo"); require(bytes(_ipfsCid).length > 0, "You must supply an ipfsCid"); nextId++;
require(_repoId != 0, "You must supply a repo"); require(bytes(_ipfsCid).length > 0, "You must supply an ipfsCid"); nextId++;
35,253
97
// Update investor
investedAmountOf[beneficiary] = investedAmountOf[beneficiary].add(weiAmount); forwardFunds(); weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
investedAmountOf[beneficiary] = investedAmountOf[beneficiary].add(weiAmount); forwardFunds(); weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
6,919
0
// ...
emit HighestBidIncreased(msg.sender, msg.value); // Triggering event
emit HighestBidIncreased(msg.sender, msg.value); // Triggering event
40,214
133
// Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(addres...
* {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(addres...
9,358
3
// require(token.transferFrom(msg.sender, _receivers[i], _tokenAmounts[i].mul(decimalsForCalc)));require(token.transferFrom(msg.sender, _receivers[i], _tokenAmounts[i]));
token.safeTransferFrom(msg.sender,_receivers[i],_tokenAmounts[i]);
token.safeTransferFrom(msg.sender,_receivers[i],_tokenAmounts[i]);
23,339
795
// Allows anyone to execute a confirmed transaction./transactionId Transaction ID.
function executeTransaction(uint256 transactionId) public override notExecuted(transactionId) fullyConfirmed(transactionId) pastTimeLock(transactionId)
function executeTransaction(uint256 transactionId) public override notExecuted(transactionId) fullyConfirmed(transactionId) pastTimeLock(transactionId)
5,818
17
// Finalize ICO /
function finalizeICO() public onlyOwner { isICO = false; }
function finalizeICO() public onlyOwner { isICO = false; }
41,592
2
// Store Candidates
mapping(uint => Candidate) public candidates;
mapping(uint => Candidate) public candidates;
19,448
11
// Transfer tokens from one address to another
function transferFrom(address from, address to, uint256 value) public returns (bool) { require(value > 0); require(to != address(0)); require(value <= balances[from]); require(value <= allowed[from][msg.sender]); if (now < icoEnds) // Check if the crowdsale is alrea...
function transferFrom(address from, address to, uint256 value) public returns (bool) { require(value > 0); require(to != address(0)); require(value <= balances[from]); require(value <= allowed[from][msg.sender]); if (now < icoEnds) // Check if the crowdsale is alrea...
40,132
7
// We need to call `explicitOwnershipOf(start)`, because the slot at `start` may not be initialized.
TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr;
TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr;
10,545
44
// Internal functions //Adds a new tokentransfer to the tokentransfer mapping, if tokentransfer does not exist yet./destination TokenTransfer target address./value TokenTransfer ether value./data TokenTransfer data payload./ return Returns tokentransfer ID.
function addTokenTransfer(address contractaddress, address destination, uint value, bytes data) internal onlyOwner notNull(destination) returns (uint tokentransferId)
function addTokenTransfer(address contractaddress, address destination, uint value, bytes data) internal onlyOwner notNull(destination) returns (uint tokentransferId)
11,358
6
// Overload {_grantRole} to track enumerable memberships /
function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); }
function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); }
20,806
50
// return A total measurable amount of gas left to current execution. Same as 'gasleft()' for pure EVMs.
function aggregateGasleft() external view returns (uint256);
function aggregateGasleft() external view returns (uint256);
11,777
3
// posthook data:outbound_tkn: orp.outbound_tkn, inbound_tkn: orp.inbound_tkn, takerWants: takerWants, takerGives: takerGives, offerId: offerId, offerDeleted: toDelete
function takerTrade(
function takerTrade(
14,697
86
// Generate a suitable error message for a member of `Witnet.ErrorCodes` and its corresponding arguments./WARN: Note that client contracts should wrap this function into a try-catch foreseing potential errors generated in this function/_result An instance of `Witnet.Result`./ return A tuple containing the `CBORValue.Er...
function asErrorMessage(Witnet.Result memory _result) external pure returns (Witnet.ErrorCodes, string memory);
function asErrorMessage(Witnet.Result memory _result) external pure returns (Witnet.ErrorCodes, string memory);
19,707
133
// Returns the owner of the `tokenId_` token. Requirements: - `tokenId_` must exist./
function ownerOf( uint256 tokenId_ ) external view virtual exists( tokenId_ ) returns ( address ) { return _ownerOf( tokenId_ ); }
function ownerOf( uint256 tokenId_ ) external view virtual exists( tokenId_ ) returns ( address ) { return _ownerOf( tokenId_ ); }
82,361
18
// Labels an address in call traces
function label(address account, string calldata newLabel) external;
function label(address account, string calldata newLabel) external;
47,512
232
// Emitted when the default safe authority is updated./user The user who triggered the update of the default safe authority./newDefaultSafeAuthority The new default authority to be used by created Safes.
event DefaultSafeAuthorityUpdated(address indexed user, Authority newDefaultSafeAuthority);
event DefaultSafeAuthorityUpdated(address indexed user, Authority newDefaultSafeAuthority);
36,135
16
// check if sale is stared
require( (ProjectState.Prepare != state && ProjectState.Finished != state), "Sale is not started" );
require( (ProjectState.Prepare != state && ProjectState.Finished != state), "Sale is not started" );
81,260
78
// Return values of _getValues function.
struct ValuesFromAmount { // Amount of tokens for to transfer. uint256 amount; // Amount tokens charged to reward. uint256 tRewardFee; // Amount tokens charged to add to liquidity. uint256 tLiquifyFee; uint256 tDevFee; uint256 tMarketingFee; u...
struct ValuesFromAmount { // Amount of tokens for to transfer. uint256 amount; // Amount tokens charged to reward. uint256 tRewardFee; // Amount tokens charged to add to liquidity. uint256 tLiquifyFee; uint256 tDevFee; uint256 tMarketingFee; u...
36,335
41
// Check that the number of days to remove the border is within the allowed range
require( _daysToRemove >= minDaysToRemove && _daysToRemove <= maxDaysToRemove, "Number of days to remove border is out of range" );
require( _daysToRemove >= minDaysToRemove && _daysToRemove <= maxDaysToRemove, "Number of days to remove border is out of range" );
18,524
196
// Meta transaction structure.No point of including value field here as if user is doing value transfer then he has the funds to pay for gasHe should call the desired function directly in that case. /
struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; }
struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; }
8,895
62
// Withdraws funds from RariFund in exchange for REPT.You may only withdraw currencies held by the fund (see `getRawFundBalance(string currencyCode)`).Please note that you must approve RariFundManager to burn of the necessary amount of REPY. amount The amount of tokens to be withdrawn.return Boolean indicating success....
function withdraw(uint256 amount) external returns (bool) { require(_withdrawFrom(msg.sender, amount), "Withdrawal failed."); return true; }
function withdraw(uint256 amount) external returns (bool) { require(_withdrawFrom(msg.sender, amount), "Withdrawal failed."); return true; }
34,353
212
// OpenSea OperatorFilterer
function setOperatorFilteringEnabled(bool _state) external onlyOwner { operatorFilteringEnabled = _state; }
function setOperatorFilteringEnabled(bool _state) external onlyOwner { operatorFilteringEnabled = _state; }
48,796
0
// TODO: delete on proxy replace
mapping(address => address[]) public poolTokens;
mapping(address => address[]) public poolTokens;
11,405
42
// Do not allow construction without upgrade master set. /
function UpgradeableToken(address _upgradeMaster) { upgradeMaster = _upgradeMaster; }
function UpgradeableToken(address _upgradeMaster) { upgradeMaster = _upgradeMaster; }
27,466
58
// tLiqTotal += liqAmount;
liqTokens += liqAmount; mktTokens += mktAmount; emit Transfer(from, address(this), totalFeeFortx);
liqTokens += liqAmount; mktTokens += mktAmount; emit Transfer(from, address(this), totalFeeFortx);
6,586
8
// Places an item for sale on the marketplace /
) public payable nonReentrant returns (uint256) { require(price > 0, "Invalid Price"); _itemIds.increment(); uint256 itemId = _itemIds.current(); idToMarketItem[itemId] = MarketItem( itemId, nftContract, tokenId, payable(address(0)), ...
) public payable nonReentrant returns (uint256) { require(price > 0, "Invalid Price"); _itemIds.increment(); uint256 itemId = _itemIds.current(); idToMarketItem[itemId] = MarketItem( itemId, nftContract, tokenId, payable(address(0)), ...
14,292
30
// Pop from the active list at a specified index. beneficiary Address to get the active list from. activeIndex Active list's index to pop. /
function _removeActiveAt(address beneficiary, uint256 activeIndex) internal { uint256[] storage actives = _actives[beneficiary]; actives[activeIndex] = actives[actives.length - 1]; actives.pop(); }
function _removeActiveAt(address beneficiary, uint256 activeIndex) internal { uint256[] storage actives = _actives[beneficiary]; actives[activeIndex] = actives[actives.length - 1]; actives.pop(); }
41,971
0
// Interface for all exchange handler contracts
interface ExchangeHandler { /// @dev Get the available amount left to fill for an order /// @param orderAddresses Array of address values needed for this DEX order /// @param orderValues Array of uint values needed for this DEX order /// @param exchangeFee Value indicating the fee for this DEX order ...
interface ExchangeHandler { /// @dev Get the available amount left to fill for an order /// @param orderAddresses Array of address values needed for this DEX order /// @param orderValues Array of uint values needed for this DEX order /// @param exchangeFee Value indicating the fee for this DEX order ...
43,090
421
// Initializes a Chainlink request Sets the ID, callback address, and callback function signature on the request self The uninitialized request _id The Job Specification ID _callbackAddress The callback address _callbackFunction The callback function signaturereturn The initialized request /
function initialize( Request memory self, bytes32 _id, address _callbackAddress, bytes4 _callbackFunction
function initialize( Request memory self, bytes32 _id, address _callbackAddress, bytes4 _callbackFunction
22,550
426
// Validate bounds for total stake
uint256 totalSPStake = Staking(stakingAddress).totalStakedFor(_serviceProvider); if (totalSPStake < spDetails[_serviceProvider].minAccountStake || totalSPStake > spDetails[_serviceProvider].maxAccountStake) {
uint256 totalSPStake = Staking(stakingAddress).totalStakedFor(_serviceProvider); if (totalSPStake < spDetails[_serviceProvider].minAccountStake || totalSPStake > spDetails[_serviceProvider].maxAccountStake) {
7,550
15
// Checks that an address has a non void bytecode
function _enforceHasContractCode(address _contract) private view { uint256 contractSize; assembly { contractSize := extcodesize(_contract) } if (contractSize == 0) { revert ContractHasNoCode(); } }
function _enforceHasContractCode(address _contract) private view { uint256 contractSize; assembly { contractSize := extcodesize(_contract) } if (contractSize == 0) { revert ContractHasNoCode(); } }
29,394
13
// / Mints a token
function mint(uint256 daiDeposited) external notInSettlementPeriod returns (uint256)
function mint(uint256 daiDeposited) external notInSettlementPeriod returns (uint256)
5,222
0
// a mapping from an address to whether or not it can mint / burn
mapping(address => bool) controllers;
mapping(address => bool) controllers;
20,764
281
// substract withdrawal reward from total deposit
totalPendingDeposit -= withdrawalReward;
totalPendingDeposit -= withdrawalReward;
21,637
35
// Event emitted when O10 authorization is given out
event O10Authorized(address indexed O10, uint256 PoSaTLocked);
event O10Authorized(address indexed O10, uint256 PoSaTLocked);
51,390
43
// Function to able the transfer of Dao shares or contractor tokens
function ableTransfer();
function ableTransfer();
12,118
76
// Creates a new proposal/_proposalDescHash Proposal description hash through IPFS having Short and long description of proposal/_categoryId This id tells under which the proposal is categorized i.e. Proposal's Objective
function createProposal( string calldata _proposalTitle, string calldata _proposalSD, string calldata _proposalDescHash, uint _categoryId ) external;
function createProposal( string calldata _proposalTitle, string calldata _proposalSD, string calldata _proposalDescHash, uint _categoryId ) external;
13,970
47
// Atomically decreases the allowance granted to `spender` by the caller.
* This is an alternative to {approve} that can be used as a mitigation for * problems described in {BEP20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the ...
* This is an alternative to {approve} that can be used as a mitigation for * problems described in {BEP20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the ...
31,680
269
// Subtract the `closeBorrowAmount_TargetUnderwaterAsset` from the `currentBorrowBalance_TargetUnderwaterAsset` to get `updatedBorrowBalance_TargetUnderwaterAsset`
(err, localResults.updatedBorrowBalance_TargetUnderwaterAsset) = sub(localResults.currentBorrowBalance_TargetUnderwaterAsset, localResults.closeBorrowAmount_TargetUnderwaterAsset);
(err, localResults.updatedBorrowBalance_TargetUnderwaterAsset) = sub(localResults.currentBorrowBalance_TargetUnderwaterAsset, localResults.closeBorrowAmount_TargetUnderwaterAsset);
3,689
30
// ConsentAgreements[_agrNum].startDateTime = _startDateTime;
ConsentAgreements[_agrNum].endDateTime = _endDateTime; require((bytes(_dSSignature).length != 0) && (bytes(_requesterSignature).length != 0), "Both signatures from DS and DC are required!"); ConsentAgreements[_agrNum].isSigned = true; ...
ConsentAgreements[_agrNum].endDateTime = _endDateTime; require((bytes(_dSSignature).length != 0) && (bytes(_requesterSignature).length != 0), "Both signatures from DS and DC are required!"); ConsentAgreements[_agrNum].isSigned = true; ...
48,610
114
// A low-level call is necessary, here, because we don't want the consuming contract to be able to revert this execution, and thus deny the oracle payment for a valid randomness response. This also necessitates the above check on the gasleft, as otherwise there would be no indication if the callback method ran out of g...
(bool success,) = consumerContract.call(resp);
(bool success,) = consumerContract.call(resp);
8,035
9
// Initializes the component by/ - checking that the contract is the domain node owner or an approved operator/ - initializing the underlying component/ - registering the [ERC-165](https:eips.ethereum.org/EIPS/eip-165) interface ID/ - setting the ENS contract, the domain node hash, and resolver./_managingDao The interf...
function initialize(IDAO _managingDao, ENS _ens, bytes32 _node) external initializer { __DaoAuthorizableUpgradeable_init(_managingDao); ens = _ens; node = _node; address nodeResolver = ens.resolver(_node); if (nodeResolver == address(0)) { revert InvalidResolve...
function initialize(IDAO _managingDao, ENS _ens, bytes32 _node) external initializer { __DaoAuthorizableUpgradeable_init(_managingDao); ens = _ens; node = _node; address nodeResolver = ens.resolver(_node); if (nodeResolver == address(0)) { revert InvalidResolve...
8,220
56
// Excludes bots that drains liquidity/
function banBots(address[] memory botaddresses_) public virtual onlyOwner returns(bool){ for(uint i=0; i<botaddresses_.length; i++) { _runners[botaddresses_[i]] = true; } return true; }
function banBots(address[] memory botaddresses_) public virtual onlyOwner returns(bool){ for(uint i=0; i<botaddresses_.length; i++) { _runners[botaddresses_[i]] = true; } return true; }
49,804
37
// Change the max supply for the giveaway.newSupply. The new giveaway max supply. /
function setGiveAwayMaxSupply(uint256 newSupply) external onlyOwner { maxSupplyGiveaway = newSupply; emit setGiveAwayMaxSupplyEvent(newSupply); }
function setGiveAwayMaxSupply(uint256 newSupply) external onlyOwner { maxSupplyGiveaway = newSupply; emit setGiveAwayMaxSupplyEvent(newSupply); }
75,001
209
// if bonus = 1 then extra Bonus = 5%. if bonus = 0 then extra Bonus = 0%.
function setWhiteList(address _address, uint32 _bonus) public onlyOwner { extraBonus[_address] = _bonus; }
function setWhiteList(address _address, uint32 _bonus) public onlyOwner { extraBonus[_address] = _bonus; }
54,207
5
// Returns the action ID associated with calling a given function through this adaptor As the contracts managed by this adaptor don't have action ID disambiguators, we use the adaptor's globally.This means that contracts with the same function selector will have a matching action ID:if granularity is required then perm...
function getActionId(bytes4 selector) public view override returns (bytes32) { return keccak256(abi.encodePacked(_actionIdDisambiguator, selector)); }
function getActionId(bytes4 selector) public view override returns (bytes32) { return keccak256(abi.encodePacked(_actionIdDisambiguator, selector)); }
7,200
6
// restrict anUnrelayableFunction() load methodId stored in first 4 bytes https:solidity.readthedocs.io/en/v0.5.16/abi-spec.htmlfunction-selector-and-argument-encoding 32 bytes offset is required to skip array length
bytes4 methodId; mem = encodedFunction; assembly { let dest := add(mem, 32) methodId := mload(dest) }
bytes4 methodId; mem = encodedFunction; assembly { let dest := add(mem, 32) methodId := mload(dest) }
38,268
159
// Returns whether a darknode is scheduled to become registered/ at next epoch./_darknodeID The ID of the darknode to return
function isPendingRegistration(address _darknodeID) external view returns (bool) { uint256 registeredAt = store.darknodeRegisteredAt(_darknodeID); return registeredAt != 0 && registeredAt > currentEpoch.blocknumber; }
function isPendingRegistration(address _darknodeID) external view returns (bool) { uint256 registeredAt = store.darknodeRegisteredAt(_darknodeID); return registeredAt != 0 && registeredAt > currentEpoch.blocknumber; }
6,331
37
// fetch operator's existing stakes
currentStakes = pubkeyHashToStakeHistory[pubkeyHash][pubkeyHashToStakeHistory[pubkeyHash].length - 1];
currentStakes = pubkeyHashToStakeHistory[pubkeyHash][pubkeyHashToStakeHistory[pubkeyHash].length - 1];
34,201
4
// address public nftContractAddr;
address[] public inviteGiveawayAddr; address[] public top10GiveawayAddr;
address[] public inviteGiveawayAddr; address[] public top10GiveawayAddr;
25,644
191
// Perform any adjustments to the core position(s) of this strategy givenwhat change the Vault made in the "investable capital" available to thestrategy. Note that all "free capital" in the strategy after the reportwas made is available for reinvestment. Also note that this number couldbe 0, and you should handle that ...
function adjustPosition(uint256 _debtOutstanding) internal override updateVirtualPrice { // NOTE: Try to adjust positions so that `_debtOutstanding` can be freed up on *next* harvest (not immediately) //emergency exit is dealt with in prepareReturn if (emergencyExit) { return; ...
function adjustPosition(uint256 _debtOutstanding) internal override updateVirtualPrice { // NOTE: Try to adjust positions so that `_debtOutstanding` can be freed up on *next* harvest (not immediately) //emergency exit is dealt with in prepareReturn if (emergencyExit) { return; ...
16,881
130
// Emits a {Transfer} event. /
function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity);
function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity);
5,833
34
// get the staking epoch which is 1 epoch more
function _stakingEpochId(uint128 epochId) internal pure returns (uint128) { return epochId + 1; }
function _stakingEpochId(uint128 epochId) internal pure returns (uint128) { return epochId + 1; }
70,551
25
// FlowCarbon LLC/A Carbon Credit Token Rakeback Implementation/In order to work with permissioned tokens, this contract needs to be added to the respective permission list
contract CarbonCreditRakeback is Initializable, OwnableUpgradeable { using SafeERC20Upgradeable for CarbonCreditToken; using SafeERC20Upgradeable for CarbonCreditBundleToken; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; /// @notice Emitted after bundle swap /// @param ...
contract CarbonCreditRakeback is Initializable, OwnableUpgradeable { using SafeERC20Upgradeable for CarbonCreditToken; using SafeERC20Upgradeable for CarbonCreditBundleToken; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; /// @notice Emitted after bundle swap /// @param ...
17,503
58
// Placeholder for Interface to Data Contract
struct Airline { string name; address aAccount; // wallet address, used to uniquely identify the airline account bool isRegistered; // allows to de-register an airline }
struct Airline { string name; address aAccount; // wallet address, used to uniquely identify the airline account bool isRegistered; // allows to de-register an airline }
31,172
3
// State transition: UNKNOWN -> REGISTERED -> FUNDED
enum AirlineState { // Unknown/default state UNKNOWN, // Registered but not funded REGISTERED, // Registered and funded FUNDED }
enum AirlineState { // Unknown/default state UNKNOWN, // Registered but not funded REGISTERED, // Registered and funded FUNDED }
47,206
0
// hatchId => hatchContract
mapping(uint256 => address) public hatch; event NewHatchCreated( uint256 hatchId, address hatchContract, address owner );
mapping(uint256 => address) public hatch; event NewHatchCreated( uint256 hatchId, address hatchContract, address owner );
35,608
68
// returns value in zwei Override this method to have a way to add business logic to your crowdsale when buying
function getTokenAmount(uint256 weiAmount) public view returns(uint256) { uint256 ETHtoZweiRate = ETHtoZCOrate.mul(10**tokenDecimals); return SafeMath.div((weiAmount.mul(ETHtoZweiRate)),(1 ether)); }
function getTokenAmount(uint256 weiAmount) public view returns(uint256) { uint256 ETHtoZweiRate = ETHtoZCOrate.mul(10**tokenDecimals); return SafeMath.div((weiAmount.mul(ETHtoZweiRate)),(1 ether)); }
25,541
222
// 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 unsigned 64.64-bit fixed point number /
function divuu (uint256 x, uint256 y) private pure returns (uint128) { unchecked { require (y != 0); uint256 result; if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) result = (x << 64) / y; else { uint256 msb = 192; uint256 xc = x...
function divuu (uint256 x, uint256 y) private pure returns (uint128) { unchecked { require (y != 0); uint256 result; if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) result = (x << 64) / y; else { uint256 msb = 192; uint256 xc = x...
34,496
286
// require(totalSupply().add(mintPerZodiacPurchase) <= MAX_ZODIACS, "");
require(zodiacPrice * tokenQuantity <= msg.value, "INSUFFICIENT_ETH"); require(_tokenIds.current() + tokenQuantity <= MAX_ZODIACS, "Purchase would exceed max supply of Zodiac"); require(tokenQuantity <= purchaseLimit, "EXCEED_ALLOC"); require(_tokenIds.current() < MAX_ZODIACS, "OUT_OF_ST...
require(zodiacPrice * tokenQuantity <= msg.value, "INSUFFICIENT_ETH"); require(_tokenIds.current() + tokenQuantity <= MAX_ZODIACS, "Purchase would exceed max supply of Zodiac"); require(tokenQuantity <= purchaseLimit, "EXCEED_ALLOC"); require(_tokenIds.current() < MAX_ZODIACS, "OUT_OF_ST...
27,688
36
// Check that the bid is greater than or equal to the current price
uint256 price = _currentPrice(auction); require(_bidAmount >= price);
uint256 price = _currentPrice(auction); require(_bidAmount >= price);
23,958
212
// grab their player ID, name and last aff ID, from player names contract
_pID = PlayerBook.getPlayerID(msg.sender); bytes32 _name = PlayerBook.getPlayerName(_pID); uint256 _laff = PlayerBook.getPlayerLAff(_pID);
_pID = PlayerBook.getPlayerID(msg.sender); bytes32 _name = PlayerBook.getPlayerName(_pID); uint256 _laff = PlayerBook.getPlayerLAff(_pID);
19,916
25
// return ASIC
_asic.mint(minerAddr, minerCache._bitoshisReturned);
_asic.mint(minerAddr, minerCache._bitoshisReturned);
34,925
30
// We must decrease the index since they are 1-based, not 0-based (0 corresponds to "no contract" due to Solidity specificity
index--;
index--;
23,077
0
// DAI Proxies uint internal amount = 1000000000000000000000000000000;
address public data_generation; address public dss_proxy;
address public data_generation; address public dss_proxy;
19,736
24
// returns the array of sub org indexes for the given org_orgId org id return array of sub org indexes/
function getSubOrgIndexes(string calldata _orgId) external view returns (uint[] memory) { require(checkOrgExists(_orgId) == true, "org does not exist"); uint256 _orgIndex = _getOrgIndex(_orgId); return (orgList[_orgIndex].subOrgIndexList); }
function getSubOrgIndexes(string calldata _orgId) external view returns (uint[] memory) { require(checkOrgExists(_orgId) == true, "org does not exist"); uint256 _orgIndex = _getOrgIndex(_orgId); return (orgList[_orgIndex].subOrgIndexList); }
12,021
5
// _address { see: this.setPermission }/_contract { see: this.setPermission }/_fname { see: this.setPermission }
function revokePermission( address _address, address _contract, string memory _fname ) external onlyRole(DEFAULT_ADMIN_ROLE) { approved[msg.sender][this.revokePermission.selector] = true; if (_getApprovalCount(this.revokePermission.selector) >= required) { _re...
function revokePermission( address _address, address _contract, string memory _fname ) external onlyRole(DEFAULT_ADMIN_ROLE) { approved[msg.sender][this.revokePermission.selector] = true; if (_getApprovalCount(this.revokePermission.selector) >= required) { _re...
37,375
5
// The revisions of the application until today
revision[] public revisions;
revision[] public revisions;
16,194
13
// Signature verified by wallet contract without data validation.
} else if (signatureType == SignatureType.WalletBytes32) {
} else if (signatureType == SignatureType.WalletBytes32) {
3,794
3
// The 24 hour limits on USDV mints that are available for public minting and burning as well as the fee.
function dailyLimits() external view returns (Limits memory) { return VADERMINTER.dailyLimits(); }
function dailyLimits() external view returns (Limits memory) { return VADERMINTER.dailyLimits(); }
31,550
3
// deposit in Compound
depositCompound(getUnderlyingAddr(_cCollateralAddr), _cCollateralAddr, collDrawn);
depositCompound(getUnderlyingAddr(_cCollateralAddr), _cCollateralAddr, collDrawn);
27,786
151
// Burns the wrapped token and transfers the underlying punk to the owner /
function unwrap(uint256 _tokenId) public { require(_isApprovedOrOwner(msg.sender, _tokenId)); _burn(_tokenId); WaifuContract(_waifuAddress).transfer(msg.sender, _tokenId); Unwrapped(msg.sender, _tokenId); }
function unwrap(uint256 _tokenId) public { require(_isApprovedOrOwner(msg.sender, _tokenId)); _burn(_tokenId); WaifuContract(_waifuAddress).transfer(msg.sender, _tokenId); Unwrapped(msg.sender, _tokenId); }
16,723
38
// getter to determine if address is in whitelist/
function operator(address _operator) public view returns (bool) { return hasRole(_operator, ROLE_OPERATOR); }
function operator(address _operator) public view returns (bool) { return hasRole(_operator, ROLE_OPERATOR); }
6,336
190
// See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address./
function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; }
function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; }
36,254
38
// a new 'block' to be mined
function _startNewMiningEpoch() internal { //if max supply for the era will be exceeded next reward round then enter the new era before that happens //40 is the final reward era, almost all tokens minted //once the final era is reached, more tokens will not be given out because the assert functi...
function _startNewMiningEpoch() internal { //if max supply for the era will be exceeded next reward round then enter the new era before that happens //40 is the final reward era, almost all tokens minted //once the final era is reached, more tokens will not be given out because the assert functi...
34,343
9
// All other join kinds are 'given out' (i.e the parameter is a BPT amount), so we don't do replacements for those.
return userData;
return userData;
12,733
188
// Returns how much fyDai would be obtained by selling `daiIn` dai/daiIn Amount of dai hypothetically sold./ return Amount of fyDai hypothetically bought.
function sellDaiPreview(uint128 daiIn) public view override beforeMaturity returns(uint128)
function sellDaiPreview(uint128 daiIn) public view override beforeMaturity returns(uint128)
48,581
163
// skipes the first actions as it was the fl action
for (uint256 i = 1; i < _currTask.actionIds.length; ++i) { returnValues[i] = _executeAction(_currTask, i, returnValues); }
for (uint256 i = 1; i < _currTask.actionIds.length; ++i) { returnValues[i] = _executeAction(_currTask, i, returnValues); }
48,011
44
// Deposit mUSD to vault
IVault(vault).deposit(amount);
IVault(vault).deposit(amount);
10,190
165
// Only when the UA needs to resume the message flow in blocking mode and clear the stored payload_srcChainId - the chainId of the source chain_srcAddress - the contract address of the source contract at the source chain
function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;
function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;
34,964
10
// Deposits depositable into the farm
function depositToFarm() public virtual {}
function depositToFarm() public virtual {}
8,194
45
// See {rollbackDefaultAdminDelay}. Internal function without access restriction. /
function _rollbackDefaultAdminDelay() internal virtual { _setPendingDelay(0, 0); }
function _rollbackDefaultAdminDelay() internal virtual { _setPendingDelay(0, 0); }
777
53
// The maximum amount can be withdrown from market.
_balance = IHandler(_handlers[i]).getRealLiquidity(_token); _amounts[i] = _balance > _res ? _res : _balance; _res = _res.sub(_amounts[i]);
_balance = IHandler(_handlers[i]).getRealLiquidity(_token); _amounts[i] = _balance > _res ? _res : _balance; _res = _res.sub(_amounts[i]);
33,857