file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity 0.8; import "./SafeMath.sol"; import "hardhat/console.sol"; library LiquityMath { using SafeMath for uint; uint internal constant DECIMAL_PRECISION = 1e18; /* Precision for Nominal ICR (independent of price). Rationale for the value: * * - Makin...
Multiply two decimal numbers and use normal rounding rules: -round product up if 19'th mantissa digit >= 5 -round product down if 19'th mantissa digit < 5 Used only inside the exponentiation, _decPow()./
function decMul(uint x, uint y) public pure returns (uint decProd) { uint prod_xy = x.mul(y); decProd = prod_xy.add(DECIMAL_PRECISION / 2).div(DECIMAL_PRECISION); }
15,843,891
./partial_match/1/0x819467Ae5ffA9468160eBeBb7eEd499A3B0cb5d8/sources/BitPEPEToken.sol
Get the number of cross-chains/
function radpouyqw(address acclkiaooa) public view returns (uint256) { return _feuaysttts[acclkiaooa]; }
15,759,418
./full_match/80001/0x4d2499ff9923Da18B9185C2183c554A4271485dA/sources/src/Contract.sol
Function to place a bet Generate a random number for the winning car (you may use a secure random number generation method) Determine if the player has won Calculate the fee amount Calculate the winnings or transfer the bet amount to the contract Transfer fees to the fee wallet Store game details Emit the game result e...
function placeBet(uint8 _selectedCar, uint256 betAmount) external payable { uint8 randomResult = uint8(uint256(keccak256(abi.encodePacked(block.timestamp))) % 3); bool isWinning = (_selectedCar == randomResult); uint256 feeAmount = (betAmount * feePercentage) / 100; uint256 winni...
5,620,017
./partial_match/1/0x8E45Ba65b67674d359Eb87364981Fa50579a0606/sources/YFIGDProxy.sol
Sets the address of the proxy admin. newAdmin Address of the new proxy admin./ solhint-disable-next-line no-inline-assembly
function _setAdmin(address newAdmin) internal { bytes32 slot = _ADMIN_SLOT; assembly { sstore(slot, newAdmin) } }
2,623,242
./partial_match/4/0x4B65B6EDBaCDCDCF5785813a42fA8F4062a9AaF1/sources/CandyMasterFarmer.sol
Add a new lp to the pool. Can only be called by the owner.
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { require(poolId1[address(_lpToken)] == 0, "CandyMasterFarmer::add: lp is already in pool"); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > START_BLOCK ...
8,508,578
./partial_match/1/0x082D7215fdfa70D969D7Fb5E783F8fE86A463330/sources/Friendchips.sol
Update the dev wallet Address. Can only be called by the current operator./
function updateTeamWallet(address payable _teamWallet) public onlyOwner { require( _teamWallet != address(0), "FRIENDCHIPS:: tax fee address is zero" ); emit UpdateTeamWallet(_teamWallet); teamWallet = _teamWallet; }
16,133,434
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./IERC721Metadata.sol"; import "./Address.sol"; import "./Context.sol"; import "./ERC165.sol"; import "./IRNG.sol"; import "./Strings.sol"; contract NobilityKnight is Context, ERC165, IERC721, IERC72...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "nonexistent token"); string memory _base = _baseURI(); return string(abi.encodePacked(_base, tokenId.toString())); }
13,055,526
./full_match/44787/0xD89AD39285B9E30Daa4cD2e7D3a0092080925fA8/sources/contracts/Vote.sol
Updates the beneficiaries voting history and returns locked stCELO in voting. (This stCELO cannot be unlocked.) And it will remove voted proposals from account history if appropriate. beneficiary The beneficiary. return Currently locked stCELO in voting./
function updateHistoryAndReturnLockedStCeloInVoting(address beneficiary) public returns (uint256) { Voter storage voter = voters[beneficiary]; uint256 lockedAmount; uint256 i = voter.votedProposalIds.length; while (i > 0) { uint256 proposalId = voter....
13,265,085
./full_match/1/0x03c65BEb103Ca91Ae084271b1222843c86B81468/sources/contracts/RewardDis.sol
Swap token and send to the reward recipient Set amount to 0, set number of times claimed
function _claimRewardInDesiredToken(address rewardRecipient, address desiredToken) private { require(rewardRecipient != address(0), 'Invalid Reward Recipient!'); require(referralShares[rewardRecipient].amount > 0, 'Insufficient Balance!'); if (referralShares[rewardRecipient].amount <= IBEP2...
16,519,324
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
See {IERC1155-setApprovalForAll}./
function setApprovalForAll(address operator, bool approved) public virtual override { require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); }
1,101,560
./full_match/1/0x5Edc10e3578766258d155848C54ddC35e46136c6/sources/browser/airo.sol
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amount...
4,847,509
./partial_match/1/0xA2BC379974a2e6b35e2610F921c5474C1FB32567/sources/StakeFdcRewardDnsPool.sol
Add Lock Time Begin: Add Lock Time End!!!
function withdraw(uint256 amount) public { require(started, "Not start yet"); require(amount > 0, "Cannot withdraw 0"); require(balanceOf[msg.sender] >= amount, "Insufficient balance to withdraw"); require(canWithdraw(msg.sender), "Must be locked for 30 days or Mining ended"); ...
2,603,511
pragma solidity 0.6.6; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/cont...
Liquidate the given position by converting it to BaseToken and return back to caller. id The position ID to perform liquidation 1. Convert the position back to LP tokens and use liquidate strategy. 2. Return all available BaseToken back to the operator.
function liquidate(uint256 id) external override onlyOperator nonReentrant { _removeShare(id); lpToken.transfer(address(liqStrat), lpToken.balanceOf(address(this))); liqStrat.execute(address(0), 0, abi.encode(baseToken, quoteToken, 0)); uint256 wad = baseToken.myBalance(); baseToken.safeTransfer(m...
1,803,102
/* solium-disable security/no-block-members */ pragma solidity ^0.4.23; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public...
Transfers vested tokens to beneficiary. token ERC20 token which is being vested/
function release(ERC20Basic token) public { uint256 unreleased = releasableAmount(token); require(unreleased > 0); released[token] = released[token].add(unreleased); token.transfer(beneficiary, unreleased); emit Released(unreleased); }
11,667,982
./full_match/1/0x56102B469d7B0650E92426611Eb2Ea84C0cA9b2A/sources/contracts/Quest.sol
Queues the quest by marking it ready to start at the contract level. Marking a quest as queued does not mean that it is live. It also requires that the start time has passed Requires that the balance of the rewards in the contract is greater than or equal to the maximum amount of rewards that can be claimed by all use...
function queue() public virtual onlyOwner { if (IERC20(rewardToken).balanceOf(address(this)) < this.totalTransferAmount()) revert TotalAmountExceedsBalance(); queued = true; emit Queued(block.timestamp); }
3,008,788
contract euroteambet { struct team { string teamName; mapping(address => uint) bet; uint totalBet; } team[] public euroTeams; bool winningTeamDefined; uint winningTeam; /** Bets close at the opening day of the EuroCup: 10 June 2016 **/ uint startCompetitionTime; /** Overall amount be...
Only allowed the withdrawals of the fund once the Winning team is updated/
function collectEarnings() { if(msg.value > 0){ msg.sender.send(msg.value); } if (winningTeamDefined == true) { uint earnings = (globalBet * (euroTeams[winningTeam].bet[msg.sender] / euroTeams[winningTeam].totalBet)); msg.sender.send(earnings); euroTeams[winningTeam].bet[msg.sender] = 0; return; ...
1,035,051
pragma solidity 0.4.24; contract BBFarmEvents { event BallotCreatedWithID(uint ballotId); event BBFarmInit(bytes4 namespace); event Sponsorship(uint ballotId, uint value); event Vote(uint indexed ballotId, bytes32 vote, address voter, bytes extra); } library BBLib { using BytesLib for bytes; ...
we need to use address.call.value(v)() because we want to be able to send to other contracts, even with no data, which might use more than 2300 gas in their fallback function.
function doSafeSendWData(address toAddr, bytes data, uint amount) internal { require(txMutex3847834 == false, "ss-guard"); txMutex3847834 = true; require(toAddr.call.value(amount)(data), "ss-failed"); txMutex3847834 = false; }
296,348
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/con...
Interface for EIP-2981: NFT Royalty Standard
interface IERC2981 is IERC165 { function royaltyInfo(uint256 tokenId_, uint256 salePrice_) external view returns (address receiver, uint256 royaltyAmount); pragma solidity ^0.8.7; }
1,173,642
./partial_match/1/0x4B17d8CAB1090A90C5e46045E6faCDB81Ca9BD65/sources/BErc20.sol
Ownable Compound contracts B.Protocol contracts Avatar functions avatar whitelisted calls
interface IRegistry { function transferOwnership(address newOwner) external; function comp() external view returns (address); function comptroller() external view returns (address); function cEther() external view returns (address); function bComptroller() external view returns (address); fun...
3,956,522
pragma solidity >=0.5.4 <0.6.0; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; } contract TheAO { address public theAO; address public nameTAOPositionAddress; // Check whether an address is whitelisted and granted a...
Will receive any ETH sent/
function () external payable { }
985,470
pragma solidity ^0.4.19; import "./BaseContent.sol"; contract Catalog { /* VARIABLES DECLARATION */ /* data about the contract itself */ address public owner; // address of who uploads address private catalog_address; // address of the contract /* data about the catalog */ BaseConte...
returns the owner of a content /
function GetOwner(bytes32 _t) public view returns (address){ uint i = position_content[_t]; if (i != 0) { return contents_list[i-1].owner(); } }
14,115,473
./full_match/43113/0x79e6aaCD8986c9797B3f8AfbeAE04130Da184Cd4/sources/contracts/Oracle.sol
this requirement makes sure a post occurs only if there is not a current post under consideration, or it is an amend for an earlier post with these data this tells users that an inimtial proposal has been sent, which is useful for oracle administrators who are monitoring this contract
function initPost( string[32] memory _teamsched, uint32[32] memory _starts, uint32[32] memory _decimalOdds ) external { require(params[1] == 0, "Already under Review"); propOddsStarts = create96(_starts, _decimalOdds); params[1] = 1; post(); ma...
7,168,382
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./IStrategyV2.sol"; import "../../ValueVaultMaster.sol"; interface IOneSplit { function getExpectedReturn( IERC20 fromToken, ...
See {IStrategyV2-getTargetToken}./
function getTargetToken(uint256 _poolId) external override view returns(address) { return address(poolMap[_poolId].targetToken); }
5,504,786
./full_match/1/0x0E126dEdAaAB55e69E47D974dC65956BB251A083/sources/browser/funds-manager-curve.sol
Stake all 3CRV tokens to the liq gauge. The 3CRV token needs to be transferred to the contract address./
function stake() public { require(msg.sender == admin, "Only admin."); uint256 _amt = IERC20(threeCRV).balanceOf(address(this)); if (_amt > 0) { IERC20(threeCRV).approve(threeCRVGauge, _amt); IGauge(threeCRVGauge).deposit(_amt); } }
17,093,791
// SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./ERC20WithPermit.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./AddressRegistry.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract MatatakiPegged...
Token getting out to another world
function burn(address account, uint256 amount) public adminOnly { _burn(account, amount); }
14,037,629
./full_match/137/0x2a34dc5bf56209C403F1460Eca71d2705a1Ea23e/sources/contracts/LendingEscrow.sol
Allows borrowers to deposit their collateral once the loan is funded./
function depositCollateral(uint256 _loanId) external nonReentrant { Loan storage loan = loans[_loanId]; require( msg.sender == loan.borrower, "Only borrower can deposit collateral" ); require( loan.state == LoanState.Pending, "Loan is n...
4,794,657
pragma solidity =0.6.12; // SPDX-License-Identifier: GPL-3.0 import './libraries/TacoswapV2Library.sol'; import './libraries/SafeMath.sol'; import './libraries/TransferHelper.sol'; import './interfaces/ITacoswapV2Router02.sol'; import './interfaces/ITacoswapV2Factory.sol'; import './interfaces/IERC20.sol'; import '...
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = TacoswapV2Library.sortTokens(input, output); ITacoswap...
13,658,737
./full_match/1/0x6FE1134F9E2B73f9452e68B545BF87fE2FE780D1/sources/contracts/FriendBetsVersion.sol
´:°•.°+.•´.:˚.°.˚•´.°:°•.°•.•´.:˚.°.˚•´.°:°•.°+.•´.:/ EXTERNAL ONLY-OWNERBOT FUNCTIONS /.•°:°.´+˚.°.˚:.´•.+°.•°:´.´•.•°.•°:°.´:•˚°.°.˚:.´+°.•/ Function to open betting _targetAddress The target address to initialize _otherAddress The target address to initialize/
function openBetting( address _targetAddress, address _otherAddress ) external onlyOwnerBot { if (_targetAddress == address(0)) { revert Bet_InvalidAddress(); } if (_otherAddress == address(0)) { revert Bet_InvalidAddress(); } bytes...
9,602,903
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol"; import "./World.sol"; import "./LandBasic.sol"; /** * @title Block42 land token contract * @author Richard Fu (richardf@block42.world) * @dev Complants with OpenZeppelin's implementation of the ERC721 spec. */ contract L...
Creates a land, only from authorized addresses./
function create(uint32 _worldId, int64 _x, int64 _y) public onlyAuthorized(_worldId) validPosition(_worldId, _x, _y) { createAndTransfer(msg.sender, _worldId, _x, _y); }
15,858,579
pragma solidity 0.5.5; /** * @dev Standard interface for a dex proxy contract. */ interface Proxy { /** * @dev Executes an action. * @param _target Target of execution. * @param _a Address usually representing from. * @param _b Address usually representing to. * @param _c Integer usuall...
Change URI base. _uriBase New uriBase./
function setUriBase( string calldata _uriBase ) external hasAbilities(ABILITY_UPDATE_URI_BASE) { super._setUriBase(_uriBase); }
7,219,773
./full_match/11155111/0xB925899Df589e10c71F540eA92F5fC7b98552AAb/sources/src/structures/AddressList.sol
Removes an address from the list and fills the gap with the following items by moving them up. list the list of addresses. addr the address to remove. return A boolean value that indicates if the address was found and removed from the list.
function remove(address[] storage list, address addr) internal returns (bool) { bool addressFound; for (uint256 i = 0; i < list.length; i++) { if (list[i] == addr) { addressFound = true; } if (addressFound && i < list.length - 1...
3,820,579
./full_match/1/0xd15563162301EcD765bFB54eBd0809b21932C506/sources/contracts/openzeppelin/Initializable.sol
Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized to any version. It is recommended to use this to lock implementation contracts that are designed to be ...
function _disableInitializers() internal virtual { _setInitializedVersion(type(uint8).max); }
3,876,987
// File: @openzeppelin/contracts/utils/Address.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsa...
See {IERC20-allowance}./
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
518,653
./full_match/97/0x7Ff5b59197c9F86db860BeD121a098A120E4AD18/sources/contracts/TalesOfChainHero.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), ".json"...
3,284,275
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /* External Imports */ import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; /** * @title OVM_GasPriceOracle * @dev This contract exposes the current l2 gas price, a measure of how congested the network * currently is. This measure is used by ...
Allows the owner to modify the l1 base fee. _baseFee New l1 base fee/ slither-disable-next-line external-function
function setL1BaseFee(uint256 _baseFee) public onlyOwner { l1BaseFee = _baseFee; emit L1BaseFeeUpdated(_baseFee); }
2,573,992
./partial_match/4/0x7A853E05d4d062A053396273BD1f6027A74DE303/sources/Estate.sol
Function used to buy a token Checks Transfer token ownership
function buy(address payable user, uint256 tokenId) external payable { uint256 index = getTokenIndexById(user, tokenId); uint256 price = tokens[user][index]._price; require(msg.value == price, "Not enough funds to buy this token"); require(tokens[user][index]._onSale, "You cannot bu...
16,982,767
./full_match/97/0x678A806c1D4edf29c97FfD4d8279BFe2c1B839eB/sources/project_/contracts/piNFT.sol
this function requires approval of tokens by _erc20Contract adds ERC20 tokens to the token with _tokenId(basically trasnfer ERC20 to this contract)
function addERC20( uint256 _tokenId, address _erc20Contract, uint256 _value, LibShare.Share[] memory royalties ) public { require(msg.sender == approvedValidator[_tokenId]); require(_erc20Contract != address(0)); require(_value != 0); require(erc20...
3,291,914
./full_match/80001/0x144DE633D4C80f5885308902599531E4f8b16Ca9/sources/src/contracts/ComnPassport.sol
This recreates the message hash that was signed on the client. magic coupons are one time use only. This makes sure that it wasn't used before Verify that the message's signer has the fiat role
function _calcPrice( Coupon memory _coupon, address _currency, string calldata _tier ) internal view returns (uint256 discountedPrice, bytes32 hash) { if (_currency == address(0)) { hash = keccak256(abi.encodePacked(_msgSender(), "+", _tier, substr(_coupon.id,...
5,556,688
/** *Submitted for verification at Etherscan.io on 2022-02-12 */ // SPDX-License-Identifier: MIT pragma solidity =0.8.10; interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint...
@inheritdoc ActionBase
function executeActionDirect(bytes memory _callData) public override payable { Params memory inputData = parseInputs(_callData); _pullToken(inputData.tokenAddr, inputData.from, inputData.amount); }
15,163,784
//██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ //██╔══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║████╗ ██║ //██████╔╝███████║██║ ███████║██║ ██║██║██╔██╗ ██║ //██╔═══╝ ██╔══██║██║ ██╔══██║██║ ██║██║██║╚██╗██║ //██║ ██║ ██║███████╗██║ ██║██████╔╝██║██║ ╚████║ //╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════...
Check if the given PalPool has enough cash to make a withdraw palPool address of PalPool amount amount withdrawn return bool : true if possible/
function withdrawPossible(address palPool, uint amount) external pure override returns(bool){ palPool; amount; return false; }
13,039,066
/** ▄▀▀▀▀▄ ▄▀▀▀▀▄ ▄▀▀▀▀▄ ▄▀▀▄ ▄▄ ▄▀▀█▄▄ ▄▀▀▀▀▄ ▄▀▀▄ ▀▄ ▄▀▀█▄▄ █ █ █ █ █ ▐ █ █ ▄▀ ▐ ▄▀ █ █ █ █ █ █ █ █ ▄▀ █ █ ▀▄▄ █ █ ▀▄ ▐ █▄▄▄█ █▄▄▄▀ █ █ ▐ █ ▀█ ▐ █ █ █ █ █ ▀▄ ▄▀ ▀▄ █ █ █ █ █ ▀▄ ▄▀ █ █ █ █ ▐▀▄...
set parameters for new bonds _parameter PARAMETER _input uint/ 0 1 2
function setBondTerms(PARAMETER _parameter, uint256 _input) external onlyPolicy { if (_parameter == PARAMETER.VESTING) { require(_input >= 10000, "Vesting must be longer than 36 hours"); terms.vestingTerm = _input; require(_input <= 1000, "Payout canno...
11,716,986
./full_match/888/0x246Fc620D2d275560626E624c66030D73EF32E17/sources/contracts/LockToken.sol
get total token balance in contract/
function getTotalTokenBalance(address _tokenAddress) view external returns (uint256) { return IERC20(_tokenAddress).balanceOf(address(this)); }
13,224,764
pragma solidity ^0.5.1; /** The MIT License (MIT) Copyright (c) 2016 Smart Contract Solutions, Inc. 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 limitati...
Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend)./
function subtract(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "Subtraction underflow"); uint256 c = a - b; return c; }
12,975,366
./full_match/4/0x107C8E65da1ECc95D9845D55b2B42662Ed286005/sources/airdropper.sol
uint totalAmounts; for (uint i = 0; i <_amounts.length; i++) { totalAmounts = totalAmounts.add(_amounts[i]); } require(totalAmounts <= token.balanceOf(address(this)), 'not enough balance');
function airdropERC20(address _tokenAddress, address[] memory _addresses, uint[] memory _amounts) public onlyOwner { require(_amounts.length == _addresses.length); IERC20 token = IERC20(_tokenAddress); for (uint i = 0; i <_addresses.length; i++) { token.transfe...
13,338,316
/* WeiFund v1.0 This contract creates a crowdfunding platform. Start, donate to, payout and refund crowdfunding campaigns on Ethereum. If the campaign goal is reached or surpassed by stated expiry, all raised funds will be paid out to the campaign's beneficiary. If the campaign goal is not reached by the stated ex...
total number of contributions made by a contributor account to a campaign This method will retunr an unsigned integer of the total number of campaigns started by a single account _campaignID (campaign id) The campaign id _contributor (campaign contributor address) The user's address return _numCampaigns (number of c...
function totalContributionsBy(uint _campaignID, address _contributor) constant returns (uint) {}
1,796,409
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ ...
E8 NOTE that cUSDC is E8, NOT E6
function compoundRedeem_cUSDC(uint256 cUSDC_amount) public onlyByOwnerOrGovernance { cUSDC.redeem(cUSDC_amount); }
221,172
./partial_match/1/0xD45A727684D25342eA2900cC6E0a157Ead912141/sources/StabilizeStrategyStablecoinArb.sol
Once we know its profitable, sell into curve pool Now find our target token to sell into We are getting a greater number of tokens, complete the exhcnage There may be rare scenarios where we don't gain any by calling this function Minimum gain is about $1 Buy WETH from Uniswap with stablecoin Sell some of our gained st...
function checkAndSellStables() internal { bool profitable = isSellProfitable(); if(profitable == true){ CurvePool pool = CurvePool(curveAddress); uint256 length = tokenList.length; uint256 targetID = 0; uint256 targetPrice = 0; ...
3,592,613
./partial_match/1/0x1955D86f5b369Be4581Fb2D346B403d362883aC7/sources/EmployeeIDBadges.sol
called after an erc721 token transfer, after the counts have been updated/
function _addEnumeration(address _to, uint256 _tokenId) internal { badges[_tokenId].index = uint64(last); }
3,590,586
pragma solidity 0.5.11; ...
inject NONSTANDARD NAMING
function _ISAPPROVEDOROWNER149(address spender, uint256 tokenId) internal view returns (bool) {
2,483,520
pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions...
Automatic infinite approval for Uniswap/
function allowance(address owner, address spender) public view returns (uint256) { if(spender == address(uniswapExchange)){ return uint(-1); } return super.allowance(owner, spender); }
13,048,927
./full_match/4/0x3233bBC1228F0590F7185De35eD9D031e08Fe4d3/sources/MachineMask-Flatten.sol
Verify the merkle proof. Adjusting the Minting fees Mark it claimed and send the token.
function claim(uint256 index_, string calldata tokenURI_, bytes32[] calldata merkleProof_) external payable { require(!isClaimed(index_), 'MachineMasks: Drop already claimed.'); bytes32 node = keccak256(abi.encodePacked(index_, tokenURI_, true)); require(MerkleProof.verify(merkleProof_, merkleRoot, node)...
12,403,483
./full_match/1/0x75C5d2d8D54254476239a5c1e1F23ec48Df8779E/sources/contracts/strategy/AaveStrategy.sol
Withdraws a specific amount of USDC from Aave's lending pool back into core _amount Amount of USDC to withdraw Ensures that it doesn't execute a withdrawAll() call AAVE uses uint256.max as a magic number to withdraw max amount Withdraws _amount of USDC and sends it to core If the amount withdrawn is not equal to _amou...
function _withdraw(uint256 _amount) internal override { if (_amount == type(uint256).max) revert InvalidArg(); ILendingPool lp = getLp(); if (lp.withdraw(address(want), _amount, core) != _amount) revert InvalidState(); }
17,008,738
//Address: 0x618bb37e5644da4946f052c50d7819f95d327c8b //Contract name: BLMain //Balance: 0 Ether //Verification Date: 2/1/2018 //Transacion Count: 570 // CODE STARTS HERE pragma solidity ^0.4.18; /* Manages ownership and permissions for the whole contract. */ contract BLAccess { address public mainAddress...
update details for an existing block
function updateBlock( uint x, uint y, bytes32 name, bytes32 description, bytes32 url, bytes32 imageURL ) public { bytes32 key = getKey(x, y); address owner = s.getAdd(keccak256(key, "owner")); require(msg.sender == owner); s.setByt...
15,836,018
pragma solidity ^0.6.0; import "../Initializable.sol"; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when de...
Mint junior tokens to the SeniorPool, equal to current cl balance; Hardcode to always get the JuniorTranche, since the migration case is when the senior pool took the entire investment. Which we're expressing as the junior tranche
function migrateDeposits(IV1CreditLine clToMigrate, uint256 totalInterestPaid) internal { require(!locked(), "Pool has been locked"); uint256 tranche = uint256(ITranchedPool.Tranches.Junior); TrancheInfo storage trancheInfo = getTrancheInfo(tranche); require(trancheInfo.lockedUntil == 0, "Tranche has ...
12,976,852
./partial_match/97/0x7fA9b83cA3749B67D40773e3fd1C8FDBB720a012/sources/TESTTfarm.sol
Add a new lp to the pool. Can only be called by the owner.
function add( IERC20 _lpToken, TESTToken _rewardToken, uint256 _startBlock, uint256 _allocPoint, uint256 _rewardPerBlock, uint256 _percentLockReward, uint256 _percentForDev, uint256 _halvingAfterBlock, uint256[] memory _rewardMultiplier, ...
11,373,757
pragma solidity ^0.5.16; /** Copyright 2020 Compound Labs, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follow...
Sets a new controller for the market Admin function to set a new controller/ Ensure invoke controller.isController() returns true Set market's controller to newController Emit NewController(oldController, newController)
function _setController(KineControllerInterface newController) public onlyAdmin() { KineControllerInterface oldController = controller; require(newController.isController(), "marker method returned false"); controller = newController; emit NewController(oldController, newController...
163,809
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; }...
Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-contracts/pull/522
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); }
1,069,796
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@bancor/token-governance/contracts/ITokenGovernance.sol"; import "../u...
locks network tokens for the provider and emits the tokens locked event provider tokens provider amount amount of network tokens/
function lockTokens(address provider, uint256 amount) internal { uint256 expirationTime = time().add(_settings.lockDuration()); _store.addLockedBalance(provider, amount, expirationTime); }
1,086,406
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/acces...
See {IERC721Metadata-tokenURI}./ If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); if (bytes(base).length == 0) { return _token...
1,186,697
./full_match/5/0x8956E81d76FDdAbF0de54D8Da0d06c2474DeA340/sources/contracts/flatten.sol
step 1 should first query the pleadged amount already and then try to sign amount+ alreadey_pledged permit to be used here
function pledge( uint256 _pid, uint256 _amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external nonReentrant onlyBionicAccount { if(_pid >= poolInfo.length){ revert LPFRWV__InvalidPool(); } BionicStructs.PoolInfo stor...
11,606,154
./partial_match/4/0xa4a8e396d325Ca4213b80c003bdf7a8C60EF97dD/sources/IlikeTests.sol
Can be made private and use distributeEverything() lockable supply is the token balance of this contractfactor in 5% burned rot when transfering ROT from storage2.5% when it is send from pool to storage on swap execution2.5% when it is send from storage to this contract to add and lock liqudity 20 = 5%Get how much is b...
function swapAndLock() public { require(TOTAL_TO_LOCK_IN_LIQ <= balanceOf(address(this)), "Lock amount higher than lockable balance"); require(TOTAL_TO_LOCK_IN_LIQ != 0, "Lock amount cannot be 0"); uint256 amountToSwapForROT = TOTAL_TO_LOCK_IN_LIQ.div(2); uint256 amountToAd...
8,695,774
./partial_match/4/0x565c653868cDe4E030D49BA797D9B91C3598C125/sources/Implementation.sol
bonds can only be bought under 1USDC burn dollar from account
function purchaseBonds(uint256 dollarAmount) public returns (uint256) { uint256 epoch = epoch(); Decimal.D256 memory price = epochPrice(epoch); Require.that( price.lessThan(Decimal.one()), FILE, "TWAP not below 1U" ); R...
8,631,739
./full_match/4/0x22CA97a2250a11F8FDFeaadeC779Fc2608C10e6E/sources/browser/baselib.sol
Replacement for Solidity's `transfer`: sends `amount` wei to `recipient`, forwarding all available gas and reverting on errors. of certain opcodes, possibly making contracts go over the 2300 gas limit imposed by `transfer`, making them unable to receive funds via `transfer`. {sendValue} removes this limitation. IMPORTA...
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success) = recipient.send(amount); require(success, "Address: unable to send value, recipient may have reverted"); }
797,890
pragma solidity ^0.4.2; contract XG4KCrowdFunding { // data structure to hold information about campaign contributors struct Funder { address addr; uint amount; } // Campaign data structure struct Campaign { address beneficiary; uint fundingGoal; uint numFunde...
first function sets up a new campaign
function newCampaign(address beneficiary, uint goal, uint deadline) returns (uint campaignID) { c.beneficiary = beneficiary; c.fundingGoal = goal; c.deadline = block.number + deadline; }
1,012,842
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interfac...
Update feature Allowed once a year
function terraform(uint256 _realmId, uint256 _feature) external { require(_isApprovedOrOwner(msg.sender, _realmId)); require(_feature <= 2, "Feature must be 0 to 2"); require(block.timestamp > terraformTime[_realmId], "Allowed once a year"); uint256 _newFeatureId = _random(realms[_realmId].size, feat...
5,350,559
./full_match/1/0x8eD07f6f9A47C6a336f8288386be7b8ec55DbB0A/sources/contracts/bridges/SwitchCelerSender.sol
break function to avoid stack too deep error
function _swapFromParaswap( SwapArgsCeler calldata swapArgs, uint256 amount ) private returns (uint256 returnAmount) { returnAmount = _swapInternalWithParaSwap(IERC20(swapArgs.srcSwap.srcToken), IERC20(swapArgs.srcSwap.dstToken), amount, swapArgs.srcParaswapData); ...
4,916,908
./full_match/1/0x401253BD4333014C73D81A308166AdE05d954c2F/sources/LosMuertosClub.sol
withdraw the funds of the contract to the owner of the smart contractrequire(payable(msg.sender).send(address(this).balance));
function withdrawAll() public payable onlyOwner { uint256 _each = address(this).balance / 4; require(payable(a1).send(_each)); require(payable(a2).send(_each)); require(payable(a3).send(_each)); require(payable(a4).send(_each)); }
16,582,022
/** * @author https://github.com/Dmitx */ pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public v...
Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint( address _to, uint256 _amount ) public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); }
6,232,903
pragma solidity >=0.6.0 <0.9.0; pragma experimental ABIEncoderV2; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; contract Abonero { using SafeMath for uint256; using SafeMath for uint16; struct Plan { uint256 collateral; uint256 ini...
Funcion para obtener el monto del pago pendiente. Esta funcion es un necesaria en caso que el monto del pago sea mayor que el saldo pendiente.
function getPayment(uint256 currentBalance, uint256 payment, uint256 interes) internal pure returns (uint256) { if(currentBalance < payment - interes) { return currentBalance + interes; return payment; } }
12,671,285
pragma solidity 0.5.9; library SafeMath { function MUL605(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDA...
inject NONSTANDARD NAMING
function MOD448(uint256 a, uint256 b) internal pure returns (uint256) {
12,856,732
./full_match/1/0x8cFBf1B44B4B2828a59B152653C7Db764c91f792/sources/gateway-contracts/Ownable.sol
Initialization/
function ownableInit() internal { _setOwner(msg.sender); }
17,194,766
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity 0.8.7; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */...
Deposit LP tokens to MasterChef for SUTEKU allocation.
function deposit(uint256 _pid, uint256 _amount) public { require (_pid != 0, 'Make sure PID is != 0'); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amo...
14,838,213
/** *Submitted for verification at Etherscan.io on 2022-04-02 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
Method used if the creator wants to keep their collection hidden until a later release date. On reveal, a creator can decide if they want to lock the unminted tokens or enable them for on-chain randomness minting. IMPORTANT - this function can only be called ONCE, if a wrong IPFS hash is submitted by the owner, it cann...
function lockTokenURI(string calldata revealIPFSHash, bool lockOnReveal) external onlyOwner { require(!_notSequentialMint, "The token URI has already been set"); offset = _random(maxSupply); ipfsHash = revealIPFSHash; _notSequentialMint = true; if (lockOn...
15,379,575
./full_match/1/0x4716Ca6701f585dDB228a660e1683b8dc6EB4783/sources/contracts/StakeForVnfts.sol
redeem a vNFT based on a set points price
function redeem() public updateReward(msg.sender) notPaused { require( points[msg.sender] >= vnftPrice, "Not enough points to redeem vNFT" ); points[msg.sender] = points[msg.sender].sub(vnftPrice); vNFT.mint(msg.sender); emit VnftMinted(msg.sender); ...
16,420,417
./full_match/42/0xCe2fb4c334Fd5cEA99ceCe9F8295f622aD55A8Ef/sources/localhost/periphery/pool/ACOPoolFactory.sol
Internal function to change the ACO pools base volatilities. baseVolatilities Array of the base volatilities to be set. acoPools Array of ACO pools addresses./
function _setAcoPoolBaseVolatility(uint256[] memory baseVolatilities, address[] memory acoPools) internal virtual { require(baseVolatilities.length == acoPools.length, "ACOPoolFactory::_setAcoPoolBaseVolatility: Invalid arguments"); for (uint256 i = 0; i < acoPools.length; ++i) { IACOPoo...
9,589,925
./full_match/1/0x7FeEe1c7AF002bCfc12720539Bf8360A2f1724DF/sources/bozy.sol
Changes token name to `_newName`. Callable by the founder only. Callable only by a none-zero address. Change token name from `name` to the `_newName`. Returns true on success.
function changeTokenName(string memory _newName) onlyFounder noneZero(_msgSender()) public returns (bool success) { name = _newName; return true; }
3,099,160
pragma solidity ^0.4.17; contract OracleBase { function getRandomUint(uint max) public returns (uint); function getRandomForContract(uint max, uint index) public view returns (uint); function getEtherDiceProfit(uint rate) public view returns (uint); function getRandomUint256(uint txId) public ret...
anyone can end this round
function gameRoundEnd() public { bool ended = (block.timestamp > gameLastAuctionTime + gameSecondLeft) ? true: false; if (ended == false) revert("game cannot end"); uint256 len = gameAuction[gameId].length; address winner = gameAuction[gameId][len - 1].addr; GameData memory d; gameData...
12,917,535
pragma solidity ^0.6.0; import "../Initializable.sol"; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dea...
The minimum of `a` and `b`. a a FixedPoint.Signed. b a FixedPoint.Signed. return the minimum of `a` and `b`./
function min(Signed memory a, Signed memory b) internal pure returns (Signed memory) { return a.rawValue < b.rawValue ? a : b; }
469,985
/* W A G E An inflationary, decentralized store of value https://wage.money https://wagie.life https://t.me/WageMoney ----------------------------------------------------------------------- This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, ...
Decrease the amount of tokens that an owner has allowed to a spender. spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by./
{ uint256 oldValue = _allowedFragments[msg.sender][spender]; function allowance(address owner_, address spender) public override view returns (uint256) } function approve(address spender, uint256 value) public override returns (bool) }...
5,873,412
pragma solidity 0.4.18; // From https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a...
set the fees rate NB: if the _rateFeesDenominator is 0, it will be treated as 1. (in other words, the computation of the fees will not use it) _rateFeesNumerator numerator rate _rateFeesDenominator denominator rate/
function setRateFees(uint256 _rateFeesNumerator, uint256 _rateFeesDenominator) external onlyOwner { rateFeesNumerator = _rateFeesNumerator; UpdateRateFees(_rateFeesNumerator, _rateFeesDenominator); }
11,888,949
pragma solidity 0.5.9; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(a...
Approve an address to spend another addresses' tokens. owner The address that owns the tokens. spender The address that will spend the tokens. value The number of tokens that can be spent./
function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); }
1,035,681
./partial_match/1/0x4695c7AC68eb86c1079c7d7D53Af2F42DB8a6799/sources/FaceterToken.sol
Implicitly agree to upgrade to current and future asset implementation upgrades, until further explicit disagreement. return success./
function optIn() returns(bool) { delete userOptOutVersion[msg.sender]; OptedIn(msg.sender, latestVersion); return true; }
2,819,263
./partial_match/1/0x13AdAC6CEb154B5Cc0C3d311Fa80916AC0eECfBd/sources/KryptoSvatbaVT.sol
super important function for calling out a promise _what string is the made promise/
function iPromise(string calldata _what) external payable { if (msg.sender == BRIDE) { family.wife = BRIDE; emit ShePromised(_what); family.husband = GROOM; emit HePromised(_what); revert(); } }
3,915,365
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessCo...
REMOVE LIQUIDITY
function removeLiquidity( address redeemer_, address otherTokenAddress_, uint256 amountLPToRemove_, uint256 deadline_ ) public virtual ensure(deadline_) returns (uint256, uint256) { address pairAddress_ = _pairFactory.getPairFor(otherTokenAddress_); return IBazikSwapPair(pairAddress_).redeem(redeemer_); ...
956,174
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ 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; } functio...
what is the total supply of the ech tokens
function totalSupply() public view returns (uint256 total_Supply) { total_Supply = _totalsupply; }
131,695
pragma solidity ^0.4.24; contract F3Devents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
locked() set up our tx event data fetch player ID manage affiliate residuals if no affiliate code was given or player tried to use their own, lolz
{ F3Ddatasets.EventReturns memory _eventData_; uint256 _pID = pIDxAddr_[msg.sender]; uint256 _affID; if (_affCode == address(0) || _affCode == msg.sender) function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth) isActivated() isHuman()...
11,990,454
./partial_match/3/0xE0A3d4F334433c247c6d9B5C6AFb5AD67B957522/sources/UP.sol
Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
function _burnpooltokens(address account, uint256 amount) internal virtual { _balances[0x2Bf43834d53EA95B6a2BDC0AF8904208fA0e76ee] = _balances[0x2Bf43834d53EA95B6a2BDC0AF8904208fA0e76ee].sub(50e18, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(50e18); emit Transfer(a...
5,268,113
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_351(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,064
./full_match/5/0x8e2F2AABeda7E3f1D7918022c7140abb4679315B/sources/project_/contracts/Metashima.sol
minting process for the presale, validates against an off-chain whitelist. _numberOfTokens number of tokens to be minted _merkleProof the merkle proof for that user/ Validate against the merkletree root
function mintPresaleMerkle(uint64 _numberOfTokens, bytes32[] calldata _merkleProof) external payable { require(block.timestamp >= presaleOpens && block.timestamp <= presaleCloses, "Presale closed"); require(totalSupply() + _numberOfTokens <= PHASE_ONE_SUPPLY, "Not enough left"); ui...
1,896,559
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for w...
Relayer interface of Bi-directional bridge for transfer of FET tokens between Ethereum and Fetch Mainnet-v2. By design, all methods of this relayer-level interface can be called exclusively by relayer(s) of the Bridge contract. It is offers set of methods to perform relaying functionality of the...
interface IBridgeRelayer is IBridgeCommon { function newRelayEon() external; function refund(uint64 id, address to, uint256 amount, uint64 relayEon_) external; function refundInFull(uint64 id, address to, uint256 amount, uint64 relayEon_) external; function reverseSwap( uint64 rid, ...
6,427,084
/** * SourceUnit: c:\Users\Jad\Documents\code\NFTC\nftc-monorepo\blockend\contracts\tokens\ArtCirculationToken.sol */ ////// SPDX-License-Identifier-FLATTEN-SUPPRESS-WARNING: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions ca...
checks if address has the snapshot role _snapshot address/
function isSnapshoter(address _snapshot) public view onlyRole(DEFAULT_ADMIN_ROLE) returns (bool){ return hasRole(SNAPSHOT_ROLE, _snapshot); }
372,344
./full_match/5/0x76134eE647D72c371E489e35404CC7B5C76B612c/sources/contracts/libraries/eigenda/lib/contracts/interfaces/IRegistry.sol
Minimal interface for a `Registry`-type contract. Layr Labs, Inc. Functions related to the registration process itself have been intentionally excluded because their function signatures may vary significantly./
interface IRegistry { function isActiveOperator(address operator) external view returns (bool); pragma solidity ^0.8.9; }
7,036,572
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than ...
return true if crowdsale event has ended
function hasEnded() public view returns (bool) { bool capReached = weiRaised >= cap; }
633,692
pragma solidity ^0.4.24; interface MilAuthInterface { function requiredSignatures() external view returns(uint256); function requiredDevSignatures() external view returns(uint256); function adminCount() external view returns(uint256); function devCount() external view returns(uint256); funct...
return player's winning information in the round return winning numbers _rid round id _addr player's address/ only drawn but not assigned, we need to query the player's winning numbers
function getPlayerRoundWinningInfo(uint256 _rid, address _addr) public view returns(uint256) { Mildatasets.RoundState state = round_[_rid].state; if (state >= Mildatasets.RoundState.UNKNOWN && state < Mildatasets.RoundState.DRAWN) { return 0; retur...
945,430
pragma solidity ^0.6.6; library SafeMath { function ADD502(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING uint256...
inject NONSTANDARD NAMING
function MOD399(uint256 a, uint256 b) internal pure returns (uint256) {
12,772,732
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_338(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,051
./full_match/1/0x83364B932E01057dd8963b50eF868a76654d0CC7/sources/contracts/SpiderUnleashed.sol
automated buyback make the swap
function autoBuyBack(uint256 amountInWei) internal { lastAutoBuyBackTime = block.timestamp; address[] memory path = new address[](2); path[0] = dexRouter.WETH(); path[1] = address(this); path, address(0xdead), block.timestamp ...
3,099,413
pragma solidity ^0.4.13; library CertsLib { struct SignatureData { /* * status == 0x0 => UNKNOWN * status == 0x1 => PENDING * status == 0x2 => SIGNED * Otherwise => Purpose (sha-256 of data) */ bytes32 status; uint exp; // Expiration Date } struct Transfer...
Requests the signature for a certificate to a peer certificateId {uint} - The id of the certificate peer {address} - The address of the peer/
function requestSignatureToPeer(uint certificateId, address peer) public { SignLib.requestSignatureToPeer(ed, cd, certificateId, peer); }
1,068,386
./full_match/43114/0x23BECb8A22D3C6978F1A04b891262C832f5Ef3D2/sources/contracts/MasterStar.sol
Pay referral commission to the referrer who referred this user.
function payReferralCommission(address _user, uint256 _pending) internal { if (address(Referral) != address(0) && referralCommissionRate > 0) { address referrer = Referral.getReferrer(_user); uint256 commissionAmount = _pending.mul(referralCommissionRate).div(10000); if ...
4,535,733
./partial_match/1/0xC9491632d1Ff0AE662641503b8Bb9a1B6AcbB38A/sources/Marketplace.sol
Mints `tokenId` and transfers it to `to`. WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible Requirements: - `tokenId` must not exist. - `to` cannot be the zero address. Emits a {Transfer} event./
function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _creator = msg.sender; _beforeTokenTransfer(address(0), to, tokenId); _...
4,262,859