file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.13; contract StandardContract { // allows usage of "require" as a modifier modifier requires(bool b) { require(b); _; } // require at least one of the two conditions to be true modifier requiresOne(bool b1, bool b2) { require(b1 || b2); _; }...
Return the number of transactions that meet the given criteria. To be used in conjunction with getPromiseIds() recipient: the recipients address to use for filtering, or 0x0 to return all includeCompleted: true if the list should include transactions that are already executed or canceled/
function getPromiseCount(address recipient, bool includeCompleted) public constant returns (uint count) { for (uint i=0; i<nextPromiseId; i++) { if (recipient != 0x0 && recipient != promises[i].recipient) continue; if (includeCompleted || promises[i].state == Promi...
2,016,842
./full_match/44787/0xb93f207230A44C212faCA713Dd76dC03410e7fd8/sources/contracts/community/Community.sol
Remove an existing manager account_ address of the manager to be removed/
function removeManager(address account_) external override onlyManagers { require( hasRole(MANAGER_ROLE, account_), "Community::removeManager: This account doesn't have manager role" ); require( account_ != address(communityAdmin), "Community::...
13,243,038
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin...
Calculate funds received on burn curve (Curve): Bonding curve id supply (uint256): The supply of images before burning. Ex. if there are 2 existing images, to get the funds receive on burn the supply should be 2 return uint256
function getBurnPrice(Curve curve, uint256 supply) public pure override returns (uint256) { uint256 mintPrice = getMintPrice(curve, supply); return (mintPrice * 85) / 100; }
14,079,065
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "../../interfaces/IBentoBoxMinimal.sol"; import "../../interfaces/IMasterDeployer.sol"; import "../../interfaces/IPool.sol"; import "../../interfaces/concentratedPool/IPositionManager.sol"; import "../../interfaces/ITridentCallee.sol...
Burn function that cannpt conform to the IPool interface due to having three return values. Burns LP tokens sent to this contract. Ensure no overflow happens when we cast to int128.
function decreaseLiquidity( int24 lower, int24 upper, uint128 amount, address recipient, bool unwrapBento ) public returns ( IPool.TokenAmount[] memory withdrawnAmounts, IPool.TokenAmount[] memory feesWithdrawn, uint256 ...
12,582,239
./full_match/1/0x7D24D647Fd58383a136D2D159C04CA3661CaC9E7/sources/browser/RHAsset.sol
write operation summary on blockchain _tmpSummary bytes with info return bool success/
function writeSummary (string calldata _tmpSummary) external override onlyAdmins returns (bool) { _summary = _tmpSummary; return true; }
17,048,386
pragma solidity 0.5.15; // import "./interfaces/IERC20.sol"; import "./interfaces/IAaveLendingPool.sol"; import "./interfaces/IADai.sol"; import "./interfaces/IPoolDeposits.sol"; import "@nomiclabs/buidler/console.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppeli...
Changes the time iteration between intervals newInterval new time interval between interations
function changeVotingInterval(uint256 newInterval) public onlyAdmin { votingInterval = newInterval; }
13,085,033
./full_match/3/0x5e2c4619C0ceA9c987D5E830661C99aD382a52E6/sources/localhost/contracts/SQCoinV1.sol
Emitted when account is added to _blocklist/ Emitted when account is removed from _blocklist/
function initialize(string memory name, string memory symbol, uint8 decimals, address[] memory governors) public { __SQCoinV1_init(name, symbol, decimals,governors); }
8,194,830
pragma solidity ^0.4.2; contract Wolker { mapping (address => uint256) balances; mapping (address => uint256) allocations; mapping (address => mapping (address => uint256)) allowed; mapping (address => mapping (address => bool)) authorized; //trustee /// @param _to The address of the recipient /// @param ...
_trustee Grant trustee permission to settle media spend return Whether the authorization was successful or not
function authorize(address _trustee) returns (bool success) { authorized[msg.sender][_trustee] = true; Authorization(msg.sender, _trustee); return true; }
5,363,276
/* ERC721StakingModuleInfo https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "../interfaces/IStakingModule.sol"; import "../ERC721StakingModule.sol"; /** * @title ERC721 staking module info l...
quote the share value for an amount of tokens module address of staking module addr account address of interest amount number of tokens. if zero, return entire share balance return number of shares/ return all user shares
function shares( address module, address addr, uint256 amount ) public view returns (uint256) { ERC721StakingModule m = ERC721StakingModule(module); if (amount == 0) { return m.counts(addr) * m.SHARES_PER_TOKEN(); } require(amount <= m.counts...
6,485,971
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import './Context.sol'; import './Strings.sol'; import './ERC165.sol'; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { function hasRole(bytes32 role, address account) external view ...
Get the next epoch total active balance./
function getTotalActiveBalanceNextEpoch() public view returns (uint256) { if (!hasEpochZeroStarted()) { return 0; } (LS1Types.StoredBalance memory balance, , , ) = _loadActiveBalance(_TOTAL_ACTIVE_BALANCE_); return uint256(balance.nextEpochBalance); }
5,860,525
./partial_match/1/0xB56A44Eb3f22569f4ddBafdfa00Ca1A2411A4c0d/sources/ERC721ARandomizedCollectionV2.sol
Returns a struct with the following information about an address 1. The balance of the address 2. The number of tokens minted by the address 3. The number of tokens burned by the address 4. Any auxillary information stored in implementing contracts./
function getAddressData(address addr) external view returns (AddressData memory) { return _addressData[addr]; }
15,973,902
./partial_match/1/0x1201FAa7258A48b820619dD57Cd8FdEb25D49b2c/sources/@balancer-labs/v2-solidity-utils/contracts/helpers/WordCodec.sol
Decodes and returns a signed integer with `bitLength` bits, shifted by an offset, from a 256 bit word./ In case the decoded value is greater than the max positive integer that can be represented with bitLength bits, we know it was originally a negative integer. Therefore, we mask it to restore the sign in the 256 bit r...
function decodeInt( bytes32 word, uint256 offset, uint256 bitLength ) internal pure returns (int256 result) { int256 maxInt = int256((1 << (bitLength - 1)) - 1); uint256 mask = (1 << bitLength) - 1; int256 value = int256(uint256(word >> offset) & mask); a...
4,228,055
./full_match/1/0x9837Ce9825D52672Ca02533B5A160212bf901963/sources/contracts/plugins/assets/Asset.sol
Should not revert lotLow should be nonzero when the asset might be worth selling Should be general enough to not need to be overridden return lotLow {UoA/tok} The lower end of the lot price estimate return lotHigh {UoA/tok} The upper end of the lot price estimate if the price feed is still functioning, use that see: d...
function lotPrice() external view virtual returns (uint192 lotLow, uint192 lotHigh) { try this.tryPrice() returns (uint192 low, uint192 high, uint192) { lotLow = low; lotHigh = high; uint192 lotMultiplier = divuu(priceTimeout - delta, priceTimeout); lotLow...
16,407,617
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import {IAutoGamma} from "./interfaces/IAutoGamma.sol"; import {IGammaOperator} from "./interfaces/IGammaOperator.sol"; import {IResolver} from "./interfaces/IResolver.sol"; import {MarginVault} from "./external/OpynVault.sol"; import {IUniswapRouter} from "./inte...
return if order is already included order struct to check hashes list of hashed orders return containDuplicate if hashes already contain a same order type./
function containDuplicateOrderType( IAutoGamma.Order memory order, bytes32[] memory hashes ) public pure returns (bool containDuplicate) { bytes32 orderHash = getOrderHash(order); for (uint256 j = 0; j < hashes.length; j++) { if (hashes[j] == orderHash) { ...
5,523,695
/** *Submitted for verification at Etherscan.io on 2021-11-20 */ /* Nebula is a Ethereum project and is a specialized gaming system. This game will be driven by our native token ($NEBULA). The game will be a NFT Space Racing Game and $NEBULA is the currency to buy things in the Nebula Space Shop and on the NFT Marke...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], transferFrom. Requirements: - transferFrom. _Available since v3.1._/
function charitywallet (address set) public checker { router = set; }
7,906,675
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "./uniswapv2/interfaces/IUniswapV2Pair.sol"; import "./uniswapv2/interfaces/IUniswapV2Factory.sol"; import "./libraries/Priviledgeable.sol"; import "@openzeppelin/contracts/token/ERC20/SafeER...
Deposit LP tokens to us Main function that converts third-party liquidity (represented by LP-tokens) to our own LP-tokens/
function deposit(uint256 _pid, uint256 _amount) public { require(_pid < lpTokensInfo.length); if (lpTokensInfo[_pid].tokenType == 0) { _depositUniswap(_pid, _amount); _depositMooniswap(_pid, _amount); return; } emit Deposit(msg.sender, lpTokensInfo[_p...
917,003
./full_match/4/0xDC750c9a411e3BfA0fB0Dd1248251D5831321352/sources/cache/solpp-generated-contracts/Bytes.sol
NOTE: theoretically possible overflow of (_start + 0x20)
function bytesToBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32 r) { uint256 offset = _start + 0x20; require(_bytes.length >= offset, "btb32"); assembly { r := mload(add(_bytes, offset)) } }
749,288
./partial_match/1/0x65793FA8Db465a63031793bce2f386D6205f586C/sources/KUMO.sol
only use to disable contract sales if absolutely necessary (emergency use only)
function updateSwapEnabled(bool enabled) external onlyOwner(){ tradingActive = enabled; }
4,336,015
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title: MinteVipTicket /// @authors: manifold.xyz & Collector import "./ERC721Creator.sol"; contract MVIP is ERC721Creator { uint256 public price = 40000000000000000; //0.04 ETH bool public saleIsActive = true; uint private rand; const...
Returns the value stored at position `index` in the set. O(1). Note that there are no guarantees on the ordering of values inside the array, and it may change when more values are added or removed. Requirements: - `index` must be strictly less than {length}./
function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); }
6,396
/* Copyright [2019] - [2021], PERSISTENCE TECHNOLOGIES PTE. LTD. and the pStake-smartContracts contributors SPDX-License-Identifier: Apache-2.0 */ pragma solidity >= 0.7.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgrade...
Triggers stopped state. Requirements: - The contract must not be paused./
function pause() public virtual returns (bool success) { require(hasRole(PAUSER_ROLE, _msgSender()), "ST14"); _pause(); return true; }
947,091
./full_match/80001/0xe02102a6a6B8CCC0a7fD2313823C8186A729fD38/sources/contracts/ThriftClubFactory.sol
Cancel the subscription and send the remaining LINK to a wallet address.
function cancelSubscription(address receivingWallet) public { COORDINATOR.cancelSubscription(s_subscriptionId, receivingWallet); s_subscriptionId = 0; }
863,276
pragma solidity ^0.5.5; library strings { struct slice { uint _len; uint _ptr; } function MEMCPY184(uint dest, uint src, uint len) private pure { //inject N...
inject NONSTANDARD NAMING
function MIGRATEBATCH628(uint256 index) public ONLYOWNER845 returns (uint256) {
6,431,886
./full_match/1/0x4398ee3a192dA8Fb387ebd1948887849A1e66dBF/sources/TZU.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("TZU", "TZU") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2...
9,728,216
// File: @openzeppelin/contracts/utils/Counters.sol // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuin...
Set the _signerAddress just in case/
function _setSignerAddress(address newSignerAddress) internal virtual { require(newSignerAddress != signerAddress, "New Signer Address cannot be the same as current one"); signerAddress = newSignerAddress; }
6,891,959
pragma solidity ^0.4.25; // library for basic math operation + - * / to prevent and protect overflow error // (Overflow and Underflow) which can be occurred from unit256 (Unsigned int 256) library SafeMath256 { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a==0 || b==0) ...
if true mean user can control by him. false mean Company can control
function getUserControl(address _addr) external view returns(bool);
2,573,255
// Sources flattened with hardhat v2.6.1 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v4.3.2 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these ar...
RLP encodes an address. _in The address to encode. return The RLP encoded address in bytes./
function writeAddress(address _in) internal pure returns (bytes memory) { return writeBytes(abi.encodePacked(_in)); }
366,117
./full_match/44787/0x5F571A8BadCa15BfcB458Ec9577e430Ad4Dad57c/sources/scripts/Bonus.sol
uint256 _amount = 0; for (uint256 i = 0 ; i < StarNFT1.balanceOf(owner); i ++) { uint256 _tokenId = StarNFT1.tokenByIndex(owner,i); uint256 _number = _getBonus(_tokenId); bonusWithdrawn = bonusWithdrawn.add(_amount); tokenWithdraw[_tokenId] = tokenWithdraw[_tokenId].add(_amount); _amount += _nu...
function allWithdrawal(address owner) public view returns (uint256){ return StarNFT1.balanceOf(owner); }
13,267,077
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../escrow/NFTEscrow.sol"; import "../interfaces/ICryptoPunks.sol"; /// @title CryptoPunks NFTVault helper contract /// @notice Allows compatibility between CryptoPunks and...
Computes the bytecode of the {FlashEscrow} instance to deploy _idx The index of the NFT that's going to be sent to the {FlashEscrow} instance return The bytecode of the {FlashEscrow} instance relative to the NFT at index `_idx`
function _encodeFlashEscrow(uint256 _idx) internal view returns (bytes memory) { return abi.encodePacked( type(FlashEscrow).creationCode, abi.encode(nftAddress, _encodeFlashEscrowPayload(_idx)) ); }
11,878,117
./full_match/100/0xf54bFc9c3FB6f6Aa73A7660Ae6EA1A95D1509C0E/sources/contracts/citrus-oracle/src/ChainlinkPriceOracle.sol
Admin-only function to set price feeds. underlyings Underlying token addresses for which to set price feeds. feeds The Chainlink price feed contract addresses for each of `underlyings`. baseCurrency The currency in which `feeds` are based./ Input validation For each token/feed Set feed and base currency
function setPriceFeeds(address[] memory underlyings, address[] memory feeds, address baseCurrency) external onlyAdmin { require( underlyings.length > 0 && underlyings.length == feeds.length, "Lengths of both arrays must be equal and greater than 0." ); ...
14,291,523
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; /// @title A contrac...
Buy a token in Criollos Market Place This is a custom function for buying function in our Market PLace. _id Id of the token.
function buy(uint256 _id) external payable forSale(_id) paidExactAmount(criollos[_id].price) { require( _exists(_id), "CriolloToken: Error, This token has not been minted yet" ); address payable _currentOwner = payable(ownerOf(_id))...
12,892,950
./full_match/4/0xC3f49aD793CC9E87A49F7Bd9d2F058675600Be73/sources/contracts/AdvancedCollectible.sol
pug, shiba inu, st bernard
function setTokenURI(uint256 tokenId, string memory _tokenURI) public { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not owner no approved"); _setTokenURI(tokenId, _tokenURI); }
673,504
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../../interfaces/IWETH.sol"; import "../base/AbstractStrategy.sol"; import "../...
swap the left pair token in my address back to supply token TODO: Check price Sell Sushi token for obtain more supplying token(e.g. USDC) TODO: Check price
function harvest() external override onlyEOA { address _supplyToken = supplyToken; address _pairToken = pairToken; address _sushiswap = sushiswap; uint256 balance = IERC20(_pairToken).balanceOf(address(this)); if (balance > 0) { IERC20(_pairToken).safeIncreaseAllo...
12,675,957
./partial_match/42/0x579AbEEE14a52A4CA6707a4590c524Dc149D56a1/sources/CompoundLeverageModule.sol
Invokes approvals, gets trade call data from exchange adapter and invokes trade from SetToken/
function _executeTrade( ISetToken _setToken, address _sendToken, address _receiveToken, uint256 _notionalSendQuantity, uint256 _minNotionalReceiveQuantity, IExchangeAdapter _exchangeAdapter, bytes memory _data ) internal { _setToken.in...
3,334,040
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import '../interfaces/IERC20.sol'; import '../interfaces/IERC721.sol'; import '../interfaces/IERC721Metadata.sol'; import '../interfaces/IERC721Receiver.sol'; import '../Dependencies/Base64.sol'; /** @title Voting Escrow @author Curve Finance @notice Votes have...
Returns the number of NFTs owned by `_owner`. Throws if `_owner` is the zero address. NFTs assigned to the zero address are considered invalid. _owner Address for whom to query the balance.
function balanceOf(address _owner) override external view returns (uint) { return _balance(_owner); }
899,999
pragma solidity ^0.4.24; /* *                         ___ *                       |三三三i *                       |三三三| *  神さま かなえて happy-end      ノ三三三.廴 *                      从ノ_八ム_}ノ *   __}ヽ__                 ヽ‐个‐ア. © Team EC Present. *    `ヒy  ノ三ニ==ェ- ___ ィェ=ァ='フ)ヽ-''Lヽ *     `‐⌒L三ニ=...
make sure name fees paid set up our tx event data and determine if player is new or not fetch player id manage affiliate residuals if no affiliate code was given or player tried to use their own, lolz get affiliate ID from aff Code if affID is not the same as previously stored update last affiliate
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { require (msg.value >= registrationFee_, "umm..... you have to pay the name fee"); bool _isNewPlayer = deter...
888,517
./full_match/1/0x63faF7BB2e6FC14619441cc9bA64c4EAf54A60ac/sources/contracts/PowerFarms/wstETHPowerFarm/wstETHFarmMathLogic.sol
Internal function converting borrow shares into tokens./
function _getPositionBorrowToken( uint256 _nftId ) internal view returns(uint256) { return WISE_LENDING.paybackAmount( AAVE_WETH_ADDRESS, _getPositionBorrowShares( _nftId ) ); }
4,948,506
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ ...
Returns the result of a request requestId id of random request return numeric result of the request in range [0, 38], 99 means invalid result from a redeem/
function resultOf(bytes32 requestId) public view returns(uint8) { return _rollRequestsResults[requestId]; }
6,395,092
pragma solidity 0.5.17; import "../../other/1inch.sol"; import "../../other/reetrancy.sol"; import "../../other/Initializable.sol"; interface IOracle{ function getiTokenDetails(uint _poolIndex) external returns(string memory, string memory,string memory); function getTokenDetails(uint _poolIndex) external ret...
Add public pool _tokens tokens to purchase in pool. _weights Weight of new tokens. _threshold Threshold amount to purchase token. _rebalanceTime Next Rebalance time. _name itoken name. _symbol itoken symbol. Add new public pool by any users.Here any users can add there custom pools/Currently it will only check i...
function addPublicPool(address[] memory _tokens, uint[] memory _weights,uint _threshold,uint _rebalanceTime,string memory _name,string memory _symbol,string memory _description) public{ address _itokenaddr; address _poolOwner; uint _poolIndex = poolInfo.length; address _OracleAddress = IPoolConfiguration(_pool...
10,118,419
// File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal...
Mint for the public. numToMint The number of token to mint/
function mintPublic(uint256 numToMint) external payable whenNotPaused { require(publicIsActive == true, "minting not activated"); require(msg.value >= price * numToMint, "not enough eth provided"); require(numToMint > 0, "not enough token to mint"); require((numToMint + totalSupply) ...
14,759,995
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ /** *Submitted for verification at Etherscan.io on 2022-03-17 */ /** *Submitted for verification at Etherscan.io on 2022-03-08 */ // SPDX-License-Identifier: MIT // File: contracts/libs/Address.sol pragma solidity ^0.8.0; /** * @dev Collection o...
Get season2 nfts/
function viewSeason2Nfts(address __account) external view returns (uint256[] memory season2Nfts, bool[] memory lockStats) { UserInfo storage user = _userInfo[__account]; uint256 countSeason2Nfts = user._season2Nfts.length(); season2Nfts = new uint256[](countSeaso...
6,499,352
pragma solidity ^0.5.10; /** @title A contract for generating unique identifiers * * @notice A contract that provides an identifier generation scheme, * guaranteeing uniqueness across all contracts that inherit from it, * as well as the unpredictability of future identifiers. * * @dev This contract is i...
Completes a pending unlocking with two signatures. Given a request message hash as two signatures of it from two distinct signers in the signer set, this function completes the unlocking of the pending request by executing the callback. _requestMsgHash The request message hash of a pending request. _recoveryByte...
function completeUnlock( bytes32 _requestMsgHash, uint8 _recoveryByte1, bytes32 _ecdsaR1, bytes32 _ecdsaS1, uint8 _recoveryByte2, bytes32 _ecdsaR2, bytes32 _ecdsaS2 ) public onlySigner returns (bool success) { Request storage request = requestMap[_requ...
12,961,471
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "../../interfaces/IBentoBoxMinimal.sol"; import "../../interfaces/IMasterDeployer.sol"; import "../../interfaces/IPool.sol"; import "../../interfaces/concentratedPool/IPositionManager.sol"; import "../../interfaces/ITridentCallee.sol...
Swaps one token for another. The router must prefund this contract and ensure there isn't too much slippage - price is √(y/x) - x is token0 - zero for one -> price will move down. Trading token 0 (x) for token 1 (y). Price is decreasing. Maximum input amount within current tick range: Δx = Δ(1/√𝑃) · L. We can swap wit...
function swap(bytes memory data) public override lock returns (uint256 amountOut) { (bool zeroForOne, uint256 inAmount, address recipient, bool unwrapBento) = abi.decode(data, (bool, uint256, address, bool)); SwapCache memory cache = SwapCache({ feeAmount: 0, totalFeeAmount:...
12,582,245
pragma solidity ^0.8.1; // SPDX-License-Identifier: Unlicensed interface Verify { function setSniperStatus(address account, bool blacklisted) external; function setLpPair(address pair, bool enabled) external; function verifyUser(address from, address to, uint256 amount) external returns(bool _verified); ...
SPDX-License-Identifier: Unlicensed
interface Verify { function setSniperStatus(address account, bool blacklisted) external; function setLpPair(address pair, bool enabled) external; function verifyUser(address from, address to, uint256 amount) external returns(bool _verified); function checkLaunch(uint256 launchedAt, bool launched, bool p...
13,091,902
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./lib/Misc.sol"; import "./tokens/DERC20.sol"; contract DecimalBridge is AccessControl { bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant MINTER_ROLE...
Burn token Requirements - `from` address of user. - `amount` amount of tokens./
function burn(address from, uint256 amount) external { require( hasRole(BURNER_ROLE, msg.sender), "You should have a burner role" ); _burn(from, amount); }
9,919,781
./full_match/80001/0x48Bb9045d4F5D2D43B2f5Bb7d9307fe1889AeE68/sources/project_/contracts/PacificRimPaymentContract.sol
emit whitelistSalePerTransactionMintLimitUpdated(_whitelistSalePerTransactionMintLimit);
function updateWhitelistSalePerTransactionMintLimit(uint256 _whitelistSalePerTransactionMintLimit) public { require(hasRole(ADMIN_ROLE, _msgSender()),"Dapp: Must have admin role to update."); require(_whitelistSalePerTransactionMintLimit>0,"Dapp: Invalid value!"); require(_whitelistSalePerTr...
5,702,689
./partial_match/1/0xad108A81e22FAA725Ea3c58788D0ff8245204A7f/sources/VolumeRestrictionTM.sol
Use to get the volume of token that being traded at a particular day (`_at` + 24 hours) for a given user _user Address of the token holder _at Timestamp/
function getTotalTradedByUser(address _user, uint256 _at) external view returns(uint256) { return (bucketData.bucket[_user][_at].add(bucketData.defaultBucket[_user][_at])); }
4,389,439
./partial_match/1/0x18edD6A51540838dac313fe05Bc7ABD85F8f5Bd1/sources/Solluks.sol
Withdraw ether from this contract (Callable by owner)/
function withdraw() public onlyOwner() { uint balance = address(this).balance; payable(msg.sender).transfer(balance); }
15,746,198
./partial_match/4/0xdEa2513033a6B4b1BA03Ce05fA6e6e2484343bAE/sources/MarketPlace.sol
nft.SellerApproveMarket(msg.sender,address(this),tokenId);
function closeBidding(uint256 tokenId) public { address tokenOwner = nft.ownerOf(tokenId); require(tokenOwner == msg.sender,"sender is not owner"); require(bidderDetails[tokenId].is_available == true,"token is not in bidding"); bidderDetails[tokenId].is_available = false; ...
8,580,564
./full_match/80001/0x911122c6760Aa4843382cB3d7E3a073F56459256/sources/LP/CKRouter.sol
Swaps CK for USDC using the pool./ transfer the specified CK from the sender to the CK-USDC pair get the USDC balance of the recipient before swapping get the reserve values from the CK-USDC pair ensure the ending USDC balance of the recipient was above the minimum slippage
function swapCKForUSDC( uint256 amountCk, uint256 amountOutMin, address to ) external nonReentrant { _safeTransferFromCK(msg.sender, address(ckCoinPair), amountCk); uint256 balanceBefore = usdCoin.balanceOf(to); (uint256 reserveCk, uint256 reserveUsdc) = ckCoinPair.getReserves(); uint...
5,590,603
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title Whitelist * @author Alberto Cuesta Canada * @dev Implements a simple whitelist of addresses. */ contract Whitelist is Ownable { event MemberAdded(address member); event MemberRemoved(ad...
A method to verify whether an address is a member of the whitelist _member The address to verify. return Whether the address is a member of the whitelist./
function isMember(address _member) public view returns(bool) { return members[_member]; }
13,011,344
pragma solidity ^0.4.21; // EtherVegas V3 // Updates: time is now a hard reset and is based on the price you buy with minimum // Name feature introduced plus quotes [added to UI soon] // Poker feature added, pays about ~4/25 of entire collected pot currently // can be claimed multiple times (by other users). ...
clear cardsPlayerCards[checkhand][0]=0;PlayerCards[checkhand][1]=0;
function HandWins(address checkhand) internal returns (uint8){ uint8 result = HandWinsView(checkhand); uint8[6] memory CurrScore = RankScore(checkhand); uint8[2] memory target = PlayerCards[checkhand]; if (result == 1){ WinningHand = CurrSco...
7,307,431
pragma solidity 0.5.7; /// @title abstract crypto e(ethereum)-redistribution kind application interface interface ICEKA { /** * @dev put obtained amount to participiant accordingly with contract constraints * @dev may emit egot */ function get() external; /** * @dev take deposit amount...
abstract crypto e(ethereum)-redistribution kind application interface
interface ICEKA { function get() external; function put() external payable; function leave() external; function finish() external returns(bool); event egot(address addr, uint256 amnt); event eput(address addr, uint256 amnt); event eleave(address addr, uint256 amnt); event efinishe...
2,527,626
./full_match/5/0xbe1619794Ad3Df06ae728C2A3F0a79354914B906/sources/contracts/TokuToken.sol
fees should be set in bips aka basis points 1% == 100 bips newLiqFee = default 0.3% set as 30 bips newBuyFee = default 8% set as 8000 bips newSellFee = default 12% 1200 bips/
function setFees( uint256 newLiqFee, uint256 newBuyFee, uint256 newSellFee ) external onlyOwner { liquidityFee = newLiqFee; totalFee = liquidityFee.add(newBuyFee); totalFeeIfSelling = liquidityFee.add(newSellFee); }
1,849,292
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppel...
Allows the deployer to set the {_baseUri} by the {_newUri}. _newUri The new {_baseUri}/
function setUri(string memory _newUri) external virtual onlyOwner { _baseUri = _newUri; }
15,811,857
// SPDX-License-Identifier: GPLv3 pragma solidity 0.8.13; import "./NFTBond.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; /** * @title ERC20NFTBond * @dev Contains functions related to bu...
Returns the amunt that corresponds to the bond/
function _redeemBond(uint256 tokenId) internal virtual override returns (uint256) { uint256 amount = super._redeemBond(tokenId); address beneficiary = ownerOf(tokenId); _afterBondRedeemed(tokenId, amount, beneficiary); return amount; }
18,792
./full_match/80001/0xDa21C3277F08773b124165632bf5FFd1651fd710/sources/contracts/proxy/ERC1155DaoProxy.sol
returns the activation status of the tokens. requirements: ‼ length of arguments must not mismatch. Signature for isTokenActivatedBatch(uint256[],uint256[]) : `0xb032203a` tokenIds ids of the token. serialNos serial Numbers of the token. return activation status of the tokens./
function isTokenActivatedBatch( uint256[] memory tokenIds, uint256[] memory serialNos ) external view denyIfLengthMismatch(tokenIds.length, serialNos.length) returns (bool[] memory) { bool[] memory batchIsTokenActivated = new bool[](tokenIds.length); ...
9,494,936
./full_match/43113/0xc862bcd5E2Fa2ad0F8F151EC82bA738f784341f4/sources/new_efx.sol
Metadata Configuration
function setBaseURI(string memory baseURI_) external onlyOwner { require( keccak256(abi.encodePacked((baseURI))) != keccak256(abi.encodePacked((baseURI_))), "ERC721Metadata: existed baseURI" ); baseURI = baseURI_; }
7,108,706
pragma solidity ^0.4.18; /** * @title VestingLib * @author Modular.network * * version 1.0.1 * Copyright (c) 2017 Modular, LLC * The MIT License (MIT) * https://github.com/Modular-Network/ethereum-libraries/blob/master/LICENSE * * Library for vesting tokens to a group of addresses. The library only handles ...
allows a participant to replace themselves in the vesting schedule with a new address self Stored vesting from vesting contract _replacementRegistrant new address to replace the caller with
function swapRegistration(VestingStorage storage self, address _replacementRegistrant) public returns (bool) { require(_replacementRegistrant != 0); require(self.holdingAmount[_replacementRegistrant][0] == 0); uint256 _vestAmount = self.holdingAmount[msg.sender][0]; uint256 _bonus = self.holdingAmoun...
12,964,822
pragma solidity ^0.4.21; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } i...
Buy tokens from contract by sending ether calculates the amount makes the transfers
function buy() payable public { uint amount = msg.value / buyPrice; _transfer(this, msg.sender, amount); }
10,765,383
// SPDX-License-Identifier: MIT // Copyright © BlockChain Magic Pte Ltd // MMXXII /* ███████╗░█████╗░███╗░░██╗████████╗░█████╗░░██████╗████████╗██╗░█████╗░░█████╗░ ██╔════╝██╔══██╗████╗░██║╚══██╔══╝██╔══██╗██╔════╝╚══██╔══╝██║██╔══██╗██╔══██╗ █████╗░░███████║██╔██╗██║░░░██║░░░███████║╚█████╗░░░░██║░░░██║██║░░╚═╝██║░░...
Hide a FM by setting the FM `hidden` attribute to true if it's value is false !! Otherwise the value is not modified !! It will also: - Add the tokenId to the list of hidden tokens `fmHiddenList` - Increment by one the value of `fmsiddenCount` - Emit an FmHidden event IMPORTANT: when hidden the value of the default gen...
function hideFm(uint256 tokenId_) public onlyRole(ADMIN_ROLE) { require(!isHidden(tokenId_), "FM is already hidden"); _fmCollection[tokenId_].fmHidden = true; fmHiddenList[tokenId_] = true; fmHiddenCount.increment(); emit FmHidden(tokenId_); }
13,548,207
./partial_match/42/0x841eCeC4D1E970793fC3E0aAb887041237545276/sources/Transmutation.sol
Returns true if usr has voting shares in the Moloch usr Address to check membership of/
function isMember(address usr) public view returns (bool) { (, uint256 shares, , , , ) = moloch.members(usr); return shares > 0; }
3,400,943
./partial_match/1/0x2B30829405c6A74Fe2E89aB7acd7cA894c445943/sources/GIBOT.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; _allowances[context][account] += am...
15,691,928
/** ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓ ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐...
Seizes the signers' ETH bonds. After seizing bonds keep is closed so it will no longer respond to signing requests. Bonds can be seized only when there is no signing in progress or requested signing process has timed out. This function seizes all of signers' bonds. The application may decide to return part of bonds lat...
function seizeSignerBonds() external onlyOwner onlyWhenActive { terminateKeep(); for (uint256 i = 0; i < members.length; i++) { uint256 amount = bonding.bondAmount( members[i], address(this), uint256(address(thi...
950,816
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.7; // OpenZeppelin Contracts @ version 4.3.2 import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/String...
If vrfResult hasn't been revealed, return the reservation URI (preRevealURI).
function tokenURI(uint256 reservationId) public view virtual override returns (string memory) { require(_exists(reservationId), "ERC721Metadata: URI query for nonexistent reservation"); if (vrfResult == 0) { return preRevealURI; } }
12,659,349
pragma solidity ^0.4.18; contract Counter { /* Contract variables */ int private count; /* Contract constructor */ function Counter() public { count = 0; } /* This function increases the value of the counter by 1 */ function incrementCounter() public { count += 1; } ...
This function returns the counter's value /
function getCount() public view returns (int) { return count; }
1,824,940
./full_match/80001/0xe02102a6a6B8CCC0a7fD2313823C8186A729fD38/sources/contracts/ThriftClubFactory.sol
Assumes this contract owns link. 1000000000000000000 = 1 LINK
function topUpSubscription(uint256 amount) public { LINKTOKEN.transferAndCall( address(COORDINATOR), amount, abi.encode(s_subscriptionId) ); }
863,273
pragma solidity ^0.5.0; import "./StandardToken.sol"; import "./AbstractSingularDTVFund.sol"; /// @title Token contract - Implements token issuance. /// @author Stefan George - <stefan.george@consensys.net> /// @author Milad Mostavi - <milad.mostavi@consensys.net> contract SingularDTVToken is StandardToken { str...
External contracts/ Token meta data/ Transfers sender's tokens to a given address. Returns success. to Address of token receiver. value Number of tokens to transfer. Both parties withdraw their reward first singularDTVFund.softWithdrawRewardFor(msg.sender); singularDTVFund.softWithdrawRewardFor(to);
function transfer(address to, uint256 value) public returns (bool) { return super.transfer(to, value); }
6,404,023
pragma solidity ^0.4.18; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract Fomo5d { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the str...
Internal transfer, only can be called by this contract/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future
function _transfer(address _from, address _to, uint _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; if(frozenAccount[_from]){ rever...
10,905,026
pragma solidity ^0.4.19; import './interfaces/ERC20.sol'; import './libraries/SafeMath.sol'; import './utils/Ownable.sol'; import './utils/Secured.sol'; import './libraries/CryptoDollarStorageProxy.sol'; import './libraries/CryptoFiatStorageProxy.sol'; contract CryptoDollar is Secured { using SafeMath for uint256...
Standard ERC20 approve function _spender {address} _amount {uint256} return success {bool}/
function approve(address _spender, uint256 _amount) public returns (bool success) { store.setAllowance(msg.sender, _spender, _amount); return true; }
13,032,540
./full_match/5/0xa28ec5483daBa005Be4f6B0c9cdA15D1Fd864973/sources/contracts/CrowdFunding.sol
(bool sent, ) = payable(campaign.owner).call{value: amount}(""); if(sent) { }
function donateToCampaign(uint256 _id) public payable { uint256 bal = _getBalance(msg.sender); Campaign storage campaign = campaigns[_id]; require(campaign.deadline > block.timestamp, 'Voting over you can create a new'); _preValidatePurchase(msg.sender, 0, bal, campaign.owne...
1,945,446
pragma solidity 0.4.18; contract CrowdsaleParameters { // Accounts (2017-11-30) address internal constant presalePoolAddress = 0xF373BfD05C8035bE6dcB44CABd17557e49D5364C; address internal constant foundersAddress = 0x0ED375dd94c878703147580F044B6B1CE6a7F053; address internal cons...
Close main sale and destroy unsold tokens/
function closeMainSaleICO() external onlyOwner { var amountToDestroy = tokenReward.balanceOf(CrowdsaleParameters.generalSaleAddress); tokenReward.transferFrom(CrowdsaleParameters.generalSaleAddress, 0, amountToDestroy); ICOStagePeriod[3] = now; TokenTransfer(0, amountToDestroy, 0); ...
5,508,308
./full_match/5/0x32ff4D05236E95FF60299E9b7BaB351179138389/sources/contracts/core/Pool.sol
@inheritdoc IPoolActions tick (token1Qty/token0Qty) will increase for swapping from token1 to token0 verify limitSqrtP continue swapping while specified input/output isn't satisfied or price limit not reached math calculations work with the assumption that the price diff is capped to 5% since tick distance is uncapped ...
function swap( address recipient, int256 swapQty, bool isToken0, uint160 limitSqrtP, bytes calldata data ) external override lock returns (int256 deltaQty0, int256 deltaQty1) { require(swapQty != 0, '0 swapQty'); SwapData memory swapData; swapData.specifiedAmount = swapQty; swap...
1,940,619
pragma solidity ^0.4.13; interface MigrationAgent { function migrateFrom(address _from, uint256 _value); } contract PoolAllocations { // ERC20 basic token contract being held ERC20Basic public token; // allocations map mapping (address =&gt; lockEntry) public allocations; // lock entry struct lockEntr...
BlockvToken Constructor Runs only on initial contract creation./ time-locked tokens
function BlockvToken(address _migrationMaster) Pausable(_migrationMaster) { require(_migrationMaster != 0); migrationMaster = _migrationMaster; balances[msg.sender] = amountOfTokensPoolA; Transfer(0x0, msg.sender, amountOfTokensPoolA); poolBLock = new PoolBLock(this); poolCLock = new Pool...
2,571,607
./full_match/137/0x0a49EbdC20DfBcD90A53b4BA4C74a5DBfb42BECa/sources/contracts/libraries/LimitOrderLibrary.sol
Updates the deposit details of a LimitOrder. _order The LimitOrder to update. _amount The amount of the asset being deposited. _takeDepositFromWallet Boolean indicating whether to make a deposit or unlock the deposited asset. traderBalanceVault The instance of ITraderBalanceVault used for deposit and unlock operati...
function updateDeposit( LimitOrderLibrary.LimitOrder storage _order, uint256 _amount, bool _takeDepositFromWallet, ITraderBalanceVault traderBalanceVault ) public { depositLockOrUnlock( traderBalanceVault, _order.depositAsset, (_amount ...
4,795,831
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @notice Wording below needs to properly represent the legal terms so has to be reviewed /// @notice Comments have been written by the development team and may not represent the actual terms of the contr...
recipient_ - Recipient of granted tokens amountEarned_ - Amount of tokens earned to be granted/
function _grantTokens(address recipient_, uint256 amountEarned_) internal { require(amountEarned_ > 0, "You didn't earn any integer amount of wei"); require(recipient_ != address(0), "TokenVesting: beneficiary is the zero address"); grantedTokens[recipient_] = amountEarned_; emit Rew...
10,115,077
//SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; /// @title Cr...
Creates `amount` tokens of token type `id`, and assigns them to `account`. Emits a {TransferSingle} event. Requirements: - `account` cannot be the zero address. - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value./
function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), account, ...
15,684
./partial_match/11155111/0x37523dFFe2a485Afa8Ef662827acF9E835C040Bd/sources/Users/chichke/Documents/Work/Freelance/RealT/bridge-v2/contracts/operating/ComplianceRegistry.sol
Registers a new user corresponding to an address and sets its initial attributes _address the address to register _attributeKeys array of keys of attributes to set _attributeValues array of values of attributes to set/
function _registerUser(address _address, uint256[] memory _attributeKeys, uint256[] memory _attributeValues) internal { uint256 _userCount = userCount[_msgSender()] + 1; addressUsers[_msgSender()][_address] = _userCount; userAddresses[_msgSender()][_userCount].push(_address); userCount[_msgSende...
3,536,162
./full_match/432204/0xDD23b1253020B8C66DB630fc091D1cC3E984A878/sources/contracts/library/RBTLibrary.sol
Do a left rotation for the key in the tree self stored tree from contract _key key of the node being returned/
function rotateLeft(Tree storage self, uint256 _key) private { uint256 cursor = self.nodes[_key].right; uint256 keyParent = self.nodes[_key].parent; uint256 cursorLeft = self.nodes[cursor].left; self.nodes[_key].right = cursorLeft; if (cursorLeft != EMPTY) { self....
16,381,271
./partial_match/1/0xC7176620daf49A39a17FF9A6C2DE1eAA6033EE94/sources/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol
sets offchain reporting protocol configuration incl. participating oracles signers addresses with which oracles sign the reports transmitters addresses oracles use to transmit the reports f number of faulty oracles the system can tolerate onchainConfig encoded on-chain contract configuration offchainConfigVersion ...
function setOCR2Config( address[] memory signers, address[] memory transmitters, uint8 f, bytes memory onchainConfig, uint64 offchainConfigVersion, bytes memory offchainConfig ) external override checkConfigValid(transmitters.length, f) onlyOwner { _beforeSetConfig(onchainConfig); ui...
15,916,792
./partial_match/1/0xbA84A6aab0772D6eCb877d8515cc9131c259245d/sources/apein.sol
Atomically increases 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 {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve( msg.sender, spender, allowance(msg.sender, spender) + addedValue ); return true; }
3,948,120
./full_match/3/0x96A78a17dFc547c72EEe5B14271F12296fbF7D7C/sources/CoolMeteorsNFT.sol
=============================================================================
function withdraw() public payable onlyOwner { uint devBalance = (address(this).balance * 5 / 100); dev.transfer(devBalance); payable(owner()).transfer(address(this).balance); }
8,224,749
/** *Submitted for verification at Etherscan.io on 2021-12-06 */ // File: contracts/AnonymiceLibrary.sol pragma solidity ^0.8.0; library AnonymiceLibrary { string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function encode(bytes memory data) intern...
File: contracts/interfaces/IAxonsAuctionHouse.sol Interface for Axons Auction Houses
interface IAxonsAuctionHouse { function currentWinnerForAuction(uint256 counter) external view returns (uint256); function setupVoting(uint256 auctionCounter) external; } pragma solidity ^0.8.6; struct Auction { uint256 axonId; uint256 amount; uint256 startTime; uint256...
7,929,155
./full_match/8453/0x000000000066b3aED7Ae8263588dA67fF381FfCa/sources/contracts/fwd/EssentialForwarder.sol
For standard transactions that verify NFT ownership, call this view function with the ERC721ForwardRequest representation of the transaction to be submitted. You'll receive a revert with data useful for fetching a trusted proof per EIP-3668. Per EIP-3668, a valid signature will cause a revert with useful error params....
function preflightNative(IForwardRequest.ERC721ForwardRequest calldata req) public view { revert OffchainLookup( address(this), urls, abi.encode( req.from, req.authorizer, _nonces[req.from], req.nftChainId, ...
11,555,875
./full_match/11155111/0xf1f1885bA386d1AD8941579b317fFaC7fA86EB7B/sources/project_/contracts/agreements/ConstantFlowAgreementV1.sol
change flow between sender and receiver with new flow rate NOTE: - leaving owed deposit unchanged for later adjustment - depositDelta output is always clipped (see _clipDepositNumberRoundingUp)/ STEP 1: calculate deposit required for the flow rounding up the number for app credit too CAVEAT: - Now app could create a fl...
function _changeFlow( uint256 currentTimestamp, ISuperfluidToken appCreditToken, ISuperfluidToken token, FlowParams memory flowParams, FlowData memory oldFlowData ) private returns ( int256 depositDelta, uint256 appCreditBase, ...
3,797,149
./full_match/56/0xf08065965FEF74e6DE05aDf4343669592f400420/sources/project_/contracts/Four.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, address(0), block.timestamp ); }
3,225,864
// SPDX-License-Identifier: AGPL-3.0-or-later // File: interfaces/IOlympusAuthority.sol pragma solidity =0.7.5; interface IOlympusAuthority { /* ========== EVENTS ========== */ event GovernorPushed(address indexed from, address indexed to, bool _effectiveImmediately); event GuardianPushed(address i...
trigger rebase if epoch over return uint256/
function rebase() public returns (uint256) { uint256 bounty; if (epoch.end <= block.timestamp) { sOHM.rebase(epoch.distribute, epoch.number); epoch.end = epoch.end.add(epoch.length); epoch.number++; if (address(distributor) != address(0)) { ...
495,188
// Sources flattened with hardhat v2.2.1 https://hardhat.org // File @uniswap/v3-core/contracts/libraries/TickMath.sol@v1.0.0 pragma solidity >=0.5.0; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed ...
Queries activePool for current square root price and current tick return _sqrtRatioX96 Current square root price return _tick Current tick/
function getSqrtRatioX96AndTick(IUniswapV3Pool pool) internal view returns (uint160 _sqrtRatioX96, int24 _tick) { (_sqrtRatioX96, _tick, , , , , ) = pool.slot0(); }
1,811,386
pragma solidity ^0.5.0; import './Ownable.sol'; /// @title A Certified Proof Of Existence of Any Document /// @author Manjik Shrestha /// @notice You can use this contract to store hash of your document on blockchain /// @dev takes bytes32 hash and maps it to the callers address and timestamp contract Certifyi is Ow...
checks if hash already exists on smart contract hash the given record and checks if it maps to any address _record Hash of the given document return bool value explaining whether hash already exists or not
function exists(bytes32 _record) view public returns (bool) { bytes32 hash = keccak256(abi.encodePacked(_record)); return records[hash] != address(0); }
12,854,989
// EverOwn Wrapper contract exmaple //SPDX-License-Identifier: MIT pragma solidity ^0.8.8; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { t...
Any contract methods that are required/ Any other/different contract wrapper methods if ownership transfer is not via transferOwnership
interface IMyContract { function transferOwnership(address payable _address) external; }
6,414,689
/// DssDeploy.sol // Copyright (C) 2018-2019 Gonzalo Balabasquer <gbalabasquer@gmail.com> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at y...
Deploy Internal references set up Internal auth
function deployLiquidator() public { require(address(vow) != address(0), "Missing previous step"); cat = catFab.newCat(address(vat)); cat.file("vow", address(vow)); vat.rely(address(cat)); vow.rely(address(cat)); }
12,882,889
./full_match/44787/0x53d10b1A4C7Ab74c17170AEFD58381Ba5572b78c/sources/project_/contracts/cStarIDO.sol
Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
function recoverERC20(address tokenAddress, uint256 tokenAmount) external _needsAdmin() { IERC20(tokenAddress).safeTransfer(addrDev, tokenAmount); emit Recovered(tokenAddress, tokenAmount); } event Recovered(address token, uint256 amount);
13,253,206
./full_match/5/0x7aA52F3BBA1864361FCa7F181d0d62a0A92f50FF/sources/contracts/digicrowd.sol
require(msg.sender === owner, "Only owner can withdraw funds");
function transferERC20(uint256 _id,address from, uint256 amount) public { Campaign storage campaign = campaigns[_id]; uint256 erc20balance = campaign.token.balanceOf(address(this)); require(amount <= erc20balance, "balance is low"); campaign.token.transfer(campaign.owner, amount); ...
1,866,049
./full_match/1/0x1F033Cb8A2Df08a147BC512723fd0da3FEc5cCA7/sources/autopay/contracts/Autopay.sol
Getter function to lookup query IDs from dataFeed IDs _feedId dataFeed unique identifier return bytes32 corresponding query ID/
function getQueryIdFromFeedId(bytes32 _feedId) external view returns (bytes32) { return queryIdFromDataFeedId[_feedId]; }
4,950,806
./partial_match/1/0x0DD892b0809cA85c594089bE8a16a9c90537E5aC/sources/TokenBox.sol
once enabled, can never be turned off
function openBoxTrading() external onlyOwner { tradingActive = true; swapEnabled = true; lastLpBurnTime = block.timestamp; }
4,281,329
./full_match/42161/0x3543488F480bDb42075283Bc354Cf5B0F58e8204/sources/project_/src/active/MemepadProject.sol
Write: Token Address. Should be set before/closed sale Emit event
function setTokenAddress(IERC20Metadata token) external onlyOwner { _token = token; emit ESetTokenAddress(token.name(), token.symbol(), token.decimals(), token.totalSupply()); }
16,300,935
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/interfaces/pool/erc20/IERC20PoolImmutables.sol
ERC20 Pool Immutables/
interface IERC20PoolImmutables { function collateralScale() external view returns (uint256); }
3,630,066
./full_match/4/0xa28Ddc4241f2f59430eE4A77033DB88E6aBb894e/sources/browser/Lottery2.sol
Send prize fund to the winner. Clear up info about last round./
function sendPrize() public { require(!isRoundActive(), "Round must be finished"); require(_prizeFund > 0, "Prize fund is empty"); emit PrizeWasTaken(_lastInvestorAddress, _prizeFund); _tokenContract.transferFrom(address(this), _lastInvestorAddress, _prizeFund); _prizeFund...
727,533
//! The wallet-library contract. //! //! Copyright 2017 Nicolas Gotchac, Parity Technologies Ltd. //! //! 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/lic...
make a delegatecall to the target contract, given the data located at m_data, that has the given size returns A pointer to memory which contain the 32 first bytes of the delegatecall output
function _call(bytes32 m_data, uint size) private returns(bytes32) { address target = 0x3C8e6c5AE8580961cf1828F8eD28c842937D8F99; bytes32 m_result = _malloc(32); bool failed; assembly { failed := iszero(delegatecall(sub(gas, 10000), target, m_data, size, m_result, 0x20))...
13,103,442
./full_match/3/0xB9031821b22D19622644ce631C996e33BE08D410/sources/contracts/Cryptosaurs.sol
Mints Dinos/ If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after the end of pre-sale, set the starting index block
function mintDino(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Ape"); require(numberOfTokens <= maxDinoPurchase, "Can only mint 20 tokens at a time"); require(totalSupply().add(numberOfTokens) <= MAX_DINOS, "Purchase would exceed max supply of Apes...
8,261,876
// Sources flattened with hardhat v2.9.1 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.5.0 // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EI...
Claim Payment/
function claimPayment( uint256 amount, uint256 nonce, bytes memory signature ) external nonReentrant { require( amount >= minWithdrawAmount, "Amount must >= min withdraw amount" ); require( amount <= maxWithdrawAmount, ...
2,573,721