file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.13; // Imports import "./Ownable.sol"; import "./ReentrancyGuard.sol"; import "./IERC20.sol"; import "./IERC721.sol"; // MOD Interface interface MODToken { function mint(address recipient, uint256 amount) external; } /// @title MOD - Staking Contract contra...
staker The address of a user Returns all token IDs staked by a user/
function getStakedTokens(address staker) public view returns (uint256[] memory) { return stakers[staker].tokenIds; }
1,421,416
/* Copyright 2019 dYdX Trading 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 ...
Liquidate liquidAccount using solidAccount. This contract and the msg.sender to this contract must both be operators for the solidAccount. solidAccount The account that will do the liquidating liquidAccount The account that will be liquidated owedMarket The owed ma...
function liquidate( Account.Info memory solidAccount, Account.Info memory liquidAccount, uint256 owedMarket, uint256 heldMarket, address[] memory tokenPath, uint expiry, uint minOwedOutputAmount, bool revertOnFailToSellCollateral ) public n...
2,570,381
./full_match/5/0x7983443EdAf27a55b2652726449dDb8F4Bf3DE1a/sources/contracts/MONSTER.sol
Use the rest of the inherited claim function logic
function _transferTokensOnClaim( address _receiver, uint256 _tokenId, uint256 _quantity ) internal override { soul.burn( _receiver, 0, _quantity ); ticket.burn( _receiver, 0, ...
1,858,354
./full_match/1/0x4B8092CdF0FF8473f7CAB01b267208Eb565943AD/sources/contracts/libraries/Percent.sol
Return true if the _percent with _decimals many decimals is valid and false otherwise
function isValidPercent(uint256 _percent, uint256 _decimals) internal pure returns (bool) { return _isValidPercent(_percent, _decimals); }
4,846,130
pragma solidity ^0.8.0; //SPDX-License-Identifier: GPL-3.0 import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; // prevent re-entrancy attacks import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract nftMarket is ReentrancyGuard { using Co...
total number of items unsold on our platform total number of items that are unsold = total number of items created - total number of items ever sold Instanciate or Craete an array of MarketItem loop through all items ever created check if the item has not been sold by checking if the owner field is empty yes, this it...
function fetchMarketItems() public view returns (MarketItem[] memory){ uint unsoldItemCount = _itemIds.current() - _itemSold.current(); uint currentIndex = 0; MarketItem[] memory items = new MarketItem[](unsoldItemCount); for(uint i =0; i < itemCount; i++) { ...
15,862,034
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.4.21 <0.8.0; pragma experimental ABIEncoderV2; import "./GorenCoinToken.sol"; contract Election { // Structs struct Candidate { string fullName; uint256 voteCount; } struct Voter { bool authorized; bool voted; ...
End Vote - Triggered by time
function endVote() public ownerOnly returns (string memory) { voteLive = false; uint256 _winner = 999; uint256 _maxVotes = 0; for (uint256 i = 0; i < countCandidates; i++) { if (candidates[i].voteCount >= _maxVotes) { _maxVotes = candidates[i].voteCount; ...
908,855
./full_match/84531/0x5a39b86bEc8003214d9dF2AFe63b3f7D34e6b312/sources/contracts/CoincheckerMultipleAddresses.sol
update balancestransfer tokens into contract
function createMultipleLocks( address _tokenAddress, address _withdrawalAddress, uint256[] memory _amounts, uint256[] memory _unlockTimes ) public payable returns (uint256) { require(_amounts.length > 0, "CoincheckerLock: Amounts length must be...
14,316,113
pragma solidity ^0.5.10; contract Oracle { /** Contract Constructor * @param ethPrice the starting price of ETH in USD, represented as 150000000 = 150.00 USD * @dev The message sender is assigned as the contract administrator */ constructor (uint ethPrice) public { admins[msg.sender] = tr...
Add a new asset tracked by the Oracle _name the plaintext name of the asset _startPrice the starting price of the asset in USD 10^6, eg 120000 = $0.120000 this should usually be called on a Settlement Day return id the newly assigned ID of the asset/ Fill the asset struct
function addAsset(bytes32 _name, uint _startPrice) public returns (uint _assetID) { require (admins[msg.sender] || msg.sender == address(this)); Asset memory asset; asset.name = _name; asset.currentDay = 0; asset.lastUpdateTime = now; asset.lastSet...
7,243,037
// "SPDX-License-Identifier: Apache-2.0" pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "../BaseRegistryStorage.sol"; import "../AccessControl/AccessControl.sol"; import "./IOwnershipRegistry.sol"; /** * @title OwnershipRegistry */ contract OwnershipRegistry is BaseRegistryStorage, AccessControl,...
Retrieves the registered addresses of owners (creator, counterparty) of an asset. assetId id of the asset return addresses of all owners of the asset/
function getOwnership(bytes32 assetId) external view override returns (AssetOwnership memory) { return assets[assetId].ownership; }
6,424,744
./full_match/4/0x66ca57dc387DEeE28a7Da103d23b0590C3307541/sources/contracts/zhen2.sol
Unpauses all token transfers. See {ERC721Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`./
function unpause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "__ZhenArt_init: must have pauser role to unpause"); _unpause(); }
12,409,447
// SPDX-License-Identifier: MIT pragma solidity >=0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { require((c = a + b) >= b, "SafeMath: Add Overflow"); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require((c = a ...
given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'SoulSwapLibrary: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'SoulSwapLibrary: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } ...
12,963,398
./partial_match/137/0x6d15Cd2eD2f8BfFEA3827AA8911aEEfA346ACf97/sources/MintplexOpenEditionPlusStandalone.sol
Update the maximum amount of tokens that can be minted by a unique wallet _newWalletMax the new max of tokens a wallet can mint. Must be >= 1/
function setWalletMax(uint256 _newWalletMax) public onlyTeamOrOwner { if(_newWalletMax == 0) revert ValueCannotBeZero(); MAX_WALLET_MINTS = _newWalletMax; }
3,520,748
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, whi...
Updates the admin role for the address. _account Address to update admin role. _allowed Whether the address is granted the admin role./
function setAdmin(address _account, bool _allowed) external { require(msg.sender == governance, "not governance"); require(_account != address(0x0), "account not set"); admins[_account] = _allowed; }
312,628
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0 || b == 0) ...
Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend)./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "Sub overflow!"); return a - b; }
13,031,495
./partial_match/1/0xee319C50a873493d220e11946655270244D8e164/sources/src/ERC20StakingPool.sol
The amount of reward tokens an account has accrued so far. Does not include already withdrawn rewards.
function earned(address account) external view returns (uint256) { return _earned( account, balanceOf[account], _rewardPerToken( totalSupply, lastTimeRewardApplicable(), rewardRate ...
4,265,605
./full_match/5/0x76f01394144a45741efccdA993837368D8031456/sources/contracts/Xen/xenClaimMod.sol
accepts User cRank claim provided all checks pass (incl. no current claim exists)/ Verify the merkle proof. Mark it claimed. create and store new MintInfo
function claim(uint256 index, address account, uint256 _amount, bytes32[] calldata merkleProof) external { require(!isClaimed(index), "MerkleDistributor: Drop already claimed."); bytes32 node = keccak256(abi.encodePacked(index, account, _amount)); require(MerkleProof.verify(merkleProof, mer...
11,607,487
./partial_match/1/0xAF5078bCEE5B9DE9Bb9394207Ca48ac32648C45f/sources/Workspace.sol
"Send" a "file" to this contract. File should be encrypted on this contract asymetricEncryptionPublicKey, before upload on decentralized file storage, before submitting a TX here./
function identityboxSendfile( uint _fileType, uint _fileEngine, bytes _fileHash ) external { require(!identityboxBlacklisted[msg.sender], "You are blacklisted"); emit FileReceived(msg.sender, _fileType, _fileEngine, _fileHash); }
3,939,190
pragma solidity ^0.5.7; library SafeMath { int256 constant private in...
inject NONSTANDARD NAMING
function ALLOWANCE123(address owner, address spender) external view returns (uint256);
12,598,026
./full_match/8453/0x2dE89c7A9902291ac9c4f81a8121BE491E258aa9/sources/contracts/distribution/BASEGenesisRewardPool.sol
Update the given pool's TOMB allocation point. Can only be called by the owner.
function set(uint256 _pid, uint256 _allocPoint, uint256 depositFee) public onlyOperator { require(depositFee < 500, "max deposit fee"); massUpdatePools(); PoolInfo storage pool = poolInfo[_pid]; if (pool.isStarted) { totalAllocPoint = totalAllocPoint.sub(pool.allocPoint)....
11,537,646
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.3.2 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, is...
Calculate the royalty payment _salePrice the sale price of the token
function royaltyInfo(uint256, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { return (address(this), (_salePrice * royalty) / BASE); }
13,934,875
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Sets `account`'s Internal Balance for `token` to `newBalance`. Emits an `InternalBalanceChanged` event. This event includes `delta`, which is the amount the balance increased (if positive) or decreased (if negative). To avoid reading the current balance in order to compute the delta, this function relies on the caller ...
function _setInternalBalance( address account, IERC20 token, uint256 newBalance, int256 delta ) private { _internalTokenBalance[account][token] = newBalance; emit InternalBalanceChanged(account, token, delta); }
642,233
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint25...
Explicitly set `owners` to eliminate loops in future calls of ownerOf()./
function _setOwnersExplicit(uint256 quantity) internal { uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet; require(quantity > 0, "quantity must be nonzero"); uint256 endIndex = oldNextOwnerToSet + quantity - 1; if (endIndex > currentIndex - 1) { endIndex = currentInde...
150,289
./partial_match/3/0x735110791D1DD21032c310F0DbFE167d54F84A64/sources/FarmUniswap.sol
withdraw LP token function for msgSender _amount the total withdrawable amount/
function withdraw(uint256 _amount) public { address msgSender = _msgSender(); UserInfo storage user = userInfo[msgSender]; require(user.amount >= _amount, "INSUFFICIENT"); updatePool(); if (user.amount == _amount && _amount > 0) { factory.userLeftFarm(msgSender); farmInfo.numFarmers = ...
5,136,452
./partial_match/3/0x25E2e5D8EcC4fE46a9505079Ed29266779dC7D6f/sources/HoprChannels.sol
Fund a channel between 'accountA' and 'accountB', specified tokens must be approved beforehand. Called when HOPR tokens are send to this contract. fund a channel additionalDeposit uint256 amount to fund the channel funder address account which the funds are for recipient address account of first participant of the ...
function fundChannel( uint256 additionalDeposit, address funder, address recipient, address counterparty ) internal { require(recipient != counterparty, "HoprChannels: 'recipient' and 'counterParty' must not be the same"); require(recipient != address(0), "HoprCha...
5,147,871
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "../libs/SafeMath.sol"; import "../libs/SignedSafeMath.sol"; import {Classifier64} from "./Classifier.sol"; contract Perceptron is Classifier64 { using SafeMath for uint256; using SignedSafeMath for int256; mapping(uint64 => int80) public...
Update model. predict checks each data[i] >= 0. Data is binarized. sign = 1 sign = -1
function update(int64[] memory data, uint64 classification) public onlyOwner { uint64 prediction = predict(data); if (prediction != classification) { uint i; uint len = data.length; int80 change = toFloat * learningRate; if (classification > 0) { ...
5,395,265
./partial_match/1/0xd81b3000D6Cad7af85E9939AfAb1243B56618EA9/sources/VFIN.sol
Token migration / Migrate contract. ===> CAUTION: DEFINITIVE ACTION This function shall be called once a new version of the smart contract has been created. Once this function is called: - The address of the new smart contract is set in ERC1820 registry - If the choice is definitive, the current smart contract is tu...
function _migrate(address newContractAddress, bool definitive) internal { ERC1820Client.setInterfaceImplementation(ERC20_INTERFACE_NAME, newContractAddress); ERC1820Client.setInterfaceImplementation(ERC1400_INTERFACE_NAME, newContractAddress); if(definitive) { _migrated = true; ...
4,032,173
./partial_match/1/0x85cdDcE5C1889D84e10d97074b7Af007f2CaDCC5/sources/BankrollNetworkStackPlus.sol
Retrieve the dividends owned by the caller./
function myDividends() public view returns (uint256) { address _customerAddress = msg.sender; return dividendsOf(_customerAddress); }
11,023,174
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; library Math { /// Cannot Declare State var (it's not a contract, just helper function) function max(uint256 x, uint256 y) internal pure returns (uint256) { return x >= y ? x : y; } function min(uint256 x, uint256 y) internal pure returns (uint256) {...
Cannot Declare State var (it's not a contract, just helper function)
function max(uint256 x, uint256 y) internal pure returns (uint256) { return x >= y ? x : y; }
12,911,788
/** * MPSBoardSig.sol * Governance smart contract including multi-signature capabilities. * It uniquely represents the Board of Directors of Mt Pelerin Group SA on-chain * until it is superseded by a resolution of the board referring to a new * governance on-chain reference. * The unflattened code is avai...
Time of the last received transaction/
function lastReceivedAt(address _address) public view returns (uint256) { return audits[_address].lastReceivedAt; }
1,773,392
// File: @openzeppelin/contracts/math/Math.sol pragma solidity ^0.5.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b...
Withdraws all assets from the vault. We ask the yCRV vault to give us our entire yCRV balance and then convert it to the underlying asset using the Curve protocol./ withdraw everything until there is only dust left
function withdrawAllToVault() external restricted { uint256 shares = IERC20(ycrvVault).balanceOf(address(this)); IVault(ycrvVault).withdraw(shares); yCurveToUnderlying(uint256(~0)); uint256 actualBalance = IERC20(underlying).balanceOf(address(this)); if (actualBalance > 0) { IERC20(underlyin...
6,814,839
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ // SPDX-License-Identifier: MIT pragma solidity =0.6.12; // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.d...
Earn APE tokens to MasterChef.
function claimAPE() public { PoolInfo storage pool = poolInfo; UserInfo storage user = userInfo[msg.sender]; updatePool(); uint256 APEReward = user.amount.mul(pool.accAPEPerShare).div(1e12).sub(user.rewardAPEDebt); pool.lpToken.safeTransfer(msg.sender, APEReward); ...
2,416,984
./full_match/5/0xE4B77C4738eA64922a03c7287cBA6D400f5BA349/sources/contracts/GoingUpProjects.sol
Withdraw native tokens (matic)
function withdrawFunds() public onlyAdmin { payable(msg.sender).transfer(address(this).balance); }
1,867,400
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./IPNS.sol"; contract PNS is IPNS, ERC721Enumerable { // ownable address private _root; modifier onlyRoot(...
todo : put `to` last
function mint(address to, uint256 newTokenId) public virtual override onlyRoot { _mint(to, newTokenId); }
13,101,538
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "hardhat/console.sol"; import "@openzeppelin/contracts/governance/TimelockController.sol"; import "@openzeppelin/contracts/utils/Multicall.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; ...
mapping arrays to maps cause of the lack of support of params mapping in Solidity
function _mappingSettings(DataTypes.InvestmentSettings memory settings) private { if (settings.investInERC20.length > 0) { for (uint256 i = 0; i < settings.investInERC20.length; i++) { address _token = settings.investInERC20[i]; _investThresholdInERC20[_token] = settings.investThreshol...
2,520,466
pragma solidity 0.6.7; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../../shared/libs/LibChannelCrypto.sol"; import "./LibDispute.sol"; /// @title LibStateChannelApp /// @author Liam Horne - <liam@l4v.io> /// @notice Contains the structures and enums needed when disput...
Checks whether the given timeout has passed timeout a timeout as block number
function hasPassed( uint256 timeout ) public view returns (bool) { return timeout <= block.number; }
12,943,723
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when d...
Withdraw all El from this contract to admin/
function withdrawElToAdmin() public onlyAdmin { _el.transfer(msg.sender, _el.balanceOf(address(this))); }
14,490,687
./partial_match/42220/0x00e533B7d6255D05b7f15034B1c989c21F51b91C/sources/project:/contracts/utils/BuyGDClone.sol
Calculates the minimum amount of tokens that can be received for a given amount of base tokens, based on the time-weighted average price (TWAP) of the token pair over a specified period of time. baseAmount The amount of base tokens to swap. baseToken The address of the base token. return minTwap The minimum amount of...
function minAmountByTWAP( uint256 baseAmount, address baseToken, uint32 period ) public view returns (uint256 minTwap, uint256 quote) { uint128 toConvert = uint128(baseAmount); if (baseToken == celo) { (quote, ) = oracle.quoteAllAvailablePoolsWithTimePeriod( toConvert, baseToken, cusd, pe...
3,494,629
./full_match/100/0xB4d0774C38bD9A4539CA7810ddEd8C3599a766Fe/sources/contracts/rari-fuse/src/FuseFeeDistributor.sol
Sets the proportion of Fuse pool interest taken as a protocol fee. _minBorrowEth Minimum borrow balance (in ETH) per user per Fuse pool asset (only checked on new borrows, not redemptions). _maxSupplyEth Maximum supply balance (in ETH) per user per Fuse pool asset. _maxUtilizationRate Maximum utilization rate (scale...
function _setPoolLimits( uint256 _minBorrowEth, uint256 _maxSupplyEth, uint256 _maxUtilizationRate ) external onlyOwner { minBorrowEth = _minBorrowEth; maxSupplyEth = _maxSupplyEth; maxUtilizationRate = _maxUtilizationRate; }
14,288,703
pragma solidity ^0.4.25; import './AppDD.sol'; /** * @title External interface for AppDAO */ interface CommonI { function transferOwnership(address _newOwner) external; function acceptOwnership() external; function updateAgent(address _agent, bool _state) external; } /** * @title Decentralized Aut...
Change voting rules Make so that Proposals need to be discussed for at least `_debatingPeriodDuration/60` hours, have at least `_minimumQuorum` votes, and have 50% + `_requisiteMajority` votes to be executed _minimumQuorum how many members must vote on a proposal for it to be executed _debatingPeriodDuration the mini...
function changeVotingRules( uint _minimumQuorum, uint _debatingPeriodDuration, uint _requisiteMajority ) onlyOwner public { minimumQuorum = _minimumQuorum; debatingPeriodDuration = _debatingPeriodDuration; requisiteMajority = _requisiteMajority; emit Chan...
2,555,635
./partial_match/80001/0x69fcF6A264F5017CBdA314535ddD5c765A7F5968/sources/contracts/AlgebraPool.sol
@inheritdoc IAlgebraPoolActions
function initialize(uint160 initialPrice) external override { globalState.price = initialPrice; if (plugin != address(0)) { IAlgebraPlugin(plugin).beforeInitialize(msg.sender, initialPrice).shouldReturn(IAlgebraPlugin.beforeInitialize.selector); } (uint16 _communityFee, int24 _tickSpacing, uin...
8,812,783
./full_match/43114/0xa72f9D358c96f01C77654F927Afb7A4c7d2b95FC/sources/VictusChef.sol
Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all.
function updateEmissionRate(uint256 _victPerSec) external onlyOwner { massUpdatePools(); victPerSec = _victPerSec; emit UpdateEmissionRate(msg.sender, _victPerSec); }
4,533,598
./full_match/97/0xef5a6C4C5411D3cc3680b10A71afb235c8aF127b/sources/project_/contracts/factory.sol
Returns beacon address to which proxy address's point to./
function escrowBeaconAddress() public view returns (address) { return beacon; }
3,273,651
./full_match/80001/0x9e931a143eC263C2eF9302ca6D859F80751f6941/sources/contracts/upgradeable/WheelcoinPausable.sol
solhint-disable-next-line func-name-mixedcase, private-vars-leading-underscore
function __WheelcoinPausable_init() internal onlyInitializing { WheelcoinRoles.__WheelcoinRoles_init(); PausableUpgradeable.__Pausable_init(); __WheelcoinPausable_init_unchained(); }
5,641,133
./full_match/42/0xC527910E9DB5bE5f18DF2EC0c77e2760908eB5E0/sources/contracts/FundMe.sol
Function to transfer Ether from this contract to address from input
function transfer(address payable _to, uint _ethAmount) payable public { addressToAmountFunded[_to] = addressToAmountFunded[_to] + _ethAmount; }
16,275,967
./full_match/43114/0x1959be52241f53504eE53bDaf38D436C9EadA520/sources/contracts/xUSDTFlood.sol
generate the uniswap pair path of token -> wAVAX make the swap
function swapTokensForAVAX(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WAVAX(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForAVAXSupportingFe...
4,543,165
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function ba...
Checks whether the cap has been reached. return Whether the cap was reached/
function capReached() public view returns (bool) { return tokensSold >= cap; }
2,567,013
// File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * man...
Returns the total rewards currently available for withdrawal. (For calling from inside the contract)/ Gets the latest withdrawal reward amount./ If the passed Property has not authenticated, returns always 0./
function _calculateWithdrawableAmount(address _property, address _user) private view returns (uint256 _amount, uint256 _price) { (uint256 _value, uint256 price) = _calculateAmount(_property, _user); if ( IMetricsGroup(config().metricsGroup()).hasAssets(_property) == false ) { return (0, price); }...
7,798,476
pragma solidity ^0.8.0; // SPDX-License-Identifier: Apache-2.0 import "../include/IERC165.sol"; import "../include/IERC721.sol"; import "../include/IERC721Metadata.sol"; import "../include/IERC721TokenReceiver.sol"; import "../lib/Address.sol"; abstract contract ERC721 is IERC165, IERC721, IERC721Metadata { usi...
ensure everything is ok before call it delete tokenIndexs[tokenId]; save gas
function _removeTokenFrom(address from, uint256 tokenId) internal { uint256 index = tokenIndexs[tokenId]; uint256[] storage tokens = ownerTokens[from]; uint256 indexLast = tokens.length - 1; uint256 tokenIdLast = tokens[indexLast]; tokens[index] = tokenIdLast; token...
15,841,605
pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { ret...
Creates a new promo Covfefe with the given term, with given _price and assignes it to an address.
function createPromoCovfefe(address _owner, string _term, string _meaning, uint16 _generation, uint _price) public onlyCovmanager { require(promoCreatedCount < PROMO_CREATION_LIMIT); address covfefeOwner = _owner; if (covfefeOwner == address(0)) { covfefeOwner = covmanagerAddress...
5,488,651
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IVORConsumerBase { function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external; } interface BlockHashStoreInterface { function getBlockhash(uint256 number) external view returns (bytes32); } /** * @dev Interface of the ERC20...
getProviderFee - get provider's base fee return address/
function getProviderFee(bytes32 _keyHash) external view returns (uint96) { return serviceAgreements[_keyHash].fee; }
14,443,775
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; import "../libraries/SafeMath.sol"; import "../libraries/TransferHelper.sol"; import "../modules/Configable.sol"; import "../modules/ConfigNames.sol"; interface IERC20 { function approve(address spender, uint256 value) external returns (bool); function balan...
Audit borrowers's reward to be up-to-date
function _auditBorrower(address user) internal { UserInfo storage userInfo = borrowers[user]; if (userInfo.amount > 0) { uint256 pending = userInfo.amount.mul(accAmountPerBorrow).div(1e12).sub(userInfo.rewardDebt); userInfo.rewardEarn = userInfo.rewardEarn.add(pending); mintCumulation = mintCumulation.add...
7,226,430
./full_match/1/0xeaF29f1EeBa396f2E738B174e8d8D0F14308BE3d/sources/contracts/ORSTGenesisFactory.sol
Main minting logic implemented here!/ Items are pre-mined (by the owner), so transfer them (We are an operator for the owner). Option is used as a token ID here
function _mint( uint256 _option, address _toAddress, uint256 _amount, bytes memory _data ) internal { require( _canMint(_msgSender(), _option, _amount), "ORSTGenesisFactory#_mint: CANNOT_MINT_MORE" ); if (_option < NUM_ITEM_OPTIONS)...
3,116,442
pragma solidity ^ 0.5.8; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VAR...
Add an airline to the registration queue Can only be called from FlightSuretyApp contract/
function registerAirline( address _airlineAccount, string calldata _airlineName ) external requireIsCallerAuthorized { addAirline(_airlineAccount, _airlineName); }
14,037,460
./full_match/1/0x22A430719D5b3162d5215ffb0bab09311A5981B8/sources/localhost/OBOControl.sol
Add OBOAddress for immediate use. This is an internal only Fn that is called only when the contract is deployed./ set the date to one in past so that address is active immediately.
function addApprovedOBOImmediately(address _oboAddress) internal onlyOwner { if (_oboAddress != address(0)) { approvedOBOs[_oboAddress] = block.timestamp - newAddressWaitPeriod - 1; emit NewOBOAddressEvent(_oboAddress, true); } }
17,132,825
/** *Submitted for verification at Etherscan.io on 2021-08-10 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address toke...
Create a uniswap pair for this new token exclude from receiving dividends exclude from paying fees or having max transaction amount enable owner wallet to send tokens before presales are over.
constructor(address payable devWallet) ERC20("Test", "TEST") { _devWallet = devWallet; dividendTracker = new EPRODividendTracker(); liquidityWallet = owner(); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address _unisw...
2,059,076
// File: contracts/interfaces/IWeth.sol pragma solidity ^0.6.10; interface IWeth { function deposit() external payable; function withdraw(uint) external; function approve(address, uint) external returns (bool) ; function transfer(address, uint) external returns (bool); function transferFrom(addre...
Users use `post` in YieldProxy to post ETH to the Controller (amount = msg.value), which will be converted to Weth here. to Yield Vault to deposit collateral in.
function post(address to) public payable { controller.post(WETH, address(this), to, msg.value); }
2,147,623
// SPDX-License-Identifier: MIT pragma solidity ^0.8; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721A.sol"; import "....
Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`),/
function _exists(uint256 tokenId) internal view returns (bool) { return tokenId < currentIndex; }
4,002
pragma solidity ^0.4.15; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed pre...
Kills this contract. Used only during debugging. TODO: Remove this method before deploying Smart Contract.
function kill() onlyOwner { selfdestruct(msg.sender); }
13,058,048
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ /** Memecoin made to raise awareness for the upcoming gay pride. Some of the taxes will go to #lgbtq associations to fight against homophobia. https://t.me/ApePridePortal/4 https://twitter.com/ApePride Be proud & Ape Pride */ // SPDX-License-Identifie...
exclude from paying fees or having max transaction amount
constructor() ERC20("Ape Pride", "ApePride") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair =...
816
//Address: 0x10a5f6dbd1f9e56fe09df25b1163cd299d5d2413 //Contract name: EthernautsExplore //Balance: 0.251 Ether //Verification Date: 4/24/2018 //Transacion Count: 727 // CODE STARTS HERE pragma solidity ^0.4.19; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Ethernauts con...
Exploration is complete and at most 10 Objects will return during one exploration. _shipTokenId The Token ID that represents a ship and can explore _sectorTokenId The Token ID that represents a sector and can be explored _IDs that represents a object returned from exploration _attributes that represents attributes ...
function explorationResults( uint256 _shipTokenId, uint256 _sectorTokenId, uint16[10] _IDs, uint8[10] _attributes, uint8[STATS_SIZE][10] _stats ) external onlyOracle { uint256 cooldown; uint64 cooldownEndBlock; uint256 builtBy; (,,,...
1,044,230
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; /// SPDX-License-Identifier: MIT import "@openzeppelin-3.4.0/token/ERC20/IERC20.sol"; import "@openzeppelin-3.4.0/token/ERC20/SafeERC20.sol"; import "./interfaces/Upgradeable.sol"; import "./GovToken.sol"; import "./MintCoordinator_Polygon.sol"; import "./inte...
Anyone can contribute native token rewards to GOV pool stakers
function addAltReward() public payable checkNoPause { IMasterChef.PoolInfo storage pool = poolInfo[IBZRX_POOL_ID]; require(block.number > pool.lastRewardBlock, "rewards not started"); uint256 lpSupply = balanceOf[IBZRX_POOL_ID]; require(lpSupply != 0, "no deposits"); update...
15,815,779
// SPDX-License-Identifier: No License (None) pragma solidity ^0.8.0; import "./TransferHelper.sol"; interface IERC20 { function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function a...
return balance for swap
function getBalance( address tokenA, address tokenB, address sender, address receiver ) external view returns (uint256) { return _balanceOf[_getHashAddress(tokenA, tokenB, sender, receiver)]; }
285,084
./partial_match/42/0xa5e044bB1025d095782DDccfD70eA17EA6EA76c5/sources/CollateralManager.sol
Remove it from the the address set lib.
function removePynths(bytes32[] calldata pynths, bytes32[] calldata synthKeys) external onlyOwner { for (uint i = 0; i < pynths.length; i++) { if (_pynths.contains(pynths[i])) { _pynths.remove(pynths[i]); delete pynthsByKey[synthKeys[i]]; emit Pyn...
8,831,512
// File: localhost/Toft_Contracts/contracts/ToftToken/openzeppelin/utils/Pausable.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * ...
See {ITrasnferFee-setMinTransferFee}. sets `minTransferFee` to `_minTransferFee` by the caller. Requirements: - `minTransferFee` cannot be the zero. - `minTransferFee` should be less than maxTransferFee./ solhint-disable-next-line max-line-length
function setMinTransferFee(uint256 minTransferFee) override external onlyOwner returns (bool) { require(minTransferFee <= _maxTransferFee, "TransferFee: minTransferFee should be less than maxTransferFee"); emit MaxTransferFeeUpdated(_minTransferFee, minTransferFee); _minTransferFee ...
2,277,815
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title: MinteVipTicket /// @authors: manifold.xyz & Collector import "./ERC721Creator.sol"; contract MVIP is ERC721Creator { uint256 public price = 40000000000000000; //0.04 ETH bool public saleIsActive = true; uint private rand; const...
See {IAdminControl-getAdmins}./
function getAdmins() external view override returns (address[] memory admins) { admins = new address[](_admins.length()); for (uint i = 0; i < _admins.length(); i++) { admins[i] = _admins.at(i); } return admins; }
6,293
./full_match/7701/0x4e0b416439DEe7Dc3488Eb08b408390529763AD2/sources/MagnetErc721aBase.sol
hook called after mint, used for emiting event through event hub
function _postMint() internal { eventhub.emitMintedEvent(); }
13,215,318
./partial_match/42/0x0c3C5453c7C7a768b97d98E3Ef043f943405c38E/sources/EtherCollateralsUSD.sol
Acccount that created the loan Amount (in collateral token ) that they deposited Amount (in synths) that they issued to borrow Minting Fee When the loan was created ID for the loan When the loan was paidback (closed) Applicable Interest rate interest amounts accrued last timestamp interest amounts accrued
function aggregators(bytes32 currencyKey) external view returns (address); function aggregatorWarningFlags() external view returns (address); function anyRateIsInvalid(bytes32[] calldata currencyKeys) external view returns (bool); function canFreezeRate(bytes32 currencyKey) external view returns (boo...
8,842,762
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IAccounts.sol"; import "../common/Initializable.sol"; import "../common/Signatures.sol"; import "../common/UsingRegistry.sol"; import "../common/lib...
Removes the currently authorized attestation signer for the account/
function removeAttestationSigner() public { Account storage account = accounts[msg.sender]; emit AttestationSignerRemoved(msg.sender, account.signers.attestation); account.signers.attestation = address(0); }
13,126,232
./full_match/4/0xdFb7DA59D91246a1fe59B22fcB81F1673e257772/sources/homework/work.sol
设置物品上下架物品必须存在必须是出借人才可以改变状态物品必须没被借出改变上下架状态
function setGoodsStatus(string memory stickName, uint inx, bool available) public { require(isGoodExist(stickName, inx), "goods not exist"); require(goodsData_liuyang[stickName][inx].owner == msg.sender, "not goods owner"); require(!goodsData_liuyang[stickName][inx].isBorrow, ...
12,388,597
pragma solidity 0.4.23; /** * @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 ...
Transfer bounty in Parsecs Participant's bounty is increased by value Increase total transferred bounty Log an event of the participant's bounty Transfer Parsecs
function transferParsecs(address participant, uint256 value) private { bountyOf[participant] = bountyOf[participant].add(value); totalTransferredBounty = totalTransferredBounty.add(value); LogCampaignBounty(participant, value, now); parsecToken.transfer(participant, value); }
6,401,024
/** *Submitted for verification at Etherscan.io on 2021-09-20 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.0; // Part: OpenZeppelin/[email protected]/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract...
Whitelist accounts for presale
function whitelistForPresale(address[] memory presaleAddresses) public onlyOwner { for(uint i =0; i < presaleAddresses.length; i++) { presaleWhitelisted[presaleAddresses[i]] = true; } }
1,992,198
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "./external/@openzeppelin/token/ERC20/extensions/IERC20Metadata.sol"; import "./external/spool-core/SpoolOwnable.sol"; import "./interfaces/IVoSPOOL.sol"; /* ========== STRUCTS ========== */ /** * @notice global tranche struct * @dev used so it can be...
Execution of function is prohibited to disallow token movement/
function transfer(address, uint256) external pure override returns (bool) { revert("voSPOOL::transfer: Prohibited Action"); }
233,158
./partial_match/42/0x53AF86B01ca8668D7a5F52E3361D4Bc7A331bfdf/sources/BirdCore.sol
User supplies assets into the market and receives bTokens in exchange Assumes interest has already been accrued up to the current block minter The address of the account which is supplying the assets mintAmount The amount of the underlying asset to supply return (uint, uint) An error code (0=success, otherwise a fai...
function mintFresh(address minter, uint mintAmount) internal returns (uint, uint) { uint allowed = bController.mintAllowed(address(this), minter, mintAmount); emit AllowedTestEvent(minter, address(this), allowed); if (allowed != 0) { return (failOpaque(Error.BCONTROLLER_REJECTI...
8,918,198
// File: canonical-weth/contracts/WETH9.sol // Copyright (C) 2015, 2016, 2017 Dapphub // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option)...
GUARD statement roll-back oldPar roll-forward newPar user went from borrowing to repaying or positive user went from zero or positive to borrowing User went from a non-zero balance to zero. Remove the market from the set. User went from zero to non-zero. Add the market to the set.
function setPar( Storage.State storage state, Account.Info memory account, uint256 marketId, Types.Par memory newPar ) internal { Types.Par memory oldPar = state.getPar(account, marketId); if (Types.equals(oldPar, newPar)) { return; ...
6,397,810
./partial_match/1/0xE950159CCdF36f6Dc661DEC0E0De75113455bF63/sources/contracts/sh-verify/sETH.sol
Mints a given amount of tokens Only slot settlement registry module can call _recipient of the tokens _amount of tokens to mint
function mint(address _recipient, uint256 _amount) external { require(msg.sender == address(slotRegistry), "mint: Only SLOT registry"); _mint(_recipient, _amount); }
15,964,474
./partial_match/3/0x529242E2680f288460d4be3f7b93F3699bec1d31/sources/NUG.sol
1342465753424 = ~ 4900000 NUNS_PER_NUG / 365 /
function _waasLobby(uint256 enterDay) private returns (uint256 waasLobby) { if (enterDay > 0 && enterDay <= 180) { waasLobby = CLAIM_STARTING_AMOUNT - ((enterDay - 1) * 2222222222222); waasLobby = CLAIM_LOWEST_AMOUNT; }...
5,293,752
pragma solidity ^0.4.2; // @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens // @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) pu...
_owner The owner whose element tokens we are interested in. This method MUST NEVER be called by smart contract code. First, it's fairly expensive (it walks the entire Elements array looking for elements belonging to owner), but it also returns a dynamic array, which is only supported for web3 calls, and not contrac...
function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); uint256[] memory result = new uint256[](tokenCount); uint256 totalElements = totalSupply(); uint256 res...
5,503,528
./full_match/42/0x9978Bc141d6fb9E9b3E0E63EfEAaa359c8355081/sources/contracts/FController.sol
Set the given borrow caps for the given rToken markets. Borrowing that brings total borrows to or above borrow cap will revert. Admin or borrowCapGuardian function to set the borrow caps. A borrow cap of 0 corresponds to unlimited borrowing. rTokens The addresses of the markets (tokens) to change the borrow caps for ...
function _setMarketBorrowCaps(FRToken[] calldata rTokens, uint[] calldata newBorrowCaps) external { require(msg.sender == admin || msg.sender == borrowCapGuardian, "only admin or borrow cap guardian can set borrow caps"); uint numMarkets = rTokens.length; uint numBorrowCaps = newBorrowCaps.le...
16,224,494
pragma solidity ^0.7.1; /** * @title Utilized for ongoing development. */ // Open Zeppelin import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // Internal import {VaultVenue} from "./VaultVenue.sol"; import {SafeMath} f...
let a venue borrow options. TEST FUNCTION ONLY DO NOT DEPLOY todo make specific VenueTest.sol with test utility fns Receivers are this address
function borrowOptionTest( bytes32 oid, uint256 amount ) public returns (bool) { address[] memory receivers = new address[](2); receivers[0] = address(this); receivers[1] = address(this); _house.borrowOptions(oid, amount, receivers); return true; }
12,553,344
./full_match/1/0x51e63665AC51D0313A042d89DEd26763936C0D12/sources/contracts/NeozenMythics.sol
Check if mint is live
function isLive() public view returns (bool) { return block.timestamp >= liveAt && block.timestamp <= expiresAt; }
8,329,497
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.7.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) interna...
set users can transaction token to others/
function transferAble() public onlyOwner() { _transferAble = true; }
7,760,073
pragma solidity ^0.4.24; // Deployed at 0x06af8345c1266ee172ee66a31e2be65bf9aa7b46 on Ropsten! contract SecretEventOrg{ address public organizer; // Address of organizer string public encryption_key; // Linnia encr...
Referred friend applies for membership
function applyMembership(string public_key) public payable _alreadyReferred(msg.sender) { memberInfo[msg.sender] = Member(msg.sender, memberInfo[referralInfo[msg.sender]].provenance+1, referralInfo[msg.sender], MAX_REFERRALS, public_key); referralInfo[msg.sender] = 0; innerCircle.push(msg.se...
5,413,108
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@uniswap/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol"; import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; import "@uniswap/v3-periphery/contracts/libraries/LiquidityAmounts.sol"; import "@un...
Swap tokens in xU3LP / xAssetCLR using 1inch v3 exchange xU3LP - swap for xU3LP if true, xAssetCLR if false minReturn - required min amount out from swap, in 18 decimals _0for1 - swap token0 for token1 if true, token1 for token0 if false tokenDetails - xU3LP / xAssetCLR token 0 and token 1 details _oneInchData - O...
function oneInchSwap( bool xU3LP, uint256 minReturn, bool _0for1, TokenDetails memory tokenDetails, bytes memory _oneInchData ) public { uint256 token0AmtSwapped; uint256 token1AmtSwapped; bool success; { IERC20 token0 = IERC20...
14,744,837
./full_match/137/0xF1f4d32b5D5b2CFF6e8aB9C2287139Ed66a9D1e4/sources/taxDistributor.sol
Reward rate per day for each type of node (1e9 = 1 Sin)
function updateRewardRates(uint256[7] memory _rewardRates) external onlyOwner { rewardRates = _rewardRates; }
4,755,988
./full_match/80001/0xdb99Ab2F236574174D4BD25f35ab3E37E66B7167/sources/project_/contracts/factory/MineNFTFactory.sol
Remove oneself from the admin role.
function renounceAdmin() external virtual { renounceRole(DEFAULT_ADMIN_ROLE, msg.sender); }
5,590,584
/** * Copyright 2017–2018, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.4.24; pragma experimental ABIEncoderV2; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../modifiers/BZxOwnable.sol"; import "../modifiers/EMACollector.sol"; imp...
solhint-disable-next-line contract-name-camelcase
interface KyberNetwork_Interface { function trade( address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId ) external payable returns(uint); function getExpec...
14,071,613
./full_match/4/0x29c4264614218D0894502A689b351fa38d42aBE6/sources/ERC721.sol
Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is forwarded in {IERC721Receiver-onERC721Received} to contract recipients./
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual returns(bool){ _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); return true; }
833,019
./partial_match/1/0xDC8d77b69155c7E68A95a4fb0f06a71FF90B943a/sources/src/libraries/PendingOwnable.sol
Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./
function renounceOwnership() public override onlyOwner { _transferOwnership(address(0)); }
3,665,291
./full_match/5/0xc40a0656f0EF78bD8eA319C2d2f58587F190e686/sources/contracts/MintBees.sol
metamorphosisURI: Function to get the metadata URI for a bee NFT based on its token ID. This function is public and can be called by anyone. _tokenId uint256 - The token ID of the bee NFT to get the metadata URI for. return string - The metadata URI for the bee NFT. This function gets the metadata URI for a ...
function getMetamorphosisURI( uint256 _tokenId ) public view returns (string memory) { if (_tokenId < stakeSupplyStart) { if (metadataHash == 0) { return metamorphosisURI; return string( abi.encodePacked( ...
11,599,718
./full_match/3/0x505A5362fACFAFefFe2625E7a259266986Aa802c/sources/contracts/IToken_.sol
Sender supplies assets into the market and receives cTokens in exchange Accrues interest whether or not the operation succeeds, unless reverted mintAmount The amount of the underlying asset to supply return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/
function mint(uint mintAmount) external returns (uint) { return mintInternal(mintAmount, msg.sender, msg.sender); }
8,090,069
pragma solidity ^0.4.22; contract Utils { function Utils() public { } // function compareStrings (string a, string b) view returns (bool){ // return keccak256(a) == keccak256(b); // } // // verifies that an amount is greater than zero // modifier greaterThanZero(uint256 _amount) { // requi...
Starting here means the LSB will be the byte we care about
function strlen(string s) internal pure returns (uint) { uint ptr; uint end; assembly { ptr := add(s, 1) end := add(mload(s), ptr) } for (uint len = 0; ptr < end; len++) { uint8 b; if (b < 0x80) { ptr += 1; ptr += 2; ptr += 3; ptr += 4; ptr += 5; ptr += 6; } } ret...
12,687,255
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; import "contracts/interface/ICouncil.sol"; import "contracts/interface/IContent.sol"; import "contracts/interface/IContentsManager.sol"; import "contracts/interface/IFundManager.sol"; import "contracts/interface/IAccountManag...
로그인 처리 _userName 계정 이름(ID) _password 비밀번호 return key_ 로그인 성공 시 private key 전달, 실패시 에러 메시지 전달 return result_ 로그인 성공 여부/
function login( string _userName, string _password ) external view validString(_userName) validString(_userName) returns (string key_, bool result_) { if(account.length == 0 || !isRegisteredUserName(_userName)) { key_ = "Login failed: Please register accou...
12,893,319
pragma solidity 0.6.12; // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/CarefulMath.sol //Copyright 2020 Compound Labs, Inc. //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: //1. ...
Sets maxAssets which controls how many markets can be entered Admin function to set maxAssets newMaxAssets New max assets return uint 0=success, otherwise a failure. (See ErrorReporter for details)/
function _setMaxAssets(uint newMaxAssets) external onlyOwner returns (uint) { uint oldMaxAssets = maxAssets; maxAssets = newMaxAssets; emit NewMaxAssets(oldMaxAssets, newMaxAssets); return uint(Error.NO_ERROR); }
36,983
./full_match/1/0x4060dBA72344DA74EDaEEAe51a71a57F7E96b6b4/sources/contracts/SkinnyOptimisticOracle.sol
Returns hash of request parameters. These are mapped to the unique request ID to track a request's lifecycle.
function _getRequestHash(Request memory request) private pure returns (bytes32) { return keccak256(abi.encode(request)); }
2,956,463
./full_match/1/0x6A0ECf6075dCc9fbCaBf8c2484f82f282A8Ba766/sources/browser/Splitter.sol
distribute any token in contract via addressget balancedistribute
function distributeToken(address tokenAddress) public { Token _token = Token(tokenAddress); uint256 balance = _token.balanceOf(address(this)); require(balance > 199, "value too low to distribute"); uint256 percent = balance.div(100); uint256 half_percent = balance.div(200); ...
9,709,624
pragma solidity 0.5.16; import "./GovernableInit.sol"; // A clone of Governable supporting the Initializable interface and pattern contract ControllableInit is GovernableInit { constructor() public {} function initialize(address _storage) public initializer { GovernableInit.initialize(_storage); ...
Returns the cash balance across all users in this contract./
function underlyingBalanceInVault() public view returns (uint256) { return IERC20(underlying()).balanceOf(address(this)); }
37,754
// SPDX-License-Identifier: NONE pragma solidity ^0.8.0; import "./utils/MerkleProof.sol"; import "./utils/Ownable.sol"; import "./utils/SafeERC20.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IRewardsAirdropWithLock.sol"; /** * @title Ruler RewardsAirdropWithLock contract * @author crypto-pumpkin ...
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function penaltyReceiver() external view returns (address); function claimWindow() external view returns (uint256); function isClaimed(uint256 _roundsIndex, uint256 index) external view returns (bool); function getAllAirdropRounds() external returns (AirdropRound[] memory); function getAirdropRound...
1,531,914
./full_match/5/0x95422c7d13F0A80B6CCb47F8346E21396823bfE6/sources/src/contracts/PublicLock/PublicLockV11.sol
Change the maximum number of keys the lock can edit _maxNumberOfKeys uint the maximum number of keys Can't be smaller than the existing supply/
function setMaxNumberOfKeys (uint _maxNumberOfKeys) external { _onlyLockManager(); if (_maxNumberOfKeys < _totalSupply) { revert CANT_BE_SMALLER_THAN_SUPPLY(); } maxNumberOfKeys = _maxNumberOfKeys; }
11,630,620
./partial_match/4/0x6480e156865Bbb84Ba94d53dC09f667bdC2B371a/sources/Contract.sol
Получение имен кандидатов./
function getProposalsName() public view isBallotExist returns(bytes32[] memory) { return ballots[ballots.length - 1].proposalsName; }
8,508,798
pragma solidity ^0.5.0; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint25...
This is the actual transfer function in the token contract, it can only be called by other functions in this contract. Check for availability must be done before. _from The address holding the tokens being transferred _to The address of the recipient _amount The amount of tokens to be transferred return True if the...
function doTransfer(Supply storage _self, Availability storage /*_availability*/, address _from, address _to, uint256 _amount) public { require(_to != address(0), "addr0"); require(_to != address(this), "target self"); uint256 previousBalanceFrom = balanceOfNow(_self, _from); requir...
6,461,827