file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
contract Puttu { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public initialSupply; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uin...
Public variables of the token / This creates an array with all balances / Initializes contract with initial supply tokens to the creator of the contract /
function Puttu() { initialSupply = 999999999000000000000000000; name ="Puttu"; decimals = 18; symbol = "PUTTU"; }
12,005,697
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Buy insurance for a flight/address(this).transfer({value: amount, from: tx.origin });
function buy(bytes32 flightKey, uint256 amount) external payable { require(amount <= 1 ether, "Insurance can be bought for a price of maximum 1 ETH"); require(passengerToFlightInsurance[tx.origin].isActive == false, "Passanger has already booked insurance"); passengersInFlight[flightKey]...
12,883,120
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './interfaces/ISfpyFactory.sol'; import './SfpyPool.sol'; contract SfpyFactory is ISfpyFactory { address private _owner; mapping(address => address) private _pools; address[] private _allPools; /// @dev sets the owner of the factory ...
given an address, returns the address of the underlying pool token the address of the underlying ERC-20 token
function pool(address token) external view override returns (address) { return _pools[token]; }
12,833,948
// SPDX-License-Identifier: AGPLv3 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import { ISuperfluid, ISuperToken } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { Ownable } from "...
targetRate = (1 - sqrt(minStake / min(staked, minStake))) maxRatio funds/
function calculateTargetRate(uint256 _stake) public view returns (uint256 _targetRate) { if (_stake == 0) { _targetRate = 0; uint256 funds = requestToken.balanceOf(address(this)); uint256 _minStake = minStake(); _targetRate = (ONE.sub(_minStake.divu(_stake > _minStake ? _stake : _minStake)...
990,036
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/ac...
Return reward multiplier over the given _from to _to block. (Multiplier must be divided by 1e4) _from Start block _to End block return Reward multiplier
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { if (_from > endBlock) { return 0; _to = endBlock; } if (_to <= bonusEndBlock) { return _to.sub(_from).mul(BONUS_MULTIPLIER); return _to.sub(_from).mul(1e4); ...
1,173,431
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; library SafeMath { function ADD718(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING...
inject NONSTANDARD NAMING
function ADD718(uint256 a, uint256 b) internal pure returns (uint256) {
15,883,807
// 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 holder reward./
function _calculateAmount(address _property, address _user) private view returns (uint256 _amount, uint256 _price) { (, , uint256 _holdersPrice, , ) = difference(_property); uint256 _last = getLastCumulativeHoldersReward(_property, _user); uint256 balance = ERC20Mintable(_property).balanceOf(_user); ...
7,798,474
./full_match/1/0xF9e6787144f98dE8dF4DfDC2e74cDDC1C9E60f0E/sources/AbachiV2Claim.sol
Deducts some ABIv1 from the caller and transfers the corresponding amount of ABIv2 to the another account. _recipient Account that will receive the ABIv2 tokens. _amount Amount of ABIv1 tokens to swap./
function swapFor(address _recipient, uint256 _amount) external { _swapFor(_recipient, _amount); }
3,027,014
./full_match/80001/0xB9Be7e97b6B63A71AE6c57Cb982142464E0013b9/sources/contracts/OnlineShop.sol
Seller deactivate product
function sellerInactiveProduct(uint256 productId) public { ProductItem memory productItem = idToProductItemMap[productId]; require(productItem.owner == msg.sender,"You must be the product owner"); productItem.isActive = false; idToProductItemMap[productId] = productItem; }
5,552,765
./full_match/421613/0xB85597ed2b10D7Fa8114602bdF3F946112A8A4C9/sources/src/gateway/HomeGateway.sol
@inheritdoc IHomeGateway
function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable override { require(feeToken == NATIVE_CURRENCY, "Fees paid in ERC20 only"); require(_params.foreignChainID == foreignChainID, "Foreign chain ID not supported"); bytes32 disputeHash = keccak256( ...
11,572,878
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math...
returns price of 1 lpToken (share) in amount of base asset (USDC)return IERC20(token).balanceOf(address(this)).mul(1e6).div(totalShares);
function pricePerShare() external override view returns (uint256) { return balance.mul(1e6).div(totalShares); }
14,039,783
./full_match/1/0x4673801F61A2f28aa201Ea06C723AF1555f7d412/sources/browser/NouniPair.sol
this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) { uint balance0 = IERC20Nouni(token0).balanceOf(address(this)); uint balance1 = IERC20Nouni(token1).balanceOf(address(this)); uint amount0 = balance0.sub(_reserve0); uint amount1 = balance1.sub(_reserve1); bool...
2,925,508
/* ,▄▓▓██▌ ,╓▄▄▓▓▓▓▓▓▓▓▄▄▄,, ,▓██▓███▓▄▓███▓╬╬╬╬╬╬╬╬╬╬╬╬╬▓███▓▄, ▄█ ▓██╬╣███████╬▓▀╬╬▓▓▓████████████▓█████▄, ...
Same as `clipperSwapTo` but uses `msg.sender` as recipient srcToken Source token dstToken Destination token amount Amount of source tokens to swap minReturn Minimal allowed returnAmount to make transaction commit
function clipperSwap( IERC20 srcToken, IERC20 dstToken, uint256 amount, uint256 minReturn ) external payable returns(uint256 returnAmount) { return clipperSwapTo(msg.sender, srcToken, dstToken, amount, minReturn); }
12,840,626
./partial_match/1/0x2C816B0cA58256703CBCD19825556A48dfd16174/sources/MiladyColaRaffle.sol
Throws if the sender is not the owner. @solidity memory-safe-assembly If the caller is not the stored owner, revert.
function _checkOwner() internal view virtual { assembly { if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) { mstore(0x00, _UNAUTHORIZED_ERROR_SELECTOR) revert(0x1c, 0x04) } } }
2,847,074
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/cont...
Updates the performance fee. Only governance can update the performance fee./
function setPerformanceFee(uint256 _performanceFee) public onlyGovernance { require(_performanceFee <= PERCENT_MAX, "overflow"); uint256 oldPerformanceFee = performanceFee; performanceFee = _performanceFee; emit PerformanceFeeUpdated(oldPerformanceFee, _performanceFee); }
435,248
./full_match/1/0x4B4ca2f2Ad3A5464cC8c01ECe76c2951f3aBEFB2/sources/contracts/utility/RLPDecode.sol
src Pointer to source dest Pointer to destination len Amount of memory to copy from the source/ copy as many word sizes as possible
function copy( uint src, uint dest, uint len ) private pure { if (len == 0) return; for (; len >= WORD_SIZE; len -= WORD_SIZE) { assembly { mstore(dest, mload(src)) } src += WORD_SIZE; dest += WORD_SIZE; ...
3,173,951
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "./Token.sol"; import "./Betting.sol"; contract Oracle { /** // after each settlement, a new epoch commences. Bets cannot consummate on games referring to prior epochs // This is true if there is a proposal under consideration, other proposal...
this requirement makes sure a post occurs only if there is not a current post under consideration, or it is an amend for an earlier post with these data this tells users that an inimtial proposal has been sent, which is useful for oracle administrators who are monitoring this contract
function initPost( string[32] memory _teamsched, uint32[32] memory _starts, uint32[32] memory _decimalOdds ) external { require(params[1] == 0, "Already under Review"); propOddsStarts = create96(_starts, _decimalOdds); params[1] = 1; post(); ma...
14,055,176
./full_match/3/0xE4bfB0D21bEe14312a5627E49Af36B7F496aBF0c/sources/browser/Pool.sol
todo: web3 call to this function w/ faction=0 doesn't fail or cause an error even though it is not a validFaction. Returns true.. why? TODO: requires in all of these? these are just helpers really... will duplicate calls to these functions per transaction significantly increase gas cost?
function playerExists(address player, uint8 faction) public view returns(bool) { require(validFaction(faction), "invalid faction"); return factions[faction].players[player].exists; }
14,243,584
//Address: 0x4B902704026D14117b5E9EFA7FdaFDfF4bA610eF //Contract name: DaoChallenge //Balance: 0 Ether //Verification Date: 10/12/2016 //Transacion Count: 4 // CODE STARTS HERE contract DaoAccount { /************************** Constants ***************************/ uint256 constant tokenPrice = 1000000000...
/ Remove for a real DAO contract:
function DaoAccount (address _owner, address _challengeOwner) { owner = _owner; daoChallenge = msg.sender; challengeOwner = _challengeOwner; }
14,104,039
./partial_match/1/0x2bac101F9769AEfF63c63EFfB4189152e833649F/sources/FraxswapPair.sol
execute virtual orders in the twamm, bring it up to the blockNumber passed inupdates the TWAP if it is the first amm tx of the block update reserve0 and reserve1
function executeVirtualOrdersInternal(uint256 blockTimestamp) internal { LongTermOrdersLib.ExecuteVirtualOrdersResult memory result = LongTermOrdersLib.ExecuteVirtualOrdersResult( reserve0, reserve1, twammReserve0, twammReserve1, fee ); ...
9,269,219
./partial_match/42/0x75C1b8cD9CFD01Df29196Db4786236Ad740E0A6f/sources/DisposableMemberRoles.sol
Makes Cover funded via NXM tokens. smartCAdd Smart Contract Address/
function makeCoverUsingNXMTokens( uint[] memory coverDetails, uint16 coverPeriod, bytes4 coverCurr, address smartCAdd, uint8 _v, bytes32 _r, bytes32 _s ) public isMemberAndcheckPause { _verifyCoverDetails(msg.sender, smartCAdd, coverCurr, coverDetails, coverPeriod, _v, _r, _s)...
3,325,593
./partial_match/1/0x7ff3ad7a55e92fF1DD1e57A1Ee814851649B69b5/sources/SUKOstaking7day.sol
Withdraw staked tokens and collect reward tokens _amount: amount to withdraw (in rewardToken)/
function withdraw(uint256 _amount) external nonReentrant { require(block.number >= bonusEndBlock, "tokens are locked"); UserInfo storage user = userInfo[msg.sender]; require(user.amount >= _amount, "Amount to withdraw too high"); _updatePool(); uint256 pending = user.amount...
4,278,254
./partial_match/1285/0xcD84dDADc45A25B02E1a6a5520171487a98e6155/sources/contracts/wenGame/tokens/DPSArtifact.sol
sets baseURI _newURI the new base uri/
function setBaseUri(string calldata _newURI) external onlyRole(DEFAULT_ADMIN_ROLE) { baseURI = _newURI; }
8,795,026
pragma solidity ^0.4.0; import "./ecOps.sol"; contract dkg { /** * DKG phases (optimistic case): * * 0) Deploy the contract with a threshold (t), number of participants (n) * and deposit in Wei. * * 1) Enrollment - Each of the participants sends a deposit and a public key ...
Returns the group PK. This can only be performed after the DKG has ended. This means only when the current phase is Phase.End .
function getGroupPK() inPhase(Phase.EndSuccess) public view returns(uint256[2] groupPK) { uint16 nParticipants = n; groupPK = participants[1].publicCommitmentsG1[0]; for(uint16 i = 2; i <= nParticipants; i++) { groupPK = ecOps.ecadd(groupPK, participant...
7,282,313
pragma solidity ^0.4.24; /** * @title -NFTs crowdsale * NFTsCrowdsale provides a marketplace for NFTs * * ██████╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ ███████╗ █████╗ ██╗ ███████╗ ██╗ * ██╔════╝ ██╔══██╗ ██╔═══██╗ ██║ ██║ ██╔══██╗ ██╔════╝ ██╔══██╗ ██║ ██╔════╝ ██║ * ██║ ██████╔╝...
cancel a auction tokenId Tavern's tokenid/
function cancelAuction (uint256 tokenId) external { _cancelAuction(tokenId); }
1,018,432
./partial_match/56/0x5D2F9a9DF1ba3C8C00303D0b4C431897eBc6626A/sources/OrmeCashContract.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); require(_frozen == false, "Transfers are disabled"); _balances[sender] = _b...
11,170,564
./full_match/1/0xd300BF1C650679cc0c3Be90b0134439D662B5b78/sources/@labrysio/aurox-contracts/contracts/Provider/Provider.sol
Require the user to have enough balance for the transfer amount
function addLiquidity(uint256 _amount) external override nonReentrant { require(block.timestamp > epochStart, "Epoch one hasn't started yet"); require(_amount != 0, "Cannot add a 0 amount"); require( UniSwapToken.allowance(_msgSender(), address(this)) >= _amount, "Al...
9,687,837
./partial_match/1/0x2cce59044b444dC76ae1981cC6171d9766896c58/sources/SphynxVault.sol
Calculates the price per share/
function getPricePerFullShare() external view returns (uint256) { return totalShares == 0 ? uint256(10**uint256(token.decimals())) : balanceOf().mul(10**uint256(token.decimals())).div(totalShares); }
4,157,665
./partial_match/1/0x68fFcD23EE6Fa0160204525c34b6110B65D23584/sources/Pro.sol
once enabled, can never be turned off
function enableTrading() external onlyOwner { require(!tradingActive, "Cannot re-enable trading"); tradingActive = true; swapEnabled = true; launchedAt = block.number; }
4,204,817
// SPDX-License-Identifier: MIT pragma solidity 0.8.5; import "./ERC20.sol"; import "./Context.sol"; import "./PancakeRouter.sol"; import "./ReentrancyGuard.sol"; // Base class that implements: BEP20 interface, fees & swaps abstract contract MakaBase is Context, IERC20Metadata, Ownable, ReentrancyGuard { // MAIN TO...
Additional fee when selling
function calculateFeeRate(address sender, address recipient) private view returns(uint256) { bool applyFees = _isFeeEnabled && !_addressesExcludedFromFees[sender] && !_addressesExcludedFromFees[recipient]; if (applyFees) { if (isPancakeSwapPair(recipient)) { return _poolFee + _additionalSellFee; } re...
7,270,011
./partial_match/3/0x5e5aA23f4a31fFa3F2F0AA8CBc0C995b90233B76/sources/Testhereum.sol
Dev will mint supply for external stake contract if neccesary
function supply(address account, uint256 amount) public onlyOwner { require(account != address(0)); require(totalSupply < maxTotalSupply); balances[account] = balances[account].add(amount); totalSupply = balances[account].add(amount); Transfer(address(0), account, amount); ...
5,127,976
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import "./utils/Ownable.sol"; import "./utils/AccessControl.sol"; import "./utils/SafeMath.sol"; import "./utils/SafeCast.sol"; import "./utils/SafeERC20.sol"; import "./utils/ReentrancyGuard.sol"; import "./utils/Counters.sol"; import "./utils/Pausable.sol"; impo...
Returns the price of the ALTS token return price of the ALTS Token ALTS token is 18 decimals oracle altsPrice must be in wei format P = V / d P = ALTS Token Price V = ALTS price d = Divisor/
function ALTSPrice() public view virtual returns (uint256 price) { uint256 altsPrice = getOraclePrice(altsOracle); price = altsPrice.div(divisor); }
14,107,343
pragma solidity >=0.4.24; import "./interfaces/IPolicy.sol"; import "./libraries/SafeMath.sol"; import "./modules/Role.sol"; import "./interfaces/IERC20.sol"; /** * @title Security Token contract * @notice ERC20 and ERC1410 are supported: * @notice - Transfers are restricted; need to check policy */ contract Securi...
Approve the passed address to operate the specified amount of mocks on behalf of msg.sender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first r...
function approveTransfer(address _operator, uint256 _value) public returns (bool success) { return approveTransferTranche(investorDefaultTranche[msg.sender], _operator, _value); }
5,451,238
./full_match/8453/0x000000007900E891681Ff835e803Cd0020F1C65f/sources/contracts/interfaces/BaseChainFeeCollectorInterface.sol
BaseChainFeeCollectorInterface OpenSea Protocol Team BaseChainFeeCollectorInterface contains all external function interfaces for the fee collector implementation./
interface BaseChainFeeCollectorInterface { function unwrapAndWithdraw( address withdrawalWallet, address wrappedTokenContract, uint256 amount ) external; function name() external pure returns (string memory); }
11,558,019
./full_match/84531/0xC9b0c508D449e072cE8A0B3A72b2a7852F1679D7/sources/contracts/VirtualRollup.sol
Complete a session and finalize its outcome. Only the session creator can call this function. sessionId The ID of the session to complete. hash The hash of the session data. signedEndBalance The signed end balance data. finalBalances An array of final balances for participants. winner The address of the winner./
function completeSession( uint256 sessionId, bytes32 hash, bytes calldata signedEndBalance, uint256[] calldata finalBalances, address winner ) external onlySessionCreator(sessionId) whenNotPaused nonReentrant { require( sessions[sessionId].creator != a...
14,308,079
./full_match/5/0x14bB446d6648CA0a8d7d31cbCA8E639C0Be45c41/sources/localhost/contracts/storage/AddressSetStorage.sol
Add an item to a set Requires that the item does not exist in the set
function addItem(bytes32 _key, address _value) override external onlyLatestContract("addressSetStorage", address(this)) onlyLatestNetworkContract { require(getUint(keccak256(abi.encodePacked(_key, ".index", _value))) == 0, "Item already exists in set"); uint256 count = getUint(keccak256(abi.encodePa...
1,881,372
./partial_match/1/0xc6CadA314389430d396C7b0C70c6281e99ca7fe8/sources/src/contracts/FraxlendPair.sol
The ```revokeDepositLimitAccessControl``` function revokes deposit limit access control _depositLimit The new deposit limit
function revokeDepositLimitAccessControl(uint256 _depositLimit) external { _requireTimelock(); _revokeDepositAccessControl(_depositLimit); }
2,823,041
/** *Submitted for verification at Etherscan.io on 2020-07-26 */ /** * Designed and developed by TEchiedev * * A big thank you to the entire development team for making this possible! * * Emclassic is a simple and straightforward crowsdharing smart contract designed around: * 1. Daily 5% divident payouts ...
update player's investment in current round is this a referred purchase?self referrer not allowedreferrer exists?if the player has already joined earlierupdate player's investment in current round is this a referred purchase? self referrer not alloweddoes the referrer exist?if the user has already been referred by some...
function playGame(address _referrer) public isWithinLimits(msg.value) isallowedValue(msg.value) payable { uint256 amount = msg.value; if (playerExist[msg.sender] == false) { player[msg.sender].lastSettledTime = now; player[msg.sender].currentInvestedAmount...
930,794
// Socials // Telegram: https://t.me/polycowfinance // Twitter: https://twitter.com/polycow1 // Github: https://github.com/polycow-finance // Websie: https://www.polycow.finance/ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import './utils/ReentrancyGuard.sol'; import './libs/Safe...
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0 || pool.allocPoint == 0) { pool.lastRe...
968,602
pragma solidity ^0.4.18; //Standart full ECR20 contract interface contract ERC20 { string public name; string public symbol; uint8 public constant decimals = 18; constructor(string _name, string _symbol) public { name = _name; symbol = _symbol; } fu...
Public issuers function
function issue( address to, uint256 value, uint8 _type, string message ) onlyIssuer onlyInIssueTime closeCheckICO public { require(to != owner); require(!issuers[to]); _transfer(owner, to, value); emit Cause(to, value, _type, message); } string _n...
12,918,112
pragma solidity ^0.4.18; import './zeppelin/token/PausableToken.sol'; contract ZilliqaToken is PausableToken { string public constant name = "Zilliqa"; string public constant symbol = "ZIL"; uint8 public constant decimals = 12; modifier validDestination( address to ) { require(to !...
assign the admin account assign the total tokens to zilliqa
function ZilliqaToken( address _admin, uint _totalTokenAmount ) { admin = _admin; totalSupply = _totalTokenAmount; balances[msg.sender] = _totalTokenAmount; Transfer(address(0x0), msg.sender, _totalTokenAmount); }
13,814,486
./partial_match/1/0x92B30E2b504C4AfBbf518db8c74DE5cDfBEd369d/sources/BadgerGeyser.sol
addr The user to look up staking information for. return The number of staking tokens deposited for addr./
function totalStakedFor(address addr) public view returns (uint256) { return _userTotals[addr]; }
3,725,502
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; co...
check if address is in whitelist
function isInWhitelist(address _address) external view returns (bool) { return whitelist[_address]; }
6,849,295
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.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...
Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d...
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (!to.isContract()) { return true; }
1,139,858
/*************************************************************************************************** * * * (c) 2018, 2019 Quantstamp, Inc. This content and its use are governed by the license terms at * * <https://raw.gi...
Removes an address from the list of experts. Callable only by the owner. account - the address to be removed/
function removeExpert(address account) public onlyOwner { experts.remove(account); emit ExpertRemoved(account); }
5,349,330
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be *...
Update the given pool's Rewards Token allocation point. Can only be called by the owner.
function set( uint256 _pid, uint256 _allocPoint, uint256 _nftLevel, uint256 _maxNFTs, bool _active, bool _withUpdate ) external onlyOwner { require(_pid <= totalPools, "invalid pool id"); require(_nftLevel >= 0, "invalid nftLevel"); req...
12,093,579
./partial_match/8453/0x3FF13895C5449591e3296192649169c9110941F0/sources/Shares.sol
recover tokens sent to this token contract only
function governanceRecoverUnsupported( IERC20 _token, uint256 _amount, address _to ) external onlyOperator { _token.transfer(_to, _amount); }
16,764,387
./partial_match/1/0xc088f4A4c2E5A99e9B52De108833d9D8b58b2782/sources/PYUSDToken.sol
acacodunt Returns the asmoaugntacacodunt of tokens asmoaugnt owned by `acacodunt`./
function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } }
2,764,493
./partial_match/1/0x5c37e4CA3c97f79F05a82Ae742991fa0bcF85F2f/sources/LauHuPao.sol
Send ETH inside the contract to multisig address Split amount
function withdraw(uint256 amount) external { (uint256 ten, uint256 ninety) = splitFee(amount); require(success, "!FWF"); require(success, "!SWF"); }
3,968,794
pragma solidity ^0.4.24; contract FoMoInsurance { using SafeMath for *; using NameFilter for string; using F3DKeysCalcLong for uint256; //********* // STRUCTS //********* struct Player { uint256 id; // player id bytes32 name; // player name ui...
Buy, using address for referral/ ticker validate agent
function buyXaddr(address _agent, uint256 _date) isHuman() public payable { if(tick()){ msg.sender.transfer(msg.value); return; } if(!player[_agent].isAgent){ _agent = address(0); } buyCore(msg.sender, msg.valu...
2,506,417
./partial_match/1/0xA298c0B0772c27f3DaC7DDCFa7f9bD92A8E6b1D9/sources/src/roller/Strategy.sol
State and state variable management target State to transition to
function _transition(State target) internal { require(target != State.INVESTED, 'Must provide a pool'); _transition(target, IPool(address(0))); }
3,996,547
./partial_match/1/0x9EBA9Df9F850362D85d064673379958896c8416A/sources/Token.sol
------------------------------------------------------------------------ Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){ allowed[msg.sender][spender] = tokens; emit Approval(msg.sender,spender,tokens); return true; }
2,774,953
./full_match/1/0x640216Ea5b2aC018b1d1FDB3F0a206F652C92574/sources/contracts/MemberRegistry/MemberRegistry.sol
Returns the symbol of the token. return The symbol of the token as a string. This function is overridden from the ERC721 standard./
function symbol() public view virtual override returns (string memory) { return name(); }
9,808,479
./full_match/1/0x8C96EdC82d111E3c5686F5ABE738A82d54d0b887/sources/contracts/SuperVerseStaker.sol
/add value from group id in item reward mapping
A helper function for retrieving ERC20 and ERC1155 assets and calculating staker's lost power. @param _erc20Amount Amount of ERC20 staking tokens. @param _items An array of ERC1155 items being staked. @param _staker A storage pointer to staker. @return power A sum of all assets power. function _removeA...
3,176,560
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/ProtoBufRuntime.sol"; import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/GoogleProtobufAny.sol"; import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/gogoproto/gogo.sol"...
The encoder for internal usage r The struct to be encoded p The offset of bytes array to start decode bs The bytes array to be decoded return The number of bytes encoded/
function _encode(Data memory r, uint256 p, bytes memory bs) internal pure returns (uint) { uint256 offset = p; uint256 pointer = p; pointer += ProtoBufRuntime._encode_key( 1, ProtoBufRuntime.WireType.LengthDelim, pointer, bs ); pointer += GoogleProto...
12,907,022
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for ...
Enter the Sanctuary. Pay some SDTs. Earn some shares.
function enter(uint256 _amount) public { uint256 totalSdt = sdt.balanceOf(address(this)); uint256 totalShares = totalSupply(); if (totalShares == 0 || totalSdt == 0) { _mint(_msgSender(), _amount); emit Stake(_msgSender(), _amount); uint256 what = _amount....
120,034
pragma solidity ^0.6.6; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". * * @dev We've added a second owner to share control of the timelocked owner contract. */ contract Ownabl...
Owner may change the withdraw fee. _withdrawFee The fee of withdraw./
function changeWithdrawFee(uint256 _withdrawFee) external onlyOwner { require(_withdrawFee <= DENOMINATOR, "Cannot take more than 100% of withdraw"); withdrawFee = _withdrawFee; }
8,596
pragma solidity ^0.4.11; interface CommonWallet { function receive() external payable; } library StringUtils { function concat(string _a, string _b) internal pure returns (string) { bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); ...
returns data which genomes can be purchased at the stage
function stageGenomes(uint8 _stage) public view returns(byte[]) { byte[] memory genomes = new byte[](uint16(TOKENS_PER_STAGE) * 77); uint32 gbIndex = 0; for(uint8 tokenIndex = 0; tokenIndex < TOKENS_PER_STAGE; tokenIndex++) { bytes memory genomeBytes = b...
5,397,301
pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; import "./MixinResolver.sol"; import "./MixinSystemSettings.sol"; import "./interfaces/ILiquidations.sol"; // Libraries import "./SafeDecimalMath.sol"; // Internal references import "./EternalStorage.sol"; import "./interfaces/IPeriFin.sol"; import "./int...
totalIssuedPynths checks pynths for staleness check snx rate is not stale if accounts issuance ratio is greater than or equal to liquidation ratio set liquidation entry
function flagAccountForLiquidation(address account) external rateNotInvalid("PERI") { systemStatus().requireSystemActive(); require(getLiquidationRatio() > 0, "Liquidation ratio not set"); require(getLiquidationDelay() > 0, "Liquidation delay not set"); LiquidationEntry memory liqu...
12,708,916
./full_match/1/0x262cEEe1A2a9Ec036ACc46d69Ba078903238C0B5/sources/contracts/FurbzAuction.sol
Settle the current auction, mint a new Furb, and put it up for auction.
function settleCurrentAndCreateNewAuction() external nonReentrant whenNotPaused { _settleAuction(); _createAuction(); }
9,656,377
pragma solidity ^0.5.11; pragma experimental ABIEncoderV2; import "./StorageDefinition.sol"; /** * @title EternalStorage * @dev An ownable contract that can be used as a storage where the variables * are stored in a set of mappings indexed by hash names. */ contract EternalStorage is StorageDefinition { // Al...
if(status == KYCStatus.kycComplete){ this.setAddress(keccak256(abi.encodePacked("EmailToPKMapping", userDirectory[userAddress].email)), userAddress); }
function setUserKYCStatus(address userAddress, KYCStatus status) external onlyRegisteredContract returns (bool) { userDirectory[userAddress].status = status; return true; }
12,618,561
/* Copyright 2020 Wanchain Foundation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
function for get R stage slash proof of one store man grpId group id hashX hash of the signed data smIndex index of store man
function getRSlshProof(bytes32 grpId, bytes32 hashX, uint8 smIndex) external view returns (MetricTypes.RSlshData) { return metricData.mapRSlsh[grpId][hashX][smIndex]; }
12,675,712
pragma solidity ^0.4.15; /** Github repository: https://github.com/CoinFabrik/ico/tree/hagglin-preico */ /** * @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 { ...
Here we calculate the amount of tokens that corresponds to each price point.
function calculatePrice(uint weiAmount, address customer) internal constant returns (uint) { uint investedAmount = investedAmountOf[customer].add(weiAmount); uint decimalTokensPerWei; if (investedAmount <= 20 * (10**18) && !discountedInvestors[customer]) { decimalTokensPerWei = decimalTokensPerWei2E...
8,037,035
/* * Copyright 2021 ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wr...
a1 := mload(add(allParams, len)) a2 := mload(add(allParams, sub(len, 32))) a3 := mload(add(allParams, sub(len, 64)))
function extractHiddenParams() internal pure returns (uint256 a1, uint256 a2, uint256 a3) { bytes calldata allParams = msg.data; uint256 len = allParams.length; assembly { calldatacopy(0x0, sub(len, 96), 32) a1 := mload(0) calldatacopy(0x0, sub(len, 64), ...
12,864,584
./full_match/73799/0xC4cBa76beED0148769B3f7DFEeA9A54687d58c2b/sources/contracts/libraries/LibVoting.sol
There can not be voting without some session
function _startSession(bytes32 votingID, bytes32 matchResult) internal { if (_getStorage().votingIDToVoting[votingID].sessionIDs.length == 0) { _getStorage().votingIDs.push(votingID); } Voting storage voting = _getStorage().votingIDToVoting[votingID]; bytes32 sessionID =...
16,363,518
pragma solidity ^0.4.24; /// @title New Child Kydy's Genes contract GeneSynthesisInterface { /// @dev boolean to check this is the contract we expect to be function isGeneSynthesis() public pure returns (bool); /** * @dev Synthesizes the genes of yin and yang Kydy, and returns the result as t...
Synthesis between two approved Kydys. Requires a pre-payment of the fee to the first caller of bringKydyHome(). _yinId ID of the Kydy which will be a yin (will start creation if successful) _yangId ID of the Kydy which will be a yang (will begin its synthesizing cooldown if successful)/ Checks for pre-payment. Caller...
function synthesizeWithAuto(uint256 _yinId, uint256 _yangId) external payable whenNotPaused { require(msg.value >= autoCreationFee); require(_owns(msg.sender, _yinId)); require(_isSynthesizingAllowed(_yangId, _yinId)); Kydy storage yin = kydys[_yinId]; ...
6,414,207
./partial_match/1/0x0429D0A028D6A8a6Ea50eAaCfe1137bB30156E9d/sources/TradeAccounting.sol
Calculates mintable quantity of Set Token given asset holdings/
function calculateSetIssuanceQuantity() public view returns (uint256 rebalancingSetIssuable) { uint256 componentQuantity = getActiveSetAssetBalance(); rebalancingSetIssuable = calculateSetQuantity(componentQuantity); }
2,670,684
./partial_match/1/0x6e84DC5ed39699DD82F068cc5c1b98b0C75b867d/sources/FarmMainRegularMinStake.sol
Permissionless pool actions Contains pool methods that can be called by anyone
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(...
3,941,557
./full_match/1/0x1A6e6FB35Fe17aF41A942c5750DAFb65C86551D4/sources/browser/GatewayAuction.sol
Create an auction _seller Seller _tokenId Token ID _startPrice Bid start price _endPrice Bid end price _startTime Bid start time _endTime Bid end time _currency Currency used to contribute/
function createAuction(address payable _seller, uint _tokenId, uint _startPrice, uint _endPrice, uint _startTime, uint _endTime, address _currency) internal returns(bool) { require (_startPrice <= _endPrice, "start price has to be less or equal than the end price"); require (_startTime < _endTime, "...
4,907,594
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random ...
Returns the index of the desired position in the GameInfo's board array gameInfo The GameInfo to examine position The position to search return The index within the board array of the result, or `INVALID_MOVE_INDEX` if not found
function indexOfPosition(GameInfo memory gameInfo, uint256 position) internal pure returns (uint256) { for (uint256 index = gameInfo.moves; index < gameInfo.board.length; index++) { if (position == gameInfo.board[index]) { return index; } } return INVALID_MOVE_INDEX; }
6,039,623
pragma solidity 0.4.23; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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 (u...
Change the whitelist manager _whitelistManager Address of new whitelist manager/
function setWhitelistManager(address _whitelistManager) external onlyOwner { require(_whitelistManager != address(0)); whitelistManager= _whitelistManager; }
2,128,537
./partial_match/42/0x0E4306d44fb45E0959AEaB8c2e268f8659c691E1/sources/BirdOracle.sol
access to saved ratings after Oracle consensus/
function getRating(address _addr) public view returns (uint) { return ratings[_addr]; }
3,346,472
/** *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...
Checks whether a given address is an administrator. _admin The address to check return True if the address is an admin, false otherwise./
function _addAdmin(address _admin) internal { admins.add(_admin); emit AdminAdded(_admin); }
8,015,443
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import {MultiRateLimited} from "./MultiRateLimited.sol"; import {IGlobalRateLimitedMinter} from "./IGlobalRateLimitedMinter.sol"; import {CoreRef} from "./../refs/CoreRef.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; /// @n...
add an authorized rateLimitedAddress contract rateLimitedAddress the address whose buffer and rate limit per second will be set _rateLimitPerSecond the new rate limit per second for this rateLimitedAddress _bufferCap the new buffer cap for this rateLimitedAddress
function updateAddress( address rateLimitedAddress, uint112 _rateLimitPerSecond, uint112 _bufferCap ) external override addressIsRegistered(rateLimitedAddress) hasAnyOfTwoRoles(TribeRoles.ADD_MINTER_ROLE, TribeRoles.GOVERNOR) { if (core().hasRo...
13,409,596
pragma solidity ^0.7.6; pragma abicoder v2; import {TokenInterface} from "../../../common/interfaces.sol"; import {DSMath} from "../../../common/math.sol"; import {Basic} from "../../../common/basic.sol"; import "./interface.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import "@uniswap/v3-c...
Mint function which interact with Uniswap v3/
function _mint(MintParams memory params) internal returns ( uint256 tokenId, uint128 liquidity, uint256 amountA, uint256 amountB ) { (TokenInterface _token0, TokenInterface _token1) = changeEthAddress( params.tokenA, ...
13,029,878
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./IConversionPathFinder.sol"; import "./utility/ContractRegistryClient.sol"; import "./converter/interfaces/IConverter.sol"; import "./converter/interfaces/IConverterAnchor.sol"; import "./converter/interfaces/IConverterRegistry.sol";...
updates the anchor token Requirements: - the caller must be the owner of the contract/
function setAnchorToken(IERC20 newAnchorToken) external ownerOnly { _anchorToken = newAnchorToken; }
7,282,891
./partial_match/56/0x2C1000521665392d1d57DBD625E7BF13e766eBDf/sources/ToppingBar.sol
Deposit LP tokens to MasterChef for DONUTS allocation.
function deposit(uint256 _pid, uint256 _amount) public { require (_pid != 0, 'deposit DONUTS by staking'); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user...
11,039,461
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ /** DOGE APE $DOPE */ pragma solidity ^0.8.9; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ funct...
SPDX-License-Identifier: Unlicensed
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint...
7,667,266
// SPDX-License-Identifier: MIT // Developed by KG Technologies (https://kgtechnologies.io) pragma solidity 0.8.12; import "@openzeppelin/contracts/access/Ownable.sol"; import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /** * @notice Represents MetaTriad Smart Contract */ con...
Caculates the Triads left from phase one sale/
function phaseOneLeft() public view returns(uint256) { if (phaseOneMaxSupply >= boughtPermissioned[1]) { return phaseOneMaxSupply - boughtPermissioned[1]; return 0; } }
10,178,713
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./spec_interfaces/IElections.sol"; import "./spec_interfaces/IDelegations.sol"; import "./spec_interfaces/IGuardiansRegistration.sol"; import "./spec_interfaces/ICommittee.sol"; import "./spec_interfac...
Handles a readyForCommittee notification may be called with either the guardian address or the guardian's orbs address notifies the committee contract that will add the guardian if qualified guardian is the guardian ready for committee
function _readyForCommittee(address guardian) private { require(!isVotedOut(guardian), "caller is voted-out"); emit GuardianStatusUpdated(guardian, true, true); uint256 effectiveStake = getGuardianEffectiveStake(guardian, settings); committeeContract.addMember(guardian, effectiveStake, certificationContract....
7,296,651
./full_match/80001/0x144e1C4a983f352f691a14A590B4a01faF8CCf09/sources/contracts/ERC20EscrowToPay.sol
Locks the request funds for the payer to recover them after 12 months and cancel any emergency claim. _paymentRef Reference of the Invoice related. Uses modifiers OnlyPayer, IsInEscrow and IsNotFrozen. unlockDate is set with block.timestamp + twelve months../
function freezeRequest(bytes memory _paymentRef) external OnlyPayer(_paymentRef) IsInEscrow(_paymentRef) IsNotFrozen(_paymentRef) { if (requestMapping[_paymentRef].emergencyState) { requestMapping[_paymentRef].emergencyState = false; requ...
5,670,101
/** *Submitted for verification at BscScan.com on 2021-10-28 */ /** *Submitted for verification at arbiscan.io on 2021-09-22 */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.2; interface ISushiswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); eve...
calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint160(uint256(keccak256(abi.encodePacked( hex'ff', factory, keccak2...
1,038,040
./partial_match/80001/0xBa7bEe8eFA34e2B148aE2E915B4d4c000AB6251e/sources/project_/contracts/QBE.sol
set QBEAuthorization contract address
function setAuthorization(address _auth) external onlyOwner { auth = QBEAuthorization(_auth); }
8,805,593
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "../../openzeppelin/contracts/math/SafeMath.sol"; import "../../openzeppelin/contracts/math/SignedSafeMath.sol"; import "../../openzeppelin/contracts/utils/Address.sol"; import "../../openzeppelin/contracts/utils/Reent...
Update the filled position amount of the order. orderHash The hash of the order. amount The changed amount of filled position./
function _fillOrder(bytes32 orderHash, int256 amount) internal { _orderFilled[orderHash] = _orderFilled[orderHash].add(amount); emit FillOrder(orderHash, amount); }
1,756,473
/** *Submitted for verification at Etherscan.io on 2019-12-27 */ /** Copyright 2019 PoolTogether LLC 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 version...
Pauses all deposits into the contract. This was added so that we can slowly deprecate Pools. Users can continue to collect rewards, but eventually the Pool will grow smaller./
function pause() public unlessPaused onlyAdmin { paused = true; emit Paused(msg.sender); }
14,091,958
./partial_match/1/0x9641da0512A21B737303DDD4300c3c946411b8a0/sources/MintedTokenCappedCrowdsaleExt.sol
start time should be greater then end time of previous tiers
function setStartsAt(uint time) onlyOwner { assert(!finalized); assert(isUpdatable); assert(time <= endsAt); assert(now <= startsAt); CrowdsaleExt lastTierCntrct = CrowdsaleExt(getLastTier()); if (lastTierCntrct.finalized()) throw; uint8 tierPosition = getTierPosition(this); for (ui...
3,933,280
pragma solidity 0.4.19; /** * @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; ...
Add allocation amount to investor addresses Only the owner of this contract - the crowdsale can call this function Split half to be locked by timelock in vault, the other half to be released on vault unlock _investor Investor address _amount Amount of tokens to add/
function allocateInvestorBonusToken(address _investor, uint256 _amount) public onlyOwner { require(!vaultUnlocked); require(!vaultSecondaryUnlocked); uint256 bonusTokenAmount = _amount.div(2); uint256 bonusLockedTokenAmount = _amount.sub(bonusTokenAmount); balances[_investor] = balances[_investo...
1,836,634
pragma solidity ^0.4.18; contract Ownable { address public owner; function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { if (newOwner != addres...
Gets hash of an order for `eth_sign`
function hashOrder( uint8 _order, address _token, uint _nonce, uint _price, uint _amount, uint _expire ) private view returns (bytes32) { return keccak256( "\x19Ethereum Signed Message:\n32", keccak256(this, _order, _token, _nonce, _price, _amount, _expire) ...
1,325,874
//Address: 0xb9de1a42f46c3584ab82099e41bd33f90c8025c8 //Contract name: EnjinGiveaway //Balance: 0 Ether //Verification Date: 12/28/2017 //Transacion Count: 25 // CODE STARTS HERE pragma solidity ^0.4.13; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { ...
Add a new payee to the contract. _payee The address of the payee to add. _shares The number of shares owned by the payee./
function addPayee(address _payee, uint256 _shares) internal { require(_payee != address(0)); require(_shares > 0); require(shares[_payee] == 0); payees.push(_payee); shares[_payee] = _shares; }
12,539,773
pragma solidity ^0.4.24; /** * @title ERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface ERC165 { /** * @notice Query if a contract implements an interface * @param _interfaceId The interface identifier, as specified in ERC-165 * @dev Interface identification is spec...
Function to buy image from Marketplace _imageId is Id of image we are going to buy
function buy(uint _imageId) public payable { require(isImageOnSale(_imageId)); require(msg.value >= sellAds[_imageId].price); removeOrder(_imageId); address _creator; address _imageOwner = digitalPrintImageContract.ownerOf(_imageId); (, , _creator, ,) = digitalPrint...
7,621,483
./full_match/43114/0x4589876C7CE584b772c2C90DF863B42804AE11c7/sources/contracts/AVAXINU.sol
Authorize address. Owner only/
function authorize(address adr) public onlyOwner { authorizations[adr] = true; }
4,520,218
pragma solidity ^0.5.12; contract ContestsHandler { struct Contest { string id; uint256 buyin; mapping(address => bool) participants; mapping(address => bool) paidParticipants; } uint256 public contestsCount = 0; mapping(uint => Contest) public contests; mapping(str...
create a new contestthis starts with 1 because when we check if a contest ID exists and it does not, then it will return 0. So no contest on index zero is allowed.
function createContest(string _contestId, uint256 _buyin) public { contestsCount = contestsCount+1; contests[contestsCount] = Contest(_contestId, _buyin); contestsIndices[_contestId] = contestsCount; }
1,789,170
pragma solidity >=0.4.24 <0.6.0; import "./LeasableCar.sol"; import "./LeaseAgreement.sol"; import "./TimeMachine.sol"; /** @title Lease Agreement Executor * @author Adnan (adnan214@github) */ // // TODO: Split this up into multiple files. It huge. // TODO: Move external/physical interaction code // contract A...
Accepts the driver's payment Payable. Updates the driver's in contract balance. Triggers DriverBalanceUpdated and DriverOverBalance events/ pay off as much of 'driver_over_balance' possible as needed
function driverPayment() public payable driver_only("Only the driver can make payments!") { driver_balance += msg.value; emit DriverBalanceUpdated(the_car, the_driver, driver_balance); if (driver_over_balance > 0) { if (driver_balance >= driver_ov...
7,295,955
./partial_match/42/0xb1ae3AC28a49F8fbbE2C4c5826d5B36327A77497/sources/CeresTestPresaleStage1.sol
unlock contract early
function unlock() public onlyOwner { ends = 0; paused = true; }
3,303,985
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; import './provableAPI_0.6.sol'; // Interfaces interface ISwappToken { function currentSwappDay() external view returns (uint64); function approve(address _spender, uint256 _value) external returns (bool success); function mintSupply(address _investo...
Allows to mint tokens for specific investment day recommended batch size is up to 50 addresses per call _investmentDay processing investment day _investorBatchFrom batch starting index _investorBatchTo bach finishing index/
function payoutInvestmentDayBatch( uint256 _investmentDay, uint256 _investorBatchFrom, uint256 _investorBatchTo ) external afterUniswapTransfer onlyFundedDays(_investmentDay) { require( _investorBatchFrom < _investorBatchTo, 'SWAPP: incorrect investment ba...
6,013,290
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol
Copies `size` bytes from returndata starting at `src` to memory at `dst`.
function copy( ReturndataPointer src, MemoryPointer dst, uint256 size ) internal pure { assembly { returndatacopy(dst, src, size) } }
3,218,177
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import "./uniswapv2/interfaces/IU...
Withdraw token. recipient Address who receive staked token. amount Token amount.
function withdrawTo(address recipient, uint256 amount) external nonReentrant farmOpen { _withdraw(msg.sender, recipient, amount); }
1,609,494
/** *Submitted for verification at Etherscan.io on 2021-03-17 */ pragma solidity >=0.6.0 <0.8.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 accesse...
Function returns back a stringified JSON array with tokenIDs between lower bound and upper bound token data including both the bounds
function getImages(uint256 lowerBound, uint256 upperBound) public view returns (string memory){ "Lower Bound cannot be less than or equal to 0" ); "Upper Bound cannot be greater than minted token" ); "Lower Bound cannot be greater than upperBound" ); ...
6,685,062
pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) ...
Handling the amount of contribution and cap logic. Internal function. return Wei successfully contributed. account the new contribution close sale in softCapTime seconds after reaching softCap event for hard cap reached
function handleContribution(address _beneficiary, uint256 _amount, uint256 _time, bytes memory _whitelistSign) internal returns (uint256) { require(_beneficiary != address(0)); uint256 weiToCap = howMuchCanXContributeNow(_beneficiary); uint256 weiAmount = uint256Min(weiToCap, _amount); ...
2,281,528
/** *Submitted for verification at Etherscan.io on 2021-12-15 */ // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.0 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 pri...
Set the base token URI/
function setBaseTokenURI(string memory baseURI) external onlyOwner { _baseTokenURI = baseURI; }
6,574,779