file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/97/0x53B92ab335Ccd58Ef3578AA58d0069e6207377cD/sources/Staking.sol
require(amount <= _users[msg.sender], "Amount cannot be higher balance");
function withdraw(uint256 amount) public { require(amount > 0, "Amount cannot be 0"); _burn(msg.sender, amount); token.safeTransfer(msg.sender, amount); emit Withdraw(msg.sender, amount); }
11,441,843
./partial_match/1/0x6afE6C37bF75f80D512b9D89C19EC0B346b09a8d/sources/RariFundController.sol
Withdraws funds from the specified pool. pool The index of the pool. currencyCode The currency code of the token to be withdrawn. amount The amount of tokens to be withdrawn./
function withdrawFromPool(LiquidityPool pool, string calldata currencyCode, uint256 amount) external fundEnabled onlyRebalancer { _withdrawFromPool(pool, currencyCode, amount); _poolsWithFunds[currencyCode][uint8(pool)] = _getPoolBalance(pool, currencyCode) > 0; }
2,629,749
./full_match/1/0x92Cc4c289cA8821A233A404c58479a0f209cF285/sources/contracts/PancakeV3LmPool.sol
Update the lmTicks state from the oldLMPool. Need to rest Negative Tick info when tick flipped.
function updatePosition(int24 tickLower, int24 tickUpper, int128 liquidityDelta) external onlyMasterChef { _updateLMTicks(tickLower); _updateLMTicks(tickUpper); (, int24 tick, , , , , ) = pool.slot0(); uint128 maxLiquidityPerTick = pool.maxLiquidityPerTick(); uint256 _reward...
4,989,598
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; /** * @dev Define interface verifier */ interface VerifierRollupInterface { function verifyProof( uint256[2] calldata proofA, uint256[2][2] calldata proofB, uint256[2] calldata proofC, uint256[1] calldata input ) e...
Copy 'len' bytes from memory address 'src', to address 'dest'. _preBytes bytes storage _postBytes Bytes array memory/ Read the first 32 bytes of _preBytes storage, which is the length of the array. (We don't need to use the offset into the slot because arrays use the entire slot.) Arrays of 31 bytes or less have an e...
function _concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal { assembly { let fslot := sload(_preBytes_slot) let slength := div( and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2 ) let ml...
616,473
pragma solidity 0.5.16; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Mintable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import ".....
Cashes everything out and withdraws to the vault/
function withdrawAllToVault() external restricted { underlying.safeTransfer(address(vault), underlying.balanceOf(address(this))); }
14,065,855
./partial_match/1/0xAA6826abE27f7D4D45E0938C78d80031D348EBd7/sources/contracts/BIFI/strategies/Common/StratFeeManagerInitializable.sol
set new fee config address to fetch fees
function setBeefyFeeConfig(address _beefyFeeConfig) external onlyOwner { beefyFeeConfig = IFeeConfig(_beefyFeeConfig); emit SetBeefyFeeConfig(_beefyFeeConfig); }
3,924,037
./full_match/1/0x36940bf3Ee06C33434D169493b6C65c1B95dF00e/sources/contracts/Sales.sol
settle the auction by the member in whitelist check the validity of the target auction the auction has been bidden transfer pay token to the receiver from this contract transfer erc721s to the bidder who keeps the highest price
function settleAuction(uint _saleID) external onlyWhitelist { Auction memory auction = _getAuctionByID(_saleID); require(auction.base.isAvailable, "only the available auction can be settled"); require(auction.base.endTime <= now, "the auction can only be settled after...
8,286,529
/** * SPDX-License-Identifier: MIT * * Copyright (c) 2018-2020 CENTRE SECZ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the right...
Call owner() Renamed to fiatTokenOwner due to the existence of Ownable.owner() return owner/
function fiatTokenOwner() external view returns (address) { return FiatTokenV1(_proxy).owner(); }
44,669
./partial_match/1/0x1234567a022acaa848E7D6bC351d075dBfa76Dd4/sources/LibAuthVoken.sol
Remove an `account` access from the Minter role. Can only be called by the current owner./
function removeMinter(address account) public onlyAgent { _minters.remove(account); emit MinterRemoved(account); }
4,189,223
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_117(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,453,830
// SPDX-License-Identifier: MIT /** * @authors: [@fnanni-0] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity ^0.7; import "@kleros/erc-792/contracts/IArbitrator.sol"; import "@kleros/erc-792/contracts/IArbitrable.sol"; import "@kleros/erc-792/contracts/erc-1497/IEvide...
Return the status of a dispute (in the sense of ERC792, not the Dispute property). _disputeID ID of the dispute to rule. return status The status of the dispute./ If the appeal period is over, consider it solved even if rule has not been called yet.
function disputeStatus(uint256 _disputeID) external view override returns(DisputeStatus status) { Dispute storage dispute = disputes[_disputeID]; if (dispute.jurorStatus == JurorStatus.Challenged) { return dispute.backupArbitrator.disputeStatus(dispute.appealID); return Dispu...
15,860,944
./partial_match/1/0x53BbAB02c0fb63A422F21204E6d99B9d092B5fC1/sources/contracts/Staking.sol
Safe rewardToken transfer function, just in case if rounding error causes pool to not have enough MIDASes./
function _safeTransfer(address _to, uint256 _amount) internal { uint256 midasBalance = rewardToken.balanceOf(address(this)) - poolInfo.totalDeposited; if (_amount > midasBalance) { rewardToken.safeTransfer(_to, midasBalance); rewardToken.safeTransfer(_to, _amount); } ...
4,224,815
pragma solidity ^0.4.24; import "../../../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title A Marketplace contract for managing listings, offers, payments, escrow and arbitration * @author Nick Poulden <nick@poulden.com> * * Listings may be priced in Eth or ERC20. */ contract ER...
Pay seller in ETH or ERC20
function paySeller(uint listingID, uint offerID) private { Offer storage offer = offers[listingID][offerID]; uint value = offer.value - offer.refund; if (address(offer.currency) == 0x0) { require(offer.buyer.send(offer.refund), "ETH refund failed"); require(offer.sel...
946,199
pragma solidity ^0.4.18; import "./ConvertLib.sol"; /// @title A library that houses the data structures used by the engine /// @author Aaron Kendall /// @notice Not all data structures have been used yet /// @dev There are probably more efficient layout for these structures library WonkaLib { /// @title A data str...
Aaron Kendall The engine's constructor Some Attributes are created by default, but in future versions, Attributes can be created by the contract's user
function WonkaEngine() public { rulesMaster = msg.sender; attributes.push(WonkaLib.WonkaAttr({ attrId: 1, attrName: "Title", maxLength: 256, maxLengthTruncate: true, maxNumValue: 0, defaultValue: "Blank"...
12,559,341
./partial_match/1/0x160a66E2834F4484dEBC4a59C0Ea7E1eb25Aaf87/sources/QuorumVote.sol
check if the proposal has been decided, and if so, execute the proposal _proposalId the id of the proposal/ this is the actual voting rule:
function _execute(bytes32 _proposalId) internal votable(_proposalId) returns(bool) { Proposal storage proposal = proposals[_proposalId]; uint256 totalReputation = VotingMachineCallbacksInterface(proposal.callbacks).getTotalReputationSupply(_proposalId); uint256 precReq = parameters[p...
4,278,196
./full_match/1/0x2dD4242C894d20060b162747362aF1721Fa7f5d5/sources/contracts/MAGIStaker.sol
start the procedure of redeeming xMAGI token through a vesting time get amounts of MAGI to redeem (after vesting period) and to burn (now, the amount that won't be redeemed)
function redeemxMAGI( uint256 _amount, uint256 _vestingTime ) external nonReentrant returns (uint) { require( _vestingTime >= minimumVestingTime && _vestingTime <= completeRedeemTime, "Invalid vesting time" ); address account = msg...
3,189,525
./full_match/80001/0xdE63C15C7C4bb819f343a781c6f6b4BB46ab4603/sources/contracts/LazyMintERC1155.sol
Returns the current active mint condition for a given tokenId.
function getTimestampForNextValidClaim( uint256 _tokenId, uint256 _index, address _claimer ) public view returns (uint256 nextValidTimestampForClaim) { uint256 timestampIndex = _index + claimConditions[_tokenId].timstampLimitIndex; uint256 timestampOfLastClaim = claimCond...
5,555,715
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Number of votes for an airline return An int that represents if the airline exists/
function getNumberOfVotes(address newAirlineAddress) public view returns (uint256) { return airlines[newAirlineAddress].numberOfVotes; }
12,786,245
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import { HoldersHelper } from "./DRPLibraries.sol"; // %@( // ...
checks the project whitelist
function _checkDropsWhitelist(Token memory tokenToMint) internal view returns(bool) { if (tokenToMint.drops.length == 0 ) { return true; for (uint16 i = 0; i < tokenToMint.drops.length; i++) { uint16 dropNo = tokenToMint.drops[i]; uint256 _amount = ERC721(indexToDrop[dropNo]).balanceOf(msg.sender); ...
280,165
./full_match/11155111/0x836a5d1D18bfbC218296A011d9d758146d3e18Dc/sources/project:/contracts/VaultyTimeVault.sol
Either the current owner or the pending owner can cancel the transfer
function cancelOwnershipTransfer() external payable { require( msg.sender == pendingOwner || msg.sender == owner(), "Only the pending owner or the current owner can cancel the change." ); ownerChangeTimeout = 0; pendingOwner = address(0); }
3,805,158
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.6; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../interfaces/ISovWrapper.sol"; import "../interfaces/ISmartPool.sol"; import "../interfaces/IMintableERC20.sol"; import "hardhat/conso...
gets current LP exchange rate for single tokenapply protocol fee
function getTokenAmountOutSingle( address tokenOut, uint256 poolAmountIn, uint256 minTokenAmountOut ) public view returns (uint256 tokenAmountOut) { BPool bPool = smartPool.bPool(); require(bPool.isBound(tokenOut), "ERR_NOT_BOUND"); uint256 poolAmountInAdj = pool...
12,888,462
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // 'ER' 'ERGON' token contract // // Symbol : ERG // Name : ERGON // ---------------------------------------------------------------------------- // ---------------------------------------------------...
------------------------------------------------------------------------ Returning upper limit ------------------------------------------------------------------------
function SC_returnlimit() public view returns (uint) { return upper_limit; }
927,262
// SPDX-License-Identifier: MIT pragma solidity 0.6.2; /** * @title Factory for deploying option contracts. * @author Primitive */ import { Option, SafeMath } from "../../primitives/Option.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { OptionTemplateLib } from "../../librarie...
Only the factory can call the initRedeemToken function to set the redeem token address. This function is only callable by the Registry contract (the owner)./
function initRedeemToken(address optionAddress, address redeemAddress) external override onlyOwner { Option(optionAddress).initRedeemToken(redeemAddress); }
6,355,394
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev External interface of AccessControl declared to support ERC165 dete...
Runs super function and then increases total supply. See {ERC1155Upgradeable._mint}./ add the id to the owned token ids of the user
function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal override { super._mint(account, id, amount, data); _addOwnedToken(account, id); totalSupply += amount; }
6,317,321
./full_match/80001/0x9f64453823217455743eC714F3a014a8295AB3aE/sources/contracts/AvaxPrediction.sol
Set treasury fee Callable by admin/
function setTreasuryFee(uint256 _treasuryFee) external onlyAdmin { require(_treasuryFee <= MAX_TREASURY_FEE, "Treasury fee too high"); treasuryFee = _treasuryFee; emit NewTreasuryFee(currentEpoch, treasuryFee); }
9,482,620
./partial_match/42/0x30E761d94E357ABD4C15878ae795312868F1c32B/sources/Perifi.sol
return (_lockTimes[account], _lockAmounts[account]);
function getLock(address account) public view returns (uint256 lockTime, uint256 lockAmount) { LockState[] memory accountLockState = _LockStates[account]; uint256 _lockTime; uint256 _lockAmount; for (uint i = 0; i < accountLockState.length; i++) { if (accountLockState[...
3,299,406
./partial_match/1/0x0CEB4829B3A054ae387E2E0FE0836Baf35A5B6e2/sources/WrappedERC4626YearnCRVAave.sol
If amountIn is low enough, than fee substraction may substract 1 And in case in low amountIn this can make big difference
function _checkSlippage(address source, address destination, uint256 amountIn, uint256 amountOut) internal view returns(bool) { amountIn -= 1; uint256 maxSlippage = routes[source][destination].maxAllowedSlippage; if (maxSlippage == 0) { maxSlippage = defaultMaxAllowedSlippage; } uint256 sourceUSDPrice; ...
3,584,738
./full_match/1/0x9858728DE38c914C2eA32484A113b6628d984A82/sources/browser/textMiner.sol
Deposit LP tokens to MasterChef for text allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accTextPerShare).div(1e12).sub(user.rewardD...
9,795,903
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; interface IEmprunteur { function doStuff( address _nftContract, uint256[] calldata _ids, uint256[] calldata _amou...
/ Retient la quantité d'eth dans le contract avant l'execution du flashloan Le fonctionnement est similaire mais le code est different en fonction du type de NFT voulu
function flashloan(address _nftContract, address _executor, uint256 _type, uint[] calldata _ids, uint[] calldata _amounts, bytes calldata _params) external payable { uint256 iniBalance = address(this).balance; uint256 cost; if (_type == 721) { } else if (_type == 1155) { ...
15,858,794
/** *Submitted for verification at Etherscan.io on 2021-09-27 */ // File: contracts/ISpacePunksTreasureKeys.sol pragma solidity 0.8.7; interface ISpacePunksTreasureKeys { function burnKeyForAddress(uint256 typeId, address burnTokenAddress) external; function balanceOf(address account, uint256 id) external view...
public method for minting multiple tokens if public sale is enable
function mintPublicMultipleTokens(uint256 _amount) public payable nonReentrant whenNotPaused { require(totalSupply().add(_amount) <= TOKEN_LIMIT - TREASURE_KEYS_LIMIT, "Purchase would exceed max supply of Llamas"); require(publicSale, "Public sale must be active to mint multiple tokens at once"); require(...
8,060,841
./full_match/4/0x2cB260f1313454386262373773124f6bc912cF28/sources/contracts/ERC721.sol
See {IERC721-ownerOf}./
function ownerOf(uint256 tokenId) public view override returns (address) { return _tokenOwners[tokenId]; }
714,608
// File: contracts/interfaces/IBridgeValidators.sol pragma solidity 0.4.24; interface IBridgeValidators { function isValidator(address _validator) external view returns (bool); function requiredSignatures() external view returns (uint256); function owner() external view returns (address); } // File: cont...
Returns an id of the currently processed message. return id of the message that originated on the other side./
function messageId() public view returns (bytes32) { return bytes32(uintStorage[MESSAGE_ID]); }
2,409,426
./full_match/11155111/0x298F37fFd4B31d216B8954968cEe7EC5273CB891/sources/src/Managed.sol
Grants the pauser role to an address. Callable only by the admin. pauser The granted address.
function grantPauser(address pauser) public onlyAdmin { require(_managedStorage().pausers.add(pauser), "Address already is a pauser"); emit PauserGranted(pauser, msg.sender); }
3,819,374
pragma solidity ^0.4.18; import './UpdatableContent.sol'; /** * @title Iterative Content * @dev The IterativeContent along with allowing you to change offchain content address also keeps track of older content addresses */ contract IterativeContent is UpdatableContent { string[] public iterations; functi...
A view function that tells how many total iterations are there/
function getTotalIterations() external view returns(uint256) { return iterations.length; }
12,843,605
./full_match/1/0xE60a57cc57b51C4e801Ee8a0E6Df675F94abC0af/sources/contracts/helpers/IERC2981Royalties.sol
IERC2981Royalties Interface for the ERC2981 - Token Royalty standard is owed and to whom.
interface IERC2981Royalties { function royaltyInfo(uint256 _tokenId, uint256 _value) external view returns (address _receiver, uint256 _royaltyAmount); pragma solidity ^0.8.0; }
4,887,320
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../math/SafeMathU128.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; /** Writes a simple match function This function needs to accept as params: All the raw params of the order commi...
Process commisions for matched order This function is called when the order is matched The commission is calculated as a percentage of the fee/ Gossiper commission Main processor commission Treasury commission
function processCommissions( uint128 amount, address payable gossiper, address payable matcher ) public payable returns (bool) { uint128 gossiperCommission = amount * allocationRatio[0] / 100; uint128 treasuryCommission = amount * allocationRat...
12,755,533
./partial_match/1/0x052c2da7bbd2FB771E6E95217Ff402437171087B/sources/Shmokies.sol
This variable should never be directly accessed by users of the library: interactions must be restricted to the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add this feature: see https:github.com/ethereum/solidity/issues/4637
function _beforeTokenTransfer( address from, address to, uint256 tokenId function _afterTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; struct Counter { }
9,324,474
./full_match/1/0x2C6bD2A550Ff9dAcE0c7e71e17C0047220317021/sources/browser/CosmoDistributor.sol
Draw down amount currently available (based on the block timestamp) beneficiary beneficiary of the vested tokens return amount tokens due from vesting schedule/
function availableDrawDownAmount(address beneficiary) external view returns (uint256) { return _availableDrawDownAmount(beneficiary); }
4,850,657
./full_match/10/0x5Ca7D3e5689A976266245AD2b50c674f60d6195d/sources/src/Facets/HopFacetPacked.sol
Bridges ERC20 tokens via Hop Protocol from L1 transactionId Custom transaction ID for tracking receiver Receiving wallet address destinationChainId Receiving chain sendingAssetId Address of the source asset to bridge minAmount Amount of the source asset to bridge destinationAmountOutMin Destination swap minimal a...
function encode_startBridgeTokensViaHopL1ERC20Packed( bytes8 transactionId, address receiver, uint256 destinationChainId, address sendingAssetId, uint256 minAmount, uint256 destinationAmountOutMin, address relayer, uint256 relayerFee, address h...
3,778,594
// https://yfgenius.finance pragma solidity ^0.6.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of to...
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate, bool _taxable, uint256 _startBlock) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = _startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poolInfo....
6,696,678
./full_match/5/0x45FBC42B0a580771Cb9d95Ea530F980183223640/sources/contracts/Contract.sol
Sets the vote count for multiple candidates at once. _candidateIds The IDs of the candidates. _voteCounts The corresponding vote counts for the candidates./
function setVoteCountForCandidates(uint[] memory _candidateIds, uint[] memory _voteCounts) public onlyAdmin { require(_candidateIds.length == _voteCounts.length, "Invalid input lengths"); for (uint i = 0; i < _candidateIds.length; i++) { uint candidateId = _candidateIds[i]; ...
1,862,192
./partial_match/42/0x5e54a5691b414522472114036241abcFa1421469/sources/MockZcoin.sol
burn all ether balance of this contract swap ether, get ZCOIN and burn swap ETH get ZCOIN
function burnEther() internal { address[] memory path = new address[](2); path[0] = WETH; path[1] = address(this); uint256 tokenBalance = address(this).balance; 0, path, address(this), UNISWAP_TX_EXPIRED ); _burn(addres...
3,323,798
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; library UQ112x112 { uint224 constant Q112 = 2**112; // encode a uint112 as a UQ112x112 function encode(uint112 y)internal pure returns(uint224 z) { z = uint224(y) * Q112;// never overflows } //devide a UQ112x112 by a uint112 ,...
devide a UQ112x112 by a uint112 , returning a UQ112x112
function uqdiv(uint224 x ,uint112 y) internal pure returns (uint224 z) { z = x / uint224(y); }
12,697,669
./full_match/5/0x2851242feD46C7Cd80Fa532c63Ea3609bD37e40e/sources/project_/contracts/CoinFlip.sol
update games playedhttps:ethereum.stackexchange.com/questions/98692/approve-safetransferfrom-erc721-from-existing-smart-contract some link to help with this
function createCoinFlipGame(address[] calldata _nftContract, uint256[] calldata _tokenId, CoinFlipSelections choice) public { gamesPlayed += 1; uint256 gameId = gamesPlayed; for (uint256 i = 0; i < _nftContract.length; i++) { _gameIdToCoinFlip[gameId].nfts.push((NFT({ nftContract: _nftContrac...
7,081,067
pragma solidity ^0.5.0; /** * @title Lambdeth * @dev Helpful methods for working with arrays */ contract Lambdeth { /** * @dev Iterates an array and returns true if the specified value is present in the array */ function concat(uint[] memory arr1, uint[] memory arr2) public pure returns (uint[] m...
Iterates an array and returns true if the specified value is present in the array/
function contains(uint[] memory arr, uint value) public pure returns (bool) { uint length = arr.length; for (uint i = 0; i < length; i++) { if (arr[i] == value) return true; } return false; }
1,759,058
./full_match/137/0xdEc0FF6De71335d0f7b170AcEEEdd35655AfBeB0/sources/contracts/trove-factory.sol
function to be called from trove to update total collateral value of all troves of this tokens _increase bool that indicates "+" or "-" operation/
function updateTotalCollateral(address _token, uint256 _amount, bool _increase) public override troveExists(_token, msg.sender) { if (_increase) { _troves[ _token].totalCollateral += _amount; _troves[ _token].totalCollateral -= _amount; } emit CollateralUpdate(_token, _troves[ _token].totalCol...
4,779,931
pragma solidity ^0.5.8; contract IERC1271 { function isValidSignature( bytes memory _messageHash, bytes memory _signature) public view returns (bytes4 magicValue); } /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a mess...
Change the daily limit for a user _newDailyLimit New daily limit to set
function changeDailyLimit(uint256 _newDailyLimit) public onlyValidAuthKeyOrSelf { dailyLimit = _newDailyLimit; emit DailyLimitChanged(msg.sender, dailyLimit); }
15,857,533
./full_match/1/0x41ECdc3AEF2bdC4Bf1853889e6F1ffe9d00058d8/sources/contracts/Ranking.sol
Blocks rank variability For the admin only If the rank is variable Name - Unique rank identifier return bool (On successful execution returns true)
function lockRank(string memory Name) public onlyOwner returns (bool) { require(_ranks.length > 0, "RANK: There are no ranks."); uint256 index = searchRank(Name); require( _ranks[index].isChangeable, "RANK: This rank cannot be changed!" ); _ranks[ind...
9,821,773
// SPDX-License-Identifier: MIT // // Copyright (c) 2021 Kentaro Hara // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php pragma solidity ^0.8.11; import "./JohnLawCoin_v2.sol"; //------------------------------------------------------------------------------ // [O...
Pause the ACB in emergency cases. Only the genesis account can call this method.
function pause() public onlyOwner { if (!paused()) { _pause(); } coin_v2_.pause(); }
6,358,425
// SPDX-License-Identifier: MIT pragma solidity ^0.7.5; // Links to use when working on https://remix.ethereum.org/#optimize=true&runs=200&evmVersion=null&version=soljson-v0.7.5+commit.eb77ed08.js // import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol"; // import "https://github...
Withdraw ether from smart contract
function withdraw(address _recipient, uint256 _amount) external onlyOwner returns (bool) { address payable recipient = payable(_recipient); recipient.transfer(_amount); return true; }
12,711,128
/// @title CryptoKitties: Collectible, breedable, and oh-so-adorable cats on the Ethereum blockchain. /// @author Axiom Zen (https://www.axiomzen.co) /// @dev The main CryptoKitties contract, keeps track of kittens so they don't wander around and get lost. /** * 这是主要的CryptoKitties合约,编译和运行在以太坊区块链上。 这份合约把所有东西联系在一起。 */...
No tipping! Reject all Ether from being sent here, unless it's from one of the two auction contracts. (Hopefully, we can prevent user accidents.) 拒绝所有以太被发送到这里,除非它是从两个拍卖合同之一。(希望,我们可以防止用户事故。)
function() external payable { require( msg.sender == address(saleAuction) || msg.sender == address(siringAuction) ); } 等等...我没有看到任何图像数据。 什么决定了小猫的样子? 从上面的代码可以看出,一个“小猫”基本上归结为一个256位的无符号整数,代表其遗传密码。 Solidity合约代码中没有任何内容存储猫的图像或其描述,或者确定这个256位整数的实际含义。 该遗传密码的解释发生...
15,848,328
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import './token/PoolsInterestBearingToken.sol'; import './token/Bridge.sol'; import './utils/MyPausableUpgradeable.sol'; import 'hardhat/cons...
Sets the maximum stake amount for a specific token can only be called by MANAGE_REWARD_POOLS_ROLE tokenAddress the address of the token _maxStakeAmount the maximum staking amount/
function setMaxStakeAmount(address tokenAddress, uint256 _maxStakeAmount) external { require( hasRole(MANAGE_REWARD_POOLS_ROLE, _msgSender()), 'RewardPools: must have MANAGE_REWARD_POOLS_ROLE role to execute this function' ); require(rewardPools[tokenAddress].exists, 'RewardPools: rewardPool d...
87,283
pragma solidity ^0.5.3; pragma experimental ABIEncoderV2; import "./IPoMain.sol"; import "./IPoTypes.sol"; import "./IErc20.sol"; import "./IPoStorage.sol"; import "./IProductStorage.sol"; import "./IBusinessPartnerStorage.sol"; import "./IFunding.sol"; import "./IWalletBuyer.sol"; import "./IWalletSeller.sol"; import...
pass-through to po storage
function getPoByEthPoNumber(uint64 ethPoNumber) public view returns (IPoTypes.Po memory po) { return poStorage.getPoByEthPoNumber(ethPoNumber); }
12,594,552
// Voting.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; /// @title Voting contract /// @author Grégory Seiller /// @notice Voting contract for a small organization contract Voting is Ownable { // STATES VARIABLES /// @notice Winning proposal...
Owner ends the proposal registration phase Owner ends the proposal registration phase. Current status must be ProposalsRegistrationStarted. Emits WorkflowStatusChange
function endProposalRegistration() external onlyOwner withStatus(1) { require(proposals.length >= 1, "There is no submitted proposal for now, cannot end this phase"); status = WorkflowStatus.ProposalsRegistrationEnded; emit WorkflowStatusChange(WorkflowStatus.ProposalsRegistrationStarted, st...
2,494,605
// File: localhost/Toft_Contracts/contracts/ToftToken/openzeppelin/utils/Pausable.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * ...
Forward ERC20 methods to upgraded contract if this one is deprecated
function totalSupply() public override view returns (uint256) { if (!deprecated) return super.totalSupply(); else return UpgradedStandardToken(upgradedAddress).totalSupplyByLegacy(); }
2,277,850
pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; import '../interfaces/ConstraintInterface.sol'; import '../public_coin.sol'; import '../proof_types.sol'; import '../utils.sol'; import '../primefield.sol'; import '../iterator.sol'; import '../default_cs.sol'; import './recurrence_trace.sol'; import './recuren...
These constants are derived from the small fib example in rust TODO - The solidity prettier wants to delete all 'override' statements We should remove this ignore statement when that changes. prettier-ignore
function initalize_system(bytes calldata public_input) external view override returns (ProofTypes.ProofParameters memory, PublicCoin.Coin memory) { PublicInput memory input = abi.decode(public_input, (PublicInput)); PublicCoin.Coin memory coin = PublicCoin.Coin({ ...
6,370,693
./partial_match/84531/0x545B6DbBE966daA21bf13A36CBed62F4c261E503/sources/Implementation.sol
this function needs to be exposed for an upgrade to pass Wormhole chain ids explicitly enumerated
function initialize() initializer public virtual { if (evmChainId() == 0) { uint256 evmChainId; uint16 chain = chainId(); revert("Unknown chain id."); } setEvmChainId(evmChainId); }
16,686,626
./full_match/43113/0xC60a0Dff601911d6Aff569d289D17e2dA38d5b46/sources/avaxwhales.sol
The caller is responsible to confirm that `_to` is capable of receiving NFTs or else they may be permanently lost. Throws unless `msg.sender` is the current owner, an authorized operator, or the approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero address. Throws if `_...
function transferFrom( address _from, address _to, uint256 _tokenId ) external override canTransfer(_tokenId) validNFToken(_tokenId) { require(false, "Use safeTransferFrom"); address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, NOT_OWNER); require...
7,176,873
pragma solidity ^0.6.2; contract RunCode { // Oracle address public oracle; // Structures struct Task { string id; address owner; uint256 balance; uint256 successReward; uint256 submissionPrice; } enum CodeStatus { PENDING, // 0 ...
Stores the address of submitters
function addSubmission( string memory taskId, string memory codeKey ) public payable returns(bool) { Task memory task = tasks[taskId]; require(msg.value >= task.submissionPrice, "Value is less then the price"); codeToUser[codeKey] = msg.sen...
15,781,470
./full_match/97/0x4dd2E23cd8A85e48047592DD6Baae4F78d42b73e/sources/project_/contracts/CakePool.sol
Set UNLOCK_FREE_DURATION Only callable by the contract admin./
function setUnlockFreeDuration(uint256 _unlockFreeDuration) external onlyAdmin { require(_unlockFreeDuration > 0, "UNLOCK_FREE_DURATION cannot be zero"); UNLOCK_FREE_DURATION = _unlockFreeDuration; emit NewUnlockFreeDuration(_unlockFreeDuration); }
5,032,704
/** *Submitted for verification at Etherscan.io on 2022-03-09 */ // File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While the...
Remove a user from the whitelist
function removeUser(uint idx) public onlyOwner{ delete whitelistedAddresses[idx]; }
10,611,612
// https://yfgenius.finance pragma solidity ^0.6.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of to...
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
6,696,644
./partial_match/7672/0x271ccB614CfAE61c91f866b9408c7f6F6B421Cc5/sources/lib/ERC725/implementations/contracts/ERC725YCore.sol
Will return unchecked incremented uint256 can be used to save gas when iterating over loops/
function _uncheckedIncrementERC725Y(uint256 i) internal pure returns (uint256) { unchecked { return i + 1; } }
3,492,994
./full_match/5/0xc465F392eFFCcE7149E3081e7A150CEE3f4Fd34f/sources/contracts/Contract.sol
If _maxFreeMintAmountPerWallet is 0, reset the freeMint mapping for all addresses to false
function setMintCritera( uint256 _maxSupply, uint256 _publicMintCost, uint256 _maxMintAmountPerWallet, uint256 _maxFreeMintAmountPerWallet, uint256 _teamSupply, string memory _uriPrefix ) public onlyOwner { require(_maxFreeMintAmountPerWallet >= 0, 'Max Free Mint Amount must be non-negativ...
11,617,381
pragma solidity ^0.4.24; import "./properties/Ownable.sol"; import "./tokens/Likoin.sol"; import "./ArtifactsManager.sol"; /** * @title Contract used to vote Artifacts proposals */ contract Voting is Ownable { // The artifacts manager ArtifactsManager private _artifactsManager; // The token used for votes w...
return Debating period in hours/
function debatingPeriodInMinutes() public view returns (uint) { return _debatingPeriodInMinutes; }
7,212,832
pragma solidity ^0.5.0; import "../../Libraries/introspection/ERC165.sol"; import "../Interface/IERCX.sol"; import "../../Libraries/utils/Address.sol"; import "../../Libraries/math/SafeMath.sol"; import "../../Libraries/drafts/Counters.sol"; import "../Interface/IERCXReceiver.sol"; // import './MinterRole.sol'; contr...
Gets the approved address for setting tenant right for a item ID, or zero if no address set Reverts if the item ID does not exist. itemId uint256 ID of the item to query the approval of return address currently approved for the given item ID/
function getApprovedTenantRight(uint256 itemId) public view returns (address) { require(_exists(itemId, 2)); return _tenantRightApprovals[itemId]; }
917,049
/** *Submitted for verification at Etherscan.io on 2021-07-08 */ // SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.0; interface Realitio { // mapping(bytes32 => Question) public questions; /// @notice Ask a new question without a bounty and return the ID /// @dev Template data is only sto...
Sets the template that should be used for future questions. templateId ID of the template that should be used for proposal questions Check https://github.com/realitio/realitio-dappstructuring-and-fetching-information for more information This can only be called by the executor
function setTemplate(uint256 templateId) public executorOnly() { template = templateId; }
7,813,622
./partial_match/42/0x142201C24af5095EDED6D6A8F500B2f05E08f523/sources/Depot.sol
Exchange ETH to DOWS./ How many DOWS are they going to be receiving? Store the ETH in our funds wallet And send them the DOWS.
function exchangeEtherForDOWS() public payable rateNotStale(DOWS) rateNotStale(ETH) notPaused returns ( ) { uint shadowsToSend = shadowsReceivedForEther(msg.value); fundsWallet.transfer(msg.value); shadows().transfer(msg.sender, s...
3,468,509
// SPDX-License-Identifier: MIT pragma solidity ^0.6.7; import "./strategy-base.sol"; import "../../interfaces/beethovenx.sol"; import "../../lib/balancer-vault.sol"; abstract contract StrategyBeethovenxFarmBase is StrategyBase { // Token addresses address public constant beets = 0xF24Bcf4d1e507740041C9cFd2Dd...
Collects BEETS tokens Send performance fees to treasury
function _harvestRewards() internal { IBeethovenxMasterChef(masterchef).harvest(masterchefPoolId, address(this)); uint256 _beets = IERC20(beets).balanceOf(address(this)); uint256 _keepBEETS = _beets.mul(keepBEETS).div(keepBEETSMax); IERC20(beets).safeTransfer(IController(controller)...
1,063,970
./partial_match/1/0x3EB9D4F9848b759D2aB5947cE84cdA3fa75F3cca/sources/contracts/Land/NemoLand.sol
Deletes Listing of `_id` on sale _id Id of land to to remove from sale/
function disallowBuy(uint256 _id) external { require(msg.sender == ownerOf(_id), "Not an Owner"); require(tokenIdToPrice[_id].price > 0, "Not for sale"); removefromSale(_id); emit DisallowBuy(msg.sender, _id); }
9,275,925
./partial_match/4/0x92D455c0a6dD33da72eFD2B64643EDceC7bE97c9/sources/Treasury.sol
购买Bond 通过Oracle合约获取最新BAC价格 当前BAB价格等于BAC价格 销毁当前用户对应数量的BAC 铸造给当前用户对应数量的BAB mint:当前BAC数量 (10 18) / BAB价格 更新BAC价格
function buyBonds(uint256 amount, uint256 targetPrice) external onlyOneBlock checkMigration checkStartTime checkOperator { require(amount > 0, 'Treasury: cannot purchase bonds with zero amount'); uint256 cashPrice = _getCashPrice(bondOracle); requi...
8,642,928
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "hardhat/console.sol"; contract WakalaEscrow { /** * Encription keys used to enxcrypt phone numbers. **/ string private encryptionKey; uint private nextTransa...
Client initialize deposit transaction. _amount the amount to be deposited. _phoneNumber the client`s phone number./ newPayment.clientPhoneNo = keccak256(abi.encodePacked(_phoneNumber, encryptionKey));
function initializeDepositTransaction(uint256 _amount, string calldata _phoneNumber) public { require(_amount > 0, "Amount to deposit must be greater than 0."); uint wtxID = nextTransactionID; nextTransactionID++; WakalaTransaction storage newPayment = escrowedPaymen...
5,476,526
./full_match/1/0xd1D1254ac96D8C5877372421b1c5E505207c4B21/sources/contracts/core_libraries/Tick.sol
Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) internal pure { require(tickLower < tickUpper, "TLU"); require(tickLower >= TickMath.MIN_TICK, "TLM"); require(tickUpper <= TickMath.MAX_TICK, "TUM"); }
3,845,867
./partial_match/1/0x6B83c4f3a6729Fb7D5e19b720092162DF439f567/sources/src/VeFxsVotingDelegation.sol
The ```getPastTotalSupply``` function retrieves the total supply of veFXS at ```blockNumber``` Must use block.number instead of timestamp because VE_FXS.totalSupply(timestamp) doesn't work for historical values. blockNumber block.number of total supply, must be in past return pastTotalSupply veFXS supply at ```blockN...
function getPastTotalSupply(uint256 blockNumber) external view returns (uint256 pastTotalSupply) { if (blockNumber >= block.number) revert IVeFxsVotingDelegation.BlockNumberInFuture(); pastTotalSupply = VE_FXS.totalSupplyAt(blockNumber); }
4,454,507
./partial_match/1/0x8a1BbEf259B00cEd668A8c69e50D92619C672176/sources/contracts/AvatarToken.sol
Withdraw all money to sender's account, only owner can call this
function withdrawMoney() public onlyOwner { address payable to = payable(msg.sender); to.transfer(address(this).balance); }
2,880,360
./partial_match/1/0x67c5F13c56aEb40fd9a937214E5429dAf8A0CfC9/sources/contracts/FCNProduct.sol
Permissionless method that reads price from oracle contracts and checks if barrier is triggered vaultAddress is address of the vault/
function checkBarriers(address vaultAddress) public validVault(vaultAddress) { FCNVaultMetadata storage vaultMetadata = vaults[vaultAddress]; vaultMetadata.checkBarriers(address(cegaState)); }
15,753,070
pragma solidity 0.6.7; abstract contract TokenLike { function balanceOf(address) virtual public view returns (uint256); } abstract contract AccountingEngineLike { function debtAuctionBidSize() virtual public view returns (uint256); function unqueuedUnauctionedDebt() virtual public view returns (uint256); }...
Recompute and set the new min amount of tokens to keep unauctioned in the lender of first resort pool/
function recomputeTokensToKeep() external { require(!protocolUnderwater(), "StakedTokensToKeepSetter/cannot-compute-when-underwater"); TokenPoolLike ancestorPool = TokenPoolLike(address(lenderFirstResort.ancestorPool())); TokenLike ancestorToken = TokenLike(address(ancestorPool.token()))...
51,902
./full_match/1/0xD1CE9000dAe71a7130c193486761c324fbf94819/sources/cache/solpp-generated-contracts/PackedBets.sol
Removes all the bits encoding epoch number from the instance of the PackedBet. This routine is helpful when two PackedBets need to be checked for equality. self the instance of the PackedBet to remove epoch number from. return an instance of the PackedBet with epoch bits set to 0./
function withoutEpoch(PackedBet self) internal pure returns (PackedBet) { return PackedBet.wrap(PackedBet.unwrap(self) & ALL_BUT_EPOCH_BITS); }
2,904,046
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Add an airline to the registration queue Can only be called from FlightSuretyApp contract/
function registerAirline( address newAirlineAddress, string newAirlineName, address registeringAirlineAddress ) external requireIsOperational requireIsAirlineFunded(registeringAirlineAddress) requireAirlineDoesntExist(newAirlineAddress) returns (bo...
12,786,257
./partial_match/1/0xABD0061755A180052703f72F06CEf8c2Eb1384B6/sources/new.sol
change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool) { require( newAmount >= ((totalSupply() * 1) / 10000) / 1e9, "Swap amount cannot be lower than 0.01% total supply." ); require( newAmount <=...
15,579,566
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC20.sol"; /** * @dev ERC20 token where the admin can control what's approvable */ abstract contract ERC20Approvable is ERC20 { bool private _approved = true; /** * @dev Returns true if approvable */ function isApprovable() public vir...
Returns true if approvable/
function isApprovable() public virtual view returns(bool) { return _approved; }
1,783,766
./full_match/80001/0x6f848C0E1f747F558D9EE568d366B83980d6Eb39/sources/contracts/DID-NFT.sol
This is an custom overrided function, So this smartcontract can handle return token id by sender of transaction set opt./
function _optTokenId() internal view virtual override returns (uint256) { return claimedTokenId[_msgSender()]; }
5,611,681
// Copyright 2020 - See NOTICE file for copyright holders. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ap...
Should not be called directly but only by the parent AssetHolder. Transferes `amount` tokens from `msg.sender` to `fundingID`./
function depositEnact(bytes32, uint256 amount) internal override { require(token.transferFrom(msg.sender, address(this), amount), "transferFrom failed"); }
14,036,299
./partial_match/1/0x9D4C63565D5618310271bF3F3c01b2954C1D1639/sources/src/GitcoinGovernor.sol
The amount of GTC required to meet the quorum threshold for a proposal as of a given block. Our implementation ignores the block number parameter and returns a constant.
function quorum(uint256) public pure override returns (uint256) { return QUORUM; }
15,763,223
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import "./Interfaces/ISortedTroves.sol"; import "./Interfaces/ITroveManager.sol"; import "./Interfaces/IBorrowerOperations.sol"; import "./Dependencies/SafeMath.sol"; import "./Dependencies/Ownable.sol"; import "./Dependencies/CheckContract.sol"; import "./Depen...
Descend the list (larger NICRs to smaller NICRs) to find a valid insert position _troveManager TroveManager contract, passed in as param to save SLOAD’s _NICR Node's NICR _startId Id of node to start descending the list from/ If `_startId` is the head, check if the insert position is before the head Descend the list...
function _descendList(ITroveManager _troveManager, uint256 _NICR, address _startId) internal view returns (address, address) { if (data.head == _startId && _NICR >= _troveManager.getNominalICR(_startId)) { return (address(0), _startId); } address prevId = _startId; addre...
950,752
pragma solidity =0.6.12; // SPDX-License-Identifier: MIT interface YFIoneV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() ...
fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = YFIoneV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = ...
14,651,058
pragma solidity ^0.6.0; import "./vendor/SafeMath.sol"; import "./dev/SignedSafeMath.sol"; library Median { using SignedSafeMath for int256; int256 constant intMax = 57896044618658097711785492504343953926634992332820282019728792003956564819967; /** * @notice Returns the sorted middle, or the average of the...
Optimized median computation for lists of length at most 9 Assumes that 0 < list.len <= 9 Does not modify list/ Uses an optimal sorting network (https:en.wikipedia.org/wiki/Sorting_network) for lists of length 9. Network layout is taken from https:stackoverflow.com/a/46801450 --- end of subnetwork for lists of length...
function shortList(int256[] memory list) private pure returns (int256) { uint256 len = list.length; int256 x0 = list[0]; int256 x1 = list[1]; int256 x2 = list[2]; int256 x3 = list[3]; int256 x4 = 4 < len ? list[4] : intMax; int256 x5 = 5 < len ? list[5] : intMax; int256 x6 = 6 < len ?...
12,702,842
// SPDX-License-Identifier: BSD 2-Clause "Simplified" License pragma solidity >=0.6.0 <0.8.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/token/ERC20/ERC20.sol"; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/access/Ownable.sol"; import "h...
wrap idSp to sp A function that burns idSp and gives back sp/
function unWrapSp() external returns (bool success) { uint256 allowance = idSp.allowance(_msgSender(), address(this)); uint256 balance = sp.balanceOf(address(this)); if (balance < allowance) { allowance = balance; } idSp.burnFrom(_msgSender(),...
12,964,023
/** *Submitted for verification at Etherscan.io on 2020-12-03 */ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // ██████...
Returns the stakingWallet of the token/
function stakingWallet() public view returns (address) { return _stakingWallet; }
2,445,278
pragma solidity ^0.5.0; import "./interface/RegistryInterface.sol"; import "./registry/RegistryContract.sol"; import "./UserFactory.sol"; import "./SigningLogicInitializable.sol"; /** @title Contract for Audius user replica set management */ contract UserReplicaSetManager is SigningLogicInitializable, RegistryContr...
Get seedComplete
function getSeedComplete() external view returns (bool) { return seedComplete; }
7,304,024
./full_match/84531/0x0c2698D597752E400ecC7f270be0A6fdc2bBe1A1/sources/contracts/erc721a/ERC721A.sol
Transfers `tokenId` from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event./ The neste...
function transferFrom( address from, address to, uint256 tokenId ) public virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); ( uint256 approvedAddressSlot, a...
14,318,852
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is...
@inheritdoc IPoolCollection/
function defaultTradingFeePPM() external view returns (uint32) { return _defaultTradingFeePPM; }
10,394,324
./partial_match/4/0x6E020f49Eb228aA92fCC67B39Dade8A0153f7FD6/sources/ArbOne.sol
由第二轮仲裁合同检查报名条件,报名成功需要暂时冻结保证金报名需要同时满足的条件:@仲裁编号在前"peg"内 或 持有特殊的NFT@保证金没被锁定@保证金余额大于商家缴纳的保证金
function TwoApply(uint256 i, address usr) external returns (bool){ require(arbtwo == msg.sender, "arb/itration-not"); require((arber[usr] <= peg || setNFT(usr)) && lock[usr] == 0 && balanceMar[usr] >= user[i].mma ,"arb1/Insufficient-conditions"); lock[usr] = 1; appl[usr] += ...
8,699,182
// SPDX-License-Identifier: MIXED // File contracts/interfaces/IOracle.sol // License-Identifier: MIT pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface IOracle { /// @notice Get the latest exchange rate. /// @param data Usually abi encoded, implementation specific data that contains informati...
Return the RLP encoded bytes. self The Item. return The bytes.
function toBytes(Item memory self) internal pure returns (bytes memory) { uint256 len = self._unsafe_length; require(len != 0, "Rlp.sol:Rlp:toBytes:2"); bytes memory bts; bts = new bytes(len); _copyToBytes(self._unsafe_memPtr, bts, len); return bts; }
491,559
//SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract DeScratchOff is VRFConsumerBase, ERC721URIStorage{ bytes32...
Callback function used by VRF Coordinator/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override { bytes32 i = requestId; i = requestId; randomResult = randomness; }
5,458,834
pragma solidity >=0.4.21 <0.6.0; // Based on the solidity docs for common patterns: https://solidity.readthedocs.io/en/v0.5.0/common-patterns.html?highlight=seller contract Owned { /** * Constructor * Sets the message sender as the seller */ constructor() public { seller = msg.sender; } bool...
Getter returns { address } of seller/
function getSeller() public view returns (address) { return seller; }
6,461,250
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; abstract contract Context { function _MSGSENDER506() internal view virtual returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } ...
inject NONSTANDARD NAMING
function _MSGDATA471() internal view virtual returns (bytes memory) {
928,395
./partial_match/1/0x92B30E2b504C4AfBbf518db8c74DE5cDfBEd369d/sources/BadgerGeyser.sol
return The token users receive as they unstake./
function getDistributionTokens() public view returns (address[] memory) { uint256 numTokens = distributionTokens.length(); address[] memory tokens = new address[](numTokens); for (uint256 i = 0; i < numTokens; i++) { tokens[i] = distributionTokens.at(i); } retur...
3,725,500
/* "SPDX-License-Identifier: UNLICENSED" ElonMoon.finance */ pragma solidity ^0.6.12; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such...
Transfers mintership of the contract to a new account (`newMinter`). Can only be called by the current minter./
function transferMintership(address newMinter) public virtual onlyMinter { require(newMinter != address(0), "Mintable: new minter is the zero address"); emit MintershipTransferred(_minter, newMinter); _minter = newMinter; }
254,036
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when ...
Returns the address of the current owner./
function owner() public view returns (address) { return _owner; }
12,865