file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.23; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; //import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./ProtocolGasFuturesToken.sol"; import "./Dex.sol"; contract ProtocolGasFutures { using SafeMath for uint; ProtocolGasFuturesToken public token; ma...
Assume average block time is 15 seconds
function issue() public { uint height = block.number; uint gasLimit = 350000; }
13,031,825
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./SVG.sol"; import "./WatchData.sol"; // Renders the hands, which are layered on top of every other core element library Hands { function render( uint256 _second, uint256 _minute, uint256 _hour ) public pure returns (...
UTILS / used to determine proper accent colors.
function isLightMaterial(MaterialId _id) public pure returns (bool) { return _id == MaterialId.Pearl || _id == MaterialId.Diamond; }
12,257,425
pragma solidity ^0.5.0; import "./ERC20Detailed.sol"; import "./ERC20Burnable.sol"; import "./Stopable.sol"; /// @author /// @title Token contract contract CWDToken is ERC20Detailed, ERC20Burnable, Stoppable { constructor ( string memory name, string memory symbol, uint256 tot...
Transfer token (run anyone) recipient Token trasfer destination acount. amount Token transfer amount. return Boolean
function transfer(address recipient, uint256 amount) enabled public returns (bool) { require( !_isLocked( msg.sender, amount ) , "ERC20: Locked balance"); return super.transfer(recipient, amount); }
1,168,394
pragma solidity 0.4.24; contract ERC20Token { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uin...
Transfer tokens from one address to another
function transferFrom(address from, address to, uint256 tokens) public returns (bool success){ require(to != address(0)); require(tokens > 0 && tokens <= balances[from]); require(tokens <= allowed[from][msg.sender]); balances[from] = balances[from].sub(tokens); balances[to] = balances[t...
5,355,418
/** *Submitted for verification at Etherscan.io on 2021-02-03 */ //Audit report available at https://www.tkd-coop.com/files/audit.pdf //SPDX-License-Identifier: MIT pragma solidity ^0.7.0; abstract contract ITACData { function transfer(address recipient, uint256 amount) public virtual returns (bool) ; } //Con...
Function called by the TAC contract to adjust the locked up balance of a user.If the user has no balance, we need to set this as the current last removal time.
function adjustBalance(address user, uint256 amount) public { require(msg.sender == TACContract, "Only the TAC Contract can call this function"); lockedTACForUser[user] += amount; if (lastRemovalTime[user] == 0) { lastRemovalTime[user] = uint64(block.timestamp); } }
10,861,483
./partial_match/1/0xB9FDBa39FADE05136034d5795AC7a236b2554Be8/sources/FLP.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokens(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = UNI_ROUTER.WETH(); _approve(address(this), address(UNI_ROUTER), tokenAmount); UNI_ROUTER.swapExactTokensForETHSupportingFeeOnTransferTokens( ...
3,717,829
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; import './libs/SafeERC20.sol'; import './libs/Ownable.sol'; import './libs/SafeMath.sol'; /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting pe...
return true if the token is revoked./
function getRevoked(address token) external view returns (bool) { return revoked[token]; }
5,463,662
./full_match/4/0x3952E17C6dA66E30D8207388c8057353DeC72e1E/sources/contracts/NFTStaking.sol
If address already has ERC721 Token/s staked, calculate the rewards. Increment the amountStaked and map msg.sender to the Token Id of the staked Token to later send back on withdrawal. Finally give timeOfLastUpdate the value of now. If wallet has tokens staked, calculate the rewards before adding the new token
function stake(uint256 _tokenId) external nonReentrant { if (stakers[msg.sender].amountStaked > 0) { uint256 rewards = calculateRewards(msg.sender); stakers[msg.sender].unclaimedRewards += rewards; } nftCollection.ownerOf(_tokenId) == msg.sender, "Who...
12,419,345
pragma solidity ^0.4.11; import "./zeppelin/crowdsale/CappedCrowdsale.sol"; import "./zeppelin/crowdsale/RefundableCrowdsale.sol"; import "./zeppelin/token/TokenTimelock.sol"; import "./LindaToken.sol"; contract LindaCrowdsale is CappedCrowdsale, RefundableCrowdsale, Pausable { // time for tokens to be locked in...
freeze tokens only if goal is reached
function finalization() internal { if (goalReached()) { teamVault = new TokenTimelock(token, teamWallet, uint64(now) + teamLockTime); unsoldVault = new TokenTimelock(token, wallet, uint64(now) + unsoldLockTime); teamTokens = (maximumSaleTokenSupply.mul(teamPercentage)).div(salePerc...
2,536,411
./partial_match/1/0x3068210e6a4eedA850459573A8F872b06400284A/sources/SingularDTVToken.sol
same as above. Replace this line with the following if you want to protect against wrapping uints.require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value); balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to...
3,906,518
// SPDX-License-Identifier: GPLv3 pragma solidity 0.7.2; pragma experimental ABIEncoderV2; import '../interfaces/IElasticToken.sol'; import '../libraries/ElasticMath.sol'; import '../core/ElasticDAO.sol'; import '../models/DAO.sol'; import '../models/Ecosystem.sol'; import '../models/Token.sol'; import '../models/To...
calculates the value of deltaE; the amount of ETH required to mint deltaLambda deltaLambda = lambdaDash - lambda capitalDeltaValue the ETH/token ratio; see capitalDelta(uint256, uint256) k constant token multiplier - it increases the number of tokens that each member of the DAO has with respect to their lambda ela...
function deltaE( uint256 deltaLambda, uint256 capitalDeltaValue, uint256 k, uint256 elasticity, uint256 lambda, uint256 m ) internal pure returns (uint256) { uint256 lambdaDash = SafeMath.add(deltaLambda, lambda); return wmul( wmul(capitalDeltaValue, k), SafeMa...
10,474,406
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {FeeSharingSetter} from "./FeeSharingSetter.sol"; import {TokenSplitter} from "./TokenSplitter.sol"; /** * @title OperatorControllerForRewards * @notice It splits pending LOOKS and upd...
Convert currencies to reward token Function only usable only for whitelisted currencies (where no potential side effect) token address of the token to sell additionalData additional data (e.g., slippage)/ Adjust allowance for this transaction only Exchange token to reward token
function convertCurrencyToRewardToken(address token, bytes calldata additionalData) external nonReentrant onlyRole(OPERATOR_ROLE) { require(address(rewardConvertor) != address(0), "Convert: RewardConvertor not set"); require(token != address(rewardToken), "Convert: Cannot...
514,860
// <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD 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 ri...
ERC20 functions =========================
function transfer(address _to, uint _value) public returns (bool) { require(transferAllowed(msg.sender)); return super.transfer(_to, _value); }
9,897,397
./partial_match/1/0x202ac0A1c625fF468E8B4a54caB94b8bA11C0c21/sources/Strategy.sol
simple logic. do we get more apr than iron bank charges?if so, is that still true with increased pos?if not, should be reduce?made harder because we can't assume iron bank debt curve. So need to incrementhow much credit we have
function internalCreditOfficer() public view returns (bool borrowMore, uint256 amount) { (, uint256 liquidity, uint256 shortfall) = ironBank.getAccountLiquidity(address(this)); uint256 underlyingPrice = ironBank.oracle().getUnderlyingPrice(address(ironBankToken)); if(underlyingPri...
16,185,106
// File: @openzeppelin/contracts/access/IAccessControl.sol // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set ...
_Available since v3.1._/
interface IERC1155Receiver is IERC165 { function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); function onERC1155BatchReceived( address operator, address from, ui...
212,931
/** *Submitted for verification at Etherscan.io on 2021-04-22 */ // SPDX-License-Identifier: MIT /* This is a Stacker.vc FarmTreasury version 1 contract. It deploys a rebase token where it rebases to be equivalent to it's underlying token. 1 stackUSDT = 1 USDT. The underlying assets are used to farm on different smar...
wait time verification require that any funds locked are not leaving the account in question.
function _verify(address _account, uint256 _amountUnderlyingToSend) internal override { DepositInfo memory _existingInfo = userDeposits[_account]; uint256 _lockedAmt = _getLockedAmount(_account, _existingInfo.amountUnderlyingLocked, _existingInfo.timestampDeposit, _existingInfo.timestampUnlocked); ...
1,571,230
./full_match/1/0x8f2A5a0Bb16fd7Bc5EfA354512ac347199b127Ed/sources/@openzeppelin/contracts/finance/VestingWallet.sol
Release the native token (ether) that have already vested. Emits a {EtherReleased} event./
function release() public virtual { uint256 amount = releasable(); _released += amount; emit EtherReleased(amount); Address.sendValue(payable(beneficiary()), amount); }
5,012,511
pragma solidity 0.5.4; /** * @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(uint256 a, uint256 b) internal pure returns (uint256) { //...
[ERC1410 INTERFACE (2/10)] Get partitions index of a tokenholder. tokenHolder Address for which the partitions index are returned. return Array of partitions index of 'tokenHolder'./
function partitionsOf(address tokenHolder) external view returns (bytes32[] memory) { return _partitionsOf[tokenHolder]; }
2,563,736
/** *Submitted for verification at Etherscan.io on 2020-09-12 */ pragma solidity 0.5.16; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; interface IStakingRewards { function balanceOf(address account) external view returns (uint256); function totalSupply() external view re...
IPair pair = IPair(0x7AfcF11F3e2f01e71B7Cc6b8B5e707E42e6Ea397); no xQi yet IBar bar = IBar(0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272); (uint256 lp_totalQi, , ) = pair.getReserves();
function totalSupply() public view returns (uint256) { }
5,501,011
./partial_match/8453/0x8BFB10D2df13c6553CE10F3B995fA5Aa0F478F26/sources/Grid.sol
Define a function to get all the owners
function getAllOwners(uint256 startIndex, uint256 endIndex) public view returns (address[] memory) { address[] memory owners = new address[](10000); for (uint256 i = startIndex; i < startIndex + 10000; i++) { if (i >= endIndex) { break; } owners[i]...
16,813,090
pragma solidity ^0.4.24; contract LoyaltyCard { uint256 public totalPoints; address store; address customerAddress; uint256 stake; uint256 cashback; struct customer { string username; uint256 points; uint[] customerRewards; bool status; bool...
REWARDScustomers[_customer].customerRewards[rewardId].status = true;
function addCustomerReward(address _customer, uint256 rewardId) { customers[_customer].customerRewards.push(rewardId); }
1,070,163
/* Copyright (C) 2020 NexusMutual.io This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distribu...
removes a user from whitelist _member address to remove from whitelist/
function removeFromWhiteList(address _member) public onlyOperator returns (bool) { whiteListed[_member] = false; emit BlackListed(_member); return true; }
2,577,925
./full_match/10/0x037F94DA5096c944eEfc31Fd2696B99bAb20C2d5/sources/src/nft/ZoraCreator1155Impl.sol
If we still have no schedule, return 0 supply royalty. If we have no recipient set, return 0 supply royalty.
function _handleSupplyRoyalty(uint256 tokenId, uint256 mintAmount, bytes memory data) internal returns (uint256 totalRoyaltyMints) { uint256 royaltyMintSchedule = royalties[tokenId].royaltyMintSchedule; if (royaltyMintSchedule == 0) { royaltyMintSchedule = royalties[CONTRACT_BASE_ID].roy...
3,782,386
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {IERC20} from "./../interfaces/IERC20.sol"; import {IERC20Allowance} from "./../interfaces/IERC20Allowance.sol"; import {IERC20BatchTransfers} from "./../interfaces/IERC20BatchTransfers.sol"; import {IERC20SafeTransfers} from "./../interfaces/IERC20SafeTra...
Transfers an amount of tokens to a recipient from a specified address. If the recipient is a contract, calls `onERC20Received` on it. Note: This function implements {ERC20SafeTransfers-safeTransferFrom(address,address,uint256,bytes)}. Reverts if `to` is the zero address. Reverts if `from` does not have at least `val...
function safeTransferFrom( Layout storage s, address sender, address from, address to, uint256 value, bytes memory data ) internal { s.transferFrom(sender, from, to, value); if (to.isContract()) { _callOnERC20Received(sender, from, to, ...
2,577,752
./full_match/80001/0xBB24d7CBade17c26a19B97A1E6204125985f0412/sources/useCases/vehicle-management/vehicleModificationTracker.sol
Function to get total token payment by user
function getTotalTokenPaymentByUser( address _user ) external view onlySuperAdmin returns (uint256) { return totalPaymentTokenByUser[_user]; }
9,495,854
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * @return The hash of the byte r...
Returns the ENS namehash of a DNS-encoded name. self The DNS-encoded name to hash. offset The offset at which to start hashing. return The namehash of the name./
function namehash(bytes memory self, uint offset) internal pure returns(bytes32) { (bytes32 labelhash, uint newOffset) = readLabel(self, offset); if(labelhash == bytes32(0)) { require(offset == self.length - 1, "namehash: Junk at end of name"); return bytes32(0); } ...
1,008,113
// File: @openzeppelin/contracts/utils/cryptography/ECDSA.sol pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum...
Ok I am not proud of this function but sale conract needs to getDigitalMedia while I tried to write a interface file DigitalMediaBurnInterfaceV3.sol I could not include the DigitalMedia struct in that abstract contract. So I am writing another endpoint to return just the bare minimum data required for the sale contract...
function getDigitalMediaForSale(uint256 _id) external view returns( address, bool, uint16) { DigitalMedia storage _digitalMedia = idToDigitalMedia[_id]; require(_digitalMedia.creator != address(0), "DigitalMedia not found."); return (_digitalMedia.creator, _digitalMedia.collabora...
640,505
./full_match/84531/0x3CC6ba057f394B00aC1fF48707d5C04DE29504C6/sources/src/lib/interfaces/IOwnable.sol
IOwnable Rohan Kulkarni The external Ownable events, errors, and functions
interface IOwnable { event OwnerUpdated(address indexed prevOwner, address indexed newOwner); event OwnerPending(address indexed owner, address indexed pendingOwner); event OwnerCanceled(address indexed owner, address indexed canceledOwner); error ONLY_OWNER(); error ONLY_PENDING_OWNER(); ...
14,323,001
// Bitcoin transaction parsing library // Copyright 2016 rain <https://keybase.io/rain> // // 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-...
returns true if the bytes located in txBytes by pos and script_len represent a P2PKH script
function isP2PKH(bytes memory txBytes, uint pos, uint script_len) public returns (bool) { }
12,672,460
./full_match/5/0x3E7286ec13eFda945329901163b84915555d6157/sources/contracts/LiquidCollections.sol
address _owner = msg.sender;
function getMineWithMetadata(address _owner) public view returns (Redeemey[] memory) { uint256 lngth = ERC721A.balanceOf(_owner); Redeemey[] memory _metadatasOfOwners = new Redeemey[](lngth); uint256 i; for (i = 0; i < lngth; i++) { uint256 tU...
1,868,604
pragma solidity 0.4.24; import "./ERCProxy.sol"; /** * @title Proxy * @dev Gives the possibility to delegate any call to a foreign implementation. * @dev source https://github.com/zeppelinos/labs/blob/master/upgradeability_using_unstructured_storage/contracts/Proxy.sol */ contract Proxy is ERCProxy { // Stor...
Sets the proxyTypeId. Should be called from the Proxy constructor _proxyTypeId uint representing Forwarding Proxy (id = 1) or Upgradeable Proxy (id = 2);/
function setProxyTypeId (uint256 _proxyTypeId) internal { require(_proxyTypeId == 1 || _proxyTypeId == 2, "Must be type 1 or 2"); bytes32 position = typeIdPosition; sstore(position, _proxyTypeId) }
1,047,665
./full_match/1/0xCE938c27C04d4A638307D44e28515D4bcD28bD74/sources/contracts/f_x_/steth/stETHTreasury.sol
Public Mutated Functions / Harvest pending stETH rewards to stability pool. convert stETH to wstETH deposit rewards to stability pool
function harvest() external { uint256 _totalRewards = IERC20Upgradeable(stETH).balanceOf(address(this)).sub(totalBaseToken); uint256 _harvestBounty = (harvestBountyRatio * _totalRewards) / PRECISION; uint256 _stabilityPoolRewards = (stabilityPoolRatio * _totalRewards) / PRECISION; emit Harvest(msg.se...
3,108,176
./full_match/80001/0xCed6Ae01c8E93eb879F8dBBb7E8A8BA70Da8b16e/sources/PancakeRouter.sol
given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'PancakeLibrary: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'PancakeLibrary: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.m...
878,510
/** *Submitted for verification at Etherscan.io on 2021-08-26 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient,...
Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. Here in Life crypto token, we have initial...
function decimals() public view returns (uint8) { return _decimals; } uint256 private _totalSupply;
2,434,855
./full_match/43114/0x21499643B1Dd73168807eb1eDfa0b43b50b8F30F/sources/cache/solpp-generated-contracts/StakingV1.sol
Computes rewards generating amount of $BRO that will be used to receive staking rewards Formula: base + (1 - base) unstaking_period / max_unstaking_period _amount $BRO amount _unstakingPeriod that is used for calculation return computed rewards generating amount
function _computeRewardsGeneratingBro( uint256 _amount, uint256 _unstakingPeriod ) private view returns (uint256) { uint256 periodIndex = (_unstakingPeriod * PRECISION) / maxUnstakingPeriod; uint256 xtraRewardGeneratingAmountIndex = 1 * PRECISION - ...
4,624,980
./full_match/43114/0x7f45cb159561F8f139C5971a75a0a4210F751Adc/sources/project:/contracts/Comptroller.sol
Sets a new price oracle for the comptroller Admin function to set a new price oracle return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Check caller is admin
function _setPriceOracle(PriceOracle newOracle) public returns (uint) { if (msg.sender != admin) { return fail( Error.UNAUTHORIZED, FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK ); } return uint(Error.NO_ERROR...
4,522,656
// SPDX-License-Identifier: MIT pragma solidity ^0.7.5; pragma experimental ABIEncoderV2; contract VoteContract { address public owner; uint ElectionsCounter; struct Candidate{ string name; uint voteCount; uint candidateId; } struct Voter{ address voterAddress; string ...
get the address of the owner of a specific election
function getElectionOwner(uint _electionID) public view returns(address){ return Elections[_electionID].election_owner; }
13,081,958
pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; import './owned.sol'; import "./EnumerableSet.sol"; import "./ReentrancyGuard.sol"; contract GFBG is owned, ReentrancyGuard{ /// @notice EIP-20 token name for this token string public constant name = "GameFiBox Gold Token"; /// @notice EIP-20 tok...
Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens rawAmount The number of tokens that are approved (2^256-1 means infinite) return Whether or not the approval succeeded/
function approve(address spender, uint rawAmount) external returns (bool) { require(!frozenAccount[msg.sender],"account is frozen"); uint256 amount; if (rawAmount == uint(-1)) { amount = uint256(-1); amount = safe256(rawAmount, "GFB::approve: amount exceeds 256 bits"); ...
14,053,723
./full_match/7700/0x6eA48824253f64662945Ae77A790331D7183f8c0/sources/project_/contracts/access/MaxAccess.sol
: Classic "EIP-173" but for onlyDev() newDeveloper: addres of new pending Developer role
function transferDeveloper( address newDeveloper ) external virtual override onlyRole(DEVS) { address user = msg.sender; _grantRole(DEVS, newDeveloper); _revokeRole(DEVS, user); }
4,661,781
/* Copyright 2019 ZeroEx Intl. 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 or agreed to in writing, ...
Overridden to just emit an event.
function _updateCumulativeReward(bytes32 poolId) internal { emit UpdateCumulativeReward(poolId); }
2,478,149
/* website: bns.finance This project is freshly written to change the way ICO is done. BBBBBBBBBBBBBBBBB NNNNNNNN NNNNNNNN SSSSSSSSSSSSSSS DDDDDDDDDDDDD EEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFIIIIIIIIII B::::::::::::::::B N:::::::N N::::::N SS:::::::::::::::S D:::::...
Check max a user can deposit right now
function getMaxDepositAllowed(uint256 _pid, address _tokenAdd, address _user) external view returns (uint256){ RaisePoolInfo storage pool = poolInfo[_pid]; uint256 maxBuyPossible = (pool.maxTokensPerPerson).sub(userTokenAllocation[_pid][_user]); uint256 maxBuyPossiblePoolLimit = (pool.totalT...
15,113,587
pragma solidity ^0.4.18; // // // 🌀 EnishiCoin // // /** * @title OwnerSigneture * @dev The OwnerSigneture contract has multiple owner addresses * and does not execute if there is no signature of all owners. */ contract OwnerSigneture { address[] public owners; mapping (address => bytes32) public sig...
Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint./
function mint(address _to, uint256 _amount) signed canMint public returns (bool) { require(_amount > 0); _amount = SafeMath.mul(_amount, dec); totalSupply = SafeMath.add(totalSupply, _amount); balances[_to] = SafeMath.add(balances[_to], _amount); Mint(_to, _amount); Transfer(address(0), _to...
1,320,695
./full_match/1/0x06cB7C24990cBE6b9F99982f975f9147c000fec6/sources/browser/DSA/InstaPool.sol
Enter compound market to enable borrowing. cTknAddrs Array Ctoken addresses./
function enterMarket(address[] calldata cTknAddrs) external isMaster { _enterMarket(cTknAddrs); }
3,206,819
./full_match/1/0x1f64eA8745E316CfDE4B92353a1bB9654198A793/sources/src/x-pods/XPodAuctions.sol
send refunds to a batch of addresses. _auctionId the auction id addresses array of addresses to refund./
function sendRefundBatch( uint8 _auctionId, address[] calldata addresses ) external onlyOwner { uint256 length = addresses.length; uint8 i; do { _sendRefund(_auctionId, payable(addresses[i])); unchecked { ++i; } ...
17,076,693
/** *Submitted for verification at Etherscan.io on 2021-02-23 */ // File: contracts/interfaces/interestModelInterface.sol pragma solidity 0.6.12; interface interestModelInterface { function getInterestAmount(address handlerDataStorageAddr, address payable userAddr, bool isView) external view returns (bool, uint256...
set Operator or not _operator the address of the operator flag operator permission return true (TODO: validate results)/
function setOperators(address payable _operator, bool flag) onlyOwner external returns (bool) { operators[_operator] = flag; return true; }
2,263,623
//Address: 0x179c9d17b574e2c2296d66433d340dbe31474975 //Contract name: SecurityDepositRegistry //Balance: 0 Ether //Verification Date: 10/11/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity 0.4.15; /// @title SafeMath /// @dev Math operations with safety checks that throw on error. library SafeMath { ...
This is the function that actually insert a record.
function register(address key, uint256 amount, address depositOwner) onlyDaoOrOwner { require(records[key].time == 0); records[key].time = now; records[key].owner = depositOwner; records[key].keysIndex = keys.length; keys.length++; keys[keys.length - 1] = key; ...
1,794,796
pragma solidity >=0.6.2; import './uniswap/IUniswapV2Router02.sol'; import "./openzeppelin/IERC20.sol"; contract Swap { event LogConvertTokensToTokensEvent( uint _tokenInAmount, address _tokenInAddress, address _tokenOutAddress, address _to, uint _deadline, uint[] amounts ); event convertEthToAnyToken(uint _amo...
Convert ETH to Any kind of Tokens ... /emit convertEthToAnyToken(_amount, _tokensOut, path);
function convertETHtoAnyToken(address _tokensOut, address _to) public payable { address[] memory path = new address[](2); path[0] = uniswapRouter.WETH(); path[1] = _tokensOut; uint[] memory amounts = uniswapRouter.getAmountsOut(msg.value, path); emit Logamounts(amounts); }
1,069,323
./partial_match/4/0x6583cEBC615618b3f84881010dB276B64c5CC9E7/sources/Staking.sol
deposit dust token upon deployment to prevent division by zero
function distribute(uint256 _amount) external returns(bool) { weth.safeTransferFrom(address(msg.sender), address(this), _amount); divPerShare = divPerShare.add((_amount.mul(FLOAT_SCALAR)).div(totalSupply())); }
8,609,921
pragma solidity ^0.4.25; // ---------------------------------------------------------------------------- // 'UBETTOKEN' token contract // // Symbol : UBETS // Name : UBET COINS // Total supply: 4000000000 // Decimals : 18 // // ------------------------------------------------------------------...
Issue token based on Ether received. _beneficiary Address that newly issued token will be sent to. only accept a minimum amount of ETH?
function purchaseTokens(address _beneficiary) public payable { require(msg.value >= 0.00104 ether); uint _tokens = div(mul(msg.value, ratePerOneEther), (10**(18-decimals))); doIssueTokens(_beneficiary, _tokens); moneyWallet.transfer(address(this).balance);
2,543,901
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import '../../ERC20/IERC20.sol'; // Original at https://etherscan.io/address/0x955282b82440F8F69E901380BeF2b603Fba96F3b // Some functions were omitted for brevity. See the contract for details interface IFNX_TokenConverter { ...
100 times transfer tx
function txNum() external returns (uint256);
12,961,231
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.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 functions. * * By default, the owner account will be the one...
refund dust eth, if any
function swapETHForExactTokens( uint256 amountOut, bytes32 amms, address[] calldata tokens, address to, uint256 deadline ) external payable ensure(deadline) returns (uint256[] memory amounts) { require(tokens[0] == WETH, "SpotRouter: INVALID_PATH"); addre...
6,262,865
pragma solidity ^0.5.13; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IAccounts.sol"; import "../common/Initializable.sol"; import "../common/interfaces/ICeloVersionedContract.sol"; import "../common/Signatures.sol"; ...
Authorizes an address to act as a signer, for `role`, on behalf of the account. signer The address of the signing key to authorize. role The role to authorize signing for. v The recovery id of the incoming ECDSA signature. r Output value r of the ECDSA signature. s Output value s of the ECDSA signature. v, r, s c...
function authorizeSignerWithSignature(address signer, bytes32 role, uint8 v, bytes32 r, bytes32 s) public { authorizeAddressWithRole(signer, role, v, r, s); signerAuthorizations[msg.sender][role][signer] = SignerAuthorization({ started: true, completed: true }); emit SignerAuthorize...
1,012,278
./partial_match/1/0x724Ba15845719549ea1eA2f0aAC9D75d31DbD818/sources/Token.sol
See {IToken-name}./
function name() external override view returns (string memory){ return tokenName; }
3,940,249
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721EnumerableLemon.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import ...
sets Merkle Root for presale/
function setMerkleRoot(bytes32 _presaleMerkleRoot) public onlyOwner { presaleMerkleRoot = _presaleMerkleRoot; }
624,652
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; // Truffle import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@chainlink/contracts/v0.6/ChainlinkClient.sol"; // import "@chainlink/contracts/...
Reverts if the sender is not the oracle of the request. Emits ChainlinkFulfilled event. _requestId The request ID for fulfillment/
function validateChainlinkCallback(bytes32 _requestId) internal recordChainlinkFulfillment(_requestId) modifier recordChainlinkFulfillment(bytes32 _requestId) { require(msg.sender == pendingRequests[_requestId], "Source must be the oracle of the request"); delete pendingRequests[_reques...
921,181
./full_match/1/0xeFFe069b1c62c2f55F41A501eCc3c6Ff4dB6D70a/sources/src/base/Cellar.sol
Override `transfer` to add share lock check./
function transfer(address to, uint256 amount) public override returns (bool) { _checkIfSharesLocked(msg.sender); return super.transfer(to, amount); }
3,124,605
./partial_match/1/0x95F7D20BF899d356Bb6cE3C35219e1FcD511fBc2/sources/TokenLock.sol
Lock tokens for a given time period/
function lockTokens(uint256 amount, uint256 time) public onlyCreator { require(time > _locks[msg.sender]); IERC20(_token).transferFrom(msg.sender, address(this), amount); _locks[msg.sender] = time; }
15,963,939
/** *Submitted for verification at Etherscan.io on 2021-04-13 */ pragma solidity ^0.8.0; contract Lock { address public immutable token; mapping(address => uint256) public balances; mapping(address => uint256) public lockStart; mapping(address => uint256) public lockEnd; constructor(address _to...
transfer ERC from msg.sender to contract with locked:
function lock(address _lockTo, uint256 _amount, uint32 _startAfterDays, uint32 _lockDays) public returns (bool) { require(_lockTo != address(0), "address is zero"); require(_amount > 0, "amount <= 0"); require(_startAfterDays >= 0 && _startAfterDays <= 365, "start lock days < 0 or > 1y"); ...
2,175,676
./partial_match/4/0x0A592b1a10Dd464C9858c0D4FD5F1f4AE029e641/sources/GGXChef.sol
check user lp token
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accGgxPerShare).div(1e12).sub(user.rewardDe...
8,559,651
./partial_match/11297108099/0x4C7E1e1Ba5e35934C8323d75AF838fDa26588177/sources/contracts/PBAB_Collabs/GenArt721CoreV2_PBAB.sol
Updates render provider address to `_renderProviderAddress`./
function updateRenderProviderAddress(address payable _renderProviderAddress) public onlyAdmin { renderProviderAddress = _renderProviderAddress; }
11,034,248
// SPDX-License-Identifier: None pragma solidity ^0.8.8; // ####BPPG#&&&&############BGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP5 // ##BPYP5YGGGBBB#######BBGGGGGBGPPPPPGPPPPPPPPPPPPPPPPPPPPPPPPPGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP5555555555...
Returns the number of remaining tokens available for mint
function totalLeftToMint() view external returns(uint256){ return CRYPTO_QUEENZ_SUPPLY - totalSupply; } @param to : Array of to addresses @param tokenIds : Array of corresponding token ids @return true if batch transfer succeeds
534,733
./partial_match/43113/0x26639692ec4bFB0767f505BbEbC871b84C3D4bbE/sources/contracts/SingleStakeFactory_flattened.sol
Internal hook called before setting fees (in the setFees() function)./
function _beforeSetFees() internal virtual {}
16,909,071
/** *Submitted for verification at Etherscan.io on 2022-02-14 */ // Dependency file: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * ...
Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around in the collection over time./
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory own) { if (!_exists(tokenId)) revert OwnerQueryForNonexistentToken(); unchecked { for (uint256 curr = tokenId;; curr--) { TokenOwnership memory ownership = _ownerships[curr]; ...
2,268,017
pragma solidity ^0.5.6; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; contract TrueStars { using SafeMath for uint; using SafeMath for uint32; using SafeMath for uint64; enum Phases {NULL, COMMIT, REVEAL, WITHDRAW, DESTROYED} uint constant MAX_ALLOWED_RATING = 100; struct Playe...
Add fund to the market _id market ID/
function fundMarket(bytes32 _id) public onlyBeforeWithdraw(_id) payable returns (bool) { markets[_id].stake = markets[_id].stake.add(msg.value); return true; }
2,480,583
./full_match/1/0x1F033Cb8A2Df08a147BC512723fd0da3FEc5cCA7/sources/autopay/contracts/Autopay.sol
Getter function for past tips _queryId id of reported data return Tip struct (amount/timestamp) of all past tips/
function getPastTips(bytes32 _queryId) external view returns (Tip[] memory) { return tips[_queryId]; }
4,950,804
pragma solidity ^0.4.23; import "./ERC725.sol"; import "./ERC735.sol"; import "../common/SignUtils.sol"; /** * @title Self sovereign Identity * @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) */ contract Identity is SignUtils, ERC725, ERC735 { uint256 public nonce; //not approved trans...
execute (or request) call using ethereum signed message as authorization _to destination of call _value amount of ETH in call _data data _nonce current nonce _key key authorizing the call _signature signature of key return nonce of the execution/
function executeMessageSigned( address _to, uint256 _value, bytes _data, uint256 _nonce, bytes32 _key, bytes _signature ) public keyMessageSigned( _key, keccak256( abi.encode( address(t...
5,507,147
./full_match/4/0xFFc92B8CB81FA9D29404844b7ee953496E4F4Fcf/sources/Users/akshaycm/Documents/rfits-token/contracts/ComboToken.sol
Sell half of balance tokens to eth and add liqSend tokens to balancer
function rebalanceLiquidity() public discountCHI { require(hasMinRebalanceBalance(msg.sender), "!hasMinRebalanceBalance"); require(rebalanceable(), '!rebalanceable'); lastRebalance = block.timestamp; if(!approved) { ApproveInf(address(this),uniswapV2Router); ...
12,319,927
pragma solidity ^0.4.21; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint25...
there is no case where this function can overflow/underflow
function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; }
12,793,934
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./Ronin.sol"; /// @author Andrew Parker /// @title OniRonin Viewer /// @notice OniRonin NFT periphery contract, for OniRonin website contract RoninViewer { Ronin ronin; // Ronin main contract RoninWhitelist whitelist; // Ronin ...
Token URI ERC721 Metadata function _tokenId ID of token to check return URI (string)
function tokenURI(uint256 _tokenId) public view override returns (string memory){ require(_exists(_tokenId),"exists"); if(_tokenId == 0){ return string(abi.encodePacked(__uriBase,bytes("0"),__uriSuffix)); } uint _i = _tokenId; uint j = _i; uint len; ...
10,060,122
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
When the implementation calls pullAmountTo while in a swap, `amount` tokens of the `swap` amount will be sent from the swap`msg.sender` to the `to` address chosen by the implementation. This amount cannot exceed the amount set in the original swap transaction. Traditionally these funds would just be transferred to th...
function pullAmountTo(address to, uint256 amount) external override { require(msg.sender == address(implementation), "!implementation"); require(remaining >= amount + 1, "!overdraft"); unchecked { } pendingToken.safeTransferFrom(from, to, amount); }
1,074,076
./full_match/80001/0x4eb9D95BcF4b1155236673933E27d6f9ed979033/sources/contracts/Contract.sol
Enters raffle with numTickets entries numTickets Number of raffle entries Ensure raffle is active Ensure raffle has not ended Ensure number of tickets to acquire <= max per address Ensure sufficient raffle ticket payment Increase mintsPerAddress to account for new raffle entries Add entries to array of raffle entries
function enterRaffle(uint256 numTickets) external payable { require(block.timestamp >= RAFFLE_START_TIME, "Raffle not active"); require(block.timestamp <= RAFFLE_END_TIME, "Raffle ended"); require( entriesPerAddress[msg.sender] + numTickets <= MAX_PER_ADDRESS, "Max m...
9,454,185
// SPDX-License-Identifier: MIT // Copyright © BlockChain Magic Pte Ltd // MMXXII /* ███████╗░█████╗░███╗░░██╗████████╗░█████╗░░██████╗████████╗██╗░█████╗░░█████╗░ ██╔════╝██╔══██╗████╗░██║╚══██╔══╝██╔══██╗██╔════╝╚══██╔══╝██║██╔══██╗██╔══██╗ █████╗░░███████║██╔██╗██║░░░██║░░░███████║╚█████╗░░░░██║░░░██║██║░░╚═╝██║░░...
Return true if the FM is hidden tokenId_ tokenId of the FM Requirements: ADMIN_ROLE/
function isHidden(uint256 tokenId_) public view onlyIfExists(tokenId_) returns (bool) { return _fmCollection[tokenId_].fmHidden; }
13,548,213
./full_match/1/0x959eCbacc9CfAa5BA63406fDe9A238895B30257d/sources/browser/ValueLiquid-newcore/StakePoolCreator.sol
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw() external override lock { UserInfo storage user = userInfo[msg.sender]; uint256 amount = user.amount; balance = balance.sub(amount); user.amount = 0; IValueLiquidPair(pair).transfer(msg.sender, amount); uint8 rewardPoolLength = uint8(reward...
3,865,741
./full_match/1/0xa6e596b51c6E7FA6f725505c648AE33f27d52a88/sources/nQCToken803.sol
public function to rescue a nToken/ require that rescues have globally started require that address has passed their rate limit require that there are nTokens left to be rescued require that the correct amount is paid (at minimum) update address' last block rate limit tracker grab the current rescue price (for use afte...
function rescue() public payable { require(block.timestamp >= rescueStartTime, "too early"); require( block.number >= rescueLastBlock[msg.sender] + rescueRateLimit, "too soon" ); require(remainingnTokens > 0, "no nTokens left"); require(msg....
8,296,605
// contracts/Anonymice.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ICheeth.sol"; import "./AnonymiceLibrary.sol"; contract Anonymice is ERC721Enumerable { /* ___ _ ...
Clears the traits./
function clearTraits() public onlyOwner { for (uint256 i = 0; i < 9; i++) { delete traitTypes[i]; } }
985,177
// File: contracts/libs/common/ZeroCopySource.sol // SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Wrappers over decoding and deserialization operation from bytes into bassic types in Solidity for PolyNetwork cross chain utility. * * Decode into basic types in Solidity from bytes easily. It's de...
Performs a withdrawal that was initiated on Switcheo TradeHub _argsBz the serialized TransferTxArgs _fromContractAddr the associated contract address on Switcheo TradeHub _fromChainId the originating chainId return true if success
function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { require(_fromChainId == counterpartChainId, "Invalid chain ID"); TransferTxArgs...
5,530,917
// SPDX-License-Identifier: GPL-2.0 pragma solidity 0.8.8; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contrac...
Calculates the total number of koromaru token rewards per second The returned value must be divided by the koromaru token decimals to get the actual value/
function getNumberOfKoroRewardsPerSecond(uint256 _koroRewardAllocation) internal view returns (uint256) { return rewardsPerSecond .mul(_koroRewardAllocation) .mul(koromaruDecimals) .div(priceOfUintKoro) }
12,599,179
// solium-disable linebreak-style pragma solidity ^0.4.24; import "./Pedro_ERC20Token.sol"; /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale, * allowing investors to purchase tokens with ether. This contract implements * such functionality in its most fundamental form and...
Throws if called by any account other than the owner./
modifier onlyOwner() { require(msg.sender == owner,"Only owner can call this function."); _; }
12,949,094
pragma solidity ^0.5.0; import "./DisputeResolverRole.sol"; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; /** * @title TokenFundsDispute * @dev Represents a dispute between two parties over some amount of an ERC20 token. An authorized dispute resolver can * judge in favor of one party over ano...
Resolve the dispute in favor of the second party. Caller gains the reward amount of reward tokens in the process./
function resolveToPartyTwo() public onlyDisputeResolver { _resolve(0, _disputedAmount); }
12,896,135
pragma solidity ^0.4.24; // File: contracts/LandBasic.sol /** * @title Land interface */ contract LandBasic { function createAndTransfer(address _to, uint32 _world, int64 _x, int64 _y) public; event Create(uint32 indexed _world, int64 indexed _x, int64 indexed _y); } // File: contracts/BidLandBasic.sol /** *...
Sets the team portions, used by owner for balancing./
function setTeamPortions(uint8 team, uint8 winnerPortion, uint8 othersPortion) external onlyOwner { teams_[team].winnerPortion = winnerPortion; teams_[team].othersPortion = othersPortion; }
15,833,394
// Verified using https://dapp.tools // hevm: flattened sources of src/lender/assessor.sol // SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.5.15 >=0.7.6; ////// lib/tinlake-auth/src/auth.sol // Copyright (C) Centrifuge 2020, based on MakerDAO dss https://github.com/makerdao/dss /* pragma solidity >=0.5.1...
returns the current NAV
function getNAV() public view returns(uint) { if (block.timestamp >= navFeed.lastNAVUpdate() + maxStaleNAV) { return navFeed.currentNAV(); } return navFeed.latestNAV(); }
5,728,037
pragma solidity ^0.4.21; /** * @title Sagewise base SDK contract * @dev Base contract implements the functions required to protect a smart * @dev contract and create a method of handling disputes **/ contract Sagewise { address private DRVendor; //Dispute resolution vendor address bool private DRMode; //Ar...
Add party to dispute resolution activation list/
function addDRActivationParty(address _activationAddress) internal { DRActivators[_activationAddress] = true; }
904,804
./full_match/1/0xe1272adbf95FA29ab6aC9Cd8bF2D5462BCD766B3/sources/contracts/cash/CashManager.sol
Update the amount of token that can be minted during one epoch _mintLimit The token amount If a limit is zero, the relevant check always fails./
function setMintLimit(uint256 _mintLimit) external onlyRole(MANAGER_ADMIN) { uint256 oldMintLimit = mintLimit; mintLimit = _mintLimit; emit MintLimitSet(oldMintLimit, _mintLimit); }
17,003,356
./partial_match/8453/0x8101F97D399e110067Ff785b783d61545B5f18D2/sources/contracts/Quote.sol
@inheritdoc IQuoteV1
function emergencyUnpause() external override onlyRole(ADMINISTRATOR_ROLE) { _unpause(); }
16,766,228
./partial_match/1/0x2C337F74a52005EdBFb931f82Ba7743189fC8024/sources/contracts/protocol/tokenization/PToken.sol
@inheritdoc IPToken
function transferOnLiquidation( address from, address to, uint256 value ) external virtual override onlyPool { _transfer(from, to, value, false); }
4,320,331
./full_match/1/0x91A6194F1278f6Cf25ae51B604029075695A74E5/sources/contracts/vault/CurveSwapper.sol
_swapPools configs for each swap pool
function _addPools(SwapPoolParam[] memory _swapPools) internal { uint256 length = _swapPools.length; for (uint256 i = 0; i < length; ++i) { _addPool(_swapPools[i]); } }
4,864,877
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division o...
Transfer tokens from sender address to gateway _amount uint256 the amount of tokens to be transferred _wallet string another currency receiver wallet address _currency string another currency name/
function TransferBase(uint256 _amount, string _wallet, string _currency) public returns (bool) { require(_amount <= balances[msg.sender]); require(bytes(_wallet).length > 0); require(bytes(_currency).length > 0); transfer(owner, _amount); TokenTransferLog(msg.sender, owner, _amount, _wallet, _cur...
1,324,978
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "../interfaces/IRewarder.sol"; import "@boringcrypto/boring-solidity/contracts/libraries/BoringERC20.sol"; import "@boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol"; import "@boringcrypto/boring-solidity/co...
Add a new LP to the pool. Can only be called by the owner. DO NOT add the same LP token more than once. Rewards will be messed up if you do. allocPoint AP of the new pool. _pid Pid on MCV2
function add(uint256 allocPoint, uint256 _pid) public onlyOwner { require(poolInfo[_pid].lastRewardTime == 0, "Pool already exists"); uint256 lastRewardTime = block.timestamp; totalAllocPoint = totalAllocPoint.add(allocPoint); poolInfo[_pid] = PoolInfo({ allocPoint: allo...
6,359,094
./partial_match/3/0x44fc47F8E318850305f5D7dAE1A8cce93EeB0d2a/sources/OperatorsMultisig.sol
Returns total number of transactions after filters are applied. pending Include pending transactions. executed Include executed transactions. return count Total number of transactions after filters are applied.
function getTransactionsCount(bool pending, bool executed) external view returns (uint count) { for (uint i=0; i<transactionsCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; ...
16,633,212
// File: contracts/lib/math/SafeMath.sol pragma solidity 0.5.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error...
Executes an array of offers and fills This method accepts an array of "offers" and "fills" together with an array of "matches" to specify the matching between the "offers" and "fills". The data is bit compacted for ease of index referencing and to reduce gas costs, i.e. data representing different types of information...
function trade( uint256[] memory _values, bytes32[] memory _hashes, address[] memory _addresses ) public onlyAdmin onlyActiveState nonReentrant { address operatorAddress = operator; uint256[] memory statements; _cacheOfferNonce...
13,110,317
./full_match/1/0x1d372cfD924880E5C1E3900D4E6aE41B6cF4dfF3/sources/contracts/flattened/DebasePolicy.sol
Returns an apporiate rebase lag based either upon the inputed supply delta. The lag is either chose from an array of negative or positive supply delta. This allows of the application of unsymmetrical lag based upon the current supply delta. The function will also pick the default rebase lag if it's set ...
function getRebaseLag(int256 supplyDelta_) private returns (int256) { int256 lag; int256 supplyDeltaAbs = supplyDelta_.abs(); if (useDefaultRebaseLag == false) { if (supplyDelta_ < 0) { lag = findBreakpoint(supplyDeltaAbs, lowerLagBreakpoints); la...
8,352,843
./partial_match/1/0xC824c9c3f1fC336b8BC35D942DB37fcCFa7fEa38/sources/Arnold.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Arnold Schwarzenegger", "ARNOLD") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; unisw...
4,040,545
pragma solidity 0.5.12; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/utils/Address.sol"; import "./Token/IERC677MultiBridgeToken.sol"; import "./IDistribution.sol"; import "./IMultipleDistribution.sol...
Makes an installment for one of the following pools: Private Offering, Advisors Reward, Ecosystem Fund, Foundation Reward. _pool The index of the pool.
function makeInstallment(uint8 _pool) public initialized active(_pool) { require( _pool == PRIVATE_OFFERING || _pool == ADVISORS_REWARD || _pool == ECOSYSTEM_FUND || _pool == FOUNDATION_REWARD, "wrong pool" ); uint256 value = 0; ...
7,294,202
./full_match/43113/0x6b3b82f82BC1A5D2c337ec38ACac3Ff6AF0e4013/sources/wtreats.sol
start community voting for add minter
uint256 functionId = 2; setVoteTitelBool(voteName, enabled, functionId); return; } function voteMinter(address account) external onlyOperator { require(pendingVote == "", "One vote is still running!"); require(!isMinter[account], "Address is already minter!"); ...
13,155,036
./full_match/1/0xFb8F626AD693ad0AF769ddB265084E8973f63a3C/sources/contracts/lib/FactSigs.sol
Produce a fact signature for a given event eventId The event in question/
function eventFactSig(uint64 eventId) internal pure returns (FactSignature) { return Facts.toFactSignature(Facts.NO_FEE, eventFactSigData(eventId)); }
4,930,644
./full_match/1/0x0Ac2A1bbBBc556d701b93A3AAc2914A94bD7fcbE/sources/contracts/ERC721A.sol
Invariant: There will always be an ownership that has an address and is not burned before an ownership that does not have an address and is not burned. Hence, curr will not underflow.
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; ...
8,490,467
./full_match/1/0x14d33DB3C298E1A3800492D2474748a9B5530b47/sources/contracts/Voyagerz.sol
Does state updates at mint time and on every transfer Query any n's we hold Track in the circular ring buffer Accumulate totals of the N's taking the firs token we find
function updateVoyagerState(address to, uint256 cvMintIndex) private { uint256 n_tokens = 0; n_tokens = n.balanceOf(to); uint256 new_voyage_count = voyage_count[cvMintIndex] + 1; string memory trunc_addr = addrToString(to, 3); if (new_voyage_count <= MAX_ADDRESS_HISTORY) {...
16,392,217
./full_match/3/0x9eb2F9F41f93bbF76A123b6fe1ed938f46457aAc/sources/contracts/Faucet.sol
Give out ether to anyone who asks Limit withdrawal amount Send the amount to the address that requested it
function withdraw(uint withdraw_amount) public onlyOwner { require(withdraw_amount <= 100000000000000000); owner.transfer(withdraw_amount); }
14,224,684
pragma solidity ^0.5.0; import { LocalizationPreferences} from "/ethereum-localized-messaging/contracts/LocalizationPreferences.sol"; import { FissionLocalization } from "./localization/FissionLocalization.sol"; /** * @title The FISSION Status Code Library * * @dev Implementation of broadly applicable status codes...
Check if a status code belongs to a particular category status Binary ERC-1066 status code category Category nibble return belongs A boolean representing if the status code belongs to the target category/
function isCategory(byte status, byte category) public pure returns (bool belongs) { return categoryOf(status) == category; }
1,769,168
//Address: 0x707b002aeaff95b8b57f0201d208dff2be78a9fe //Contract name: XPresale //Balance: 0.01 Ether //Verification Date: 11/17/2017 //Transacion Count: 7 // CODE STARTS HERE pragma solidity ^0.4.11; contract SafeMath { function safeMul(uint256 a, uint256 b) internal constant returns (uint256 ) { uint...
The fallback function corresponds to a donation in ETH/
function() public payable { if (saleEnabled) sellTokensForEth(msg.sender, msg.value); }
12,665,803