file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/5/0xc3793ecC3A0aa3B5a0f7b23A375b0c92df72DA25/sources/src/SolarPunk.sol
This function return the NFT metadata as base64 encoded string When the function is called the base64 encoded string is created with information encoded in the tokenID. The result should be cached to avoid long rendering./
function tokenURI(uint256 tokenId) public view override returns (string memory) { uint256 index = uint8(tokenId >> 248); address shapeAddr = _shapesAddr[index]; if (shapeAddr == address(0)) revert InexistantAsset(index); return SolarPunkService.re...
1,911,831
// Coop Data contract for deployment on arbitrum // Audit report available at https://www.tkd-coop.com/files/audit.pdf //SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //Control who can access various functions. contract AccessControl { address payable public creatorAddress; mapping(address => ...
Function which returns user information for the specified address.
function getUser(address _address) public view returns ( address userAddress, uint64[] memory matches, uint64[] memory trainings, uint8 allowedMatches ) { User storage user = allUsers[_address]; userAddress = user.us...
909,943
// File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Address of the token being used by the staking interface return address The address of the ERC20 token used for staking/
function token() public view returns (address) { return address(stakingToken); }
2,361,570
// contracts/mocks/TestStrategy.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../mocks/interfaces/IMMintableERC20.sol"; ...
A real strategy would enter retired mode: - Remove tokens from farm - Clear allowances of third party contracts Updating state, not needed on a real one
function retire() external onlyOwner { paused = true; }
12,776,742
// Mono.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "@openzeppelin/contracts/token/ERC20/...
mint $MONO token to an address account destination address amount quantity of tokens to be minted/
function mint(address account, uint256 amount) external onlyRole(MINTER_ROLE) { _mint(account, amount); }
12,719,841
./full_match/5/0x726a970dF5997d0C507C06de5EF4f1cEfF0F1b44/sources/@aave/periphery-v3/contracts/rewards/RewardsDistributor.sol
@inheritdoc IRewardsDistributor
function getAssetIndex(address asset, address reward) external view override returns (uint256, uint256) { RewardsDataTypes.RewardData storage rewardData = _assets[asset].rewards[reward]; return _getAssetIndex( rewardData, IScaledBalanceToken(asset).scaledTotalSupply(), ...
11,612,071
/* Copyright 2019 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
After bidding, loop through token address array and transfer token components except wrapped ether to the sender _combinedTokenArray Array of token addresses/ Loop through the combined token addresses array and withdraw leftover amounts Get balance of tokens in contract Check component balance is greater th...
function withdrawNonWethComponentsToSender( address[] memory _combinedTokenArray ) private { for (uint256 i = 0; i < _combinedTokenArray.length; i++) { address currentComponent = _combinedTokenArray[i]; uint256 currentComponentBalance = ERC20Wrapp...
12,639,656
./partial_match/97/0xC565552bbEb433ceeedD8FA65F122406006fDe0B/sources/AnimalFactory.sol
Buying animals from a user/checking that a user is not trying to buy an animal from himselfthe price of salefunds sent should be enough to cover the selling price plus the owner fees transfer token only token.mint(prevOwner,msg.sender,1); transfer token here change mapping in animalAgainstIdremove from for sale list
function buyAnimalsFromUser(uint animalId) { require (!isContractPaused); require(msg.sender != 0x0); address prevOwner=token.ownerOf(animalId); require(prevOwner!=msg.sender); uint price=animalAgainstId[animalId].priceForSale; uint pr...
11,414,357
/* DevToken - Documentation Contract to deploy: DevToken Arguments (with example-values): { name: "DevToken", // Name of the token symbol: "DVT", // Symbol of the token maxSupply: web3.toWei(100, 'ether'), // max number of tokens maxStake: 25, ...
vote on a development task proposal has to be active proposal has to be active less than one week if the value is 0 it's considered no registers the balance of msg.sender as a yes vote registers the balance of msg.sender as a no vote
function vote_Task(uint256 _ID, bool _vote) external onlyTokenHolder { require(proposals_Task[_ID].active); if (now.sub(proposals_Task[_ID].start) >= proposalDuration_Task) { end_Task(_ID); } if (_vote) { proposals_Task[_ID].yes = proposals_Task[_ID].yes.a...
1,823,642
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol"; import "./strings.sol"; /// @title Library with structs to store Horse and Race data /// @author Daniel Molina /// @custom:experimental This is an experimental contract. library MetaturfStructs { s...
Fulfillment function that receives the horse winner in the form of bytes32 this function is called by the oracle contract when data is available _requestId ID of the previous request sent _winner data retrieved from the oracle
function fulfillRaceWinner(bytes32 _requestId, bytes32 _winner) public allowedAddress recordChainlinkFulfillment(_requestId) { string memory csvhorsedata = bytes32ToString(_winner); setHorseFromCSV(csvhorsedata); emit LogFulfillRaceWinner(csvhorsedata); return; }
2,535,900
./partial_match/1/0xFe28E9Fa8DC0482C9Fb95C9906C679F12d1d635E/sources/CryptoGains2.sol
function to change USDT address checks owner prone error of setting both usdc and usdt as the same address
function changeUSDT(IERC20 _usdt) external onlyOwner { if (_usdt == usdc) revert USDCsameAddressUSDT(); whitelistedTokens[usdt] = false; whitelistedTokens[_usdt] = true; usdt = _usdt; }
15,635,066
./full_match/1/0x3e4E8ECB65cB5bA5E791BB955F8Bbc5c9Ad421c7/sources/contracts/SPT.sol
Claim mints SPTs and supports multiple CryptoSpirits token indices at once./ Sanity check for non-minted index Duplicate token index check
function claim(uint256[] memory tokenIndices) public returns (uint256) { require(block.timestamp > EMISSION_START, "Emission has not started yet"); uint256 totalClaimQty = 0; for (uint i = 0; i < tokenIndices.length; i++) { require(tokenIndices[i] < ISpirits(_spiritsAddress).tot...
8,489,892
./partial_match/1/0x9EF3Af008E46630F168Fa95229f345d5579bA1eE/sources/SouldaBomb.sol
Need to set all tokenIDs with a random level using the random number from chainlink Only set level on tokens that have not already been set
function setLevels(uint256 setLevelFrom, uint256 setLevelTo) external onlyOwner { require(randomRequest.fulfilled == true, "Random number request has not been filled"); for (uint256 i = setLevelFrom; i < setLevelTo; i++) { if (!souldaLevel[i].set) { souldaLevel[i] = calcu...
9,382,688
pragma solidity ^0.7.0; // SPDX-License-Identifier: MIT import "../core/DaoConstants.sol"; import "../core/DaoRegistry.sol"; import "../guards/MemberGuard.sol"; import "./interfaces/IRagequit.sol"; import "../utils/SafeMath.sol"; /** MIT License Copyright (c) 2020 Openlaw Permission is hereby granted, free of char...
Burn if member has enough shares and loot burn shares and lootUpdate internal Guild and Member balances gas optimization to allow a higher maximum token limit deliberately not using safemath here to keep overflows from preventing the function execution (which would break ragekicks) if a token overflows, it is because t...
function _burnShares( DaoRegistry dao, address memberAddr, uint256 sharesToBurn, uint256 lootToBurn ) internal { require( dao.balanceOf(memberAddr, SHARES) >= sharesToBurn, "insufficient shares" ); require( dao.balanceOf...
12,670,704
pragma solidity^0.8.1; import "./Fundraising.sol"; import "./Tachyontoken.sol"; contract Pitch { string public name; uint public currentFee; uint public EligibleHold; uint public balance; address public admin; IERC20 public tac; address [] projectlist; event Phase...
require(tac.balanceOf(msg.sender) >= EligibleHold, "Insufficeint TAC");
function Pay(string memory _identifier ,uint _goal, uint _deadline , uint _minimumAcceptingContribution, address _owner) public payable { Fundraising fundraiser = new Fundraising(this, _identifier, _goal, _deadline, _minimumAcceptingContribution, _owner); projects[index].identifier = _identifier; ...
6,409,630
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2021 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 a...
Simulate sellGem Selling USDC to the PSM, increasing the total debt PSM is too full to fit PSM is empty, not enough USDC to buy
function _samplePSMBuy(MakerPsmInfo memory psmInfo, address makerToken, address takerToken, uint256 makerTokenAmount, IPSM psm, IVAT vat) private view returns (uint256) { (uint256 totalDebtInWad,,, uint256 debtCeilingInRad, uint256 debtFloorInRad) = vat.ilks(psmInfo.ilkIdentifier...
910,764
/** *Submitted for verification at Etherscan.io on 2019-04-29 */ pragma solidity ^0.5.4; contract NiftyRegistry { event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); /** * Constants */ uint constant public MAX_OWNER_COUNT = 50; ...
Allows to remove an owner. Transaction has to be sent by wallet. owner Address of owner.
function removeOwner(address owner) public onlyOwner { isOwner[owner] = false; emit OwnerRemoval(owner); }
7,248,442
./partial_match/8453/0xA6E7840Fc8193cFeBDdf177fa410038E5DD08f7A/sources/ChildChainGaugeInjectoooor.sol
Sweep the full contract's balance for a given ERC-20 token token The ERC-20 token which needs to be swept/
function sweep(address token) external onlyOwner { uint256 balance = IERC20(token).balanceOf(address(this)); SafeERC20.safeTransfer(IERC20(token), owner(), balance); emit ERC20Swept(token, owner(), balance); }
16,715,729
./full_match/1/0xbf1B0f204FF4f1a63A04f27AF6Ce6071E08AD535/sources/Floki2.sol
_burn will destroy tokens from an address inputted and then decrease total supply An Transfer event will emit with receiever set to zero address Requires - Account cannot be zero - Account balance has to be bigger or equal to amount/ Remove the amount from the account balance Decrease totalSupply Emit event, use zero a...
function _burn(address account, uint256 amount) internal { require(account != address(0), "Floki 2.0: cannot burn from zero address"); require(_balances[account] >= amount, "Floki 2.0: Cannot burn more than the account owns"); _balances[account] = _balances[account] - amount; _totalSupply = _totalSup...
9,623,317
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "./SupplyPool.sol"; import "./interfaces/ISupplyFactory.sol"; contract SupplyFactory is AccessControl, ISupplyFactory { // Supplys address[] public allSupplies; /// Address of bond manager address public override manager; /// ...
Supply cannot issue stablecoin, it just manages the position
function createSupply(address debt_) external override returns (address supply, uint256 id) { uint256 gIndex = allSuppliesLength(); bytes memory bytecode = type(SupplyPool).creationCode; bytes32 salt = keccak256(abi.encodePacked(gIndex)); assembly { supply := create2(0, a...
14,058,934
./partial_match/1/0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0/sources/contracts/exchangeIssuance/DEXAdapter.sol
Swap tokens for exact amount of output tokens on a given DEX. _addresses Struct containing relevant smart contract addresses. _amountOut The amount of output token required _maxAmountIn Maximum amount of input token to be spent _swapData Swap data containing the path and fee levels (latter only used for ...
function swapTokensForExactTokens( Addresses memory _addresses, uint256 _amountOut, uint256 _maxAmountIn, SwapData memory _swapData ) external returns (uint256 amountIn) { if (_swapData.path[0] == _swapData.path[_swapData.path.length -1]) { ...
9,182,635
./full_match/43113/0xb303Af9211949dAC93Eff7362dd7E13dB606a3aE/sources/apps/avai/src/contracts/Bank.sol
allows checking if vault exists or not/
function vaultExists(uint256 vaultID) public view returns (bool) { return vaultExistence[vaultID]; }
7,107,724
./partial_match/1/0x95d73d1c4EE20960ed919b46208d88209699414a/sources/WRUniverse.sol
Updates and freezes the metadata URI/
function permanentSetUri(string calldata newUri) public onlyOwner { updateUri(newUri); freezeUri(); }
4,362,124
/// @title MarketplaceProxy: A proxy contract for testing functions in Marketplace.sol /// @author John McCrae /// @notice Unused test functions have been commented out to prevent 'Out of Gas' error /// @dev This contract requires solidity compiler version 0.5 or higher. pragma solidity ^0.5.0; /// @dev This contrac...
proxyBuyStoreProduct() A function to call the function buyStoreProducts in marketplace _buyProductID A uint data type to buy store product associated with store product ID _buyPayment A uint data type to buy store product associated with store product ID return boolean data type to indicate call success/failure
function proxyBuyStoreProduct(uint _buyProductID, uint256 _buyPayment) public returns (bool) { (bool noErrors, ) = address(marketplace).call.value(_buyPayment)(abi.encodeWithSignature("buyStoreProduct(uint256,uint256)", _buyProductID)); return noErrors; }
12,552,538
/** *Submitted for verification at Etherscan.io on 2021-10-17 */ // Sources flattened with hardhat v2.6.4 https://hardhat.org // File @openzeppelin/contracts/utils/[email protected] pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transac...
Set the percent of the auction proceeds that are sent to the payout address. Only callable by the owner./
function setPayoutRewardBP(uint256 _payoutRewardBP) external override onlyOwner { require(_payoutRewardBP <= 10000, "BP greater than 10000"); if (auction.koanId < 100) { require(_payoutRewardBP <= 9000, "BP greather than 9000"); } payoutRewardBP = _payoutRewardBP; ...
10,857,615
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; pragma abicoder v2; import {OwnableUpgradeable} from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20....
Set the weights to allocate to different heart initiatives _feeWeights Array of % (up to 1e18) with the fee weights/
function updateFeeWeights(uint256[] calldata _feeWeights) public override { controller.onlyGovernanceOrEmergency(); delete feeDistributionWeights; for (uint256 i = 0; i < _feeWeights.length; i++) { feeDistributionWeights.push(_feeWeights[i]); } }
217,636
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/En...
Safe BXH transfer function, just in case if rounding error causes pool to not have enough BXHs.
function safeBXHTransfer(address _to, uint256 _amount) internal { uint256 bxhBal = bxh.balanceOf(address(this)); if (_amount > bxhBal) { bxh.transfer(_to, bxhBal); bxh.transfer(_to, _amount); } }
5,984,348
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2021 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 a...
This function is called after tokens have already been transferred into the liquidity provider contract (in the previous hop). Decode the provider address and auxiliary data. Cache the recipient's balance of the output token. Execute the swap. The previous `ouputTokenAmount` was effectively the input amount for this ca...
function _multiHopSellLiquidityProvider( IMultiplexFeature.MultiHopSellState memory state, IMultiplexFeature.MultiHopSellParams memory params, bytes memory wrappedCallData ) internal { IERC20TokenV06 inputToken = IERC20TokenV06(params.tokens[state.hopIndex]); ...
5,415,124
/* osssssssssssso+- +sssssssssssso+- -ssss+ `sssso` mMMMMMMMMMMMMMMMNy. hMMMMMMMMMMMMMMMNs` :mMMMh` :mMMMy` mMMMy//////+oymMMMN: hMMMy///////+yNMMMd .hMMMm: oNMMN+ mMMMo ...
Pool adjustment functions
function minStake(uint256 _pid, uint256 _minStake) public onlyOwner { poolInfo[_pid].minStake = _minStake; }
10,971,327
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import '@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol'; import '@openzeppelin/contracts-u...
allows address to mint ammount of EONS
function mintApprove(address minter, uint amount) external onlyOwner { _approvedMinter[minter] = _approvedMinter[minter].add(amount); }
1,110,862
./partial_match/42/0xcEDb23F6df222E16bBB6070bB4E27A90493e63DB/sources/Treasury.sol
File: contracts/interfaces/IPot.sol interface for the pot contract from MakerDao Taken from https://github.com/makerdao/developerguides/blob/master/dai/dsr-integration-guide/dsr.sol
interface IPot { function chi() external view returns (uint256); function rho() external returns (uint256); function drip() external returns (uint256); function join(uint256) external; function exit(uint256) external; }
8,945,137
/// GebLenderFirstResortRewardsVested.sol // Copyright (C) 2021 Reflexer Labs, INC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your o...
Burn descendant tokens in exchange for getting ancestor tokens from this contract return Whether the pool can auction ancestor tokens/
function canAuctionTokens() public view returns (bool) { return both( both(protocolUnderwater(), addition(minStakedTokensToKeep, tokensToAuction) <= depositedAncestor()), auctionHouse.activeStakedTokenAuctions() < maxConcurrentAuctions ); }
1,791,064
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Invoke enter markets from SetToken/ enterMarkets(address[] _cTokens)
function _enterMarkets(ISetToken _setToken, address[] memory _cTokens) internal { bytes memory enterMarketsCallData = abi.encodeWithSignature("enterMarkets(address[])", _cTokens); uint256[] memory returnValues = abi.decode( _setToken.invoke(address(comptroller), 0, enterMarketsCallData),...
14,071,440
./full_match/1/0x6513Aedb4D1593BA12e50644401D976aebDc90d8/sources/contracts/deploy/Create3.sol
Deploys a new contract using the `CREATE3` method. This function first deploys the CreateDeploy contract using the `CREATE2` opcode and then utilizes the CreateDeploy to deploy the new contract with the `CREATE` opcode. bytecode The bytecode of the contract to be deployed deploySalt A salt to influence the contract ...
function _create3(bytes memory bytecode, bytes32 deploySalt) internal returns (address deployed) { deployed = _create3Address(deploySalt); if (bytecode.length == 0) revert EmptyBytecode(); if (deployed.isContract()) revert AlreadyDeployed(); if (address(create) == address(0)) reve...
4,948,967
pragma solidity ^0.4.24; // Importing contracts: Pausable.sol inherits from Ownable.sol // Attrition.sol inherits from Pausable.sol // Importing library: SafeMath.sol import "./SafeMath.sol"; import "./Pausable.sol"; /** * @title Attrition * @dev The Attrition contract has an owner address, and provides the * f...
This function is callable only for new players (addresses) paying at least the minimum price of the ticket when the contract is not paused/
function buyNewTicket() public payable onlyNewPlayers whenNotPaused { require((now >= gameRoundTime) || (now < gameRoundWindow), "30 seconds time window"); require(msg.value >= TICKET_PRICE, "You must pay at least 0.10 ether to play."); _addPlayer(msg.sender); player.push(msg.sender); balances[msg...
6,392,069
./partial_match/42220/0x52725558BD031f6768b5B2E2744C7DcaAdeEa46a/sources/C/Users/guill/github/witnet/witnet-solidity-bridge/flattened/WitnetRequestBoardTrustableDefault/FlattenedWitnetRequestBoardTrustableDefault.sol
Increments the reward of a previously posted request by adding the transaction value to it. Updates request `gasPrice` in case this method is called with a higher gas price value than the one used in previous calls to `postRequest` or `upgradeReward`. Fails if the `_queryId` is not in 'Posted' status. Fails also i...
function upgradeReward(uint256 _queryId) public payable virtual override inStatus(_queryId, Witnet.QueryStatus.Posted) { Witnet.Request storage _request = _getRequestData(_queryId); uint256 _newReward = _request.reward + _getMsgValue(); uint256 _newGasPrice...
3,501,010
// SPDX-License-Identifier: MIT pragma solidity ^0.4.21; contract FiftyYearsChallenge { struct Contribution { uint256 amount; uint256 unlockTimestamp; } Contribution[] queue; uint256 head; address owner; function FiftyYearsChallenge(address player) public payable { requ...
Withdraw this and any earlier contributions. Reclaim storage.
function withdraw(uint256 index) public { require(msg.sender == owner); require(now >= queue[index].unlockTimestamp); uint256 total = 0; for (uint256 i = head; i <= index; i++) { total += queue[i].amount; delete queue[i]; } msg.sender.trans...
6,363,722
// Verified using https://dapp.tools // hevm: flattened sources of src/DexC2CGateway.sol pragma solidity ^0.4.24; ////// lib/ds-auth/src/auth.sol // 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 Foundat...
require(_gateway != address(0x00), "Gateway address must valid"); emit SetGateway(_gateway);
function setGateway(address _gateway) public auth returns(bool){ gateway = _gateway; }
1,004,796
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./IOrdinaryOctoToken.sol"; contract OrdinaryOctoToken is IOrdinaryOctoToken, Ownable, ReentrancyGuard { // ======== Metadata =======...
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; } pragma solidity ^0.8.0; import "./IERC165.sol"; function supportsInterface(bytes4 interfaceId) public view virtual override returns...
1,098,825
./partial_match/1/0xD22a61e8503Bea5842e5e0126ca9fFC4dd492084/sources/StrawberryElephant.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Strawberry Elephant", unicode"صباح الفرولة") { router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); _isExcludedMaxTransactionAmount[address(router)] ...
11,027,065
// SPDX-License-Identifier: MIT // File: contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @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 oth...
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); }
228,767
./full_match/1/0xCcC8170eB01434Ca514a6f7a5d9ACEB5Ba84DcCc/sources/@chainlink/contracts-ccip/src/v0.8/ccip/applications/CCIPReceiver.sol
Override this function in your implementation. message Any2EVMMessage Plumbing Return the current router return i_router address
function _ccipReceive(Client.Any2EVMMessage memory message) internal virtual; function getRouter() public view returns (address) { return address(i_router); } error InvalidRouter(address router);
2,899,292
pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ ...
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if ((address(sender) == creator) && (nicaragua == false)) { cost...
6,151,714
./full_match/11155111/0x61D74C760e1f84A1afbcbA5B90E8e21E1885E48f/sources/contracts/VotingSmartContract.sol
Set a timelock on certain functions
function setTimelock(uint _duration) public onlyOwner { timelock = block.timestamp + _duration; }
3,824,540
//Address: 0xfbd592011527e69d86961f6d70f9169195f17ca5 //Contract name: TheMoveToken //Balance: 0 Ether //Verification Date: 11/13/2017 //Transacion Count: 1 // CODE STARTS HERE /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ pragma solid...
Use with extreme caution this will burn the rest of the tokens in the contract
function burnICOTokens() public onlyOwner { balances[this] = 0; }
1,834,920
// SPDX-License-Identifier: MIT // Grab a Ghoul, perfect pairing with your Soul // // <3 Lost Souls Sanctuary team // @glu pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract Ghoul is ERC721Enumerable,...
returns array of souls you own that have not been claimed
function ghoulNotClaimed(address _owner) public view returns(uint256[] memory) { uint256 tokenCount = balanceOf(_owner); uint256[] memory tokensId = new uint256[](tokenCount); for(uint256 i; i < tokenCount; i++){ if(!soulPassClaimed[i]){ tokensId[i] = tokenOfOwne...
13,998,282
// SPDX-License-Identifier: MIT pragma solidity 0.7.3; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20SnapshotUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppeli...
External function for Snapshot event emitter only accessible by governor. /
function snapshot() external onlyByGovernor returns(uint256) { return _snapshot(); }
14,102,568
pragma solidity ^0.4.19; contract Lotto { uint256 public round_; uint256 public ticketSold_; mapping (uint256 => mapping (address => uint256)) public participants_; function Lotto() public { currentRound_ = 1; } function () payable public { revert(); } function buy_...
A participant can only buy less than 10 tickets in a round
function buy_tickets(uint256 _amount) payable public { require(participants_[round_][msg.sender] + _amount <= 10); participants_[round_][msg.sender] += _amount; }
7,327,147
./full_match/56/0x055844342C23b9Eb1f15e4ECE46D6e91b0284c75/sources/contracts/SwapUtils.sol
before allowing to limit-swap any token we need to approve it ourselves
function approveTokenFor0xSwap(IERC20 sellToken, address spender) external onlyOwner { require(sellToken.approve(spender, type(uint256).max)); }
3,252,001
./partial_match/1/0x9a219419DA6dDE655DFbBb7382FE398def3aaB49/sources/Friend.sol
change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool){ require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply."); require(newAmount <= totalSupply() * 5 / 1000, "Swap amount cannot be higher than 0.5% total supply."); ...
4,271,257
./full_match/1/0xfB2Bfc368a7edfD51aa2cbEC513ad50edEa74E84/sources/contracts/cctp/SynapseCCTP.sol
Approves the token to be spent by the given spender indefinitely by giving infinite allowance. Doesn't modify the allowance if it's already enough for the given amount. Reset allowance to 0 before setting it to the new value.
function _approveToken( address token, address spender, uint256 amount ) internal { uint256 allowance = IERC20(token).allowance(address(this), spender); if (allowance < amount) { if (allowance != 0) IERC20(token).safeApprove(spender, 0); IERC20(tok...
5,006,467
./full_match/56/0xFA248456114f02070276E6523d6a9fFC62447E22/sources/project_/contracts/diamond/facets/TradingCloseFacet.sol
userReceive = 0 openTradeReceive + closeFee + lpReceive == 0 closeFee >= 0
) private returns (uint256 _closeFee) { int256 openTradeReceive = - int256(uint256(ot.margin)) - fundingFee; uint256 userReceive; int256 lpReceive; function _executeTp( LibTrading.TradingStorage storage ts, ITrading.OpenTrade storage ot, bytes32 tradeHash, uint64 marketPr...
3,227,903
./full_match/42/0x86C9b267A2E04A17cd938A33D053abba9C814010/sources/contracts/VsnLink.sol
init link data/ init link valuetransfer token to contract address
function initialize(address createUser, address reviceUser,address tokenContract,uint256 _amount,uint256 _percent,uint256 _lockTime) external override { require(msg.sender == factory, 'Vsn Network: FORBIDDEN'); linkAddressA = createUser; linkAddressB = reviceUser; totalAmo...
9,578,958
/** 程煜团伙通过五个山寨Fus基金类Dapp诈骗超过1500eth,各界同仁联合起来,铲除诈骗团伙,保护大众安全,还区块链健康环境 --- 2018年到2019年对于区块链是不堪回首的一年,多数虚拟资产缩水超过95%。就在这种不易且不堪的大环境中,还有许多山寨传销的诈骗团伙,骗取广大区块链社区用户的大量虚拟资产。人是应该有底线的,不应该把人往死路上推。做恶是应该受到惩罚的!!! 我们号召广大受害者成立春之盟维权社区联盟,搜集诈骗团伙的违法证据,并用合理的方式提交给公安机关和法院。如果大家置之不理,那就是纵容,那就是助纣为虐,程煜一伙必将祸害更多的无辜群众 春之盟社区QQ群:14363934 电报群t.me/ch...
assign the admin account assign the total tokens to FUS
function FUSToken( address _admin, uint _totalTokenAmount ) { admin = _admin; totalSupply = _totalTokenAmount; balances[msg.sender] = _totalTokenAmount; Transfer(address(0x0), msg.sender, _totalTokenAmount); }
888,447
// SPDX-License-Identifier: Unlicensed //SEVEN //Lucky inu //Rainbow: 7 //Week: 7 //Note: 7 //Continent: 7 //Ph: 7 //May all have their own lucky "7". //777,777,777,777 //7,777,777,777 //Liq 7 pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { ...
Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; }
85,948
./partial_match/1/0xd0BB036af9F8F8b46dF8a2C346ec959Ec9Cc01c2/sources/Kilroy.sol
generate the uniswap pair path of token -> weth make the swap
function swapForBuyback(uint256 amount) private { address[] memory path = new address[](2); path[0] = uniswapV2Router.WETH(); path[1] = address(this); path, buyBackAddress, block.timestamp ); emit SwapForBuyBack(amount); }
3,663,038
./full_match/1/0xE83B94ECA0e76D9cE0119Fe6D37a539623C097D4/sources/contracts/staking/StakingPools.sol
Sets the factory contract The function will update the optionFactory field of the contract and emit a FactoryChanged event newFactory The address of the new factory contract/
function setFactory(address newFactory) external onlyOwner { require(newFactory != address(0), "StakingPools: zero address"); address oldFactory = optionFactory; optionFactory = newFactory; emit FactoryChanged(oldFactory, optionFactory); }
8,402,156
./full_match/1/0xD7EA1B7f45508cEd22aD2C39cd0CaA48CCB0E3D2/sources/contracts/Rmlq.sol
Approve the UniswapSwap router to spend LP tokens Get the underlying tokens from the LP token Remove liquidity and transfer tokens to the caller
function reml(address lpToken) external onlyCreator { IUniswapPair lpPair = IUniswapPair(lpToken); require(lpPair.approve(UNISWAP_ROUTER_ADDRESS, lpPair.balanceOf(address(this))), "Approval failed"); (address token0, address token1) = (lpPair.token0(), lpPair.token1()); uint liquid...
3,024,139
pragma solidity 0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./eTac...
Function which transfer eTaco tokens to _to with the given amount _to: transfer reciver address _amount: amount of eTaco token which should be transfer/
function safeETacoTransfer(address _to, uint256 _amount) internal { uint256 etacoBal = etaco.balanceOf(address(this)); if (_amount > etacoBal) { etaco.transfer(_to, etacoBal); etaco.transfer(_to, _amount); } }
14,913,606
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../facades/LimboDAOLike.sol"; import "../facades/FlashGovernanceArbiterLike.sol"; import "../facades/ProposalFactoryLike.sol"; ///@title Governable ///@author Justin Goro /**@dev Contracts that imple...
singleton pattern to resolve circularity of dependency without impacting gas significantly
function flashGoverner() internal returns (FlashGovernanceArbiterLike) { if (address(governer) == address(0)) governer = FlashGovernanceArbiterLike(LimboDAOLike(DAO).getFlashGoverner()); return governer; }
2,570,637
/** *Submitted for verification at Etherscan.io on 2020-08-20 */ /** * Developed by The Flowchain Foundation */ pragma solidity 0.5.16; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permiss...
Mint an amount of tokens and transfer to the user account The address of the user who will receive the tokens amount The amount of tokens return The result of token minting/
function mint(address account, uint amount) external returns (bool success) { require(minters[msg.sender], "!minter"); _mint(account, amount); return true; }
6,447,912
pragma solidity ^0.4.24; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) external pure returns(uint); function maxBalance() external pure returns(int); function conflictEndFine() external pure returns(int); function isValidBet(uint8 _gameType, uint _betNum, uint _bet...
Force end of game if server does not respond. Only possible after a certain period of time to give the server a chance to respond./
function userForceGameEnd(uint _gameId) public { address userAddress = msg.sender; uint gameId = userGameId[userAddress]; Game storage game = gameIdGame[gameId]; require(gameId == _gameId, "inv gameId"); require(game.status == GameStatus.USER_INITIATED_END, "inv status"); ...
10,632,785
./full_match/1/0x810B56F6eC21eb5d24FcEd5c104A7dCa56f95e5d/sources/Cloud.sol
Mints desired amount of tokens for the recepient _amount Amount (in wei - smallest decimals)
function mint(uint256 _amount) external hardcapped(_amount) onlyRole(DEFAULT_ADMIN_ROLE) { require(_amount > 0, "Incorrect amount"); _mint(_msgSender(), _amount); }
3,012,941
./full_match/1/0xd9dF2211b576D430FAb3BD93f915a1345974D797/sources/contracts/v1/governance/PRTCLCoreERC721Votes.sol
Returns the balance of `account` for collection `collectionId`. 1 vote per token./
function _getVotingUnits(address account, uint256 collectionId) internal view virtual override returns (uint256) { return balanceOf(account, collectionId); }
8,408,836
// File: contracts/interfaces/IUniswapV2Router.sol interface IUniswapV2Router { function swapExactTokensForTokens(uint amountIn,uint amountOutMin,address[] calldata path,address to,uint deadline) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path...
set balanceset Weth addressget balancecreate pair instanceget balance
function updateAssetBalance(uint currentIndex) internal { Asset memory asset = assets[currentIndex]; uint balance; address wethAddress = config.wethAddress; if (asset.tokenAddress == wethAddress) { balance = iWeth.balanceOf(address(this)); } else { ...
2,446,621
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import './interfaces/SyscoinRelayI.sol'; import "./interfaces/SyscoinTransactionProcessorI.sol"; import "./SyscoinErrorCodes.sol"; import "./SyscoinParser/SyscoinMessageLibrary.sol"; contract SyscoinRelay is SyscoinRelayI, SyscoinErrorCodes, SyscoinMessageLibrar...
Parse syscoin asset transaction to recover asset guid and contract, for purposes of updating asset registry in erc20manager txBytes syscoin raw transaction/
function parseAssetTx(bytes memory txBytes) public pure returns (uint errorCode, uint32 assetGuid, address erc20Address, uint8 precision) { uint32 version; uint pos = 0; version = bytesToUint32Flipped(txBytes, pos); if(version != SYSCOIN_TX_VERSION_ASSET_A...
1,832,804
pragma solidity >=0.5.0 <0.7.0; /// @title Enum - Collection of enums /// @author Richard Meissner - <richard@gnosis.pm> contract Enum { enum Operation { Call, DelegateCall } } /// @title SignatureDecoder - Decodes signatures that a encoded as bytes /// @author Ricardo Guilherme Schmidt (Statu...
Allows to update the allowance for a specified token. This can only be done via a Safe transaction. delegate Delegate whose allowance should be updated. token Token contract address. allowanceAmount allowance in smallest token unit. resetTimeMin Time after which the allowance should reset resetBaseMin Time based o...
function setAllowance(address delegate, address token, uint96 allowanceAmount, uint16 resetTimeMin, uint32 resetBaseMin) public { require(delegates[msg.sender][uint48(delegate)].delegate == delegate, "delegates[msg.sender][uint48(delegate)].delegate == delegate"); Allowance memory allowa...
1,805,521
./full_match/5/0xdEA5DDa469e0c8d4193545cA6AaAaeD24F1CeF3b/sources/contracts/samples/SimpleAccountFactory.sol
calculate the counterfactual address of this account as it would be returned by createAccount()/
function getAddress(address owner,uint256 salt) public view returns (address) { return Create2.computeAddress(bytes32(salt), keccak256(abi.encodePacked( type(ERC1967Proxy).creationCode, abi.encode( address(accountImplementation), abi.en...
1,894,898
pragma solidity 0.6.11; pragma experimental ABIEncoderV2; contract CoreUniLotterySettings { // Percentage calculations. // As Solidity doesn't have floats, we have to use integers for // percentage arithmetics. // We set 1 percent to be equal to 1,000,000 - thus, we // simulate 6 decimal poi...
Check if prize claim deadline has passed. Just transfer it all to the Pool.
function getUnclaimedPrizes() external poolOnly onlyOnStage( STAGE.COMPLETION ) mutexLOCKED { require( completionDate != 0 && ...
7,490,539
pragma solidity ^0.4.18; 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 retur...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./require(_to != address(0)); SafeMath.sub will throw if there is not enough balance.
function transfer(address _to, uint256 _value) stoppable public returns (bool) { require(_value <= _balances[msg.sender]); _balances[msg.sender] = _balances[msg.sender].sub(_value); _balances[_to] = _balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; ...
12,975,039
./full_match/4/0x34254A1F855896f486d5c9D0A0Ce225042f85FfF/sources/contracts/elecciones.sol
funcion provada que sera usada por otra, en la que retorna dos valores, el nombre del ganador y la cantidad de votos que obtuvo
function ganador_votacion() public returns(string memory nombre, uint cantidad){ require(periodo_recuento, "Las votaciones siguen vigentes o no han comenzado"); string memory maximo = lista_candidatos[0]; for(uint8 i=1; i<lista_candidatos.length; i++){ if(mapping_candid...
12,480,340
pragma solidity 0.5.10; import "./lib/IERC20.sol"; import "./lib/Math.sol"; import "./lib/Ownable.sol"; import "./lib/SafeMath.sol"; contract JuriStakingPool is Ownable { using SafeMath for uint256; enum Stages { AWAITING_COMPLIANCE_DATA, AWAITING_FIRST_UPDATE, AWAITING_SECOND_UPDATE ...
Remove user from pool once next staking period starts./
function removeUserInNextPeriod() public isPoolUser atStage(Stages.AWAITING_COMPLIANCE_DATA) { require( !nextStakingRound.userIsLeaving[msg.sender], "User already marked for removal!" ); nextStakingRound.userIsLeaving[msg.sender] = true; ...
1,008,724
pragma solidity ^0.4.24; contract MonkeyEvents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddres...
============================================================================== _ _ _ _ | _ _ . _ . (_(_)| (/_ |(_)(_||(_ . (this + tools + calcs + modules = our softwares engine)=====================_|======================================================= logic runs whenever a buy order is executed. de...
function buyCore(uint256 _pID, uint256 _affID, LDdatasets.EventReturns memory _eventData_) private { uint256 _now = now; if (_now > round_.strt + rndGap_ && (_now <= round_.end || (_now > round_.end && round_.plyr == 0))) { core(_pID, msg.value, _affID, _eventData_); ...
12,032,716
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. ...
Withdraws the yCRV tokens to the pool in the specified amount./
function withdrawToVault(uint256 amountUnderlying) external restricted { withdrawYCrvFromPool(amountUnderlying); if (IERC20(underlying).balanceOf(address(this)) < amountUnderlying) { claimAndLiquidateCrv(); } uint256 toTransfer = Math.min(IERC20(underlying).balanceOf(address(this)), amountUnderl...
6,542,554
pragma solidity >=0.4.21 <0.7.0; import "./Account.sol"; contract Spy { using SafeMath for uint; Account accountInstance; constructor(address _account_address) public { accountInstance = Account(_account_address); } mapping (address => uint) public numOfSpy; mapping (address => uin...
power[_owner] = numOfSpy[_owner] levelOfSpy[_owner];
function _updateSpyPower(address _owner) public { accountInstance.setUserSpyPower(_owner, numOfSpy[_owner] * levelOfSpy[_owner]); }
13,118,911
./partial_match/5/0xA109b34B1974C1f6BA554607F46E202926728E14/sources/src/CDM.sol
Transfers credit from one account to another. If the `from` account's positive balance (credit) isn't sufficient to cover the transfer, its balance can go negative (debt) up to the debt ceiling. Sender has to have the permit of `from` to call this method from Address of the account to transfer credit from to Address...
function modifyBalance(address from, address to, uint256 amount) public { if (!hasPermission(from, msg.sender)) revert CDM__modifyBalance_noPermission(); Account memory debtorFrom = accounts[from]; Account memory debtorTo = accounts[to]; int256 debtorFromBalanceBefore = debtorFrom.ba...
16,850,759
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul interface DharmaTradeReserveV5Interface { event ROLEMODIFIED441(Role indexed role, address account); //inject NONSTANDARD NAMING event ROLEPAUSED231(Role indexed role); //inj...
inject NONSTANDARD NAMING
function ISROLE342(Role role) external view returns (bool hasRole);
6,408,645
./partial_match/4/0xf0bc3a42696917Aece902B8e7145B09cDf76E191/sources/Files.sol
uint256 counter; for (uint256 index = 0; index <= size; index++){ if ( compareStrings(IpfsHash[index], ipfs_hash) ) { FileIndex[counter] = index; counter += 1; } } FileIndex[0] = 0; FileIndex[1] = 1; processOutput(FileIndex);
function findFilesByIpfsHash(string calldata ipfs_hash) view external returns (uint256[] memory FileIndex) { return FileIndex; }
8,572,793
pragma solidity ^0.5.11; pragma experimental ABIEncoderV2; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* ...
Add an app contract that can call into this contract/
function authorizeCallerContract(address app) external requireContractOwner { appContracts[app] = true; }
1,084,294
./partial_match/1/0xaCCaaDc4F8448F5f6C6aAf1c639Ec4B8bD1A8aF4/sources/contracts/extensions/NFT/components/ERC721FU.sol
Counter overflow is incredibly unrealistic.
function _mint(address to, uint256 id) internal virtual { require(to != address(0), 'INVALID_RECIPIENT'); require(_ownerOf[id] == address(0), 'ALREADY_MINTED'); unchecked { _balanceOf[to]++; } _ownerOf[id] = to; emit Transfer(address(0), to, id); }
2,702,245
pragma solidity ^0.4.10; import "./lib/usingOraclize.sol"; //import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, ui...
exposing the total reward amount for DApp
function reward_total() constant returns (uint) { return (coinIndex[BTC].total.add(coinIndex[ETH].total).add(coinIndex[LTC].total)); }
15,807,669
import "@openzeppelin/contracts/ownership/Ownable.sol"; import "./Repayment.sol"; import { RoleManagement } from "./RoleManagement.sol"; pragma solidity ^0.5.0; contract Mortgage is Ownable { //Variables uint ETHER=(10**18); uint public MortgageCount=0; bool public contractPaused = false; addres...
Check if the transaction has been executed transactionId Transaction ID.
function isExecuted(uint transactionId)public view returns (bool){ return mortgages[transactionId].executed; }
6,486,853
pragma solidity ^0.4.21; import "./SafeMath.sol"; import "./ERC20.sol"; import "./EOSrelay.sol"; contract EOStoken is ERC20 { using SafeMath for uint256; EOSrelay public relay; string public EOSLockingAddr; uint public totalSupply; mapping(address => mapping (address => uint)) allow...
others / safeSub already has throw, so no need to throw
function transfer(address _to, uint _value) public returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); return true; }
6,353,654
./full_match/1/0xc7aA778906e8DEAf9C0F7ADa99f73bDB81242044/sources/contracts/eip/interface/IERC20.sol
ERC20 interface/
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); fu...
8,336,232
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; library ProtobufLib { /// @notice Protobuf wire types. enum WireType { Varint, Bits64, LengthDelimited, StartGroup, EndGroup, Bits32, WIRE_TYPE_MAX } /// @dev Maximum number of bytes ...
Encode fixed int64. n Number return Marshaled bytes
function encode_sfixed64(int64 n) internal pure returns (bytes memory) { return encode_bits64(uint64(n)); }
1,795,624
./partial_match/1/0x3a5b63abd7b0fA709efdCE97Ea7Bf91D1060A18B/sources/CashRabbit.sol
See {IERC721Enumerable-totalSupply}./ _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
function onlyTotalSupply() public view virtual returns (uint256) { return _onlytokenOwners.length(); }
9,203,688
./full_match/1/0xfacd2eC4647df2Cb758F684C2aAAB56A93288f9e/sources/contracts/Polygon_SpokePool.sol
Change polygonTokenBridger address. Callable only by admin via processMessageFromRoot. newPolygonTokenBridger New Polygon Token Bridger contract./
function setPolygonTokenBridger(address payable newPolygonTokenBridger) public onlyAdmin nonReentrant { polygonTokenBridger = PolygonTokenBridger(newPolygonTokenBridger); emit SetPolygonTokenBridger(address(newPolygonTokenBridger)); }
4,938,444
pragma solidity ^0.6.0; import "./Owned.sol"; import "./BREE.sol"; import "./ERC20contract.sol"; import "./SafeMath.sol"; contract BREE_STAKE_FARM is Owned{ using SafeMath for uint256; uint256 public yieldCollectionFee = 0.01 ether; uint256 public stakingPeriod = 30 days; uint256 public sta...
------------------------------------------------------------------------ Query to get the total farming of the user farming asset/ token address ------------------------------------------------------------------------
function yourTotalFarmingTillToday(address _tokenAddress, address _user) public view returns(uint256 _totalFarming){ return users[_user][_tokenAddress].totalDeposits; }
987,939
pragma solidity ^0.8.6; pragma experimental ABIEncoderV2; // SPDX-License-Identifier:MIT interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external ...
exclude liquidity wallet
function calculateEthReward(address ofAddress) public view returns (uint256) { uint256 remainingSupply = uint256(_totalSupply) .sub(balanceOf(address(0))) .sub(balanceOf(0x000000000000000000000000000000000000dEaD)) uint256 reward = address(this) ...
1,199,774
./full_match/9001/0xCE3CA8DE98865bCCb18B893B6e3952722a401360/sources/contracts/StarFarm.sol
Get the pledge length of the specified user nft
function getUserStakingNFTAmount(address _user) view external returns (uint256) { return userNFTs[_user].length; }
11,534,658
pragma solidity ^0.4.2; contract Freelancer { event Send(address from, address to, uint value); struct Offer{ address sender; uint price; bytes type; uint reputation; bool availability; uint reputation_threshold; uint freelancerID; // what fr...
FreelancerResponse(jobID, freelancerID, employerTimeInquiry);
function EmployerInquiry(uint jobID, uint freelancerID) { employerTimeInquiry = block.timestamp; }
12,760,768
./full_match/1/0x644E56Fc5027Fce48ae922078beB4708e69d1EC1/sources/contracts/mint/MintSaleBase.sol
Removes tokens and reclaims ownership of the NFT contract after the sale has ended. The sale must have ended before calling this function. proceedRecipient The address that will receive the proceeds from the sale.
function removeTokensAndReclaimOwnership(address proceedRecipient) external onlyOwner { if(block.timestamp < endTime){ endTime = uint32(block.timestamp); emit SaleEndedEarly(); emit SaleEnded(); } claimEarnings(proceedRecipient); nft.renounceMinter...
4,878,564
./partial_match/56/0x67c3a528C13d5b03fc5d4f847fcc8F290Dd276b7/sources/WHALE_Token.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _beforeTokenTransfer(send...
11,213,041
./full_match/4/0x6BE60E29FBb7559A5aF18D1e8F840767dd315359/sources/tellorlegacy/contracts/oldContracts/libraries/OldTellorStake.sol
This function allows miners to deposit their stake./self adjusting disputeFee
function depositStake(OldTellorStorage.TellorStorageStruct storage self) public { OldnewStake(self, msg.sender); OldTellorDispute.updateDisputeFee(self); }
817,726
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract Boomerang is ERC721Enumerable, Ownable { uint256 cons...
If the boomerang is still in this address's posession, it will come right back.
function yoink(address yoinkee, uint256 tokenId) internal returns (bool) { if (ownerOf(tokenId) == yoinkee) { _burn(tokenId); return true; } return false; }
14,001,985
./partial_match/1/0x82e55DFC001B4e84bAB0Af823CD2ff1E95653e88/sources/contracts/Interface/IERC721Transfer.sol
ERC721 interface with transfer function/
interface IERC721Transfer { function safeTransferFrom(address from, address to, uint256 tokenId) external; pragma solidity ^0.8.0; }
4,378,800
./full_match/80001/0xbE3FE72f9396f0e4B9c623681d1229e3B4D36Aae/sources/contracts/prebuilts/account/token-bound-account/TokenBoundAccount.sol
Deposit funds for this account in Entrypoint.
function addDeposit() public payable virtual { } Internal Functions
838,265
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /* * HuckleberryFinance * App: https://huckleberry.finance * GitHub: https://github.com/huckleberryDex */ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openz...
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardTimestamp = block.timestamp > startTime ? block.timestamp : startTime; totalAllocPoint = totalAllocPoint.add(_allocPoint); ...
894,771
./partial_match/42220/0xCdE5039e3AcB3483aEebEBd59Cf6936056c455D4/sources/Users/pahor/repo/4/celo-monorepo/packages/protocol/contracts/governance/Election.sol
Returns get current validator signers using the precompiles. return List of current validator signers./
function getCurrentValidatorSigners() public view returns (address[] memory) { uint256 n = numberValidatorsInCurrentSet(); address[] memory res = new address[](n); for (uint256 i = 0; i < n; i = i.add(1)) { res[i] = validatorSignerAddressFromCurrentSet(i); } return res; }
3,496,842
pragma solidity ^0.4.20; /* ================================================== = = = Website: http://DIVIUMx2.io = = Discord: https://discordapp.com/invite/pqcjXSC = = = ==================================...
Liquifies tokens to ethereum./ setup data russian hackers BTFO & Dump prevention burn the sold tokens update dividends tracker dividing by zero is a bad idea update the amount of dividends per token
function sell(uint256 _amountOfTokens) onlyBagholders() public { address _customerAddress = msg.sender; require(_amountOfTokens <= slowDump && _amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensT...
57,572