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
136
// Returns the full token config struct tokenID String input of the token ID for the token chainID Chain ID of which token address + config to get /
function getToken(string memory tokenID, uint256 chainID) public view returns (Token memory token)
function getToken(string memory tokenID, uint256 chainID) public view returns (Token memory token)
24,604
195
// If the seller is the scrapyard, track price information.
if (seller == address(nftContract)) { lastScrapPrices[scrapCounter] = price; if (scrapCounter == LAST_CONSIDERED - 1) { scrapCounter = 0; } else {
if (seller == address(nftContract)) { lastScrapPrices[scrapCounter] = price; if (scrapCounter == LAST_CONSIDERED - 1) { scrapCounter = 0; } else {
38,224
107
// Emitted when the protocol fee is updated.//protocolFee The updated protocol fee.
event ProtocolFeeUpdated(uint256 protocolFee);
event ProtocolFeeUpdated(uint256 protocolFee);
39,820
43
// Initiates a withdrawal request for the underlying MATIC of an amount of TruMATIC shares from the vault./_shares The amount of TruMATIC shares to redeem and burn./_receiver The address to receive the underlying MATIC (must be caller to avoid reversion)./_user The address whose shares are to be burned (must be caller ...
function redeem( uint256 _shares, address _receiver, address _user
function redeem( uint256 _shares, address _receiver, address _user
13,316
26
// Hash Transfer Information and store in tree
bytes32 transferDataHash = sha256(abi.encodePacked( data.tokenAddress, data.destination, data.amount, data.fee, data.startTime, data.feeRampup, data.chain )); bytes32 node = sha256(abi.encodePacked(
bytes32 transferDataHash = sha256(abi.encodePacked( data.tokenAddress, data.destination, data.amount, data.fee, data.startTime, data.feeRampup, data.chain )); bytes32 node = sha256(abi.encodePacked(
31,185
22
// Constructor Function/
6,329
575
// Reads the bytes9 at `rdPtr` in returndata.
function readBytes9( ReturndataPointer rdPtr
function readBytes9( ReturndataPointer rdPtr
23,624
108
// Get the updated Element Merkle Root, given bytes32 append elements in calldata and an Append Proof
function get_new_root_from_append_proof_multi_append_c(bytes32[] calldata append_elements, bytes32[] memory proof) internal pure returns (bytes32)
function get_new_root_from_append_proof_multi_append_c(bytes32[] calldata append_elements, bytes32[] memory proof) internal pure returns (bytes32)
14,213
10
// Check if the loan is overdue
int256 loanStatus = checkLoanStatus(msg.sender); if (loanStatus == 0) { terminateLoan(msg.sender);
int256 loanStatus = checkLoanStatus(msg.sender); if (loanStatus == 0) { terminateLoan(msg.sender);
9,386
12
// Allowed users are able to remove allowed user/owner is always allowed even if someone tries to remove it from allowed mapping/_user Address of allowed user
function removeAllowed(address _user) public onlyAllowed { allowed[_user] = false; }
function removeAllowed(address _user) public onlyAllowed { allowed[_user] = false; }
11,548
70
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, andthen delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId];
uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId];
82,309
55
// Any DYP holder with a minimum required DYP balance may initiate a proposal with the TEXT_PROPOSAL action for a given staking pool
function proposeText(string memory text) external noContractsAllowed { require(Token(TRUSTED_TOKEN_ADDRESS).balanceOf(msg.sender) >= MIN_BALANCE_TO_INIT_PROPOSAL, "Insufficient Governance Token Balance"); lastIndex = lastIndex.add(1); proposalStartTime[lastIndex] = now; actions[lastI...
function proposeText(string memory text) external noContractsAllowed { require(Token(TRUSTED_TOKEN_ADDRESS).balanceOf(msg.sender) >= MIN_BALANCE_TO_INIT_PROPOSAL, "Insufficient Governance Token Balance"); lastIndex = lastIndex.add(1); proposalStartTime[lastIndex] = now; actions[lastI...
38,318
87
// The TWAP's calculation period.
uint public period = 1 hours;
uint public period = 1 hours;
38,043
36
// Transfer bid share to owner of media
token.safeTransfer( IERC721(mediaContract).ownerOf(tokenId), splitShare(bidShares.owner, bid.amount) );
token.safeTransfer( IERC721(mediaContract).ownerOf(tokenId), splitShare(bidShares.owner, bid.amount) );
42,553
24
// Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender. _spender The address which will spend the funds. _value The amount of tokens to be spent. /
function approve(address _spender, uint _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // ...
function approve(address _spender, uint _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // ...
25,200
7
// note AZTEC confidential note being destroyedsignature ECDSA signature from note ownerchallenge AZTEC zero-knowledge proof challengedomainHashT Temporary holding ```domainHash``` (to minimizeof sload ops)/
function validateInputNote(bytes32[6] note, bytes32[3] signature, uint challenge, bytes32 domainHashT) internal { bytes32 noteHash; bytes32 signatureMessage; assembly { let m := mload(0x40) mstore(m, mload(add(note, 0x40))) mstore(add(m, 0x20), mload(add(n...
function validateInputNote(bytes32[6] note, bytes32[3] signature, uint challenge, bytes32 domainHashT) internal { bytes32 noteHash; bytes32 signatureMessage; assembly { let m := mload(0x40) mstore(m, mload(add(note, 0x40))) mstore(add(m, 0x20), mload(add(n...
31,162
28
// Convert a `uint` value to a `string`via OraclizeAPI - MIT licence _i the `uint` value to be convertedreturn result the `string` representation of the given `uint` value /
function uintToStr(uint _i) internal pure
function uintToStr(uint _i) internal pure
9,068
438
// non-zero burn value check
require(_value != 0, "zero value burn");
require(_value != 0, "zero value burn");
7,137
82
// transfer output tokens to rollup contract
transferTokensAsync(address(bridgeContract), outputAssetA, outputValueA, inputs.interactionNonce); transferTokensAsync(address(bridgeContract), outputAssetB, outputValueB, inputs.interactionNonce);
transferTokensAsync(address(bridgeContract), outputAssetA, outputValueA, inputs.interactionNonce); transferTokensAsync(address(bridgeContract), outputAssetB, outputValueB, inputs.interactionNonce);
14,657
163
// View how much the Vault would increase this Strategy's borrow limit,based on its present performance (since its last report). Can be used todetermine expectedReturn in your Strategy. /
function creditAvailable() external view returns (uint256);
function creditAvailable() external view returns (uint256);
5,000
7
// The last bettor that turned on or extended the timer. /
address public fomoWinner;
address public fomoWinner;
30,092
23
// Retrieves the stored address of the oracle contractreturn The address of the oracle contract /
function chainlinkOracleAddress() internal view returns (address) { return address(s_oracle); }
function chainlinkOracleAddress() internal view returns (address) { return address(s_oracle); }
15,206
72
// Complete the transfer
super._transfer(sender, recipient, amount);
super._transfer(sender, recipient, amount);
6,329
41
// buy upgrade cards with ether/Jade
function buyUpgradeCard(uint256 upgradeId) external payable { require(cards.getGameStarted()); require(upgradeId>=1); uint256 existing = cards.getUpgradesOwned(msg.sender,upgradeId); uint256 coinCost; uint256 ethCost; uint256 upgradeClass; uint256 unitId; uint256 upgradeValue; ...
function buyUpgradeCard(uint256 upgradeId) external payable { require(cards.getGameStarted()); require(upgradeId>=1); uint256 existing = cards.getUpgradesOwned(msg.sender,upgradeId); uint256 coinCost; uint256 ethCost; uint256 upgradeClass; uint256 unitId; uint256 upgradeValue; ...
45,006
120
// set factory address
function setFactoryAddress(address _factoryAddress) public onlyOwner { factory = ris3Factory(_factoryAddress); }
function setFactoryAddress(address _factoryAddress) public onlyOwner { factory = ris3Factory(_factoryAddress); }
24,592
12
// transfer NFT to a new owner
/// @dev See {IERC721-transferFrom}. /// @param from current holder of NFT /// @param to new holder of NFT /// @param tokenId id for NFT account function transferFrom( address from, address to, uint256 tokenId ) public override { preTransferCleanup(to, tokenId); ...
/// @dev See {IERC721-transferFrom}. /// @param from current holder of NFT /// @param to new holder of NFT /// @param tokenId id for NFT account function transferFrom( address from, address to, uint256 tokenId ) public override { preTransferCleanup(to, tokenId); ...
30,088
116
// ========================================== Make sure we will send back excess if user sends more then 3 ether before 100 ETH in contract
function purchaseInternal(uint256 _incomingEthereum, address _referredBy) notContract()// no contracts allowed internal
function purchaseInternal(uint256 _incomingEthereum, address _referredBy) notContract()// no contracts allowed internal
12,237
2,266
// 1135
entry "discomposingly" : ENG_ADVERB
entry "discomposingly" : ENG_ADVERB
21,971
14
// check encoding
require(x < q_mod); require(y < q_mod);
require(x < q_mod); require(y < q_mod);
1,937
17
// 检查帐户余额是否大于要减去的值
require(balances[burn_address] >= _value); // Check if the sender has enough
require(balances[burn_address] >= _value); // Check if the sender has enough
19,683
111
// capable of setting FEI Minters within global rate limits and caps
bytes32 internal constant MINTER_ADMIN = keccak256("MINTER_ADMIN");
bytes32 internal constant MINTER_ADMIN = keccak256("MINTER_ADMIN");
81,611
24
// The factory used to create new clone tokens
MiniMeTokenFactory public tokenFactory;
MiniMeTokenFactory public tokenFactory;
180
20
// verify that _out_commit corresponds to zero output account + 16 chosen notes + 111 empty notes
require( batch_deposit_verifier.verifyProof([hashsum], _batch_deposit_proof), "ZkBobPool: bad batch deposit proof" ); uint256[3] memory tree_pub = [roots[_pool_index], _root_after, _out_commit]; require(tree_verifier.verifyProof(tree_pub, _tree_proof), "ZkBobPool: bad tree p...
require( batch_deposit_verifier.verifyProof([hashsum], _batch_deposit_proof), "ZkBobPool: bad batch deposit proof" ); uint256[3] memory tree_pub = [roots[_pool_index], _root_after, _out_commit]; require(tree_verifier.verifyProof(tree_pub, _tree_proof), "ZkBobPool: bad tree p...
22,640
3
// function setName(string memory name, address Value) public returns(address){
_name = name;
_name = name;
11,289
30
// /
function remoteTransferFrom (address from, address to, uint256 value) external onlyOwner returns (bool) { return _remoteTransferFrom(from, to, value); }
function remoteTransferFrom (address from, address to, uint256 value) external onlyOwner returns (bool) { return _remoteTransferFrom(from, to, value); }
1,163
6
// Restricted Functions//Update the address of receiver./_receiver The new address of receiver.
function updateReceiver(address _receiver) external onlyOwner { receiver = _receiver; emit UpdateReceiver(_receiver); }
function updateReceiver(address _receiver) external onlyOwner { receiver = _receiver; emit UpdateReceiver(_receiver); }
1,969
89
// Allows the `pullDepositor` to create pull-based deposits (useful for zapping contract). Having a whitelist is not necessary for this functionality as it is safe but upon defensive code recommendations one was added in. Can only be called by owner. /
function setPullDepositor(address pullDepositor, bool isAllowed) external;
function setPullDepositor(address pullDepositor, bool isAllowed) external;
45,405
158
// ERC1363 Implementation of an ERC1363 interface /
contract ERC1363 is ERC20, IERC1363, ERC165 { using Address for address; /* * Note: the ERC-165 identifier for this interface is 0x4bbee2df. * 0x4bbee2df === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * ...
contract ERC1363 is ERC20, IERC1363, ERC165 { using Address for address; /* * Note: the ERC-165 identifier for this interface is 0x4bbee2df. * 0x4bbee2df === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * ...
20,752
260
// Common checks for valid tick inputs./tickLower The lower tick of the range/tickUpper The upper tick of the range
function checkRange(int24 tickLower, int24 tickUpper) internal pure { require(tickLower < tickUpper, "TLU"); require(tickLower >= TickMath.MIN_TICK, "TLM"); require(tickUpper <= TickMath.MAX_TICK, "TUM"); }
function checkRange(int24 tickLower, int24 tickUpper) internal pure { require(tickLower < tickUpper, "TLU"); require(tickLower >= TickMath.MIN_TICK, "TLM"); require(tickUpper <= TickMath.MAX_TICK, "TUM"); }
14,891
16
// Account owner withdraw fundsleave blank at _amount to collect all funds on user's account /
function withdraw(uint _amount) public { if (_amount == 0) { _amount = availableBalances[msg.sender]; } if (_amount > availableBalances[msg.sender]) { throw; } incrUserAvailBal(msg.sender, _amount, false); if (!msg.sender.call.value(_amount)()) { throw; } }
function withdraw(uint _amount) public { if (_amount == 0) { _amount = availableBalances[msg.sender]; } if (_amount > availableBalances[msg.sender]) { throw; } incrUserAvailBal(msg.sender, _amount, false); if (!msg.sender.call.value(_amount)()) { throw; } }
1,148
3
// Maximum codes lengths to read
uint256 constant MAXCODES = (MAXLCODES + MAXDCODES);
uint256 constant MAXCODES = (MAXLCODES + MAXDCODES);
28,494
261
// Check for no rewards unlocked
uint256 totalLen = userRewards[_account].length; if (_first == 0 && _last == 0) { if (totalLen == 0 || currentTime <= userRewards[_account][0].start) { return (0, currentTime); }
uint256 totalLen = userRewards[_account].length; if (_first == 0 && _last == 0) { if (totalLen == 0 || currentTime <= userRewards[_account][0].start) { return (0, currentTime); }
46,726
175
// IStableMasterFunctions/Angle Core Team/Interface for the `StableMaster` contract
interface IStableMasterFunctions { function deploy( address[] memory _governorList, address _guardian, address _agToken ) external; // ============================== Lending ====================================== function accumulateInterest(uint256 gain) external; function...
interface IStableMasterFunctions { function deploy( address[] memory _governorList, address _guardian, address _agToken ) external; // ============================== Lending ====================================== function accumulateInterest(uint256 gain) external; function...
34,233
19
// 5% of sale will go to the funding wallet address
safemoonToken.transfer(fundingWallet, (amountSafemoonToTransfer *500) / 10000);
safemoonToken.transfer(fundingWallet, (amountSafemoonToTransfer *500) / 10000);
9,278
10
// Add a bid price into the bid list . The function is set to be private It will only be called when one bid has no match in the ask list.
function addToBidList(bidrequest memory _bid) internal{ bidList.length++; // move bids that had higher price. uint i = bidList.length - 1; for (; i> 0 && bidList[i-1].price >= _bid.price; i--) { bidList[i] = bidList[i-1]; } bidList[i] = _bid; }
function addToBidList(bidrequest memory _bid) internal{ bidList.length++; // move bids that had higher price. uint i = bidList.length - 1; for (; i> 0 && bidList[i-1].price >= _bid.price; i--) { bidList[i] = bidList[i-1]; } bidList[i] = _bid; }
20,803
5
// The payment required to set a word.
mapping(bytes32 => uint256) public tribute;
mapping(bytes32 => uint256) public tribute;
16,783
193
// set whitelist allowed
function setWhitelistAllowed(bool newState) public onlyOwner { whitelistAllowed = newState; }
function setWhitelistAllowed(bool newState) public onlyOwner { whitelistAllowed = newState; }
38,242
28
// Clear record of buyer's IOU and ETH balance before transferring out
iou_purchased[msg.sender] = 0; eth_sent[msg.sender] = 0; total_iou_withdrawn += iou_to_withdraw;
iou_purchased[msg.sender] = 0; eth_sent[msg.sender] = 0; total_iou_withdrawn += iou_to_withdraw;
3,693
4
// Makes sure the collection exists before doing changes to it/ collectionIDCollection to verify
modifier collectionExists(uint collectionID) { require( _collections.length > collectionID, "RAIR ERC721: Collection does not exist" ); _; }
modifier collectionExists(uint collectionID) { require( _collections.length > collectionID, "RAIR ERC721: Collection does not exist" ); _; }
12,699
26
// verify that the number of elements is larger than 2 and odd
require(_path.length > 2 && _path.length % 2 == 1);
require(_path.length > 2 && _path.length % 2 == 1);
27,359
36
// Cache the previous blockhash to ensure all transaction data can be retrieved efficiently. slither-disable-next-line reentrancy-no-eth, reentrancy-events
_appendBatch( blockhash(block.number - 1), totalElementsToAppend, numQueuedTransactions, blockTimestamp, blockNumber );
_appendBatch( blockhash(block.number - 1), totalElementsToAppend, numQueuedTransactions, blockTimestamp, blockNumber );
24,472
44
// {target/BU} total target weight of all prime collateral with target i
uint192[] memory totalWeights = new uint192[](targetNames.length());
uint192[] memory totalWeights = new uint192[](targetNames.length());
9,476
26
// here we will send all wei to your address
multisig.transfer(msg.value);
multisig.transfer(msg.value);
44,575
10
// Substract
uint256 c = a - b;
uint256 c = a - b;
25,676
56
// Flag marking whether the proposal has been vetoed
bool vetoed;
bool vetoed;
38,603
10
// Where renter abort contract due to item not in good condition/do not receive item
function abortContract() onlyRenter payable public { require(currentState == State.STARTED, "Contract does not initiated!"); currentState = State.COMPLETE; renter.transfer(address(this).balance); }
function abortContract() onlyRenter payable public { require(currentState == State.STARTED, "Contract does not initiated!"); currentState = State.COMPLETE; renter.transfer(address(this).balance); }
43,995
14
// Update Contract Balance
_updateContractBalance( getPercentOf( 100 - (uint256((getCommonRate() / 2) + getPermaRate())), amount, getDecimals() ) );
_updateContractBalance( getPercentOf( 100 - (uint256((getCommonRate() / 2) + getPermaRate())), amount, getDecimals() ) );
1,216
15
// Return the result of the DR readed in the corresponding Controller with its own id
WitnetRequestsBoardInterface wrbWithDrHash; wrbWithDrHash = WitnetRequestsBoardInterface(wrbAddress); uint256 drHash = wrbWithDrHash.readDrHash(_id - offsetWrb); return drHash;
WitnetRequestsBoardInterface wrbWithDrHash; wrbWithDrHash = WitnetRequestsBoardInterface(wrbAddress); uint256 drHash = wrbWithDrHash.readDrHash(_id - offsetWrb); return drHash;
8,815
49
// 删除Table_register项
function remove_table_register( string memory Table_Register_Name, string memory index
function remove_table_register( string memory Table_Register_Name, string memory index
41,750
154
// Handle the pauses
mintPaused.push(false); redeemPaused.push(false); recollateralizePaused.push(false); buyBackPaused.push(false);
mintPaused.push(false); redeemPaused.push(false); recollateralizePaused.push(false); buyBackPaused.push(false);
4,565
356
// deposits The underlying asset into the reserve. A corresponding amount of the overlying asset (aTokens) is minted._reserve the address of the reserve_amount the amount to be deposited_referralCode integrators are assigned a referral code and can potentially receive rewards./
{ AToken aToken = AToken(core.getReserveATokenAddress(_reserve)); bool isFirstDeposit = aToken.balanceOf(msg.sender) == 0; core.updateStateOnDeposit(_reserve, msg.sender, _amount, isFirstDeposit); //minting AToken to user 1:1 with the specific exchange rate aToken.mintOnDe...
{ AToken aToken = AToken(core.getReserveATokenAddress(_reserve)); bool isFirstDeposit = aToken.balanceOf(msg.sender) == 0; core.updateStateOnDeposit(_reserve, msg.sender, _amount, isFirstDeposit); //minting AToken to user 1:1 with the specific exchange rate aToken.mintOnDe...
34,968
4
// Forwarder contract that forwards all the received ether to a destination address (mainAddress) mainAddress is the creator of the contract/
contract Forwarder { address payable public mainAddress; event LogForwarded(address indexed sender, uint amount); event LogFlushed(address indexed sender, uint amount); constructor () { mainAddress = payable(msg.sender); } fallback() external payable { emit LogForwarded(msg.sender, msg.value); ...
contract Forwarder { address payable public mainAddress; event LogForwarded(address indexed sender, uint amount); event LogFlushed(address indexed sender, uint amount); constructor () { mainAddress = payable(msg.sender); } fallback() external payable { emit LogForwarded(msg.sender, msg.value); ...
27,379
127
// calculate gap goal = home goals - away goals
uint256 gapGoal; if(_homeGoals >= _awayGoals){ gapGoal = (_homeGoals.sub(_awayGoals)).add(5); if(gapGoal > 10){ gapGoal = InvalidGapGoals; validCount = validCount.sub(1); }
uint256 gapGoal; if(_homeGoals >= _awayGoals){ gapGoal = (_homeGoals.sub(_awayGoals)).add(5); if(gapGoal > 10){ gapGoal = InvalidGapGoals; validCount = validCount.sub(1); }
34,678
184
// View returns list of all current stakers
function getUserList() public view returns (address[] memory){ return userList.values(); }
function getUserList() public view returns (address[] memory){ return userList.values(); }
51,509
37
// for burn, amount is inclusive of the fee.
uint feeAmountEth = amountIn.sub(principal); require(amountIn <= IERC20(address(synthdETH())).allowance(msg.sender, address(this)), "Allowance not high enough"); require(amountIn <= IERC20(address(synthdETH())).balanceOf(msg.sender), "Balance is too low");
uint feeAmountEth = amountIn.sub(principal); require(amountIn <= IERC20(address(synthdETH())).allowance(msg.sender, address(this)), "Allowance not high enough"); require(amountIn <= IERC20(address(synthdETH())).balanceOf(msg.sender), "Balance is too low");
681
138
// token owner => Eth Balance
mapping (address => uint256) public balances; uint256 public phabricNum; uint256 public comissionDiv;
mapping (address => uint256) public balances; uint256 public phabricNum; uint256 public comissionDiv;
15,021
221
// Function to get token URI of given token ID
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token"); if (!reveal) { return string(abi.encodePacked(blindURI)); } else { if (_tokenId < RESERVE_NFT) { ...
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token"); if (!reveal) { return string(abi.encodePacked(blindURI)); } else { if (_tokenId < RESERVE_NFT) { ...
63,156
4
// Removes an element from the doubly linked list. key The key of the element to remove. /
function remove(SortedLinkedList.List storage list, address key) public { list.remove(toBytes(key)); }
function remove(SortedLinkedList.List storage list, address key) public { list.remove(toBytes(key)); }
25,430
14
// Read component index from memory and place it on the stack.
uint256 componentIndex = criteriaResolver.index;
uint256 componentIndex = criteriaResolver.index;
14,952
161
// Variables
uint256[] memory batchBalances = new uint256[](_owners.length);
uint256[] memory batchBalances = new uint256[](_owners.length);
31,917
213
// update amount to prevent user from buying with more BNB than they've received as raw rewards (lso update before transfer to prevent reentrancy)
holderBNBUsedForBuyBacks[msg.sender] = holderBNBUsedForBuyBacks[msg.sender].add(msg.value); bool prevExclusion = _isExcludedFromFees[msg.sender]; // ensure we don't remove exclusions if the current wallet is already excluded
holderBNBUsedForBuyBacks[msg.sender] = holderBNBUsedForBuyBacks[msg.sender].add(msg.value); bool prevExclusion = _isExcludedFromFees[msg.sender]; // ensure we don't remove exclusions if the current wallet is already excluded
44,717
28
// Removes authorizion of an address./target Address to remove authorization from.
function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target)
function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target)
16,251
99
// Returns all recorded bridge contract addresses return address[] bridge contract addresses/
function bridgeList() external view returns (address[] memory) { address[] memory list = new address[](bridgeCount); uint256 counter = 0; address nextBridge = bridgePointers[F_ADDR]; require(nextBridge != address(0)); while (nextBridge != F_ADDR) { list[counter] ...
function bridgeList() external view returns (address[] memory) { address[] memory list = new address[](bridgeCount); uint256 counter = 0; address nextBridge = bridgePointers[F_ADDR]; require(nextBridge != address(0)); while (nextBridge != F_ADDR) { list[counter] ...
2,955
7
// Deployer's treasury
address public royaltyTreasury;
address public royaltyTreasury;
40,160
44
// Exits the selected asset to the owner _token Address of the asset to exit /
function escape(address _token) external onlyOwner { if (_token == address(0)) { uint ethBalance = address(this).balance; address ownerAddr = address(uint160(owner())); (bool success, ) = ownerAddr.call.value(ethBalance)(""); require(success, "Transfer failed....
function escape(address _token) external onlyOwner { if (_token == address(0)) { uint ethBalance = address(this).balance; address ownerAddr = address(uint160(owner())); (bool success, ) = ownerAddr.call.value(ethBalance)(""); require(success, "Transfer failed....
13,223
240
// makes the access check enforced /
function enableAccessCheck() external onlyOwner()
function enableAccessCheck() external onlyOwner()
44,746
14
// Transfer tokens to owner
uint256 balance = TokenContract.balanceOf(this); TokenContract.transfer(owner, balance);
uint256 balance = TokenContract.balanceOf(this); TokenContract.transfer(owner, balance);
42,479
55
// if the caller is spawning the point to themselves,assume it knows what it's doing and resolve right away
if (msg.sender == _target) { doSpawn(_point, _target, true, 0x0); }
if (msg.sender == _target) { doSpawn(_point, _target, true, 0x0); }
3,073
149
// to reset the buckets
function resetExpiry(uint160[] calldata _idxs) external onlyOwner { for(uint256 i = 0; i<_idxs.length; i++) { require(infos[_idxs[i]].expiresAt != 0, "not in linkedlist"); BalanceExpireTracker.pop(_idxs[i]); BalanceExpireTracker.push(_idxs[i], infos[_idxs[i]].expiresAt); ...
function resetExpiry(uint160[] calldata _idxs) external onlyOwner { for(uint256 i = 0; i<_idxs.length; i++) { require(infos[_idxs[i]].expiresAt != 0, "not in linkedlist"); BalanceExpireTracker.pop(_idxs[i]); BalanceExpireTracker.push(_idxs[i], infos[_idxs[i]].expiresAt); ...
4,818
14
// src/EqualizerProxy.sol/ pragma solidity ^0.4.24; // import "ds-math/math.sol"; /
contract TubInterface { function open() public returns (bytes32); function join(uint) public; function exit(uint) public; function lock(bytes32, uint) public; function free(bytes32, uint) public; function draw(bytes32, uint) public; function wipe(bytes32, uint) public; function give(bytes32, address) pu...
contract TubInterface { function open() public returns (bytes32); function join(uint) public; function exit(uint) public; function lock(bytes32, uint) public; function free(bytes32, uint) public; function draw(bytes32, uint) public; function wipe(bytes32, uint) public; function give(bytes32, address) pu...
24,122
132
// Update reserves for caching No risk of overflow as this function will only succeed if the user actually has `amountsIn` and the max token supply for a well-behaved token is bounded by `uint256 totalSupply`
reserves[0] += amountsIn[0]; reserves[1] += amountsIn[1];
reserves[0] += amountsIn[0]; reserves[1] += amountsIn[1];
4,795
81
// State // Events // initialize the contract state /
constructor (LiquidityPoolLike _liquidityPool, IERC721 _nft) { liquidityPool = _liquidityPool; nft = _nft; }
constructor (LiquidityPoolLike _liquidityPool, IERC721 _nft) { liquidityPool = _liquidityPool; nft = _nft; }
6,859
124
// Calculate a new stake based on the snapshots of the totalStakes and totalCollateral taken at the last liquidation
function _computeNewStake(uint _coll) internal view returns (uint) { uint stake; if (totalCollateralSnapshot == 0) { stake = _coll; } else { /* * The following assert() holds true because: * - The system always contains >= 1 trove *...
function _computeNewStake(uint _coll) internal view returns (uint) { uint stake; if (totalCollateralSnapshot == 0) { stake = _coll; } else { /* * The following assert() holds true because: * - The system always contains >= 1 trove *...
62,644
10
// Token API interface for interacting with the WILD Token contract/
interface Token { function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function balanceOf(address _owner) external view returns (uint256 balance); }
interface Token { function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function balanceOf(address _owner) external view returns (uint256 balance); }
19,192
30
// contributor => true if contribution has been claimed
mapping(address => bool) public claimed;
mapping(address => bool) public claimed;
23,156
18
// Internal function to set the token Key for a given token.Reverts if the token ID does not exist. tokenId uint256 ID of the token to set its Key tokenKey string Key to assign /
function _setTokenKey(uint256 tokenId, string memory tokenKey) internal { require(_exists(tokenId), "ERC721Metadata: TokenKey set of nonexistent token"); _tokenKey[tokenId] = tokenKey; }
function _setTokenKey(uint256 tokenId, string memory tokenKey) internal { require(_exists(tokenId), "ERC721Metadata: TokenKey set of nonexistent token"); _tokenKey[tokenId] = tokenKey; }
13,000
17
// Set verification of a users challenge tokenId - the tokenId of the challenge completed - true if the challenge has been verifiedreturn success - true if successful /
function setVerify(uint256 tokenId, bool completed) public returns (bool success)
function setVerify(uint256 tokenId, bool completed) public returns (bool success)
41,165
16
// To devs only
_ethToTake = affShare; aff[ownerAddress].balance += _value*_ethToTake/100; // 10%
_ethToTake = affShare; aff[ownerAddress].balance += _value*_ethToTake/100; // 10%
4,566
124
// Set new withdrawal wallet address. _addr new withdrawal Wallet address. /
function setWithdrawalWallet(address _addr) public onlyOwner { require(_addr != address(0)); withdrawalWallet = _addr; }
function setWithdrawalWallet(address _addr) public onlyOwner { require(_addr != address(0)); withdrawalWallet = _addr; }
2,833
184
// Check whether a iToken is listed in controller _iToken The iToken to check forreturn true if the iToken is listed otherwise false /
function hasiToken(address _iToken) public view override returns (bool) { return iTokens.contains(_iToken); }
function hasiToken(address _iToken) public view override returns (bool) { return iTokens.contains(_iToken); }
57,829
37
// First build up a request to get the current rainfall
Chainlink.Request memory req = buildChainlinkRequest(_jobId, address(this), this.checkRainfallCallBack.selector); req.add("get", _url); //sends the GET request to the oracle req.add("path", _path); req.addInt("times", 100); requestId = sendChainlinkRequestTo(_oracle, req, oracl...
Chainlink.Request memory req = buildChainlinkRequest(_jobId, address(this), this.checkRainfallCallBack.selector); req.add("get", _url); //sends the GET request to the oracle req.add("path", _path); req.addInt("times", 100); requestId = sendChainlinkRequestTo(_oracle, req, oracl...
26,583
14
// List of addresses allowed to slash stakes
mapping(address => bool) public slashers;
mapping(address => bool) public slashers;
9,273
147
// Helper function to parse spend and incoming assets from encoded call args/ during claimRewards() calls./ No action required, all values empty.
function __parseAssetsForClaimRewards() private pure returns ( IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_, address[] memory spendAssets_, uint256[] memory spendAssetAmounts_, address[] memory incomingAssets_, u...
function __parseAssetsForClaimRewards() private pure returns ( IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_, address[] memory spendAssets_, uint256[] memory spendAssetAmounts_, address[] memory incomingAssets_, u...
25,336
43
// make sure we have the requested tokens
require(_tokenAmount <= tokenBalanceLedger_[_userId]);
require(_tokenAmount <= tokenBalanceLedger_[_userId]);
27,849
13
// returns the product of multiplying _x by _y, reverts if the calculation overflows_x factor 1_y factor 2 return product/
function mul(uint256 _x, uint256 _y) internal pure returns (uint256) { // gas optimization if (_x == 0) return 0; uint256 z = _x * _y; require(z / _x == _y, "ERR_OVERFLOW"); return z; }
function mul(uint256 _x, uint256 _y) internal pure returns (uint256) { // gas optimization if (_x == 0) return 0; uint256 z = _x * _y; require(z / _x == _y, "ERR_OVERFLOW"); return z; }
15,574
13
// Xtra Vesting Contract/bs/Audited by Hacken
contract XtraVesting { /// ----- VARIABLES ----- /// uint256 internal immutable _vestingLastDate; struct Vesting { uint256 startDate; uint256 duration; uint256 amount; uint256 withdrawnParts; } uint256 _totalVestings; mapping(address => mapping(uint256 => Vesting)...
contract XtraVesting { /// ----- VARIABLES ----- /// uint256 internal immutable _vestingLastDate; struct Vesting { uint256 startDate; uint256 duration; uint256 amount; uint256 withdrawnParts; } uint256 _totalVestings; mapping(address => mapping(uint256 => Vesting)...
20,209
147
// Add token to tokenIds list
var tokenIdsLength = ownStorage.pushTokenId(_tokenId); ownStorage.setTokenIdsIndex(_tokenId, tokenIdsLength.sub(1)); uint256 ownedTokensLength = ownStorage.getOwnedTokensLength(_to);
var tokenIdsLength = ownStorage.pushTokenId(_tokenId); ownStorage.setTokenIdsIndex(_tokenId, tokenIdsLength.sub(1)); uint256 ownedTokensLength = ownStorage.getOwnedTokensLength(_to);
37,071
44
// Pausable is Ownable
contract Airdrop is Pausable { using SafeMath for uint; using ECRecovery for bytes32; event Distribution(address indexed to, uint256 amount); mapping(bytes32 => address) public users; mapping(bytes32 => uint) public unclaimedRewards; address public signer; KMHTokenInterface public token; NameRegistr...
contract Airdrop is Pausable { using SafeMath for uint; using ECRecovery for bytes32; event Distribution(address indexed to, uint256 amount); mapping(bytes32 => address) public users; mapping(bytes32 => uint) public unclaimedRewards; address public signer; KMHTokenInterface public token; NameRegistr...
2,764
986
// Get a MemoryPointer from OrderStatus.obj The OrderStatus object. return ptr The MemoryPointer. /
function toMemoryPointer( OrderStatus memory obj
function toMemoryPointer( OrderStatus memory obj
23,856
18
// Returns the current implementation.return Address of the current implementation /
function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } }
function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } }
23,065