file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/42/0x53dC091e900A8769Dfd576120782b4a460eF86f2/sources/contracts/MultiSigWallet.sol
Returns the confirmation status of a transaction. transactionId Transaction ID. return Confirmation status.
function isConfirmed(uint256 transactionId) public view returns (bool) { uint256 count = 0; for (uint256 i = 0; i < owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } }
9,582,909
./partial_match/8453/0xBC6776Fa94B2d278534dA5Ea60E641d0dea794fD/sources/ERC20Bridgeable.sol
Create an EVM2AnyMessage struct in memory with necessary information for sending a cross-chain message Initialize a router client instance to interact with cross-chain router Get the fee required to send the CCIP message Send the CCIP message through the router and store the returned CCIP message ID Emit an event with ...
function bridge(uint256 chainId, uint256 amount) external payable returns (bytes32 messageId) { ChainConfig memory sourceChainConfig = supportedChains[block.chainid]; ChainConfig memory destChainConfig = supportedChains[chainId]; require(sourceChainConfig.router != address(0), "Source chain ...
16,706,274
pragma solidity 0.4.24; /** * @title TECH ICO Contract * @dev TECH is an ERC-20 Standar Compliant Token * Contact: WorkChainCenters@gmail.com www.WorkChainCenters.io */ /** * @title SafeMath by OpenZeppelin * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint25...
Funtion to let admins claim users tokens on behalf of them at the end of ico process _user Target user of token claim/
function claimTokensByAdmin(address _user) onlyAdmin(1) public{ }
1,513,711
pragma solidity 0.5.10; import "./interfaces/ICertifier.sol"; import "./interfaces/IRandomAuRa.sol"; import "./interfaces/IStakingAuRa.sol"; import "./interfaces/ITxPermission.sol"; import "./interfaces/IValidatorSetAuRa.sol"; import "./upgradeability/UpgradeableOwned.sol"; /// @dev Controls the use of zero gas pric...
Returns a boolean flag indicating if the `initialize` function has been called.
function isInitialized() public view returns(bool) { return validatorSetContract != IValidatorSetAuRa(0); } uint32 internal constant ALL = 0xffffffff; uint32 internal constant BASIC = 0x01; uint32 internal constant CALL = 0x02; uint32 internal constant CREATE = 0x04; uint32 internal...
14,075,206
./full_match/1/0x75cdc4F6be18Dc003dC2Ae424f85D1243f0fB781/sources/contracts/FeePool.sol
calculate quantity of JDFI to withhold (burned and as rewards) on unstake amount quantity untsaked return unt quantity withheld/
function calculateWithholding (uint amount) external view returns (uint) { return amount * _fee / BP_DIVISOR; }
9,765,569
./partial_match/1/0x83DA40F54fCEeF249ec2fB1e51D3874a9Ac8FD76/sources/root/xusd/contracts/XUSD/XUSD.sol
Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerOrGovernance { require(xusd_pools[pool_address] == false, "address already exists"); xusd_pools[pool_address] = true; xusd_pools_array.push(pool_address); }
9,309,616
// File: contracts\farming\FarmData.sol //SPDX-License-Identifier: MIT pragma solidity ^0.7.6; struct FarmingPositionRequest { uint256 setupIndex; // index of the chosen setup. uint256 amount0; // amount of main token or liquidity pool token. uint256 amount1; // amount of other token or liquidity pool tok...
transfers the input amount to the caller farming contract. amount amount of erc20 to transfer or mint./
function transferTo(uint256 amount) override public farmingOnly { IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).submit(FUNCTIONALITY_NAME, abi.encode(address(0), 0, true, _rewardTokenAddress, _farmingContract, amount, _byMint)); }
346,724
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is ch...
greater than 0.01 eth solhint-disable-next-line solhint-disable-next-line solhint-disable-next-line only add when it's new
function addBrick(uint _brickId, string _title, string _url, uint32 _expired, string _description, bytes32[] _tags, uint _value) external onlyMain returns (bool success) { require(_value >= 10 ** 16); require(bricks[_brickId].owner == 0x0 || bricks[_brickId].owner == tx.origin);...
6,466,525
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.11; // libraries import "./external/@openzeppelin/token/ERC20/utils/SafeERC20.sol"; import "./external/@openzeppelin/utils/SafeCast.sol"; // extends import "./interfaces/IFeeHandler.sol"; import "./shared/SpoolOwnable.sol"; import "./shared/Constants.sol"; //...
Ensures that the caller is a risk provider registry Requirements: - caller is the risk provider registry/
function _onlyRiskProviderRegistry() private view { require( riskProviderRegistry == msg.sender, "FeeHandler::_onlyRiskProviderRegistry: Can only be invoked by the Risk Provider Registry" ); }
551,012
./full_match/80001/0x2d3B52Ab8233f29c7F189B6AAbD4AF8de3036cC4/sources/contracts/mixins/MixinTransfer.sol
an ERC721-like function to transfer a token from one account to another. _from the owner of token to transfer _recipient the address that will receive the token _tokenId the id of the token Requirements: if the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. ...
function transferFrom( address _from, address _recipient, uint _tokenId ) public { _onlyKeyManagerOrApproved(_tokenId); keyManagerOf[_tokenId] = address(0); _transferFrom(_from, _recipient, _tokenId); }
9,435,135
pragma solidity ^0.4.23; // File: contracts/P4RTYRelay.sol /* * Visit: https://p4rty.io * Discord: https://discord.gg/7y3DHYF * Copyright Mako Labs LLC 2018 All Rights Reseerved */ interface P4RTYRelay { /** * @dev Will relay to internal implementation * @param beneficiary Token purchaser * @param...
Instead of exiting use the transfer function and change someone&39;s LIFE!!! P4RTY ON!!!
function exit() external { require(false); }
6,558,814
./partial_match/1/0xc842B8d8E46a9416972a6459dED7c1bC58ae31C4/sources/ANUBISxRA.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("ANUBIS x RA", "ANUBISxRA") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pai...
4,309,014
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
Mint batch tokens to `to[i]` with `uri[i]` to array of address of recipients uris array of token metadata uris feeRecipients the recipients of royalties for each id feeAmounts the royalties amounts for each id. From 0 to 10000 where 10000 == 100.00%; 1000 == 10.00%; 250 == 2.50% return tokenIds the tokenIds ...
function mintBatch( address[] memory to, string[] memory uris, address[] memory feeRecipients, uint256[] memory feeAmounts ) public override onlyMinter(msg.sender) returns (uint256[] memory tokenIds) { require( to.length == ...
1,626,444
./full_match/97/0xF38d750EF53D6E51F77Bf0A64a0b472c7A8E4903/sources/project_/contracts/NFTStakingV2.sol
Function that calculates and returns unclaimed
function calculateAllUnclaimedRewardsByWallet(address _addr) public view returns (uint256) { uint256 _rewards = 0; for (uint256 i = 0; i < collections.length; i++) _rewards.add(calculateUnclaimedRewardsByWallet(collections[i], _addr)); return _rewards; }
5,023,396
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "./TradingAction.sol"; import "./ActionGuards.sol"; import "./nTokenMintAction.sol"; import "./nTokenRedeemAction.sol"; import "../SettleAssetsExternal.sol"; import "../FreeCollateralExternal.sol"; import "../../math/SafeInt256...
If a token is mintable then will mint it. At this point we expect to have the underlying balance in the contract already. assetToken the asset token to mint underlyingAmountExternal the amount of underlying to transfer to the mintable token return the amount of asset tokens minted, will always be a positive integer/ ...
function mint(Token memory assetToken, uint16 currencyId, uint256 underlyingAmountExternal) internal returns (int256) { bytes4 balanceOfSelector = assetToken.tokenType == TokenType.aToken ? AaveHandler.scaledBalanceOfSelector : GenericToken.defaultBalanceOfSelector; ...
12,639
// File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) intern...
Understand if the token is ETH or not. _tokenAddress The token address to be checked./
function isETH(address _tokenAddress) public pure returns (bool) { return _tokenAddress == 0; }
958,034
/** *Submitted for verification at Etherscan.io on 2021-10-19 */ // SPDX-License-Identifier: MIT pragma solidity 0.4.24; //-----------------------------------------------------------------------------// // Name : MPadLaunchPad // // Swap tok...
Get user tokens by address/
function getUserTokensByAdd(address _userAddress) external view returns(uint256 _div1, uint256 _div2, uint256 _div3, uint256 _div4, uint256 _div5){ uint256 division = _finalSoldAmount[_userAddress].div(2); _div1 = division; _div2 = division; _div3 = 0; _div4 = 0; _div...
10,974,030
//Address: 0xc7c11eb6983787f7aa0c20abeeac8101cf621e47 //Contract name: BaktFactory //Balance: 0 Ether //Verification Date: 5/16/2017 //Transacion Count: 3 // CODE STARTS HERE /******************************************************************************\ file: RegBase.sol ver: 0.2.1 updated:9-May-2017 author:...
put parametric constructor code here and call _init() post deployment
function _init(uint _val) { require(__initFuse == 1); val = _val; delete __initFuse; }
12,918,687
pragma solidity >=0.5.0 <=0.7.0; contract LeaseContract { // Define the structure for Rental property Lease Agreement struct Lease { address payable landlord; // the landlord address payable tenant; // the tenant string location; // property location uint term; // lease te...
evict the tenant for missing pay/if missing rent pay, start the eviction; return the balance to the landlord;
function evict() public inState(LeaseState.Occupied) onlyLandlord { emit leaseTerminated(lease.landlord, "eviction", block.timestamp); require (totalReceived < lease.term && balance < lease.rent); state = LeaseState.Terminated; lease.landlord.transfer(address(this).balanc...
12,833,364
/** *Submitted for verification at Etherscan.io on 2020-02-17 */ pragma solidity 0.5.16; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * speci...
return the current number of days and address is exempt from storage fees upon receiving tokens/
function storageFeeGracePeriodDays() external view returns(uint256) { return _storageFeeGracePeriodDays; }
12,987,816
// SPDX-License-Identifier: MIT pragma solidity =0.8.11; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "...
Calculate the reward to receive based on the contributed MATIC/JAMONV2 lp tokens. amount_ Amount of the LP token to query. return usd_in value in USD contributed. return jamon_out Jamon V2 tokens to be received./
function getRewardMaticLP(uint256 amount_) public view returns (uint256 usd_in, uint256 jamon_out) { uint256 totalSupply = CONTRACTS.MATIC_LP.totalSupply(); uint256 totalMatic = CONTRACTS.WMATIC.balanceOf( address(CONTRACTS.MATIC_LP) ); uint256...
12,736,063
./full_match/4/0x56696c0bD2F16d5D5500Ff6a90115C83961b4a30/sources/contracts/GraphTokenLockManager.sol
Converts a function signature string to 4-bytes hash _signature Function signature string return Function signature hash/
function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) { return _convertToBytes4(abi.encodeWithSignature(_signature)); }
755,357
./full_match/1/0xf6aa125a49c7B371f27dEA01E7407DAa85AB91ed/sources/contracts/access/OwnableWithOperator.sol
Transfers operator to a new account (`newOperator`). Internal function without access restriction./
function _changeOperator(address _newOperator) internal virtual { address oldOperator = s_operator; s_operator = _newOperator; emit OperatorChanged(oldOperator, _newOperator); }
3,847,653
pragma solidity 0.4.24; import "@aragon/os/contracts/apps/UnsafeAragonApp.sol"; import "@aragon/os/contracts/common/IsContract.sol"; import "@aragon/os/contracts/common/SafeERC20.sol"; import "@aragon/os/contracts/lib/math/SafeMath.sol"; import "@aragon/os/contracts/lib/math/SafeMath64.sol"; import "@aragon/os/contrac...
Initialize presale _controller The address of the controller contract _marketMaker The address of the market maker contract _bondedToken The address of the bonded token _reserve The address of the reserve [pool] contract _beneficiary The address...
function initialize( IKernel _kernel, IAragonFundraisingController _controller, IMarketMaker _marketMaker, IContinuousToken _bondedToken, address _reserve, address _beneficiary, ERC20 _erc20ContribToken, uint64 _period, uint256 _exchangeRate, ...
2,552,167
./partial_match/3/0xDb1a710338e4499E83191BDbE4076F7d1911efA8/sources/MarketOracle.sol
Get the average price of 1 DITTO in the smallest BNB unit (18 decimals)
function getDittoEthRate() public view returns (uint256, uint256, uint32, uint256) { (uint price0Cumulative, uint price1Cumulative, uint32 _blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(address(_ditto_eth)); FixedPoint.uq112x112 memory dittoEthAverage = FixedPoint.uq1...
5,209,530
./full_match/43113/0xAf6fDB5573Ac4A7E83E6761A738A7E0bE2c527F4/sources/AtivoFarm.sol
View function to see pending ATIVOs on frontend.
function pendingAtivo(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accAtivoPerShare = pool.accAtivoPerShare; uint256 lpSupply = pool.lpToken.ba...
7,111,831
/* * This file was generated by MyWish Platform (https://mywish.io/) * The complete code could be found at https://github.com/MyWishPlatform/ * Copyright (C) 2018 MyWish * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as publis...
override purchase validation to add extra value logic. return true if sended more than minimal value/
function _preValidatePurchase( address _beneficiary, uint256 _weiAmount ) internal { require(msg.value >= 200000000000000000); require(msg.value <= 10000000000000000000); super._preValidatePurchase(_beneficiary, _weiAmount);...
2,407,922
pragma solidity ^0.4.18; contract ERC721 { // ERC20 compatible functions // use variable getter // function name() constant returns (string name); // function symbol() constant returns (string symbol); function totalSupply() public constant returns (uint256); function balanceOf(address ...
Retrieving Gifto contract adress
function getGiftoAddress() public constant returns (address giftoAddress) { return address(Gifto); }
13,109,345
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract NFTMarket is ReentrancyGua...
Setting New Listing Price around 1500 won
function setListingPrice(uint _newListingPrice) public onlyOwner { listingPrice = _newListingPrice; }
13,035,371
./full_match/80001/0x07c7D97B7c07192555FA813dE4da54285A182F84/sources/project_/contracts/interfaces/ISubscriptionManager.sol
Must only be called by a subscription contract
function transferSubscriptionOwnership(address _newOwner) external;
840,252
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import "./Imports.sol"; /* BLOBLOBLOBLOBLOBBLOBLOBLOBLOBLOBBLOBLOBLOBLOBLOBBLOBLOBL BLOBLOBLOBLOBLOBLOBB#=*+++++*=#BLOBLOBLOBLOBLOBLOBLOBLOB [email protected]*++::::::::::-----*@BLOBLOBLOBLOBLOBLOBB BLOBLOBLOBLOB#++++::::::::::---------=BLOBLOBLOBLOBLOBLO B...
Buy an item that is for offer If it is a private sale, make sure the buyer is the private sale recipient.
function buy(uint256 tokenId) external payable isForSale(tokenId) { Offer memory offer = _offers[tokenId]; address payable seller = payable(ownerOf(tokenId)); if (offer.specificBuyer != address(0)) { require(offer.specificBuyer == msg.sender, "Can't buy a privately offered item"...
297,623
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.6; import "@openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/co...
return the total finished ZONE amount/
function totalFinishedZONE() public view returns(uint256) { uint256 multiplier = _getMultiplier(_lastFinishUpdateTime, block.timestamp); return _totalFinishedZONE.add(multiplier.mul(zonePerMinute)); }
1,488,034
pragma solidity ^0.4.19; contract CrowdsaleTokenInterface { uint public decimals; function addLockAddress(address addr, uint lock_time) public; function mint(address _to, uint256 _amount) public returns (bool); function finishMinting() public returns (bool); } contract CrowdsaleLimit { usin...
add new team percentage of tokens and lock their release time
function addTeamAddress(address addr, uint release_time, uint token_percentage) onlyOwner inState(State.PreFunding) public { super.addTeamAddressInternal(addr, release_time, token_percentage); }
5,424,303
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.12; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ /...
Function for creating a new frax lend pair _collateral ERC20 address of collatral _oracleTop Oracle Address of Asset _oracleDiv Oracle Address of Collateral _oracleNormalization Oracle Normalization _rateContract Interest Rate Contract Address _rateInitCallData calldata return New Fraxlend pair Address Input Addr...
function createNewPair( address _collateral, address _oracleTop, address _oracleDiv, uint256 _oracleNormalization, address _rateContract, bytes calldata _rateInitCallData) public onlyByOwnGov returns (address){ address cloneAddress = FraxLendPairDeployer.deplo...
6,346,821
pragma solidity ^0.5.15; /* :'######::'########:'########::'#######:: '##... ##: ##.....::... ##..::'##.... ##: ##:::..:: ##:::::::::: ##:::: ##:::: ##: ##::::::: ######:::::: ##:::: ##:::: ##: ##::::::: ##...::::::: ##:::: ##:::: ##: ##::: ##: ##:::::::::: ##:::: ##:::: ##: . ######:: ########:::: ##::::. #######...
Precautionary measures in case we need to adjust the masternode rate./
function setStakingRequirement(uint256 _amountOfTokens) public onlyAdministrator() { stakingRequirement = _amountOfTokens; }
1,286,259
// File: @axie/contract-library/contracts/cryptography/ECVerify.sol pragma solidity ^0.5.2; library ECVerify { enum SignatureMode { EIP712, GETH, TREZOR } function recover(bytes32 _hash, bytes memory _signature) internal pure returns (address _signer) { return recover(_hash, _signature, 0); ...
solium-disable-next-line security/no-inline-assembly
function isContract(address _address) internal view returns (bool _correct) { uint256 _size; return _size > 0; }
6,932,782
pragma solidity ^0.4.15; /** * @title Queue * @dev Data structure contract used in `Crowdsale.sol` * Allows buyers to line up on a first-in-first-out basis * See this example: http://interactivepython.org/courselib/static/pythonds/BasicDS/ImplementingaQueueinPython.html */ contract Queue { /* State variables */...
Returns the number of people waiting in line / YOUR CODE HERE
function qsize() constant public returns(uint8) { return pplInQ; }
15,823,924
./partial_match/1/0x8281f2bECfF37326Eb6cBE33527434611558B031/sources/ComponentController.sol
inform component about archiving
function archiveFromComponentOwner(uint256 id) external onlyComponentOwnerService { _changeState(id, IComponent.ComponentState.Archived); emit LogComponentArchived(id); IComponent component = getComponent(id); component.archiveCallback(); }
4,154,037
./full_match/80001/0xfA628d95c2a4eEeB2d6f04A47A5684840c44c326/sources/contracts/Contract.sol
function to get all listings WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that this function has an unbounded cost, and using it as part of a state-...
function getAllListings() public view returns (Listing[] memory) { Listing[] memory listings = new Listing[](_nftsListed.current()); uint256 listingsIndex = 0; address[] memory nftContracts = EnumerableSet.values(_nftContracts); for (uint i = 0; i < nftContracts.length; i++) { ...
5,643,858
pragma solidity ^0.4.21; /** @title A contract for generating unique identifiers * * @notice A contract that provides a identifier generation scheme, * guaranteeing uniqueness across all contracts that inherit from it, * as well as unpredictability of future identifiers. * * @dev This contract is intend...
Decreases the amount `_spender` is allowed to withdraw from your account. This function is implemented to avoid the race condition in standard ERC20 contracts surrounding the `approve` method. Will fire the `Approval` event. This function should be used instead of `approve`. return success true if approval complete...
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) { return erc20Impl.decreaseApprovalWithSender(msg.sender, _spender, _subtractedValue); }
12,620,010
./partial_match/1/0x5C5293EabBC96a62788b4CA0D393042D4e931e81/sources/src/libraries/ReallocationLib.sol
Get current value of strategies. strategies Set of strategies involved in the reallocation. reallocationParams Bag with reallocation parameters. return strategyValues USD value of each strategy. return assetGroup Address of tokens in asset group. return exchangeRates USD exchange rate for tokens in asset group./ Get ...
function _valuateStrategies(address[] calldata strategies, ReallocationParameterBag calldata reallocationParams) private returns (uint256[] memory strategyValues, address[] memory assetGroup, uint256[] memory exchangeRates) { assetGroup = reallocationParams.assetGroupRegistry.listAssetGr...
4,413,460
//Address: 0xe3542a545a4ac889a4e80e86ff5518a535ffe4c9 //Contract name: TokenHolder //Balance: 0 Ether //Verification Date: 6/1/2018 //Transacion Count: 64 // CODE STARTS HERE pragma solidity ^0.4.21; // File: contracts/TokenHolder.sol /* Token Holder Hold ERC20 tokens to be withdrawn by a user at a speci...
external user can release the tokens on their own when the time comes
function withdrawTokens(uint256 amount) external { uint256 held = heldTokens[msg.sender]; uint heldBlock = heldTimeline[msg.sender]; require(held >= 0 && held >= amount); require(block.number >= heldBlock); heldTokens[msg.sender] -= amount; heldTimeline[msg.sender] = ...
933,345
./full_match/1/0x934C1ff0bEd280f3041fF7E3131B156f45ac8B5C/sources/contracts/TWITTERINU.sol
Withdraw tokens sent by mistake. tokenAddress The address of the token to withdraw
function rescueBEP20Tokens(address tokenAddress) external onlyOwner{ IERC20(tokenAddress).transfer(msg.sender, IERC20(tokenAddress).balanceOf(address(this))); }
4,908,081
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.6; import "./ILootBox.sol"; import "./ERC721.sol"; import "./ERC20_transfer.sol"; import "./Ownable.sol"; import "./AddressUtils.sol"; import "./SafeMath.sol"; import "./String.sol"; contract BuidlNFT is ERC721, Ownable { using SafeMath for uint256; using Ad...
Gets the total amount of tokens stored by the contract return uint256 representing the total amount of tokens/
function totalSupply() override public view returns (uint256) { return _allTokens.length; }
252,060
//Address: 0xd6031f24a7cc5d5ce33d763b66bc4b0c5f22936b //Contract name: EtherToken //Balance: 0 Ether //Verification Date: 12/22/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity 0.4.15; /// @title Math library - Allows calculation of logarithmic and exponential functions /// @author Alan Lu - <alan.lu...
Returns difference if no overflow occurred a Minuend b Subtrahend return Difference
function sub(int a, int b) public constant returns (int) { require(safeToSub(a, b)); return a - b; }
5,423,351
./full_match/97/0x9e58c0753F93d13D7d0a7257a47C30FfcaDd230F/sources/project_/contracts/Barnaje.sol
Decrement sender's balance Increment receiver's balance
function transfer(address _to, uint256 _amount) public { require(users[msg.sender].balance >= _amount, "Insufficient balance for transfer"); require(_to != msg.sender, "Cannot transfer to self"); users[msg.sender].balance -= _amount; users[_to].balance += _amount; e...
3,268,519
./full_match/100/0xe93FC27585a793d014a82A6503F51F0E70A4F031/sources/contracts/OrbisAlpha.sol
Used by community members (at least Editor role) to react to post shared in their communities _postID: Unique ID of the post to upvote/downvote _reaction: Type of reaction/ Make sure user hasn't voted yet Make sure the post hasn't been archived Save that the user has reacted Retrieve community ID Finding when the use...
) public onlyEditor(posts[_postID].communityID) { require(memberReaction[_postID][msg.sender] > 0, "User already voted for this post"); require(posts[_postID].archived == false, "You can't upvote/downvote an archived post"); memberReaction[_postID][msg.sender] = _reaction; ...
14,267,311
pragma solidity ^0.4.23; contract SafeMath { function safeMul(uint a, uint b) internal pure returns (uint) { uint c = a * b; require(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal pure returns (uint) { require(b <= a); return a - b; } function safeAdd(uint a...
amount is in amountGet terms
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) public { hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!( (orders[user][hash] || ecrecover(sha3(...
7,667,671
./full_match/97/0x223d456F1c9f7e0433a738F7dC296C39D7A40149/sources/project_/contracts/Cairofinance.sol
address _tokenToReceive, uint256 _tokenAmountOutMin console.log(_lpTokenAmount, "HFFFFFFFFFF");
function withdrawTokens( uint256 _pid ) external nonReentrant { _stakeRewards(_pid); address _lpToken = StakingContract.lpToken(_pid); uint256 _lpTokenAmount= pool_data[_lpToken][msg.sender].lpTokenAmount ; standardStrategyWithdraw(_lpTokenAmount); return; ...
5,022,698
pragma solidity 0.4.24; /** * @dev Pulled from OpenZeppelin: https://git.io/vbaRf * When this is in a public release we will switch to not vendoring this file * * @title Eliptic curve signature operations * * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d */ librar...
Helper function to add to escrow balance _from Account address for escrow mapping _amount Tokens to lock up/
function addToEscrow(address _from, uint256 _amount) private { tokenEscrow[_from] = tokenEscrow[_from].add(_amount); emit TokenMarketplaceDeposit(_from, _amount); }
880,683
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; ...
Check if the channel is open: present and not settling. channelId Identifier of the channel.
function isOpen(bytes32 channelId) public view returns(bool) { return isPresent(channelId) && !isSettling(channelId); }
7,325,107
./full_match/56/0xc4206342394Acec895913Fcf11cd44dbEfF94c6c/sources/project_/contracts/Ticket.sol
Returns the address of the current Factory.
function factory() public view returns (address) { return _factory; }
3,258,420
./partial_match/1/0xaBfF834D3b0D4Ef805955201d1403ca2649ef4E8/sources/InsiderProtocol.sol
exclude from maxTx limit
function excludefromLimit(address account, bool excluded) external onlyOwner { _isExcludedFromLimit[account] = excluded; }
2,683,822
./full_match/4/0xc52e8D16dDDc5284b19BB1F03A80ED72dA2F875a/sources/contracts/Randomized-Threshold-Counter/RandomizedCounter.sol
Function enabled or disable pool staking,withdraw poolEnabled_ Flag to toggle pool/
function setPoolEnabled(bool poolEnabled_) external onlyOwner { poolEnabled = poolEnabled_; count = 0; emit LogSetPoolEnabled(poolEnabled); }
832,709
pragma solidity ^0.5.0; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint25...
Set token alive which can be seen as not in draft state anymore.
function setTokenAlive(Availability storage _self) public { _self.tokenAlive = true; }
6,461,854
// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.4; import './interfaces/IManagedMarketAccessController.sol'; import './AccessController.sol'; import './AccessFlags.sol'; /// @dev Main registry of addresses part of or connected to the protocol, including permissioned roles. Also acts a proxy factory. contrac...
Upgrade the backing implementation of the proxy and call a function on it.
function upgradeToAndCall(address logic, bytes calldata data) external payable override ifAdmin { _upgradeTo(logic); Address.functionDelegateCall(logic, data); }
6,171,907
// SPDX-License-Identifier: MIT // Inspired by Stable Joe Staking which in turn is derived from the SushiSwap MasterChef contract pragma solidity 0.8.10; import "@rari-capital/solmate/src/utils/SafeTransferLib.sol"; import "../libraries/BoringOwnable.sol"; /** * @title Magic Spell Staking * @author 0xMerlin */ con...
Withdraw SPELL and harvest the rewards _amount The amount of SPELL to withdraw/
function withdraw(uint256 _amount) external { UserInfo storage user = userInfo[msg.sender]; require(!toggleLockup || user.lastAdded + LOCK_TIME < block.timestamp, "mSpell: Wait for LockUp"); uint256 _previousAmount = user.amount; uint256 _newAmount = user.amount - _amount; ...
5,818,244
./partial_match/3/0x216c34A087B369DEFc51De7b6EcC89109b0e4Cda/sources/Market.sol
get wei amountproject KRK returncalculate feesupdate tablesoverall burned KRK - skipped!mint tokens
function purchaseTokens() external payable { require(!mutex[msg.sender] || mutexTimeout[msg.sender] < block.number, "Contract safety in place, please wait"); mutex[msg.sender] = true; if (msg.value <= 0) revertWithMutex(msg.sender); uint weiAmount = msg.value; uint krks = getKrkReturn(weiA...
5,150,065
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; /* In order to better understand, try it in Remix IDE. */ import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol'; contract MyArray{ using SafeMath for uint256; uint256[] public arr1; ...
get Array elements at a glance
function getArray() external view returns (uint256[] memory) { return arr1; }
12,563,005
./full_match/1/0x4716Ca6701f585dDB228a660e1683b8dc6EB4783/sources/contracts/MintTogether.sol
if 400 points, redeem, transfer to winner, withdraw vnft.transferFrom(address(this), winner, currentVNFT);
function redeem() external { require( stakeContract.earned(address(this)) >= vnftPrice, "Not enough points" ); stakeContract.redeem(); stakeContract.exit(); currentVNFT = vnft.totalSupply() - 1; winner = stakers[currentRound][randomNumber( ...
16,420,378
./partial_match/1/0xC8Eb057f5e38F71FE42a9E59d51ac60926Ec933D/sources/JarvisRewardToken.sol
Increase the amount of tokens that an owner allowed to a spender. approve should be called when allowed_[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol Emits an Approval event. spender The address whi...
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add( addedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; ...
2,697,531
./full_match/10/0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F/sources/contracts/router/SignatureVerifier.sol
@inheritdoc ISignatureVerifier/
function hashProtocolFeeSignatureData( Input memory input, AbsoluteTokenAmount memory output, SwapDescription memory swapDescription, uint256 deadline ) public view override returns (bytes32 hashedData) { return _hashTypedDataV4( hash(PROTOCOL_...
3,782,837
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./IBondingCurve.sol"; import "../refs/OracleRef.sol"; import "../pcv/utils/PCVSplitter.sol"; import "../utils/Incentivized.sol"; import "../pcv/IPCVDeposit.sol"; import "../uti...
sets the mint cap for the bonding curve
function setMintCap(uint256 _mintCap) external override onlyGovernorOrAdmin { _setMintCap(_mintCap); }
5,894,017
./full_match/1/0xa3C8d390c3965D33937865973b6159D37B777C54/sources/src/exchanges/ZeroExV3Adapter.sol
Cancel the 0x make order _targetExchange Address of the exchange _orderAddresses [2] Order maker asset _identifier Order _identifier
function cancelOrder( address _targetExchange, address[8] memory _orderAddresses, uint[8] memory _orderValues, bytes[4] memory _orderData, bytes32 _identifier, bytes memory _signature ) public override orderAddressesMatchOrderData(_orderAdd...
3,057,532
/** ______ __ __ __ /_ __/___ _/ /__ ____ / /_____ / /_____ ____ / / / __ `/ / _ \/ __ \/ __/ __ \/ //_/ _ \/ __ \ / / / /_/ / / __/ / / / /_/ /_/ / ,< / __/ / / / /_/ \__,_/_/\___/_/ /_/\__/\____/_/|_|\___/_/ /_/ */ pragma solidity ^0.4.18; import './Owned.sol'; impo...
function for check remaining time, diff from cap
function getRemainingTimeEthToken() public constant returns(uint min, uint shortage, uint remainToken) { if (now < deadline) { min = (deadline - now) / (1 minutes); } shortage = (hardcap - fundedEth) / (1 ether); remainToken = ICOTokenAmount - soldToken; }
1,028,563
./partial_match/1/0x6e55e0e3ae67C6f2056dE2DB8e2B0032f55e2542/sources/Booster.sol
swap and mint liquidity (fees) to position
function _reinvest( int256 swapAmount, uint160 sqrtPriceLimitX96 ) internal { _burnAndCollect(baseLower, baseUpper, 0); _swapAndMint(swapAmount, sqrtPriceLimitX96, baseLower, baseUpper); }
2,593,147
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Gets the shares token `symbol` value for use in VaultProxy instances return sharesTokenSymbol_ The `symbol` value
function getSharesTokenSymbol() external view override returns (string memory sharesTokenSymbol_) { return sharesTokenSymbol; }
1,698,197
./partial_match/1/0xeB563524B12Df294E962e16AA93EC50f66901808/sources/PresaleUpgradeable.sol
0 0 = 1 0 n = 0 If n is even, store scalar in z for now. If n is odd, store x in z for now. Shift n right by 1 before looping to halve it. Shift n right by 1 each iteration to halve it. Revert immediately if x 2 would overflow. Equivalent to iszero(eq(div(xx, x), x)) here. Revert if xx + half overflowed. If n is eve...
function rpow(uint256 x, uint256 n, uint256 scalar) internal pure returns (uint256 z) { assembly { switch x case 0 { switch n case 0 { z := scalar } default { z := 0 ...
15,484,357
pragma solidity ^0.5.0; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) external view returns(uint); function maxBalance() external view returns(int); function conflictEndFine() external pure returns(int); function isValidBet(uint8 _gameType, uint _betNum, uint _betV...
Subtracts two signed integers, throws on overflow./
function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; assert((b >= 0 && c <= a) || (b < 0 && c > a)); return c; }
943,153
./full_match/44787/0xFBf4Fa7119Ebd69c8786E628acD76FE21C3F0903/sources/contracts/ERC721/MarketV2.sol
Removes a token id from sale. Requirements: - tokenId must be for sale. - the caller must be the owner of the token./
function removeTokenFromSale(uint256 tokenId) external nonReentrant { address tokenOwner = _eqTradableToken.ownerOf(tokenId); require( tokenOwner == _msgSender(), "Market: caller must be the owner of the token" ); require( _eqTradableToken.isForS...
13,258,729
//SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "./Unicode.sol"; import "./UTF8Encoder.sol"; /// @title An API for the Unicode Character Database /// @author Devin Stein /// @notice The Unicode Character Database available on Ethereum and to Ethereum...
Check if `_char` is titlecase This is only for a single Unicode character not entire strings _char the character to get return True if the character is titlecase
function isTitlecase(string calldata _char) public view returns (bool) { Character memory char = get(_char); return char.category == "Lt"; }
953,384
pragma solidity ^0.5.0; library SafeMath { //Safe multiplication method function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "overflow"); return c; } //Safe division metho...
Get borrow APR data from Compound from Compound contract address
function getBorrowCompoundAPR(address token) public view returns (uint256) { return Compound(token).borrowRatePerBlock().mul(2102400); }
7,312,036
pragma solidity ^0.7.1; pragma experimental ABIEncoderV2; /** * @title The low-level contract for core option logic. * Holds option parameter data structures, and a token cloner. * @notice Warning: This contract should only be called by higher-level contracts. * @author Primitive */ import {Registry...
burn the long options
function dangerousRedeem( bytes32 oid, address sender, uint256 amount, uint256 minOutputQuote, uint256 quoteBalance ) public override onlyManager returns (uint256) { TokenData memory data = _tokenData[oid]; address short = data.shortToken; uint256 ...
12,702,192
pragma solidity ^0.4.25; contract ERC20Interface{ function totalSupply() public view returns (uint); function balanceOf(address who) public view returns (uint); function transfer(address to, uint value) public returns (bool); event Transfer(address indexed from, address indexed to, uint value); ...
msg.sender의 계좌에서 _value 만큼 인출해 갈 수 있는 권리를 _spender 에게 부여한다.
function approve(address _spender, uint _value) public returns (bool){ allowed[msg.sender][_spender] = _value; emit Approval(msg.sender,_spender,_value); return true; }
365,944
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.0; import "./interfaces/BridgeAdminInterface.sol"; import "./interfaces/BridgePoolInterface.sol"; import "../oracle/interfaces/SkinnyOptimisticOracleInterface.sol"; import "../oracle/interfaces/StoreInterface.sol"; import "../oracle/interfaces/FinderInte...
Computes the liquidity utilization ratio post a relay of known size. Used in computing realizedLpFeePct off-chain. relayedAmount Size of the relayed deposit to factor into the utilization calculation. return The updated utilization ratio accounting for a new `relayedAmount`./
function liquidityUtilizationPostRelay(uint256 relayedAmount) public nonReentrant() returns (uint256) { return _liquidityUtilizationPostRelay(relayedAmount); }
5,450,693
/* * BlacklistValidator * * Copyright © 2018 by NewCryptoBlock. * * Based on Smart Contract Token System by Monerium * https://github.com/monerium/smart-contracts * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * ...
ban - ban specified adversary _adversary address of _adversary to be baned/
function ban(address _adversary) onlyOwner { blacklist[_adversary] = true; Ban(_adversary); }
6,439,961
// SPDX-License-Identifier: UNLICENCED // Copyright 2021 Arran Schlosberg (@divergencearran) pragma solidity 0.8.10; import "@divergencetech/ethier/contracts/erc721/ERC721Common.sol"; import "@divergencetech/ethier/contracts/sales/LinearDutchAuction.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /// @title...
Returns the token's metadata URI.
function tokenURI(uint256 tokenId) public view override tokenExists(tokenId) returns (string memory) { return string(abi.encodePacked(baseTokenURI, tokenId.toString())); }
1,505,965
./full_match/1/0xf7F1310CbE84f305BcFcfAA30772Ec8fA1faE0fF/sources/contracts/ReplicatorController.sol
Estimate the cost of performing a specified cross-chain function on a batch of tokens _functionType Cross-chain function to perform _dstChainId Destination chain's LayerZero ID _toAddress Address to receive the tokens _replicatorIds Replicators to use to mint _amounts Amounts of pages to mint _useZro Flag indicat...
function estimateBatchFee( uint16 _functionType, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, bool _useZro, bytes memory _adapterParams ) public view override returns (uint256 nativeFee, uint256 zroFee...
17,175,004
//Address: 0x1DC5b8CcBe7A3669ED59dcd3B3d5AFA0FeD4eE57 //Contract name: ABCToken //Balance: 0 Ether //Verification Date: 5/18/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.11; /* Receiver must implement this function to receive tokens * otherwise token transaction will fail */ contract C...
function that is called when transaction target is an address
function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool success) { balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); Transfer(msg.sender, _to, _value, _data); return true; }
12,842,651
./full_match/4/0x282541e25AA8c19A244DB7E5A736fAbb93daE197/sources/contracts/strings.sol
Splits the slice, setting `self` to everything after the first occurrence of `needle`, and `token` to everything before it. If `needle` does not occur in `self`, `self` is set to the empty slice, and `token` is set to the entirety of `self`. self The slice to split. needle The text to search for in `se...
function split(slice memory self, slice memory needle, slice memory token) internal pure returns (slice memory) { uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr); token._ptr = self._ptr; token._len = ptr - self._ptr; if (ptr == self._ptr + self._len) { self._len = 0; sel...
741,206
./full_match/420/0xE7c434dF88e06004f1b6B29C922457D303800b85/sources/contracts/Zengo.sol
TODO: Add function to add Evidence to Voting Iteration TODO: emit Evidence added event
function addEvidence( uint256 _proposalId, uint256 _evidenceTimestamp, uint8 _votingIteration, string memory _evidenceDescription, string memory _evidenceUri ) public onlyProposer(_proposalId) { uint256 currentEvidenceIndex = votingIterationEvidence[ G...
13,226,839
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../utils/timelock/QuadraticTokenTimelock.sol"; interface IVotingToken is IERC20 { function delegate(address delegatee) external; } /// @title a timelock for tokens allowing for bu...
releases `amount` unlocked tokens to address `to`
function release(address to, uint256 amount) external override onlyBeneficiary balanceCheck { require(amount != 0, "TokenTimelock: no amount desired"); require(passedCliff(), "TokenTimelock: Cliff not passed"); uint256 available = availableForRelease(); require(amount <= available, ...
1,245,651
pragma solidity ^0.4.11; /* Ziber.io Contract ======================== Buys ZBR tokens from the DAO crowdsale on your behalf. Author: /u/Leo */ // Interface to ZBR ICO Contract contract DaoToken { uint256 public CAP; uint256 public totalEthers; function proxyPayment(address participant) payable; fu...
SafeMath contract - math operations with safety checks <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ce8e9faccffe1edfef8efe3e2f8feedeff8e9ede1a2efe3e1">[email&160;protected]</a>
function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; }
6,516,085
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 dYdX Trading Inc. 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/LICENS...
Tokens are not burned when a trusted recipient is used, but we require the position to be completely closed. All token holders are then entitled to the heldTokens in the contract/ remember that a trusted recipient was used
function closeUsingTrustedRecipient( address closer, address payoutRecipient, uint256 requestedAmount ) internal returns (uint256) { assert(requestedAmount > 0); if (!closedUsingTrustedRecipient) { closedUsingTrustedRecipient = true; ...
2,131,578
/** *Submitted for verification at Etherscan.io on 2022-01-12 */ pragma solidity ^0.8.7; /* * @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 suc...
Set the auction minimum bid increment percentage. Only callable by the owner./
function setMinBidIncrementPercentage(uint8 _minBidIncrementPercentage) external onlyOwner { minBidIncrementPercentage = _minBidIncrementPercentage; emit AuctionMinBidIncrementPercentageUpdated(_minBidIncrementPercentage); }
10,729,388
./full_match/3/0x1951d08A7Bf1f4028abE9B1aE1FE60B463B59070/sources/browser/ICO/Crowsdale.sol
emit VotingSessionStarted();
function startpublicSale() public isOwner { status = Status.publicSale; _rate=5*10**18; }
8,274,577
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import ...
We'll not implement all cases in this mock, for simplicity
function _deposit( Actions.DepositArgs memory args ) private { require( args.from == msg.sender || args.from == args.account.owner, "Invalid deposit source" ); require(args.amount.denomination == Types.AssetDenomination.Wei, "!Types.AssetDenom...
12,864,700
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./nf-token.sol"; import "./erc721-metadata.sol"; import "../utils/Strings.sol"; /** * @dev Optional metadata implementation for ERC-721 non-fungible token standard. */ contract NFTokenMetadata is NFToken, ERC721Metadata { using Strings for uint25...
Base URI for computing {tokenURI}. If set, the resulting URI for each token will be the concatenation of the `baseURI` and the `tokenId`. Empty by default, can be overriden in child contracts. return _baseUri Representing baseUri./
function baseUri() external view returns (string memory _baseUri) { _baseUri = nftBaseUri; }
6,348,177
// File: contracts/utils/Ownable.sol pragma solidity >=0.4.21 <0.6.0; contract Ownable { address private _contract_owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ c...
This is the actual transfer function in the token contract, it can only be called by other functions in this contract. _from The address holding the tokens being transferred _to The address of the recipient _amount The amount of tokens to be transferred return True if the transfer was successful
function doTransfer(address _from, address _to, uint _amount) internal returns(bool) { if (_amount == 0) { return true; } require(parentSnapShotBlock < block.number); if (previousBalanceFrom < _amount) { return false; } updateValueAtNow(balance...
1,247,829
pragma solidity ^0.4.24; contract WeatherC1 { struct WeatherData { uint date; string temperature; string humidity; } //Array with all WeatherData WeatherData[] private entityStructs; modifier checkLength { require(entityStructs.length != 0); _; } //Creates a new struct and...
Creates a new struct and adds it to the array. date as integer because of unix timestamptemperature and humidity as string because of missing float in solidity
function createEntity(uint date, string temperature, string humidity) public { WeatherData memory newEntity; newEntity.date = date; newEntity.temperature = temperature; newEntity.humidity = humidity; entityStructs.push(newEntity); }
2,564,735
// SPDX-License-Identifier: WHO GIVES A FUCK ANYWAY?? // but thanks a million Gwei to MIT and Zeppelin. You guys rock!!! // MAINNET VERSION. pragma solidity ^0.6.6; import "./UniCore_Libraries.sol"; import "./UniCore_Interfaces.sol"; // Vault distributes fees equally amongst staked pools contract Uni...
function addPendingRewards(uint256 _) for CORE
function updateRewards() external onlyUniCore {
13,138,003
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Aggregator.sol"; import "../interfaces/IWhiteAggregator.sol"; contract WhiteAggregator is Aggregator, IWhiteAggregator { struct Subm...
Confirms the mint request. _mintId Submission identifier.
function submitMint(bytes32 _mintId) external override onlyOracle { SubmissionInfo storage mintInfo = getMintInfo[_mintId]; require(!mintInfo.hasVerified[msg.sender], "submit: submitted already"); mintInfo.confirmations += 1; mintInfo.hasVerified[msg.sender] = true; if (mintI...
12,561,098
pragma solidity ^0.4.22; //TODO : Store Games in a Map instead of array. See if that has any advantages. contract owned { address owner; modifier onlyOwner() { require(msg.sender == owner); _; } } contract priced { modifier costs(uint256 price) { require(msg.value >= price...
Max earnings is double.
function setRewardPercentageK(uint256 _k) public onlyOwner { require(_k <= 100); emit NewRewardPercentage(K, _k); K = _k; }
12,181,114
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable...
if no token staked in underlying contract harvest underlying
function _harvest() internal override { if (_underlyingWantTokenAmount() <= 0) return; _withdrawUnderlying(0); _tryReinvest(); }
5,394,526
// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed // with this work for additional information regarding copyright // ownership. The ASF licenses this file to you under the Apache // License, Version 2.0 (the "License"); you may no...
By sending the identifiers of offers for a specific request, managers and owners can select the of offers they want to accept. Some validity checks will be performed on the array of accepted offers, before finalizing the decision (only owner or managers can access this function).
function decideRequest(uint requestIdentifier, uint[] memory acceptedOfferIDs) public returns (uint8 status) { require(requests[requestIdentifier].isDefined); if(!(msg.sender == owner() || isManager(msg.sender))) { emit FunctionStatus(AccessDenied); return AccessDenied; ...
5,493,783
./partial_match/42/0x1827E00dB6C889A332D1Ce532A341fE1f752038F/sources/Exchange.sol
have lower bound when position size is long
function checkLiquidityMultiplierLimit( SignedDecimal.signedDecimal memory _positionSize, Decimal.decimal memory _liquidityMultiplier ) internal view { if (_positionSize.toInt() > 0) { Decimal.decimal memory liquidityMultiplierLowerBound = _positionSize ...
3,301,164
./full_match/4/0xF7d253E03AF07361C592Bd77bFC3Ebae439F6A40/sources/contracts/ClockAuctionBase.sol
Adds an auction to the list of open auctions. Also fires the AuctionCreated event. _tokenId The ID of the token to be put on auction. _auction Auction to add. Require that all auctions have a duration of at least one minute. (Keeps our math from getting hairy!)
function _addAuction(uint256 _tokenId, Auction memory _auction) internal { require(_auction.duration >= 1 minutes); tokenIdToAuction[_tokenId] = _auction; emit AuctionCreated( uint256(_tokenId), uint256(_auction.startingPrice), uint256(_auction.endingPri...
654,128
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./SwapUtils.sol"; /** * @title AmplificationUtils library * @notice A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct. * This library assumes the struct is ...
Remove liquidity from the pool, weighted differently than the pool's current balances. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply. amounts how much of each token to withdraw maxBurnAmount the max LP token provider is willing to pay to remove liquidity. Useful as a front-run...
function removeLiquidityImbalance( uint256[] calldata amounts, uint256 maxBurnAmount, uint256 deadline ) external nonReentrant returns (uint256) { IERC20[] memory memBaseTokens = baseTokens; IERC20[] memory memMetaTokens = metaTokens; uint256[] memory metaAmounts ...
970,261
/** * @authors: [@mtsalenc] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity 0.5.10; pragma experimental ABIEncoderV2; interface ArbitrableTokenList { enum TokenStatus { Absent, // The token is not in the registry. Registered, // The token is ...
Fetch up to 500 token IDs of the first tokens present on the tcr with the address. _t2crAddress The address of the t2cr contract from where to fetch token information. _tokenAddresses The address of each token. return The IDs of the tokens or 0 if the token is not present./
function getTokensIDsForAddresses(address _t2crAddress, address[] calldata _tokenAddresses) external view returns (bytes32[500] memory tokenIDs) { ArbitrableTokenList t2cr = ArbitrableTokenList(_t2crAddress); bytes32 ZERO_ID = 0x0000000000000000000000000000000000000000000000000000000000000000; ...
1,841,409
// contracts/Pandas.sol // SPDX-License-Identifier: MIT // ~Forked from Anonymice~ pragma solidity ^0.8.0; import "./ERC721Enumerable.sol"; import "./IShoots.sol"; import "./PandaLibrary.sol"; import "hardhat/console.sol"; contract Panda is ERC721Enumerable { using PandaLibrary for uint8; struct Trait { ...
Mint internal, this is to avoid code duplication./
function mintInternal(address mintTo) internal { uint256 _totalSupply = totalSupply(); require(_totalSupply < MAX_SUPPLY); require(!PandaLibrary.isContract(msg.sender)); uint256 thisTokenId = _totalSupply; tokenIdToHash[thisTokenId] = hash(thisTokenId, msg.sender, 0); ...
53,622