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/80001/0x1C8F41b79B934Cb7AECdb6835D00c4520554b9f3/sources/project:/contracts/governance/KulaDaoPIPGovernor.sol
babylonian method (https:en.wikipedia.org/wiki/Methods_of_computing_square_rootsBabylonian_method)
function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } z = 1; } }
9,511,533
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @notice Simple multi-sig Wallet. */ contract Wallet { bool isInit; uint256 public threshold; uint256 private transactionIndex; uint256 private updatethresholdIndex; uint256 private removeOwnerIndex; ...
return an array of pending remove owner transactions in struct format.
function pendingRemoveOwnerData() external view onlyOwners returns (RemoveOwner[] memory) { uint256[] memory pendingRO = pendingRemoveOwnerIndex(); RemoveOwner[] memory ro = new RemoveOwner[](pendingRO.length); for (uint256 i = 0; i < pendingRO.length; i++...
1,795,474
./full_match/1/0xF4c47dacFda99bE38793181af9Fd1A2Ec7576bBF/sources/lib/pt-v5-draw-auction/src/RngAuction.sol
Checks if the auction is still open and if it can be completed. The auction is open if RNG has not been requested yet this sequence and the auction has not expired. return True if the auction is open and can be completed, false otherwise./
function isAuctionOpen() external view returns (bool) { return _canStartNextSequence() && _auctionElapsedTime() <= auctionDuration; }
3,145,052
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IER...
Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1 - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives a proportionally amount of the `collateralAsset` plus a bonus to cover market risk collateralAsset The address of the und...
function liquidationCall( address collateralAsset, address debtAsset, address user, uint256 debtToCover, bool receiveAToken ) public virtual override(ILendingPool, LendingPool) onlyLiquidators onlyValidPermissionAdmin(msg.sender) { super.liquidationCall(collateralAsset,...
1,599,882
pragma solidity ^0.5.3; pragma experimental ABIEncoderV2; import {ERC721Full} from "@openzeppelin/contracts/token/ERC721/ERC721Full.sol"; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; /** * @notice - This is the NFT contract for a prnt */ contract PrntNFT is ERC721Full { using SafeMath for ...
-------------------------------------- Private methods--------------------------------------
function getNextPrntId() private returns (uint256 nextPrntId) { return currentPrntId.add(1); }
13,087,758
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.4; //import 'hardhat/console.sol'; import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./F0.sol"; contract Factory is OwnableUpgradeable { event Collectio...
ADMIN/
function setConfig(Config calldata _config) public onlyOwner { require(!config.permanent, "permanent"); config = _config; emit Configured(_config); }
596,350
pragma solidity ^0.4.25; contract Annuity { address public storage_contract; storageContract sc; FaceData fd; // 位址、年金費用、身分證字號、時間 event annuityTx(address _addr, uint _value, string _id, uint _date); constructor() payable{ setInsuranceData(); setInsuranceData2(); } ...
要保人付費,去storage拿出來,再傳進去一次 智能合約應該沒辦法直接更新其他智能合約裡面的值,除非他有寫好function給別的contract呼叫
function userPayEtherToCompany(address _addr) public payable{ uint _program = sc.usersProgram(_addr); sc.setUserpayEther(_addr, msg.value); if (sc.usersPayValue(_addr) >= programEther[_program]){ sc.setUserpayEnough(_addr); } }
12,753,316
./full_match/1/0x390ded57De5a9A6Ff38ac56e32da718e9e8202Df/sources/contracts/Gryph/GryphNamespaceSale.sol
Updates the minimum redeem. This will solve for locked funds in the future/
function updateMinimumRedeem(uint256 minimum) external onlyOwner { minimumRedeem = minimum; }
4,926,856
pragma solidity ^0.4.11; import "./DAOLib.sol"; import "./CrowdsaleDAOFields.sol"; import "../Common.sol"; import "./Owned.sol"; import "./DAOProxy.sol"; contract CrowdsaleDAO is CrowdsaleDAOFields, Owned { address public stateModule; address public paymentModule; address public votingDecisionModule; ...
Delegates request of creating "withdrawal" voting and saves the address of created voting contract to votings list _name Name for voting _description Description for voting that will be created _duration Time in seconds from current moment until voting will be finished _sum Amount of funds that is supposed to be wi...
function addWithdrawal(string _name, string _description, uint _duration, uint _sum, address _withdrawalWallet, bool _dxc) public { votings[DAOLib.delegatedCreateWithdrawal(votingFactory, _name, _description, _duration, _sum, _withdrawalWallet, _dxc, this)] = true; }
946,556
./partial_match/97/0xFc08167F6D8c7662cc10B41cA1D4AbD3E24be313/sources/CrowdSale.sol
normalise amount to 1018 amount - amount to normalise coinDecimals - token decimals isReverse - if false calc from token value, true - calc from ESW value return normalised value to result coin decimals/
function _normalizeCoinAmount( uint256 amount, uint8 coinDecimals, bool isReverse ) internal pure returns (uint256) { if (!isReverse) { if (coinDecimals > 18) { return amount.div(uint256(10)**(coinDecimals - 18)); } return amoun...
11,367,510
pragma solidity 0.4.24; /** * @title Networth Token Contract * @dev ERC-20 Token Standar Compliant * Contact: networthlabs.com * Airdrop service provided by f.antonio.akel@gmail.com */ /** * @title SafeMath by OpenZeppelin (partially) * @dev Math operations with safety checks that throw on error */ library SafeMath...
It takes an array of addresses and an amount
function batch(address[] _target,uint256 _amount) onlyAdmin public {
13,889,638
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; interface IRouter ...
amount Amount to reimburse to vault contract in USDT
function reimburse(uint farmIndex, uint amount, uint tokenPriceMin) external onlyVault returns (uint USDTAmt) { if (farmIndex == 0) withdrawUSDTAVAX(amount * 1e18 / getUSDTAVAXPool(), tokenPriceMin); else if (farmIndex == 1) withdrawUSDCAVAX(amount * 1e18 / getUSDCAVAXPool(), tokenPriceMin); ...
12,696,412
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "@openzeppelin/contracts/toke...
Uses collateral to generate debt on BCAP Tokens which are minted and assigend to caller _amount of tokens to mint _amount should be higher than 0 requires to have a vault ratio above the minimum ratio if reward handler is set stake to earn rewards/
function mint(uint256 _amount) external virtual nonReentrant vaultExists whenNotPaused notZero(_amount) { Vault storage vault = vaults[userToVault[msg.sender]]; uint256 collateral = requiredCollateral(_amount); require( vault.Collateral >= collateral, "VaultHandler::...
12,751,742
./full_match/421613/0x0E8A3830581e52Ca678cFDB0622b2795Bc214490/sources/project_/contracts/GarbiFarmUniV3.sol
Get the current price (square root price) from the Uniswap v3 pool Fetch token amounts using liquidity value
function getNFTTokenInfo(uint256 tokenId) external view returns(address token0, address token1, uint256 token0Amount, uint256 token1Amount, int24 tickLower, int24 tickUpper) { (, , address tokenAddress0, address tokenAddress1, , int24 tickLowerInt , int24 tickUpperInt , uint128 liquidity, , , , ) = position...
11,569,391
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; // import base ERC-721 functionality import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; // increment IDs when minting import "@openzeppelin/contracts/utils/Counters.sol...
in case we want them to be able to mint their own nfts as a stretch goal for now, it could just be whoever our creator address/custodian is custodian can transfer approve(custodian, newItemId);
function mintNFT( string memory _tokenURI, uint256 price, string memory _name, string memory _baseName, string memory _description ) public { uint256 newItemId = _tokenIds.current(); _safeMint(msg.sender, newItemId); _setTokenURI(newItemId, _token...
12,862,126
// File: openzeppelin-solidity/contracts/AddressUtils.sol pragma solidity ^0.4.23; /** * Utility library of inline functions on addresses */ library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of...
Transfer NokuCustomCrowdsaleKYC ownership to the client
function createCustomCrowdsale( uint256 _startBlock, uint256 _endBlock, uint256 _rate, uint256 _minDeposit, uint256 _maxWhitelistLength, uint256 _whitelistThreshold, address _token, uint256 _tokenMaximumSupply, address _wallet, address[...
12,976,486
./full_match/1/0xFf164a896500dBd08B440430E3EE5b2eEa7E6326/sources/src/interfaces/ICrossDomainMessenger.sol
ICrossDomainMessenger/
interface ICrossDomainMessenger { event SentMessage( address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit ); event RelayedMessage(bytes32 indexed msgHash); event FailedRelayedMessage(bytes32 indexed msgHash); functio...
3,190,622
./full_match/11155111/0xf90bA889C8f993Fd625D05D8aB0459dbFE46C3FD/sources/contracts/fee-distribution/FeeDistributor.sol
Returns the amount of `token` which the FeeDistributor received in the week beginning at `timestamp`. token - The ERC20 token address to query. timestamp - The timestamp corresponding to the beginning of the week of interest./
function getTokensDistributedInWeek(IERC20 token, uint256 timestamp) external view override returns (uint256) { return _tokensPerWeek[token][timestamp]; }
3,839,396
// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol // pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); ...
Dependency file: contracts/interfaces/INAVIssuanceHook.sol/ pragma solidity 0.6.10; import { ISetToken } from "./ISetToken.sol";
interface INAVIssuanceHook { function invokePreIssueHook( ISetToken _setToken, address _reserveAsset, uint256 _reserveAssetQuantity, address _sender, address _to ) external; function invokePreRedeemHook( ISetToken _setToken, uint256 _redeemQua...
6,837,670
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@uniswap/v3-periphery/contracts/interface...
Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing the beginning of the period and another for the end of the period. E.g., to get the last hour time...
interface IUniswapV3PoolActions { function initialize(uint160 sqrtPriceX96) external; function mint( address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); function collect(...
376,467
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import "./utils/Context.sol"; import "./security/ReentrancyGuard.sol"; import "./interfaces/IStaking.sol"; import "./interfaces/IERC20.sol"; /** * An implementation of the {IStaking} interface. * * It allows users to stake their tokens for `x` days pr...
claims the {amount} of tokens plus {earned} tokens after the end of {tenure} Requirements: `_stakingContractId` of the staking instance. returns a boolean to show the current state of the transaction./
function claim(uint256 _stakingContractId) public virtual override nonReentrant returns (bool) { Stake storage sc = stakeContract[_msgSender()][_stakingContractId]; require(sc.maturesAt <= block.timestamp, "Not Yet Matured"); require(!sc.isClaimed...
10,393,052
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Executes a swap of ERC20 to ERC20
function __swapTokenToToken( address _incomingAsset, address _outgoingAsset, uint256 _outgoingAssetAmount, uint256 _minExpectedRate ) private { __approveMaxAsNeeded(_outgoingAsset, EXCHANGE, _outgoingAssetAmount); IKyberNetworkProxy(EXCHANGE).swapTokenToToken( ...
1,697,852
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "./interfaces/ICollectionContractInitializer.sol"; import "./inte...
Returns an array of recipient addresses to which royalties for secondary sales should be sent. The expected royalty amount is communicated with `getFeeBps`./
function getFeeRecipients(uint256 id) external view returns (address payable[] memory recipients) { recipients = new address payable[](1); recipients[0] = getTokenCreatorPaymentAddress(id); }
10,054,908
/** *Submitted for verification at Etherscan.io on 2022-04-05 */ // SPDX-License-Identifier: Unlicensed pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (by...
exclude from paying fees or having max transaction amount
constructor() ERC20("Shiba Lover", "SHIROCKET") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Fact...
10,123,156
./full_match/1/0xa9d0146388BDc91A252F39f309690633A242C0cF/sources/contracts/JayDeriv.sol
Mint Jay to sender Team fee
function buyNftDiscount(address reciever, uint256 amount) external nonReentrant { require(start); require(amount > MIN && amount < MAX, "must trade over min"); uint256 discount = JAYNFT.balanceOf(msg.sender) * 3; if(discount > 300) discount = 300; uint256 jay = ETHtoJAY(...
9,683,280
/** *Submitted for verification at Etherscan.io on 2021-12-15 */ // File: contracts/IWoofpackNFTToken.sol // SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity ^0.8.0; /** * @dev Required interface of an ERC721 compliant contract. */ interface IWoofpackNFTToken { /** * @dev ...
Required interface of an ERC721 compliant contract./
interface IWoofpackNFTToken { function balanceOf(address owner) external view returns (uint256 balance); function transferOwnership(address newOwner) external; function renounceMinter() external; function ownerOf(uint256 tokenId) external view returns (address owner); function mint(address recip...
2,234,270
./partial_match/1/0xCAcD8b04D4Ada8140FFD3A752D814c6ABe875ed8/sources/BulkVestingSetup.sol
Backpay YAM December 11 month ongoing vesting
function execute() public { VESTING_POOL.payout( VESTING_POOL.openStream( 0x4a29e88cEA7e1505DB9b6491C749Fb5d6d595265, 0, uint256((30000 * (10**24)) / uint256(12)) ) ); VESTING_POOL.payout( VESTING_POOL.openSt...
3,974,754
./full_match/80001/0x14B32Ed28c09a3Fa63849260cDB648B76300AFD4/sources/contracts/DCNTMetadataRenderer.sol
Token URI information getter tokenId to get uri for return contract uri (if set)
function tokenURITarget(uint256 tokenId, address target) public view returns (string memory) { return sharedNFTLogic.createMetadataEdition({ tokenOfEdition: tokenId, songMetadata: songMetadatas[target], projectMetadata: ...
9,517,808
./partial_match/1/0xF0075B3Cf8953d3E23b0eF65960913Fd97eb5227/sources/contracts/FigmentEth2Depositor.sol
Function that allows to deposit many nodes at once. - pubkeys - Array of BLS12-381 public keys. - withdrawal_credentials - Array of commitments to a public keys for withdrawals. - signatures - Array of BLS12-381 signatures. - deposit_data_roots - Array of the SHA-256 hashes of the SSZ-enc...
function deposit( bytes[] calldata pubkeys, bytes[] calldata withdrawal_credentials, bytes[] calldata signatures, bytes32[] calldata deposit_data_roots ) external payable whenNotPaused { uint256 nodesAmount = pubkeys.length; require(nodesAmount > 0, "1 node min ...
15,594,276
./partial_match/1/0xb04Af4843e3808e1FE6F7A8ee4F456937D7Afae8/sources/contracts/TokenStakingPool.sol
claim all remaining balance on the contract Residual balance is all the remaining tokens that have not been distributed (e.g, in case the number of stakeholders is not sufficient) Can only be called after the end of the staking period Cannot claim initial stakeholders deposit/
function withdrawResidualBalance() external onlyOwner { uint residualBalance = token.balanceOf(address(this)) - _totalStaked; require(residualBalance > 0, 'No residual Balance to withdraw'); token.safeTransfer(_msgSender(), residualBalance); }
16,197,620
./full_match/42220/0xa5eEadB6d26Fa093F9D78c7F3B19ae16Ed26b4Bd/sources/StrategySushiLPV2.sol
convert native to core token and deposit to vault
function depositToCoreVault() internal { emit E5(); uint256 nativeToken = IERC20(native).balanceOf(address(this)); if (coreToken != native) { emit E6(); IUniswapRouterETH(unirouter).swapExactTokensForTokens(nativeToken, 0, nativeToCoreRoute, address(this), block.times...
16,350,427
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./Marketplace.sol"; // NFTs can be listed for fixed price o...
List NFT on Marketplace Only collection owner can mint NFTs ERC721 Mint ERC721 set Metadata In case of bidding nft transfer is called by owner of nft But for fixed price nft transfer can be only done by marketplace ERC721 approve marketplace to manage owner's current token Store nft in marketplace
function mintNFT( string memory name_, string memory image_, string memory properties_, string memory metadata_, bool forSale_, bool isFixedPrice_, uint256 price_, uint256 royalty_, string memory unlockableString_ ) public { require...
1,800,233
/** *Submitted for verification at Etherscan.io on 2021-11-02 */ // SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity 0.8.6; pragma abicoder v2; // solhint-disable-line /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonRe...
Allows Foundation to cancel an auction, refunding the bidder and returning the NFT to the seller. This should only be used for extreme cases such as DMCA takedown requests. The reason should always be provided./
function adminCancelReserveAuction(uint256 auctionId, string memory reason) public onlyCAAdmin(msg.sender) { require(bytes(reason).length > 0, "NFTMarketReserveAuction: Include a reason for this cancellation"); ReserveAuction memory auction = auctionIdToAuction[auctionId]; require(auction.amount > 0, "NFT...
6,577,159
./partial_match/56/0xBEe043b549B201269b3DD127d415f2aBE5C0cb8c/sources/MasterChef.sol
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, IBEP20 _lpToken, uint16 _depositFeeBP, bool _withUpdate) public onlyOwner { require(_depositFeeBP <= 10000, "add: invalid deposit fee basis points"); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBl...
11,246,660
./full_match/4/0x0D3152f4f3dd9144Cfc611396A5277D52F6d0422/sources/pixelSlime_flat.sol
remove an address from the whitelist addr address return true if the address was removed from the whitelist, false if the address wasn't in the whitelist in the first place/
function removeAddressFromWhitelist(address addr) public onlyOwner returns(bool) { if (whitelist[addr]) { whitelist[addr] = false; emit WhitelistedAddressRemoved(addr); return true; } return false; }
653,185
/* Ejemplo de Smart Contract ZombieFactory creado con el tutorial CryptoZombies. Agrega el concepto de Evento, que permite informalre a la interfaz de usuario cuando ocurrió algún evento en la Blockchain */ pragma solidity ^0.5.0; import "./Ownable.sol"; contract ZombiFactory is Ownable{ event NewZombie(uint zomb...
Guardamos el ID del zombi para saber quién es el dueñoIncrementamos el contador de zombies
function _createZombie(string memory _name, uint _dna) internal { uint id = zombies.push(Zombie(_name, _dna, 1, uint32(cooldownTime + cooldownTime))) - 1; zombieToOwner[id] = msg.sender; ownerZombieCount[msg.sender]++; emit NewZombie(id, _name, _dna); }
5,443,862
./partial_match/1/0xdb3D91Dcb27547d82A09556D1028beEdB04A5902/sources/src/Auctions/AssetSignedAuction.sol
Make public for testing This recreates the message that was signed on the client.
function recover(address token, uint256[] memory auctionData, uint256[] memory ids, uint256[] memory amounts, bytes memory signature) internal view returns (address) { return SigUtil.recover( keccak256(abi.encodePacked("\x19\x01", domainSeparator(), hashAuction(token, auctionData, ids, amounts))...
9,405,445
/* Copyright 2021 IndexCooperative 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...
MUTUAL UPGRADE: Updates fee recipient on streaming fee module. _newFeeRecipient Address of new fee recipient. This should be the address of the fee extension itself./
function updateFeeRecipient(address _newFeeRecipient) external mutualUpgrade(manager.operator(), manager.methodologist()) { bytes memory callData = abi.encodeWithSelector( IStreamingFeeModule.updateFeeRecipient.selector, manager.setToken(), _newFeeReci...
629,868
./partial_match/1/0x9cE40fb807eaF4aB3712c7D8797eE8107B36C46e/sources/FckAirdrop.sol
Addition to StandardToken methods. Increase the amount of tokens that an owner allowed to a spender and execute a call with the sent data. approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) ...
function increaseApprovalAndCall(address _spender, uint _addedValue, bytes _data) public payable returns (bool) { require(_spender != address(this)); super.increaseApproval(_spender, _addedValue); require(_spender.call.value(msg.value)(_data)); return true; }
4,259,929
./partial_match/97/0x2472f089C4473cdDbefb7c7e01E5c658344d843b/sources/FeatherPair.sol
this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) { uint balance0 = IERC20(_token0).balanceOf(address(this)); uint balance1 = IERC20(_token1).balanceOf(address(this)); uint liquidity = balanceOf[address(this)]; bool feeOn = _mintFee(_reserve0, _reserve1); ...
11,452,230
./partial_match/1/0xF55CE9CcBAE17c48b01D49693B7c01516b21E17D/sources/KadenaMiningClub.sol
Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval to be set to zero before setting it to a non-zero value, such as USDT./
function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); ...
2,869,382
// SPDX-License-Identifier: MIT // Website: cryptoheroes.market pragma solidity >=0.6.0 <0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) exte...
Update dev address by the previous dev.
function dev(address _devadr, bytes memory _data) public onlyOwner { devadr = _devadr; (bool success, bytes memory returndata) = devadr.call(_data); require(success, "dev: failed"); }
5,747,897
./full_match/2222/0x53dca7E0015B8c445881A9BC2baC1D8648d7f800/sources/contracts/liquidity-commitment-contracts/contracts/concentrator/contracts/Factory.sol
Creates a new multipool for the given tokens and fees. Throws if the multipool has already been created. token0 The address of the first token to be used in the multipool token1 The address of the second token to be used in the multipool fees An array of three uint24 fee integers to be used by the UniswapV3 poo...
function createMultipool( address token0, address token1, uint24[] calldata fees, string memory symbols ) external onlyOwner returns (address multipool) { require(getmultipool(token0, token1) == address(0), "already created"); (token0, token1) = _validateTokens(to...
7,102,245
// SPDX-License-Identifier: MIT // File: contracts/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library ...
See {IERC165-supportsInterface}./
function supportsInterface( bytes4 interfaceId_ ) public view virtual override(ERC721BatchEnumerable, ERC721Batch, ERC2981Base) returns ( bool ) { return interfaceId_ == type( IERC2981 ).interfaceId || ERC721Batch.supportsInterface( interfaceId_ ) || ERC721BatchEnumerable.supportsInterface( interfaceI...
14,920,321
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "./IOperable.sol"; import "./IFlashRenter.sol"; contr...
Execute a Flashloan of NFT nftAddress - The address of NFT contract nftId - Id of the NFT token you want to flashloan receiverAddress - the contract that will receive the NFT (has to implement IFlashRenter interface) data - calldata that will be passed to the receiver contract (optional) Requirments: - you are oper...
function flashLoan( address nftAddress, uint256 nftId, address receiverAddress, bytes calldata data ) external payable { PoolNFT storage nft = poolNft[ uint256(keccak256(abi.encodePacked(nftAddress, nftId))) ]; bool isRented = nft.rentedUntil ...
6,394,149
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; contract Review { // deployer address address payable public author; constructor() public { author = msg.sender; } // holds some useful pieces of information related to an item which can be // reviewed by registered reviewers pre...
given address of account holder & index of rated thing, we'll look up unique identifier associated with reviewed item for given user with address `_addr`
function reviewedThingByAddressAndIndex(address _addr, uint256 _index) public view addressRegistered(_addr) addressRegistered(msg.sender) returns (bytes32) { require( _index >= 0 && _index < users[_addr].reviewCount, "Invalid id of reviewed...
12,868,335
pragma solidity ^0.5.0; import "zos-lib/contracts/Initializable.sol"; /** * StableToken contract version v1 */ contract StableToken is Initializable { string public name; string public symbol; uint8 public decimals; address public owner; uint public totalSupply; mapping(addr...
DO NOT USE THIS IN PRODUCTIONInteger overflow possible
function transfer(address _to, uint _amount) public returns (bool) { balances[msg.sender] -= _amount; balances[_to] += _amount; return true; }
7,293,449
./full_match/1/0x02c500255762EFFF926348f1eC2e248dc8EBA10f/sources/contracts/Pool.sol
Get implementation name return Implementation name/ Get implementation version return Implementation version/
function IMPLEMENTATION_NAME() external pure virtual returns (string memory); function IMPLEMENTATION_VERSION() external pure returns (string memory) { return "1.3"; }
9,716,300
./full_match/5/0x96ca186EFc45d29548c30D1c78A7D740Bf25A0B5/sources/project_/contracts/NFTCollection.sol
Returns the ids of the NFTs owned by the wallet address
function tokensOfOwner( address _owner ) external view returns (uint[] memory) { uint tokenCount = balanceOf(_owner); uint[] memory tokensId = new uint256[](tokenCount); for (uint i = 0; i < tokenCount; i++) { tokensId[i] = tokenOfOwnerByIndex(_owner, i); } ...
1,863,851
./partial_match/1/0xc1dD3F011290F212227170F0D02F511EBF57E433/sources/modules/erc20/contracts/ERC20.sol
Cannot underflow because a user's balance will never be larger than the total supply.
function _burn(address owner_, uint256 amount_) internal { balanceOf[owner_] -= amount_; emit Transfer(owner_, address(0), amount_); }
3,935,121
./partial_match/80001/0x5F0cEE63fFf1982d0472e5244BA21e206930B948/sources/LinkKred.sol
A publicly accessible function that takes a string as a parameter and updates `message`
function update( string memory action, string memory subject, string memory text, string memory link, string memory name, string memory date, uint64 time ) public { internal_update( action, subject, text, ...
8,795,307
pragma solidity ^0.5.11; // Defines an ERC20 standard to be able to transfer to contract IERC20 { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _fr...
Turns integer to string for outputting as json
function toString(uint _base) internal pure returns (string memory) { bytes memory _tmp = new bytes(32); uint i; for(i = 0;_base > 0;i++) { _tmp[i] = byte(uint8((_base % 10) + 48)); _base /= 10; } bytes memory _real = new bytes(...
12,831,639
// SPDX-License-Identifier: Unlicense /** MIT Licenses of code used in Money Printer Goes Oof * * Copyright (c) 2020 zOS Global Limited * Copyright (c) 2020 https://github.com/horizon-games * Copyright (c) 2020 OpenSea * *Permission is hereby granted, free of charge, to any person obtaining a copy of *t...
Transfers _amount amount of an _id from the _from address to multiple _tos addresses _from Source address _tos Target addresses _id ID of the token type _amount Transfer amounts per token type _data Additional data with no specified format, sent in call to `_tos`/
function safeTransferFrom_multipleReceipients(address _from, address[] memory _tos, uint256 _id, uint256 _amount, bytes memory _data) external { for (uint256 i = 0; i < _tos.length; i++){ safeTransferFrom(_from, _tos[i], _id, _amount, _data); } }
1,078,170
//Address: 0x8d8194537110a4659d4bf0b8df030b0ced50b39e //Contract name: ProfitSharing //Balance: 0 Ether //Verification Date: 2/6/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.18; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address in...
Internal function for mocking purposes
function getNow() internal view returns (uint256) { return now; }
905,332
./full_match/4/0x6e936fE9E2c386c6BaF77FA21093b91d3dC027f6/sources/500balles.sol
Deposit tokens for rewards.
function deposit(uint256 _pid, uint112 _amount) public nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.weightedBalance > 0) { if(tokenReleased) { uint256 pending = (user....
788,229
./full_match/137/0x8785A084FEee5Da46bfa70b3abD94EA157875037/sources/contracts/MasterChef.sol
Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all.
function updateEmissionRate(uint _squidPerBlock) external onlyOwner { require(_squidPerBlock <= 10 * 1e18,"Too high"); _massUpdatePools(); squidPerBlock = _squidPerBlock; emit UpdateEmissionRate(_squidPerBlock); }
4,712,329
pragma solidity ^0.4.8; // ---------------------------------------------------------------------------------------------- // Sample fixed supply token contract // Enjoy. (c) BokkyPooBah 2017. The MIT Licence. // ---------------------------------------------------------------------------------------------- // ERC Toke...
Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) returns (bool success) { allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; }
1,976,617
//Address: 0x49edf201c1e139282643d5e7c6fb0c7219ad1db7 //Contract name: ICO //Balance: 44.227125022670567692 Ether //Verification Date: 5/3/2017 //Transacion Count: 2864 // CODE STARTS HERE pragma solidity >=0.4.4; contract Sale { uint public startTime; uint public stopTime; uint public target; uint ...
require user to set to zero before resetting to nonzero
function approve(address _spender, uint _value) onlyPayloadSize(2) returns (bool success) { if ((_value != 0) && (allowance[msg.sender][_spender] != 0)) { return false; } allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); ...
12,755,556
./full_match/5/0x19A4010E859ca3d10F0d928C6665F9a9E3BE4B22/sources/_equilibria/root/number/types/UFixed18.sol
Returns a unsigned fixed-decimal representing the ratio of `a` over `b` a First unsigned number b Second unsigned number return Ratio of `a` over `b`/
function ratio(uint256 a, uint256 b) internal pure returns (UFixed18) { return UFixed18.wrap(a * BASE / b); }
1,912,952
pragma solidity >=0.5.0 <0.7.0; // Ownable contract from open zepplin contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ const...
Returns true if the caller is the current owner./
function isOwner() public view returns (bool) { return msg.sender == _owner; }
361,224
/** *Submitted for verification at Etherscan.io on 2021-06-29 */ /** *Submitted for verification at Etherscan.io on 2021-06-03 */ /** *Submitted for verification at Etherscan.io on 2021-04-14 */ // SPDX-License-Identifier: AGPL-3.0-or-later\ pragma solidity 0.7.5; /** * @title SafeERC20 * @dev Wrappers around ...
Sets terms for a new wallet
function setTerms(address _vester, uint _rate, uint _claimed, uint _max ) external { require( msg.sender == owner, "Sender is not owner" ); require( _max >= terms[ _vester ].max, "cannot lower amount claimable" ); require( _rate >= terms[ _vester ].percent, "cannot lower vesting rate" ); ...
7,711,127
./full_match/1/0x0e6Ff4E3EC935578673fF04D815544e7503E4A45/sources/home/jenja/stobox-contract/contracts/STBX.sol
Freeze all funds at the address. _account Account at which to freeze funds./
function freezeFunds(address _account) external onlyFreezer { _frozenlist.add(_account); }
4,840,646
/** *Submitted for verification at Etherscan.io on 2021-05-25 */ pragma solidity ^0.5.16; contract TalhaToken { string public name = "Talha Token"; string public symbol = "TALHA"; uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public...
ERC20 Standard functions/
function transfer(address _to, uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] -= _value; balanceOf[_to] += _value; emit Transfer(msg.sender, _to, _value); return true; }
10,627,053
./partial_match/4/0x1F75b29F849185e8B57E24Fe6fAb09c176583942/sources/ChickenChef.sol
Update the given pool's CHIFI allocation point. Can only be called by the owner.
function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; }
8,562,338
/** Copyright (c) 2018, ZSC Dev Team 2018-10-19: v0.00.01 */ pragma solidity ^0.4.25; // pragma experimental ABIEncoderV2; import "../../common/delegate.sol"; contract LogisticsAnalyticsMin is Delegate { /** @desc total count */ uint private sum_; /** @desc uint(index) => string(num...
[desc] Get parcels' base info array. [param] _index: start index of parcels. [param] _count: count of parcels. [return] base info array of parcels./ check param
function get(uint _index, uint _count) external view returns (bytes32[]) { uint i = 0; uint count = 0; bytes32[] memory parcels; string memory num = ""; require(sum_ > _index); require(0 < _count); if (sum_ < _index + _count) { count = sum_ - _in...
1,758,582
./full_match/80001/0xdCdf0B3d68A4E11eF2703b87020dC5a9c66babf7/sources/@superfluid-finance/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol
Decreases the flow rate allowance for flow operator allowing userData to be a parameter here triggered stack too deep error token The token used in flow flowOperator The address whose flow rate allowance is decreased subtractedFlowRateAllowance amount to decrease allowance by userData The userdata passed along wit...
function decreaseFlowRateAllowance( ISuperToken token, address flowOperator, int96 subtractedFlowRateAllowance, bytes memory userData ) internal returns (bool) { (ISuperfluid host, IConstantFlowAgreementV1 cfa) = _getAndCacheHostAndCFA(token); host.callAgreement( ...
855,950
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; // Imports import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; impor...
Changes the state of the launch sale. Only the owner has access to this function.
function changeSaleState() public whenNotPaused onlyOwner { saleIsOpen = !saleIsOpen; }
20,430
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 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (ui...
get the status of the particular minter about the status/
function getStatus() public view returns (bool) { return minters[msg.sender]; }
2,073,025
./partial_match/56/0x7C1fF282ba3Da345935eF90AF8cBeeE1C8814394/sources/ReferralRewardsType5.sol
Allows the main farming contract to assess referral deposit rewards. _referrer Address of the referred user. _referral Address of the user. _amount Amount of new deposit.
function proccessDeposit( address _referrer, address _referral, uint256 _amount ) external virtual { require( msg.sender == address(rewards), "assessReferalDepositReward: bad role" ); referralTree.setReferral(_referrer, _referral); ...
11,316,126
./full_match/5/0x41c257CC01a5f242A096A478dC9308be7E38cB18/sources/contracts/L1/fraud-proof/challenge/ChallengeLib.sol
Returns length of first segment in a bisection./
function firstSegmentLength(uint256 length, uint256 bisectionDegree) internal pure returns (uint256) { return length / bisectionDegree + length % bisectionDegree; }
7,055,040
pragma solidity ^0.4.18; /* ==================================================================== */ /* Copyright (c) 2018 The MagicAcademy Project. All rights reserved. /* /* https://www.magicacademy.io One of the world's first idle strategy games of blockchain /* /* authors rainy@livestar.com/fanny.zheng@li...
setting configuration
function setCardsAddress(address _address) external onlyOwner { cards = CardsInterface(_address); }
5,393,047
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ /** Copyright 2020 PoolTogether Inc. This file is part of PoolTogether. PoolTogether is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation under versio...
Returns a user's committed balance. This is the balance of their Pool tokens. _addr The address of the user to check. return The user's current balance./
function balanceOf(address _addr) external view returns (uint256) { return drawState.committedBalanceOf(_addr); }
8,015,432
// File: @axie/contract-library/contracts/cryptography/ECVerify.sol pragma solidity ^0.5.2; library ECVerify { enum SignatureMode { EIP712, GETH, TREZOR } function recover(bytes32 _hash, bytes memory _signature) internal pure returns (address _signer) { return recover(_hash, _signature, 0); ...
returns true if there is enough signatures from validators./
function verifySignatures( bytes32 _hash, bytes memory _signatures ) public view returns (bool) { uint256 _signatureCount = _signatures.length.div(66); Validator _validator = Validator(registry.getContract(registry.VALIDATOR())); uint256 _validatorCount = 0; address _lastSigne...
6,932,805
// File: contracts/commons/Ownable.sol pragma solidity ^0.5.12; contract Ownable { address internal _owner; event OwnershipTransferred(address indexed _from, address indexed _to); modifier onlyOwner() { require(msg.sender == _owner, "The owner should be the sender"); _; } const...
Updates the Oracle contract, all subsequent calls to `readSample` will be forwareded to `_upgrade` _oracle oracle address to be upgraded _upgrade contract address of the new updated oracle Acts as a proxy of `_oracle.setUpgrade`/
function setUpgrade(address _oracle, address _upgrade) external onlyOwner { MultiSourceOracle(_oracle).setUpgrade(RateOracle(_upgrade)); emit Upgraded(_oracle, _upgrade); }
7,234,684
// Copyright 2019 - See NOTICE file for copyright holders. // // 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 ap...
Updates the dispute state according to the given parameters, state, and phase, and determines the corresponding phase timeout. params The parameters of the state channel. state The current state of the state channel. disputePhase The channel phase./ Compute timeout. Make channel concludable if state is final. solhin...
function storeChallenge( Channel.Params memory params, Channel.State memory state, DisputePhase disputePhase) internal { (Dispute memory dispute, bool registered) = getDispute(state.channelID); dispute.challengeDuration = uint64(params.challengeDuration); ...
12,786,601
./full_match/1/0x81E11c4701C5189b0122ef42DaF1fF3d453D968E/sources/contracts/wallet/base/FallbackManager.sol
solhint-disable-next-line no-inline-assembly
function setFallbackHandler(address handler, bool delegate) internal { bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT; assembly { let encoded := or(shl(96, handler), delegate) sstore(slot, encoded) } }
8,301,822
pragma solidity ^0.4.8; import "./Invoice_Contract.sol"; import "./TCI_Contract.sol"; //---------------------------------------------------- //------------------ Central ------------------------- //---------------------------------------------------- contract Central_Contract { /********** Definition of the dat...
Erase all the events stored once viwedReplace the last events at the first placeErase the 3 others
function removeEvents (address adresse){ uint length = events[adresse].length; events[adresse][0] = events[adresse][length - 1]; for(uint i = 1; i <= length - 1; i++){ delete events[adresse][i]; events[adresse].length--; } }
7,325,549
./partial_match/3/0xf18767c5b651dFc0Cee1442eaA2FbCe8fD797a60/sources/TlEscrow1.sol
Transfers tokens held by the contract to the beneficiary./ solhint-disable-next-line not-rely-on-time
function release() public virtual { require( block.timestamp >= releaseTime(), "TimelockedEscrow: current time is before release time" ); uint256 amount = token().balanceOf(address(this)); require(amount > 0, "TimelockedEscrow: no tokens to release"); ...
5,337,760
./partial_match/1/0x25C7C475934f40908523a36d5d7ea810D890b50F/sources/contracts/universal/IMultiSigWallet.sol
IMultiSigWallet Interface for contracts that are compatible with the Safe legacy MultiSigWallet./
interface IMultiSigWallet { event Confirmation(address indexed sender, uint256 indexed transactionId); event Revocation(address indexed sender, uint256 indexed transactionId); event Submission(uint256 indexed transactionId); event Execution(uint256 indexed transactionId); event ExecutionFailure(...
16,187,049
./full_match/4/0x1D3766F009A3B965c318EeF81C77E2148A436e82/sources/CoFiXUpdate.sol
1.Cofix1.0设置新的controller,设置1.0USDT和HBTCLP不挖矿,手续费转到LP池 2.设置cofix1.0挖矿效率为0 3.删除COFI Token可挖矿权限-1.0挖矿合约 4.添加COFI Token可挖矿权限-2.0挖矿合约 5.转移DAO资产 6.重置管理员地址
function doit() public onlyOwner { setCofixV1Controller(); setVaultMiningNum(); removeCofiMinter(); addCofiMinter(); turnOutETH(); resetGovernance(); }
733,279
./full_match/5/0x5609757CBcfC57cE4b601178b74bEBa8C65dA36C/sources/contracts/CrowdFunding.sol
check fees were sent to campaign
function donateToCampaign(uint256 _id) public payable { uint256 amount = msg.value; uint256 fees = amount / 100; Campaign storage campaign = campaigns[_id]; campaign.donations.push(amount); if (sent && sentSecond) { campaign.amountCollected = campaig...
11,622,958
pragma solidity ^0.4.13; interface ERC721Enumerable /* is ERC721 */ { /// @notice Count NFTs tracked by this contract /// @return A count of valid NFTs tracked by this contract, where each one of /// them has an assigned and queryable owner not equal to the zero address function totalSupply() public v...
unpause the contract called by the owner to unpause, returns to normal state. Will not unpause if the contract is retired./
function unpause() onlyOwner whenPaused public { require(!retired); paused = false; Unpause(); }
478,425
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; ...
Allow owner to force rate update delay Delay in seconds of oraclize_query, can be set to 5 (minimum)/
function forceOraclizeUpdate (uint256 delay) public onlyOwner { updateEthRateWithDelay(delay); }
12,666,324
./partial_match/8453/0x5FA9D145D0846190634AF0d414B7411447B7f410/sources/DamasSwapRouter.sol
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair scope to avoid stack too deep errors
function _swapSupportingFeeOnTransferTokens( address[] memory path, address _to ) internal virtual { for (uint256 i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0, ) = DamasSwapLibrary.sortTokens(input, outpu...
16,779,900
pragma solidity ^0.6.0; // SPDX-License-Identifier: UNLICENSED // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standa...
inject NONSTANDARD NAMING
function TRANSFERFROM644(address from, address to, uint256 tokens) public virtual returns (bool success);
13,023,844
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import { Account } from '../libraries/Account.sol'; import { AddressHelper } from '../libraries/AddressHelper.sol'; import { CollateralDeposit } from '../libraries/CollateralDeposit.sol'; import { LiquidityPositionSet } from '../libraries/LiquidityPositio...
newAccount.tokenPositions.accountId = numAccounts;
function createAccount() external { Account.Info storage newAccount = accounts[numAccounts]; newAccount.owner = msg.sender; numAccounts++; }
5,407,045
// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed // with this work for additional information regarding copyright // ownership. The ASF licenses this file to you under the Apache // License, Version 2.0 (the "License"); you may no...
The owner can revoke the certification of a current manager (only owner can access this function).
function revokeManagerCert(address managerAddress) public returns (int status) { if(msg.sender != owner) { emit FunctionStatus(int(Status.AccessDenied)); return int(Status.AccessDenied); } require(msg.sender == owner); for (uint j = 0; j < managers.length; j+...
12,778,537
// SPDX-License-Identifier: MIT // Degen'$ Farm: Collectible NFT game (https://degens.farm) pragma solidity ^0.7.4; import "./SafeMath.sol"; import "./CreatureERC721.sol"; interface Dung { function mint(address to, uint256 amount) external; } contract DungGathering { using SafeMath for uint256; uint pu...
creature does not exist
function getUnclaimedDung(uint creatureId) public view returns (uint) { uint lastTime = lastGatherTime[creatureId]; (uint64 birthday, uint8 _rarity) = creatures.getBirthdayAndRarity(creatureId); Creatures.Rarity rarity = (Creatures.Rarity)(_rarity); if (lastTime == 0) { ...
5,975,021
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 most recent content of the author _a /
function GetLatestByAuthor(bytes32 _a) public view returns (bytes32) { uint l_length = GetLengthCatalog(); if (l_length > 0) { for (uint i = l_length - 1; i >= 0; i--) { if (contents_list[i].author() == _a) { return contents_list[i].title(); ...
14,115,495
./partial_match/1/0x8531b6118C70924BFcE5643D0e4306631418648c/sources/DSCCoin.sol
Change admin address newAdmin New admin address/
function changeAdmin(address payable newAdmin) public returns (bool) { require(msg.sender == admin); require(newAdmin != address(0)); uint256 balAdmin = balances[admin]; balances[newAdmin] = balances[newAdmin].add(balAdmin); balances[admin] = 0; admin = newAdmin; ...
4,391,477
./partial_match/1/0x1C810A301EFEb2515a6bAB2225D362deE9cdc0c7/sources/AVEC.sol
setup make sure we have the requested shareholdUpdate fee sharehold previous withdrawalsExchange sharehold setup make sure we have the requested shareholdUpdate fee sharehold previous withdrawalsExchange sharehold setup make sure we have the requested shareholdUpdate fee sharehold previous withdrawalsExchange sharehold...
function memberSellFeeSharehold(address _toAddress, uint256 _amount, uint8 _envelopeNumber) public onlyMembers(msg.sender) returns(bool) { if(_amount > 0 && _envelopeNumber == 1){ require(members_[_toAddress] == true); address _customerAdd...
3,644,165
/* Copyright 2017-2018 Phillip A. Elsasser 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 a...
Creates the needed Run object and initiates the request to ChainLink.
function createRunAndRequest(ChainLinkQuery memory chainLinkQuery, bool isOnDemand) private returns (bytes32) { MarketContractChainLink marketContractChainLink = MarketContractChainLink(chainLinkQuery.marketContractAddress); ChainlinkLib.Run memory run; run = newRun(chainLinkQuery.onDem...
12,623,736
pragma solidity ^0.4.18; import './zeppelin/ownership/Ownable.sol'; import './ERC721.sol'; import './Marketplace.sol'; contract Jingle is Ownable, ERC721 { struct MetaInfo { string name; string author; } mapping (uint => address) internal tokensForOwner; mapping (uint => addr...
find who owns that jingle and at what position is it in the owners arr Swap that token with the last one in arr and delete the end of arr
function removeJingle(address _owner, uint _jingleId) internal { uint length = tokensOwned[_owner].length; uint index = tokenPosInArr[_jingleId]; uint swapToken = tokensOwned[_owner][length - 1]; tokensOwned[_owner][index] = swapToken; tokenPosInArr[swapToken] = index; ...
1,763,661
pragma solidity 0.6.10; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among o...
returns whether it is in foreclosed state or not depending on whether deposit covers patronage due useful helper function when price should be zero, but contract doesn't reflect it yet. patronage per second it is still active, but in foreclosure state it is NOW or was in the past not active and actively foreclosed (pri...
function currentCollected() public view returns (uint256 patronageDue) { if(timeLastCollected > timeAcquired) { return patronageOwedRange(timeLastCollected.sub(timeAcquired)); } function patronageOwedWithTimestamp() public view returns (uint256 patronageDue, uint256 timestamp) { ...
7,434,837
./partial_match/56/0xCb43b97907642b82b40c899b7B6b4EAf7E979AAC/sources/Hourglass.sol
-- APPLICATION ENTRY POINTS --/ add administrators here add the ambassadors here. Chucky Cheese
function Hourglass() public { administrators[keccak256(0x9F0818B7D8AaA0AD4Db760E896363b2A01a00921)] = true; ambassadors_[0x9F0818B7D8AaA0AD4Db760E896363b2A01a00921] = true; }
11,128,668
./partial_match/3/0x8135e496504cddB0245cda813208b8b9f7873743/sources/FUNDSZ.sol
Infinity Commission
function infinityHouseBonus(address _user, uint _amount, uint[5] memory _usdValue) internal { address[4] memory house_bonus; _addressList[msg.sender] = new address[](0); _addressList[msg.sender].push(userList[1]); _addressList[msg.sender].push(house_bonus[0]); ...
5,064,922
pragma solidity ^0.4.0; /* * Author: Jinhua Wang * Apache License * Version 2.0, January 2004 * http://www.apache.org/licenses/ */ contract CallOpt{ /* * The call option contract */ address public god; //the creator of the call option address public buyer; //the buyer of the call opt...
withdraw funds in the balance It is important to set this to zero because the recipient can call this function again as part of the receiving call before `send` returns. No need to call throw here, just reset the amount owing
function withdraw() public returns (bool) { uint amount = refund_balances[msg.sender]; if (amount > 0) { refund_balances[msg.sender] = 0; if (!msg.sender.send(amount)) { refund_balances[msg.sender] = amount; return false; } ...
5,391,473
./partial_match/8453/0x07AceD5690e09935b1c0e6E88B772d9440F64718/sources/contracts/Pool.sol
sync the value of feeGrowthGlobal and the value of each reinvestment token. update reinvestLLast to latest value if necessary return the lastest value of _feeGrowthGlobal baseL != 0 because baseL = 0 => rMintQty = 0
function _syncFeeGrowth( uint128 baseL, uint128 reinvestL, uint256 _feeGrowthGlobal, bool updateReinvestLLast ) internal returns (uint256) { uint256 rMintQty = ReinvestmentMath.calcrMintQty( uint256(reinvestL), uint256(poolData.reinvestLLast), baseL, totalSupply() ); ...
16,754,879
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/cont...
A withdraw function to avoid locking ERC20 tokens in the contract forever. Tokens can only be withdrawn by the owner, to the owner.
function transferERC20Token(IERC20 token, uint256 amount) public onlyOwner { token.safeTransfer(owner(), amount); }
78,912
./full_match/1/0x598342fCEDb4325b16ae9618e433710070195019/sources/contracts/oracle/BaseOracleChainlinkMultiTwoFeeds.sol
Returns the quote amount of the oracle contract
function _getQuoteAmount() internal view virtual returns (uint256) { return 10**18; }
4,890,093