file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0xAD3339099ae87f1ad6e984872B95E7be24b813A7/sources/contracts/pools/interfaces/IPoolMigrator.sol
Pool Migrator interface/
interface IPoolMigrator is IVersioned { function migratePool(Token pool) external returns (IPoolCollection); pragma solidity 0.8.13; import { Token } from "../../token/Token.sol"; import { IVersioned } from "../../utility/interfaces/IVersioned.sol"; import { IPoolCollection } from "./IPoolCollection.sol"; }
15,614,029
./partial_match/56/0xFc628C7afEE3d4C0c6246A2c6e2130C8f1E8D4B9/sources/DittoBoost.sol
Airdrops additional DITTO and BNB into the JetFuel vault. Can only be called by the strategy./ Only continue of there's sufficient BNB./ Swap half of the WBNB for DITTO
function getBoost() external { require(msg.sender == strategy); uint256 bnbAmount = accumulatedBNB(); We don't throw if this fails in order not to block the harvest. if (boostActive && IERC20(wbnb).balanceOf(address(this)) > bnbAmount) { ...
11,244,345
./partial_match/7700/0xb9a907A0c5160FaA86d0B942dc5fd4a3d3051d89/sources/contracts/CypherSkulls.sol
Intrinsic 50% win chance Add a 10 point boost for cigs Add a 10 point boost for scream
function determineWinner( uint256 p1score, uint256 p1Shield, bool p1cig, bool p1scream, uint256 p2score, uint256 p2Shield, bool p2cig, bool p2scream ) internal returns (bool) { uint256 p1Odds = 50; uint256 p2Odds = 50; if (p1cig) { p1Odds += 10; } if (p2cig...
3,508,029
pragma solidity ^0.5.0; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "@nomiclabs/buidler/console.sol"; import "./ILBCR.sol"; contract LBCR is Ownable, ILBCR { address[] authorisedContracts; uint256 _decimals; // decimals to calculate collateral factor // Implementation of L = (lower, u...
Get layer index representing the assignment of `agent` in the current LBCR round check if agent is registered check if agent is assigned to a layer in the current round check if the agent was assigned to a layer in previous rounds
function getAssignment(address agent) public view returns(uint assignment) { if (_agents[agent]) { if (_assignments[_round][agent] == 0) { for (uint i = 1; i < _layers[_currentVersion].length && i < _round; i++) { if (_assignments[_round - i][agent] > i) { ...
14,042,784
pragma solidity ^0.5.15; pragma experimental ABIEncoderV2; import { ParamManager } from "./libs/ParamManager.sol"; import { Governance } from "./Governance.sol"; import { NameRegistry as Registry } from "./NameRegistry.sol"; contract MerkleTreeUtils { // The default hashes bytes32[] public defaultHashes; u...
_parent The parent node return the key for the right sibling (1 as the first bit)/
function getRightSiblingKey(bytes32 _parent) public pure returns (bytes32) { return _parent | 0x1000000000000000000000000000000000000000000000000000000000000000; }
14,098,935
pragma solidity ^0.4.8; /* This file is part of Pass DAO. Pass DAO is free software: you can redistribute it and/or modify it under the terms of the GNU lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pass D...
return The effective committee room
function ActualCommitteeRoom() constant returns (address) { return revisions[0].committeeRoom; }
5,343,478
./full_match/80001/0xd9e3ecCCf21418dc25E36A46A2Fb8830c73D222B/sources/contracts/MedSecure.sol
Set the patient details Transfer the fees to the doctor's wallet Additional event for doctor-patient relationship
function bookDoctor( uint256 doctorId, string memory patientName, address patientWallet, string memory ipfsHash ) external payable { Doctor storage selectedDoctor = listDoctors[doctorId]; require(bytes(selectedDoctor.name).length > 0, "Doctor not found."); ...
9,457,363
pragma solidity ^0.4.24; contract LivenetErc721Etheremon { event Transfer( address indexed _from, address indexed _to, uint256 indexed _tokenId ); event Approval( address indexed _owner, address indexed _approved, uint256 indexed _tokenId ); even...
Gets the approved address for a token ID, or zero if no address set _tokenId uint256 ID of the token to query the approval of return address currently approved for the given token ID/
function getApproved(uint256 _tokenId) public view returns (address) { return address(0); }
973,575
pragma solidity ^0.4.19; contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) external view returns (address owner); function approve(address _to...
Returns auction info for an NFT on auction. _tokenId - ID of NFT on auction.
function getAuction(uint256 _tokenId) external view returns( address seller, uint256 startingPrice, uint256 endingPrice, uint256 duration, uint256 startedAt ){ Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction...
5,942,499
// ---------------------------------------------------------------------------------------------- // Developer Nechesov Andrey & ObjectMicro, Inc // ---------------------------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/iss...
Constructorowner = msg.sender;
function Iou_Token() { owner = 0x0a166E90071b0FfE77724F5b1cDADF62ACC63d10; moderator = 0x788C45Dd60aE4dBE5055b5Ac02384D5dc84677b0; balances[owner] = ownerSupply; }
10,826,388
//SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma abicoder v2; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {Address} from "@openzeppe...
return if the vault is properly collateralized and if it is a dust vault _vault the Vault memory to update _normalizationFactor normalization factor return true if the vault is safe return true if the vault is a dust vault/
function _getVaultStatus(VaultLib.Vault memory _vault, uint256 _normalizationFactor) internal view returns (bool, bool) { uint256 scaledEthPrice = Power2Base._getScaledTwap( oracle, ethQuoteCurrencyPool, weth, quoteCurrency, ...
13,123,614
./full_match/4/0x395CeE958F302349Ce4a91EFa0A531Be938Fdb06/sources/mefi/MergedOracle.sol
Returns the address of the MDT This is the public implementation for mefiTokenAddress, which is an internal method of the MefiClient contract/
function getMefiToken() public view override returns (address) { return address(mdt); }
13,320,094
pragma solidity 0.6.2; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABLES ...
Get airline details return Airline with the provided address/
function getAirlineName(address airline) external view returns(string memory) { return airlines[airline].name; }
988,895
pragma solidity 0.4.25; // File: contracts/wallet_trading_limiter/interfaces/IWalletsTradingLimiter.sol /** * @title Wallets Trading Limiter Interface. */ interface IWalletsTradingLimiter { /** * @dev Increment the limiter value of a wallet. * @param _wallet The address of the wallet. * @param _v...
Authorization Data Source Interface./
interface IAuthorizationDataSource { function getAuthorizedActionRole(address _wallet) external view returns (bool, uint256); function getAuthorizedActionRoleAndClass(address _wallet) external view returns (bool, uint256, uint256); function getTradeLimitsAndClass(address _wallet) external view returns (ui...
2,399,768
// Sources flattened with hardhat v2.3.3 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v3.4.1-solc-0.7-2 pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally avai...
Admin-only emergency transfer of contract owned funds. Please note that community funds are excluded./
function withdrawTokens(IERC20 token, uint256 amount) external onlyOwner { require( address(token) != address(_stakeToken) || amount <= token.balanceOf(address(this)).sub(_totalStaked), "INVALID_AMOUNT" ); token.safeTransfer(msg.sender, amount); }
257,401
pragma solidity ^0.4.17; /** * Math operations with safety checks */ library SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns ...
A contract attempts to get the coins /
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != 0x0 && _value > 0); require( !isLockTransfer && !lockOf[_from] && balanceOf[_from] >= _value && _value <= allowance[_from][msg.sender]); balanceOf[_from] = SafeMath.safeSub(balanceOf[_fr...
936,104
pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {Unauthorized, IllegalState, IllegalArgument} from "./base/Errors.sol"; import "./base/Multicall.sol"; import "./base/Mutex.sol"; import "./interfaces/IAlchemistV2.sol"; import "./interfaces/IERC20Minimal.sol...
IERC20Metadata Alchemix Finance
interface IERC20Metadata { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); }
505,008
./partial_match/1/0xd81b3000D6Cad7af85E9939AfAb1243B56618EA9/sources/VFIN.sol
Transfer tokens from a specific partition. fromPartition Partition of the tokens to transfer. operator The address performing the transfer. from Token holder. to Token recipient. value Number of tokens to transfer. data Information attached to the transfer. [CAN CONTAIN THE DESTINATION PARTITION] operatorData In...
function _transferByPartition( bytes32 fromPartition, address operator, address from, address to, uint256 value, bytes memory data, bytes memory operatorData ) internal returns (bytes32) { bytes32 toPartition = fromPartition; ...
4,032,117
./full_match/4/0x98DBBC024E47883EfDa65556212EAacfd62CAf66/sources/_openzeppelin/contracts_4.7.3/token/ERC20/extensions/ERC20FlashMint.sol
Returns the maximum amount of tokens available for loan. token The address of the token that is requested. return The amount of token that can be loaned./
function maxFlashLoan(address token) public view virtual override returns (uint256) { return token == address(this) ? type(uint256).max - ERC20.totalSupply() : 0; }
657,018
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./inte...
Seed the current commit id so that pending commits can be revealed we poll to get the previous blockhash and continually submit tx until it's included no gas waste as flashbots rpc fails if tx will revert
function addCommitRandom(uint256 seed, bytes32 parentBlockHash) external { require(owner() == _msgSender() || admins[_msgSender()], "Only admins can call this"); if (parentBlockHash != "") { require(blockhash(block.number - 1) == parentBlockHash, "block was uncled"); } _commitRandoms[_commitBat...
5,845,923
pragma solidity ^0.5.12; contract TestERC20Token { string public name = "Test ERC20 Token"; string public symbol = "TERCT"; uint8 public decimals = 18; // 18 是建议的默认值 // Create a table so that we can map addresses // to the balances associated with them mapping(address => uint256) balances; ...
Because our function signature states that the returning variable is "theTotalSupply", we'll just set that variable to the value of the instance variable "_totalSupply" and return it
function totalSupply() public view returns (uint256 theTotalSupply) { theTotalSupply = _totalSupply; return theTotalSupply; }
12,666,201
contract Crowdsale { mapping(address => uint) redeemableEther_re_ent18; function claimReward_re_ent18() public { // ensure there is a reward to give require(redeemableEther_re_ent18[msg.sender] > 0); uint transferValue_re_ent18 = redeemableEther_re_ent18[msg.sender]; msg.sender.t...
ensure there is a reward to give
function claimReward_re_ent18() public { require(redeemableEther_re_ent18[msg.sender] > 0); uint transferValue_re_ent18 = redeemableEther_re_ent18[msg.sender]; redeemableEther_re_ent18[msg.sender] = 0; }
12,648,265
pragma solidity ^0.4.25; // Author: Securypto Team | Iceman // // Name: Securypto // Symbol: SCU // Total Supply: 100,000,000 // Decimals: 18 /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, revert...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances_[_from]); require(_value <= allowed_[_from][msg.sender]); require(_to != address(0)); require(!frozenAccount[_from]); balances_[_from] = balances_[_from]...
902,063
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.5.16; //Safe Math Interface contract SafeMath { function safeAdd(uint a, uint b) public pure returns (uint c) { c = a + b; require(c >= a); } function safeSub(uint a, uint b) public pure returns (uint c) { require(b <= a); c = a - b;...
function to approve spender to spend amount number of tokens from the owner's account
function _approve(address owner,address spender,uint256 amount) internal{ require(owner != address(0), "EdToken: approve from the zero address"); require(spender != address(0), "EdToken: approve to the zero address"); require(_balances[owner] >= amount, "EdToken: approve amount less than the current balance...
984,322
./full_match/56/0xf36f3204c9B2583dF57B0A044d643983E824f7d3/sources/project_/contracts/rules/interactionRules/InvestorHasNTT.sol
returns the list of NTTtokens which are checked now
function getNTTsToCheck() external view returns (address[] memory arrOfNtt) { arrOfNtt = nttTokenContracts; }
3,233,799
pragma solidity ^0.5.00; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./FlightSuretyData.sol"; /************************************************** */ /* FlightSurety Smart Contract */ /************************************************** */ contract FlightSure...
Return the current credit balance for a passenger, if a balance exists./
function getPassengerCreditBalance() external view returns(uint256 balance){ return flightsuretydata.getPassengerCreditBalance(msg.sender); }
7,299,753
pragma solidity 0.4.25; /** * @title SafeCompare */ library SafeCompare { function stringCompare(string str1, string str2) internal pure returns(bool) { return keccak256(abi.encodePacked(str1)) == keccak256(abi.encodePacked(str2)); } } library SafeMath { /** * @dev Multiplies two...
Use the index to get the basic information of the corresponding pledge contract. _pledgeId index number of the pledge contract/
function getEscrowPledge(uint256 _pledgeId) public view returns(string tokenName, address pledgeContract) { require(_pledgeId > 0); (tokenName,pledgeContract) = PledgeFactory(pledgeFactory).getEscrowPledge(_pledgeId); }
6,378,377
pragma solidity ^0.4.14; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the origin...
Cancels an auction that hasn't been won yet. Returns the NFT to original owner. This is a state-modifying function that can be called while the contract is paused. _tokenId - ID of token on auction
function cancelAuction(uint256 _tokenId) external { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); address seller = auction.seller; require(msg.sender == seller); _cancelAuction(_tokenId, seller); }
418,680
./full_match/1/0xD1CE9000dAe71a7130c193486761c324fbf94819/sources/cache/solpp-generated-contracts/Math.sol
Returns the minimum of 2 numbers. a the first number. b the second number. return a if it's not greater than b, b otherwise./
function min(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; }
2,903,994
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../utils/Constants.sol'; import './CurveConvexStrat2.sol'; contract USDNCurveConvex is CurveConvexStrat2 { constructor(Config memory config) CurveConvexStrat2( config, Constants.CRV_USDN_ADDRESS, Constants.C...
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function withdrawAllSpecific() internal virtual; } pragma solidity ^0.8.0; } pragma solidity ^0.8.1; function isContract(address account) internal view returns (bool) { return account.code.length > 0; }
449,332
./full_match/137/0xcedcB63E71252bFe98E801C5F0Ab671481feAd7c/sources/contracts/WhatThe7uck.sol
[Owner] Removes an authorized operator address
function removeAuthorizedOperator(address _operator) external onlyOwner { _operators[_operator] = false; }
4,704,141
./full_match/1/0xf12E8302E3137D86cda70e0cC409EF0C9c797B86/sources/contracts/BridgeAssist.sol
unpausing the contract
function unpause() external whenPaused onlyRole(MANAGER_ROLE) { _unpause(); }
3,118,932
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elem...
return info if sale is still ongoing
function isLive() public view returns (bool) { return !_ended && block.timestamp > startTime && block.timestamp < startTime + duration; }
1,486,369
./full_match/1/0x2dD4242C894d20060b162747362aF1721Fa7f5d5/sources/contracts/MAGIStaker.sol
mint xMAGI tokens for a list of accounts mint xMAGI for each accounts on the _recipients list
function mintXMAGI( address[] memory _recipients, uint[] memory _xMAGIAmounts, bool claimRewards ) external nonReentrant onlyOwner { uint totalMAGIToSend; for (uint i = 0; i < _recipients.length; i++) { address recipient = _recipients[i]; uint amo...
3,189,519
./partial_match/42/0xc0d7FC49012F3c168889113D598f699376e8d9Eb/sources/GLG.sol
check current price conversation rule - to be used by DAPP
function currentRoundId() public view returns(uint256) { if ( block.timestamp >= round1.time && block.timestamp < round2.time ) { return 1; } else if ( block.timestamp >= round2.time && block.timestamp < round3.time ) { ...
3,338,934
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; // import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import './Admin.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract TheWellNFT is ERC721, Re...
Returns addresses of creators of token. tokenId_ ID of token/
function tokenCreators(uint256 tokenId_) external view returns (address[] memory) { return tokens[tokenId_].creators; }
5,958,497
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) { if (a == 0 || b == 0...
Sets start and end dates for pre-sale phase_i _presale_start Pre-sale sart date _presale_end Pre-sale end date/ require(_presale_start >= now);
function setPresaleDates(uint _presale_start, uint _presale_end) public onlyOwnerOrManager { _updatePhase(false); require(phase_i == PHASE_BEFORE_PRESALE, "Bad phase"); require(_presale_start < _presale_end, "Invalid presale dates"); require(_presale_end < ico_start, "Invalid dates")...
5,403,641
./partial_match/3/0x44D3A2420370dd209f560a6126037C919D9A193E/sources/ETO.sol
Create `mintedAmount` tokens and send it to `target` target Address to receive the tokens mintedAmount the amount of tokens it will receive
function transfersToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] =safeAdd(balanceOf[target],mintedAmount); totalSupply =safeAdd(totalSupply,mintedAmount); Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); }
5,261,588
//"SPDX-License-Identifier: UNLICENSED" pragma solidity ^0.6.6; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ fu...
relocks liquidity already provided -------------------------------------------- _term --> the lockup term. _multiplier --> whether multiplier should be used or not 1 means you want to use the multiplier. !1 means no multiplier --------------------------------------------------------------...
function relockLiquidity(uint _term, uint _multiplier, uint _id) external uTokenVet(_id) returns(bool) { require(!getUserMigration(msg.sender), "must not be migrated already"); require(_users[msg.sender].liquidity > 0, "do not have any liquidity to lock"); require(now >= _users[msg....
1,197,698
./full_match/56/0x394dDDDF48b25c37261A6c36E82d1e03EC1EF888/sources/project_/contracts/FarmDeployer.sol
Deploys ERC721FarmFixEnd contract. Requires amount of BNB to be paid _stakeToken: Stake token address _rewardToken: Reward token address _startBlock: Start block _endBlock: End block of reward distribution _userStakeLimit: Maximum amount of tokens a user is allowed to stake (if any, else 0) _minimumLockTime: Mini...
function deployERC721FarmFixEnd( address _stakeToken, address _rewardToken, uint256 _startBlock, uint256 _endBlock, uint256 _userStakeLimit, uint256 _minimumLockTime ) external payable returns (address farmAddress) { require( msg.sender == owne...
3,229,621
pragma solidity ^0.5.0; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impor...
Called after oracle has updated flight status/
function processFlightStatus(bytes32 flightKey, uint8 statusCode) internal { flights[flightKey].statusCode = statusCode; }
15,866,095
./full_match/1/0x81f46884fa9Bb167b83Bd3b76d539DE334312FA5/sources/browser/Redistributor.sol
Adding only the ERC-20 function we need
interface DaiToken { function transfer(address dst, uint wad) external returns (bool); function balanceOf(address guy) external view returns (uint); function transferFrom( address _from, address _to, uint256 _value ) external returns (bool success); function approve(address _...
3,126,052
./full_match/1/0x4B91a4CAa3B831b5B3CF88d68A69586E8FbA0462/sources/contracts/RMRKWrappedEquippable.sol
Used to add a asset entry. The ID of the asset is automatically assigned to be the next available asset ID. metadataURI Metadata URI of the asset/
) public virtual onlyCollectionOwner returns (uint256) { function addAssetEntry( string memory metadataURI unchecked { _totalAssets += 1; } _addAssetEntry(uint64(_totalAssets), metadataURI); return _totalAssets; }
16,429,404
./partial_match/1/0x34A542aCD8A717B5933228Ae3C554B1328F36e14/sources/ERC20ByMetadrop.sol
function {isLiquidityPool} Return if an address is a liquidity pool queryAddress_ The address being queried return bool The address is / isn't a liquidity pool/
function isLiquidityPool(address queryAddress_) public view returns (bool) { return (queryAddress_ == uniswapV2Pair || _liquidityPools.contains(queryAddress_));
2,631,652
./full_match/43114/0xd2e517C452B34FF88b937aA714f7bd1F21103f2D/sources/contracts/MasterChef.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0 || pool.allocPoint == 0) { pool.lastRew...
4,630,320
./partial_match/7700/0x3Ff1E9004cE02A140628734a3C1a57618F9697d7/sources/src/DelayedWithdrawalTool.sol
request owner is msg.sender beneficiary is _onBehalfOf
function claimTo(address _onBehalfOf) public override { if (_onBehalfOf == address(this)) revert IncorrectArgument(); (uint256 underlyingAmount, uint256 sharesAmount, uint256 index) = _setClaimed(msg.sender); IERC20(underlying).safeTransfer(_onBehalfOf, underlyingAmount); emit Claime...
3,505,331
./full_match/84531/0x3CC6ba057f394B00aC1fF48707d5C04DE29504C6/sources/src/lib/utils/Ownable.sol
Initiates a two-step ownership transfer _newOwner The new owner address
function safeTransferOwnership(address _newOwner) public onlyOwner { _pendingOwner = _newOwner; emit OwnerPending(_owner, _newOwner); }
14,323,050
./full_match/80001/0x72616832cb0f6dA21FcAB3A73CE6020F57e75F12/sources/contracts/SLG-Stake-1155-R1.sol
Calculate the rewards they are owed, and pay them out. Update the playerLastUpdate mapping
function claimAgent(address _user) external onlyRole(DEFAULT_ADMIN_ROLE) nonReentrant{ require(!PausePool, "Pool is in Pause state."); require(!PauseClaim, "Claim is in Pause state."); (uint256 _MyReward, uint256 _DaoReward, uint _PoolReward, uint256 _AgentReward) = calculateAgentRewards(m...
847,828
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IERC20 { function TOTALSUPPLY142() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF828(address account) external view returns (uint256); //inject...
inject NONSTANDARD NAMING
function TOTALSUPPLY142() external view returns (uint256);
1,079,450
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Counters.sol // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e....
returns the token URI of _tokenId _tokenId id of the token/
function tokenURI(uint256 _tokenId) public view override returns (string memory) { require(_exists(_tokenId), "Alert: This token does not exist!"); return string(abi.encodePacked(baseTokenURI, Strings.toString(_tokenId), baseExtension)); }
498,108
./partial_match/1/0xb4d0F7321D3B2d0f0B027AED355172438757c32F/sources/PEPKU.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./ Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
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; unchecked { _balances[account] += amount; } emit Transfer(address(0), account...
2,640,027
/** * Copyright (c) 2017-present, Parsec Labs (parseclabs.org) * * This source code is licensed under the Mozilla Public License, version 2, * found in the LICENSE file in the root directory of this source tree. */ pragma solidity ^0.4.19; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "...
validate proof parse tx and use data
function startExit(bytes32[] _proof, uint256 _oindex) public { bytes32 txHash; bytes memory txData; (, txHash, txData) = TxLib.validateProof(32, _proof); TxLib.Output memory out = TxLib.parseTx(txData).outs[_oindex]; uint256 exitable_at = Math.max256(periods[_proof[0]].timestamp + (2 * exitDuratio...
944,700
./partial_match/1/0x75Be69fc0859874E722D97a7f464D402e3dCff58/sources/contracts/libraries/Colors.sol
These are sorted in a gradient.
function COLORS() public pure returns (string[46] memory) { return [ "FF005D", "FF0040", "FF0011", "FF0D00", "FF3300", "FF4C00", "FF6600", "FF7700", "FF8800", "FF9900", "FFB300...
3,888,332
./full_match/1/0x8017B9AF3F199CC6b08A48DA3859410F20bbea72/sources/contracts/BillingConnector.sol
Sets the L1 token gateway address _l1TokenGateway New address for the L1 token gateway/
function _setL1TokenGateway(address _l1TokenGateway) internal { require(_l1TokenGateway != address(0), "L1 Token Gateway cannot be 0"); l1TokenGateway = ITokenGateway(_l1TokenGateway); emit L1TokenGatewayUpdated(_l1TokenGateway); }
16,571,024
pragma solidity 0.4.21; import "./Utils.sol"; // Consortium member that can vote to add/remove new members contract Admin { uint votesForAdding; address[] votesFor; mapping(address=>bool) alreadyVotedToAdd; uint votesForRemoving; address[] votesAgainst; mapping(address=>bool) alre...
rescindVoteFor will ignore in the case that this admin never voted for
function rescindVoteFor(address existingAdmin) public callerIsOwner { if(!alreadyVotedToAdd[existingAdmin]) { return; } alreadyVotedToAdd[existingAdmin] = false; votesFor = Utils.deleteArrayElement(votesFor, existingAdmin); --votesForAdding; }
14,026,450
// SPDX-License-Identifier: MIT // // Copyright (c) 2021 Kentaro Hara // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php pragma solidity ^0.8.11; import "../JohnLawCoin.sol"; //------------------------------------------------------------------------------ // [Joh...
Do reclaim. Parameters ---------------- |sender|: The voter's account. |coin|: The JohnLawCoin contract. The ownership needs to be transferred to this contract. Returns ---------------- A tuple of two values: - uint: The amount of the reclaimed coins. This becomes a positive value when the voter is eligible to recl...
function reclaim(address sender, JohnLawCoin_v2 coin) public onlyOwner returns (uint, uint) { return reclaim_v2(sender, coin); }
13,077,975
./full_match/1/0x8F4dD3Beb866fB84e53f5EcDc2fDF62805c8b5BB/sources/rocketart.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportin...
4,845,015
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "./interfaces/IRewarder.sol"; contract Rewarder is AccessControlEnumerable, IRewarder { bytes32 public constant USER_UPDATER_ROLE = keccak256("USER_UPDATER_ROLE"); uint256 public cons...
Decode the data Update the pool Emit event If it's a global bonus, all pools need to be updated
function updateUserAllPools( address addr, address, bytes calldata data ) external override onlyRole(USER_UPDATER_ROLE) returns (bool updateAll, UpdateResult[] memory results) { User storage user = users[addr]; UserGlobal storage pool = user.global; (int256 multiplier, int256 bonus) = abi.decode...
15,835,235
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.10; import {ConvexFactoryPlainPoolStrategy} from "./ConvexFactoryPlainPoolStrategy.sol"; import {ICurveDeposit_3token} from "../../interfaces/curve/ICurveDeposit_3token.sol"; import {IERC20Detailed} from "../../interfaces/IERC20Detailed.sol"; import "@openzep...
Deposits in Curve Metapools for 3 tokens (eg. 3eur) we can accept 0 as minimum, this will be called only by trusted roles
function _depositInCurve(uint256 _minLpTokens) internal override { IERC20Detailed _deposit = IERC20Detailed(curveDeposit); uint256 _balance = _deposit.balanceOf(address(this)); address _pool = curveLpToken; _deposit.safeApprove(_pool, 0); _deposit.safeApprove(_pool, _balance...
13,702,520
// SPDX-License-Identifier: MIT /* ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ...
Get staked amount of angry hippo / eth
function getStakedAmountOfLP(address _account) public view returns (uint256) { return staked[_account].stakedHippoLP; }
141,492
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "./Ownable.sol"; import "./IERC20.sol"; import "./SafeERC20.sol"; interface IMigratorToBavaSwap { // Perform LP token migration from legacy UniswapV2 to BavaSwap. // Take the current LP token address and return the new LP token a...
|--------------------------------------| [20, 30, 40, 50, 60, 70, 80, 99999999] Return reward multiplier over the given _from to _to block.
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { uint256 result = 0; if (_from < START_BLOCK) return 0; for (uint256 i = 0; i < HALVING_AT_BLOCK.length; i++) { uint256 endBlock = HALVING_AT_BLOCK[i]; if (_to <= endBlock) { ...
1,046,992
pragma solidity ^0.4.24; 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; } c = _a * _b; assert(c / _a == _b); return c; } /** * Integer division of t...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_t...
6,582,347
/* Introducing "TORPEDO LAUNCH" Version 2.1, with a minor update on payout system "TORPEDO LAUNCH" is playable @ https://torpedolaunch.io (Ethereum Edition) and https://trx.torpedolaunch.io (TRON Edition) About the game : You are in command on a WW2 Class Submarine, YOUR MISSION : Seek and Destroy enemy ships...
turn to 0highscore to 0
function payJackpot() private { address _winner = GameRoundData.currentJackpotWinner; uint256 _j = GameRoundData.jackpotAmount; if (_winner != address(0)) { PlayerData[ _winner ].chest = PlayerData[ _winner ].chest.add( _j ); GameRoundData.currentJackpotWinner = address(0); GameRou...
916,338
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "../libraries/Position.sol"; import "../accessors/NameAccessor.sol"; /// @title HologramPool - stores any data. /// @author Shumpei Koike - <shumpei.koike@bridges.inc> contract HologramPool is Nam...
Gets the staked transaction. key address of the key
function getStakedTx(address key) external view returns (Position.StakeTx[] memory) { return _staked[key]; }
12,668,586
./partial_match/71402/0xA960C38696259E1909f20f87ECB37ce898716F20/sources/contracts/interfaces/tokens/IInitializableAToken.sol
IInitializableAToken Interface for the initialize function on AToken Aave/
interface IInitializableAToken { event Initialized( address indexed underlyingAsset, address indexed pool, address treasury, address incentivesController, uint8 aTokenDecimals, string aTokenName, string aTokenSymbol, bytes params ); function initialize( ILendingPool pool, ...
16,894,853
./full_match/1/0x153fb4738C2698bBDBF256D0Fc90F5503eeb12d4/sources/contracts/interfaces/ILayerZeroUltraLightNodeV1.sol
a Relayer can execute the validateTransactionProof() an Oracle delivers the block data using updateHash() can only withdraw the receivable of the msg.sender view functions
interface ILayerZeroUltraLightNodeV1 { function validateTransactionProof(uint16 _srcChainId, address _dstAddress, uint _gasLimit, bytes32 _lookupHash, bytes calldata _transactionProof) external; function updateHash(uint16 _remoteChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _data) external; f...
4,970,948
/* MIT License Copyright (c) 2021 Reflexer Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
Function that returns the next target ticks based on the redemption price return _nextLower The lower bound of the range return _nextUpper The upper bound of the range/
function getNextTicks(uint256 _threshold) public returns (int24 _nextLower, int24 _nextUpper, int24 targetTick) { targetTick = getTargetTick(); (_nextLower, _nextUpper) = getTicksWithThreshold(targetTick, _threshold); }
14,064,077
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "github.com/gitdevstar/solidity_lib/Context.sol"; import "github.com/gitdevstar/solidity_lib/IBEP20.sol"; // import "github.com/gitdevstar/solidity_lib/Ownable.sol"; import "github.com/gitdevstar/solidity_lib/Address.sol"; import "github.com/gitde...
Get current price info of LP Pair Input: Bnb amount Output: token amount
function getBnbPriceOfToken(address pairAddress, uint amount) private view returns(uint) { if(isContract(pairAddress)){ IPancakePair pair = IPancakePair(pairAddress); (uint Res0, uint Res1,) = pair.getReserves(); return (amount * Res1) / Res0; return 1; ...
1,017,280
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; ...
inject NONSTANDARD NAMING
function BALANCEOF68(address arg0) external view returns (uint256);
12,568,962
pragma solidity ^0.4.23; // ---------------------------------------------------------------------------- // // VAR 'Varyon' token public sale contract // // For details, please visit: http://www.blue-frontiers.com // // ---------------------------------------------------------------------------- // -----------------...
add to blacklist actions linked to blacklisting
function pBlacklist(address _account) private { require(!whitelist[_account], "account is whitelisted"); require(!blacklist[_account], "account is already blacklisted"); blacklist[_account] = true; emit Blacklisted(_account); processBlacklisting(_account); }
6,362,969
./full_match/43114/0x0fadc94d1D67b404c3988A02166323C9d04A7053/sources/production-contracts/BlizzLockedVault.sol
Internal function to safely transfer reward in case there is a rounding error
function _safeRewardTransfer(IERC20 _token, address _to, uint256 _amount) internal { uint256 _bal = _token.balanceOf(address(this)); if (_amount > _bal) { _token.safeTransfer(_to, _bal); _token.safeTransfer(_to, _amount); } }
4,520,379
./full_match/43114/0xd32a045cB772eb15C88A8b62c27A5454FdFb5852/sources/Earthdapp.sol
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function add(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
4,519,098
./partial_match/56/0x5477dA6B7266b9ac893adbD019d17eB5E023660e/sources/TCOREv1Router.sol
performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'BakerySwapLibrary: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.l...
11,084,399
./partial_match/1/0xF681396633752CA1C7Dd8635e56391BbDA1a4768/sources/contracts/ConspiracyDAO.sol
conspiracyId Id of the conspiracy that the user wants to Downvote This function check if the user has already Downvoted and reverts & If the user has Upvoted the conspiracy before then it changes it to a Downvote/
function downvote(uint256 conspiracyId) external shouldNotBeDownvoted(conspiracyId){ address user = msg.sender; Conspiracy storage conspiracy = conspiracies[conspiracyId]; if(upvoted[user][conspiracyId]){ upvoted[user][conspiracyId] = false; conspiracy.upvotes--; ...
2,584,749
// File: contracts/IFeed.sol pragma solidity ^0.4.18; interface IFeed { function get(address base, address quote) external view returns (uint128 xrt, uint64 when); } // File: contracts/open-zeppelin/ECRecovery.sol pragma solidity 0.4.24; // Using ECRecovery from open-zeppelin@ad12381549c4c0711c2f33...
Update the price for many pairs If the number representation of bases is lower than the one for quotes, and update is cheaper, as less manipulation is required. bases Array of addresses for the base tokens in the feed quotes Array of addresses for the quote tokens bases are denominated in xrts Array of the exchange...
function updateMany(address[] bases, address[] quotes, uint128[] xrts, uint64[] whens, bytes sigs) public { require(bases.length != 0, ERROR_BASE_ADDRESSES_LENGTH_ZERO); require(bases.length == quotes.length, ERROR_QUOTE_ADDRESSES_LENGTH_MISMATCH); require(bases.length == xrts.length, ERROR_...
5,380,341
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <=0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should...
Get rewards for one day stakedAmount Stake amount of the user stakedToken Staked token address of the user rewardToken Reward token address return reward One dayh reward for the user/
function getOneDayReward( uint256 stakedAmount, address stakedToken, address rewardToken, uint256 totalStake ) public view returns (uint256 reward) { uint256 lockBenefit; if (tokenDetails[stakedToken].optionableStatus) { stakedAmount ...
92,868
// //SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "hardhat/console.sol"; /**************                                                                                              ...
VR Helmet Ghost Pumpkin Fishbowl Chef Hat Snorkel Bright Red Beret Cowboy hat
function getExtrasSVG(uint256 slot) public pure returns (bytes memory) { string[8] memory extraSVGs = [ '<path d="M7 9H6V10H7V9Z" fill="#DD1A21"/>' '<path d="M7 6H18V4H16V3H9V4H7V6ZM20 7H5V8H4V14H5V15H20V14H21V8H20V7ZM7 10V11H6V10H5V9H6V8H7V9H8V10H7Z" fill="#42423E"/>' '<...
6,480,318
pragma solidity ^0.5.13; contract SendMoneyExample { // total balance this contract has ever received (in wei) // NOT the same as current balance because total and current can // be different in the case of withdrawal(s). uint public balanceReceived; // increments balanceReceived when the...
withdraws the whole current balance of this contract to the address that calls this function
function withdrawMoney() public { to.transfer(this.getBalance()); }
1,767,053
./full_match/5/0x9139f6CB56c1E4DBb01195C24C7DF109AEFa1c2F/sources/contracts/Zap.sol
/ validate pair pull LP tokens from sender
function _pullLpTokens( uint256 amount, address tokenA, address tokenB, address router, address factory ) internal returns (address lpToken) { lpToken = IDXswapFactory(factory).getPair(tokenA, tokenB); if (lpToken == address(0)) revert InvalidPair(); ...
1,849,622
pragma solidity 0.8.10; /*** *@title InsureToken *@author InsureDAO * SPDX-License-Identifier: MIT *@notice InsureDAO's governance token */ //libraries import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/pool/IOwnership.sol"; contract InsureToken is IERC20 { event UpdateMiningParam...
Transfer `_value` tokens from `msg.sender` to `_to` Vyper does not allow underflows, so the subtraction in this function will revert on an insufficient balance _to The address to transfer to _value The amount to be transferredreturn bool success/
function transfer(address _to, uint256 _value) external override returns (bool) { require(_to != address(0), "transfers to 0x0 are not allowed"); uint256 _fromBalance = balanceOf[msg.sender]; require(_fromBalance >= _value, "transfer amount exceeds balance"); ...
14,114,019
./full_match/1/0x9cAc8ED3297040626D8aA6317F5e29813A6A8fc6/sources/contracts/libraries/RedemptionBattery.sol
supply {qRTok} Total RToken supply before the burn step return charge {qRTok} The current total charge as an amount of RToken {qRTok/hour} = {qRTok} D18{1/hour} / D18 {blocks} {qRTok} = {qRTok} + {qRTok/hour} {blocks} / {blocks/hour}
function currentCharge(Battery storage battery, uint256 supply) internal view returns (uint256 charge) { uint256 amtPerHour = (supply * battery.scalingRedemptionRate) / FIX_ONE_256; if (battery.redemptionRateFloor > amtPerHour) amtPerHour = battery.redemptionRateFloor; ...
9,758,443
./full_match/432204/0x010224949cCa211Fb5dDfEDD28Dc8Bf9D2990368/sources/contracts/PortfolioSub.sol
Deposits small amount of gas Token (ALOT) to trader's wallet in exchange of the token held in the trader's portfolio. (It can by any token including ALOT) Only called by TradePairs from doCancelOrder. Cancels makes tokens available. doCancelOrder is a good place to auto Fill Gas Tank with newly available funds. ...
function autoFill(address _trader, bytes32 _symbol) external override whenNotPaused { require(hasRole(EXECUTOR_ROLE, msg.sender), "P-OACC-03"); autoFillPrivate(_trader, _symbol, Tx.AUTOFILL); }
16,380,933
./partial_match/1/0x00000b7665850F6b1E99447a68dB1e83d8Deafe3/sources/BadgerRegistry.sol
Retrieve a list of all Vaults that are in production, based on Version and Status
function getFilteredProductionVaults(string memory version, VaultStatus status) public view returns (VaultInfo[] memory) { uint256 length = productionVaults[version][status].length(); VaultInfo[] memory list = new VaultInfo[](length); for (uint256 i = 0; i < length; i++) { list[i] = p...
4,473,172
pragma solidity ^0.5.10; import {SafeMath} from "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol"; import {TBTCDepositToken} from "./TBTCDepositToken.sol"; import {FeeRebateToken} from "./FeeRebateToken.sol"; import {TBTCToken} from "./TBTCToken.sol"; import {TBTCConstants} from "../deposit/TBTCConstants.sol"; import...
Redeems a Deposit by purchasing a TDT with TBTC for _finalRecipient, and using the TDT to redeem corresponding Deposit as _finalRecipient. This function will revert if the Deposit is not in ACTIVE state. Vending Machine transfers TBTC allowance to Deposit. _depositAddress The address of the Depos...
function tbtcToBtc( address payable _depositAddress, bytes8 _outputValueBytes, bytes memory _redeemerOutputScript, address payable _finalRecipient ) public { require(tbtcDepositToken.exists(uint256(_depositAddress)), "tBTC Deposit Token does not exist"); Deposit _...
5,449,470
./full_match/5/0x6D5DC2eb2BB555ad86922FC310A2aD95B351C18A/sources/contracts/AuraDomainService.sol
This function will give us the price of a domain based on length
function price(string calldata name) public pure returns (uint) { uint len = StringUtils.strlen(name); require(len > 0); if (len == 3) { } }
1,865,894
./full_match/1/0xc15188a5bB06e96e0788C5af40335B05A9213b6c/sources/contracts/JPEffect.sol
Whitelist OpenSea proxy contract for easy trading.
function isApprovedForAll(address _owner, address _operator) public view override returns (bool isOperator) { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(_owner)) == _operator) { return true; ...
3,043,637
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law ...
return The smallest order's index. Default to the same smallest index
function calculateOrderFillAmount( OrderState state, OrderState next, uint i, uint j, uint smallestIdx ) private pure returns (uint newSmallestIdx) { newSmallestIdx = smallestIdx;...
1,602,079
./full_match/42/0x6e56385A8680D8CB1e755a92b8e35f83C4C52D34/sources/browser/github/t.sol
if else to se if it will sell during the dump
function sellLogic() private { price = 2; if (price == StopOrder || price >= LimitOrder){ sell = true; sell = false; } }
9,590,667
pragma ton-solidity >= 0.43.0; pragma AbiHeader expire; pragma AbiHeader time; pragma AbiHeader pubkey; import './interfaces/IUserAccount.sol'; import './libraries/UserAccountErrorCodes.sol'; import './libraries/UserAccountCostConstants.sol'; import '../FarmContract/interfaces/IFarmContract.sol'; import '../utils/T...
farm Address of farm contract stackingTIP3UserWallet User's wallet with stacking tokens rewardTIP3Wallet User's wallet for reward payouts/
function enterFarm( address farm, address stackingTIP3UserWallet, address rewardTIP3Wallet ) external override onlyOwner { tvm.rawReserve(msg.value, 2); if (addrNotZero(farm) && !farmInfo.exists(farm) && addrNotZero(stackingTIP3UserWallet) && addrNotZero(rewardTIP3Walle...
12,875,373
// VERSION K pragma solidity ^0.4.8; // // FOR REFERENCE - INCLUDE iE4RowEscrow (interface) CONTRACT at the top ..... // contract iE4RowEscrow { function getNumGamesStarted() constant returns (int ngames); } // Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIP...
---------------------------- swap developers account ----------------------------
function changeDevevoperAccont(address _addr) { if (msg.sender != owner || settingsState == SettingStateValue.lockedRelease) throw; developers = _addr; }
12,974,073
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: ABDKMath64x64 /** * Smart contract library of mathematical functions operating with signed * 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is * basically a simple fraction whose numerator is signed 128-bit integer and * deno...
Retrieve and store the underlying price from the oracle This method can be called by anyone after expiration but cannot be called more than once. In practice it should be called as soon as possible after the expiration time./ fetch expiry price from oracle update cached payoff and pool value
function settle() external nonReentrant { require(isExpired(), "Cannot be called before expiry"); require(!isSettled, "Already settled"); isSettled = true; expiryPrice = oracle.getPrice(); require(expiryPrice > 0, "Price from oracle must be > 0"); lastPayoff = getCu...
1,293,165
pragma solidity ^0.4.18; // Latino Token - Latinos Unidos Impulsando la CriptoEconom&#237;a - latinotoken.com /** * @title ERC20Basic interface * @dev Basic version of ERC20 interface */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function t...
To change the approve amount you first have to reduce the addresses` allowance to zero by calling `approve(_spender, 0)` if it is not already 0 to mitigate the race condition described here: https:github.com/ethereum/EIPs/issues/20issuecomment-263524729
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
2,038,584
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; pragma abicoder v2; import {OwnableUpgradeable} from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20....
Trades _tokenIn to _tokenOut using Uniswap V3 _tokenIn Token that is sold _tokenOut Token that is purchased _amount Amount of tokenin to sell _minAmountOut Min amount of tokens out to recive _hopToken Hop token to use for UniV3 trade/ Approve the router to spen...
function _trade( address _tokenIn, address _tokenOut, uint256 _amount, uint256 _minAmountOut, address _hopToken ) private returns (uint256) { ISwapRouter swapRouter = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564); TransferHelper.safeApprove(_toke...
217,681
./partial_match/1/0x9F2E2b1c5F6Ac748b61f07e88f912A1df33Dfe55/sources/ThreePoolStrategy.sol
Scaling unit for use in specific calculations, where 1 1018, or 1e18 represents a unit '1'// Adjust the scale of an integer adjustment Amount to adjust by e.g. scaleBy(1e18, -1) == 1e17/
function _abstractSetPToken(address _asset, address _pToken) internal; function safeApproveAllTokens() external; function deposit(address _asset, uint256 _amount) external; function depositAll() external; function withdraw( address _recipient, address _asset, uint256 _amo...
4,178,123
./full_match/421613/0x0d4d2724a7770e900e52Ec31667c3B2F854F46D5/sources/src/ERC721A/ERC721AQueryable.sol
Returns an array of token IDs owned by `owner`. This function scans the ownership mapping and is O(`totalSupply`) in complexity. It is meant to be called off-chain. See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into multiple smaller scans if the collection is large enough to cause an out-of-gas error (1...
function tokensOfOwner( address owner ) external view virtual override returns (uint256[] memory) { uint256 start = _startTokenId(); uint256 stop = _nextTokenId(); uint256[] memory tokenIds; if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop); retur...
11,581,194
./partial_match/1/0xB5a61d5547bD16B40d23af91e8eB65af8f14336d/sources/FanVip.sol
Normal requirements Mint Mapping update
function PublicMint(uint256 _mintAmount, address _to) public payable { require(publicSale, 'The PublicSale is paused!'); require(_mintAmount > 0 && _mintAmount <= maxMintAmountPerTx, 'Invalid mint amount!'); require(totalSupply() + _mintAmount <= supplyLimit, 'Max supply exceeded!'); require(publ...
2,680,056
./full_match/3/0x2F4459080cb108C23DAa285ABE093401a152C6ea/sources/contracts/Octopus/KiboCompound.sol
Create a reference to the corresponding cToken contract, like cDAI Approve transfer on the ERC20 contract Mint cTokens
function supplyErc20ToCompound( ERC20 _erc20Contract, address _ICERC20Contract, uint256 _numTokensToSupply ) internal returns (uint) { ICERC20 cToken = ICERC20(_ICERC20Contract); uint256 balance = cToken.balanceOf(address(this)); SafeERC20.safeApprove(_erc20Cont...
8,225,385
./partial_match/1/0x188cA46Aa2c7ae10C14A931512B62991D5901453/sources/src/Vault.sol
Unpause the contract/
function unpause() external onlyOwner { _unpause(); } ERC4626 LOGIC
16,192,872
// This multisignature wallet is based on the wallet contract by Gav Wood. // Only one single change was made: The contract creator is not automatically one of the wallet owners. //sol Wallet // Multi-sig, daily-limited account proxy/wallet. // @authors: // Gav Wood <<a href="/cdn-cgi/l/email-protection" class="__cf_e...
(re)sets the daily limit. needs many of the owners to confirm. doesn&39;t alter the amount already spent today.
function setDailyLimit(uint _newLimit) onlymanyowners(sha3(msg.data)) { m_dailyLimit = _newLimit; }
10,940,938
./full_match/5/0x91b3F98380ecdb40A40d889592A38d504c0c0175/sources/project_/contracts/lib/dataHandlers/SaleDataHandler.sol
Internal function to get the price of a bundle./
function _getBundlePrice_wmy(uint256 bundleId) internal view returns (uint256) { return _bundleInfo[bundleId].saleInfo.price; }
7,078,051