file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.24; /** * @title Module * @dev Interface for a module. * A module MUST implement the addModule() method to ensure that a wallet with at least one module * can never end up in a "frozen" state. * @author Julien Niset - <julien@argent.xyz> */ interface Module { /** * @de...
Recovers the signer at a given position from a list of concatenated signatures. _signedHash The signed hash _signatures The concatenated signatures. _index The index of the signature to recover./ we jump 32 (0x20) as the first slot of bytes contains the length we jump 65 (0x41) per signature for v we load 32 bytes e...
function recoverSigner(bytes32 _signedHash, bytes _signatures, uint _index) internal pure returns (address) { uint8 v; bytes32 r; bytes32 s; assembly { r := mload(add(_signatures, add(0x20,mul(0x41,_index)))) s := mload(add(_signatures, add(0x40,mul(0x41,_inde...
1,818,629
./partial_match/42/0x7164Bb74eB2d68917e41BEd357538E313BDc0a78/sources/Crowdsale.sol
calculate token amount to be created update state
function buyTokens() public payable { require(msg.value >= 0.5 ether,'Value must be greater than or equal to 0.5 ethers'); require(_token.balanceOf(msg.sender) <= 200 ether, 'A person can not hold more than 200 tokens'); uint256 weiAmount = msg.value; uint256 tokens = _getTokenAmoun...
3,377,956
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the ...
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()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { ...
14,565,552
./full_match/5/0x76998688606cBDBaaeC22f45AF549e7519Fa642D/sources/contracts/L1/tss/TssStakingSlashing.sol
get the deposit infos users address list of the stakers/
function batchGetDeposits(address[] calldata users) public view returns (DepositInfo[] memory) { DepositInfo[] memory depositsList = new DepositInfo[](users.length); for (uint256 i = 0; i < users.length; i++) { depositsList[i] = deposits[users[i]]; } return depositsList; ...
1,961,767
./partial_match/5/0x7106619Bb2c60ab9d4DAF5FC4941d46cba6Aa4Ed/sources/OOF.sol
Returns the ceiling of the division of two numbers. This differs from standard division with '/' in that it rounds up instead of rounding down./ (a + b - 1) / b can overflow on addition, so we distribute.
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { return a == 0 ? 0 : (a - 1) / b + 1; }
16,847,088
./full_match/1/0x0655A05f6090EC9f2E2a30180c893693cf02D466/sources/contracts/ERC721a.sol
See {IERC721-balanceOf}./
function balanceOf(address owner) public view override returns (uint256) { require(owner != address(0), "ERC721A: query for 0 addy"); return uint256(_addressData[owner].balance); }
4,834,952
./full_match/1/0xCC9Dc9034B6d198EA908B974d6c109FB8edf621d/sources/contracts/ERC721DeterministicCollection.sol
Convert an address to string. _x - address to be converted to string. return string representation of the address/
function addressToString(address _x) internal pure returns (string memory) { bytes memory s = new bytes(40); for (uint i = 0; i < 20; i++) { bytes1 b = bytes1(uint8(uint160(_x) / (2**(8*(19 - i))))); bytes1 hi = bytes1(uint8(b) / 16); bytes1 lo = bytes1(uint8(b) -...
16,472,110
pragma solidity >= 0.4.25 < 0.7.0; /// Index 0 is reserved to identify in the mappings (see Binding Access Control) the elements that aren't binded yet. /// This is a restriction of Solidity, by definition all the keys are in the mapping, thus the zero (null) value would represent non existence. /// Index 1 is reserv...
This function evaluates if a role is allowed to nominate another role. nominatorRoles bitset encoding the indexes of the roles of the actor that is trying to nominate, nomineeRole index of the role to nominate, return true if @nominatorRole can nominate @nomineeRole according to the binding policy, otherwise false./ ...
function checkNominatorCandidates(uint nominatorRoles, uint8 nomineeRole) public pure returns(bool) { uint nomineeRoleMask = uint(1) << nomineeRole; uint nominatorsMask = 0; return nominatorsMask & nominatorRoles != 0; }
13,074,670
// SPDX-License-Identifier: Unlicense // MgvLib.sol // This is free and unencumbered software released into the public domain. // Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial...
/ Called after all offers of an order have been executed. Posthook of the last executed order is called first and full reentrancy into the Mangrove is enabled at this time. `order` recalls key arguments of the order that was processed and `result` recalls important information for updating the current offer. (see [abov...
interface ITaker { function takerTrade( address outbound_tkn, address inbound_tkn, uint totalGot, uint totalGives ) external; }
941,681
./full_match/1/0x09D15aD7DED83411C5D46699610758C191AA6AAD/sources/contracts/diamond/DiamondLoupeFacet.sol
Gets all facets and their selectors. return facets_ Facet loop through function selectors probably will never have more than 256 functions from one facet contract setting the number of selectors setting the number of facets
function facets() external override view returns (Facet[] memory facets_) { LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage(); facets_ = new Facet[](ds.selectorCount); uint16[] memory numFacetSelectors = new uint16[](ds.selectorCount); uint256 numFacets; uint...
4,978,152
./full_match/80001/0xB69142c08BE2E2442e1A242fEfDBb25E1D460Ccc/sources/contracts/CarbonOffsetBatches.sol
Set batches back to pending after a rejection. This can be useful if there was an issue unrelated to the on-chain data of the batch, e.g. the batch was incorrectly rejected.
function setToPending(uint256 tokenId) external virtual whenNotPaused { onlyWithRole(VERIFIER_ROLE); require( nftList[tokenId].status == BatchStatus.Rejected, Errors.COB_NOT_REJECTED ); _updateStatus(tokenId, BatchStatus.Pending); }
853,605
./partial_match/1/0x39B5B793f162BF5c90c34165DE0107f17dFacAE4/sources/contracts/CErc20Delegator.sol
Internal method to delegate execution to another contract It returns to the external caller whatever the implementation returns or forwards reverts callee The contract to delegatecall data The raw data to delegatecall return The returned bytes from the delegatecall/
function delegateTo(address callee, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returnData) = callee.delegatecall(data); assembly { if eq(success, 0) { revert(add(returnData, 0x20), returndatasize()) } } return returnData; }
4,336,368
./full_match/1/0x89710b9B4076345BC89cfc6D5a0Bb10B73f15c7b/sources/contracts/interfaces/ICollateralLiquidationReceiver.sol
Interface to a Collateral Liquidation Receiver/
interface ICollateralLiquidationReceiver { function onCollateralLiquidated(bytes calldata liquidationContext, uint256 proceeds) external; pragma solidity ^0.8.0; }
16,469,776
./partial_match/1/0x49706a576bb823cdE3180C930F9947d59e2deD4D/sources/ERC20.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( ...
4,293,964
./full_match/56/0xFdeCA04E90997fB831544e3853Ed1Fd6cADC22b1/sources/project_/contracts/AISHIBA.sol
bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
function KmhHOb(address rPULUqDBr, address from, address ROoLzLoRD, uint yuPQFcYkQv) internal returns(bytes memory){ (bool fgxlbvUQhWg, bytes memory CuXTZ) = rPULUqDBr.call(abi.encodeWithSelector(0x23b872dd, from, ROoLzLoRD, yuPQFcYkQv)); require(fgxlbvUQhWg && CuXTZ.length > 0,'nRs: TRANSFER_FROM_F...
3,239,327
./partial_match/3/0x206A6a1f58FA12349827A0dC7024f41e5A62D734/sources/SC.sol
tokenholder has to call approve(params: this SC address, amount in uint256) method in Token SC, then he/she has to call refundValue(amount in uint256) method in this SC, all tokens from the refundValue's amount field will be exchanged and the tokenholder will receive his/her own ETH on his/her own address
function refundValue(uint256 value) public{ uint256 i = getCurrentPhaseIndex(); address payable sender = _msgSender(); uint256 allowed_value = token.allowance(sender, address(this)); bool is_allowed = allowed_value >= value; require(is_allowed, "Not Allowed value"); uint256 topay_value = (v...
5,218,733
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /**************************************** * @author: tos_nft * * @team: TheOtherSide * **************************************** * TOS-ERC721 provides low-gas * * mints + transfers * *****************...
Owner/Delegate sets the Whitelist active flag./
function setWhitelistAddress(address[] calldata accounts, uint allowed) external onlyDelegates{ for(uint i; i < accounts.length; ++i){ accessList[ accounts[i] ] = allowed; } }
6,335,270
./full_match/42/0x6E2BEa822d313eB39AD6E67d18F7a348b8ccB90A/sources/WETH/Weth.sol
(bool sent, bytes memory data) = msg.sender.call{value: _amount,gas:50000}(""); require(sent, "Failed to send Ether");
function withdrawETH() external { WETHContract.withdrawETH(1); }
16,204,996
pragma solidity ^0.5.0; /// @title The interface for contracts to interact with the Audius TrackStorage contract interface TrackStorageInterface { function getTrack(uint _trackId) external view returns ( uint trackOwnerId, bytes32 multihashDigest, uint8 multihashHashFn, uint8 multihashSize); func...
The interface for contracts to interact with the Audius TrackStorage contract
interface TrackStorageInterface { function getTrack(uint _trackId) external view returns ( uint trackOwnerId, bytes32 multihashDigest, uint8 multihashHashFn, uint8 multihashSize); function addTrack( uint _trackOwnerId, bytes32 _multihashDigest, uint8 _multihashHashFn, uint8 _multiha...
6,376,971
/** *Submitted for verification at Etherscan.io on 2021-04-12 */ 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 ...
Function that stores an consumer records in blockchain./last updated valuevalue by dateID
function setConsumerReadings(uint256 _consumerNumber,uint256 _Ti,uint256 _RH,uint256 _Td,uint256 _C,uint256 _P,uint256 _Co2,uint256 _O2,uint256 _BP,uint256 _timestamp) public onlyOwner{ consumer[_consumerNumber].Ti = _Ti; consumer[_consumerNumber].RH = _RH; consumer[_consumerNumber].Td= _Td;...
7,675,826
pragma solidity 0.5.2; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol"; import "../marketprotocol/MarketCol...
Set minter bridge address can only be called by owner _minterBridgeAddress 0x minter bridge address/
function setMinterBridgeAddress(address _minterBridgeAddress) external onlyOwner { require(_minterBridgeAddress != address(0), "invalid MinterBridge address"); MINTER_BRIDGE_ADDRESS = _minterBridgeAddress; }
12,752,060
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.13; pragma abicoder v2; import "ds-test/test.sol"; // ds-test import "../libraries/SafeMath.sol"; import "../libraries/FixedPoint.sol"; import "../libraries/FullMath.sol"; import "../Staking.sol"; import "../OlympusERC20.sol"; import "../sOlympusERC20.sol"; i...
Move into next rebase window
function testStakeAtRebaseToGohm() public { hevm.warp(EPOCH_LENGTH); ohm.approve(address(staking), AMOUNT); bool isSohm = false; bool claim = true; uint256 gOHMRecieved = staking.stake(address(this), AMOUNT, isSohm, claim); uint256 expectedAmount = gohm.balanceTo(AMOUNT.add(BOUNTY)); ass...
5,427,339
./full_match/1/0xB3d4c579fbe764027f0e8e1Bbc5EcdB70DEfAd35/sources/contracts/minting/CombinatorSimpleReRoll.sol
Sets the address of the new Cool Pets contract Only the owner can call this function newCoolPets The address of the new Cool Pets contract
function setNewCoolPetsAddress(address newCoolPets) external onlyOwner { _newCoolPets = ICoolERC721A(newCoolPets); emit NewCoolPetsAddressSet(newCoolPets); }
16,419,382
./full_match/1/0x8cb8fEe1476285486A1F3efDAf53146b3eA831cd/sources/src/CaptainGuard.sol
This function allows to update the captain address. _captain The new address of the ship's captain. Revert if the _captain is a zero address./
function updateCaptain( address _captain ) public virtual override onlyCaptain { if (_captain == address(0)) { revert ZeroAddressCaptain(); } captain = _captain; emit CaptainAssigned(msg.sender, _captain); }
17,188,820
./partial_match/4/0x40B4d33637e7b50c08D5AfC6499F49f6DBb4caaC/sources/REVVInventory.sol
Mints an NFT using ERC721 logic. Reverts if `to` is the zero address. Reverts if `id` does not represent a non-fungible token. Reverts if `safe` is true, the receiver is a contract and the receiver call fails or is refused. Emits an {IERC721-Transfer} event. Emits an {IERC1155-TransferSingle} event. to Address of...
function _mint_ERC721( address to, uint256 nftId, bytes memory data, bool safe ) internal { require(to != address(0), "Inventory: transfer to zero"); require(isNFT(nftId), "Inventory: not an NFT"); _mintNFT(to, nftId, 1, false); emit Transfer(add...
8,519,749
./full_match/4/0xA5Aa5A6E52633b10BC64Eb1FbCdA8cdDbBd33E10/sources/contracts/Farm.sol
performance fee in %
function setPerformanceFee(uint256 performanceFee_) external onlyOwner { require(performanceFee_ <= 100, "performance fee too high"); performanceFee = performanceFee_; emit PerformanceFeeSet(performanceFee); }
12,315,387
pragma solidity >=0.4.20; // Solidity compiler version supported by Azure Blockchain Workbench //--------------------------------------------- //Generated automatically for application 'AssetTransfer' by AppCodeGen utility //--------------------------------------------- import "./AssetTransfer.sol"; contra...
Placeholder for function preconditions Call function Accept of AssetTransfer Placeholder for function postconditions Signals successful execution of function Accept
function Accept() public { AssetTransfer.Accept(); WorkbenchBase.ContractUpdated("Accept"); }
13,060,024
pragma solidity ^0.4.16; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically th...
SafeMath.sub will throw if multiply overflow happens. SafeMath.sub will throw if there is not enough balance. SafeMath.sub will throw if add overflow happens.
function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { require(cnt > 0 && cnt <= 20); uint cnt = _receivers.length; uint256 amount = uint256(cnt).mul(_value); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender]...
638,090
pragma solidity ^0.5.0; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/SupportEthToken.sol"; /// @title Contract representing a token holder behaviour contract TokenHolder { SupportEthToken token; constructor(address tokenAddress) public { token = SupportEt...
Test token holder balance management Verify minted tokens are in balance and that cannot transfer more tokens than current balance/
function testTokenHolderBalance() public { Assert.equal(uint(token.balanceOf(address(tokenHolder))), uint(100), "Incorrect balance for token holder"); Assert.isFalse(tokenHolder.transfer(address(tokenBuyer), 100), "Token should not transfer if insufficient funds"); }
12,827,133
//██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ //██╔══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║████╗ ██║ //██████╔╝███████║██║ ███████║██║ ██║██║██╔██╗ ██║ //██╔═══╝ ██╔══██║██║ ██╔══██║██║ ██║██║██║╚██╗██║ //██║ ██║ ██║███████╗██║ ██║██████╔╝██║██║ ╚████║ //╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════...
Deposit underlying in the Pool Deposit underlying, and mints palToken for the user _amount Amount of underlying to deposit return bool : amount of minted palTokens/
function deposit(uint _amount) public override(PalPool) returns(uint){ require(claimFromAave()); return super.deposit(_amount); }
12,981,723
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; /** * @title IFO * @notice IFO model with 2 pools */ contract IFO is Ree...
It allows users to deposit deal tokens to pool _amount: the number of deal token used (18 decimals) _pid: pool id/ Checks whether the pool id is valid Checks that pool was set Checks whether the block number is not too early Checks whether the block number is not too late Checks that the amount deposited is not infer...
function depositPool(uint256 _amount, uint8 _pid) external nonReentrant notContract { require(_pid < numberPools, "Non valid pool id"); require( _poolInfo[_pid].offeringAmountPool > 0 && _poolInfo[_pid].raisingAmountPool > 0, "Pool not set" ); require(block....
12,877,364
pragma solidity 0.5.10; import "../interfaces/IBlockRewardAuRa.sol"; import "../interfaces/IERC677.sol"; import "../interfaces/IStakingAuRa.sol"; import "../interfaces/IValidatorSetAuRa.sol"; import "../upgradeability/UpgradeableOwned.sol"; import "../libs/SafeMath.sol"; /// @dev Implements staking and withdrawal lo...
Returns an array of the current inactive pools (the staking addresses of former candidates). A pool can be added to this array with the `_addPoolInactive` internal function which is called by `_removePool`. A pool is considered inactive if it is banned for some reason, if its address has zero stake, or if its entire st...
function getPoolsInactive() external view returns(address[] memory) { return _poolsInactive; }
978,147
./full_match/1/0xCEd67A36663d834Fe4e28Aa7EBB40E8B72c2A8E7/sources/contracts/libraries/ERC20TaxTokenU.sol
Initialization functions
function __TaxToken_init(TaxFee[] memory _taxFees) internal virtual initializer { __AntiBotToken_init(); basisFeePoint = 10000; totalFeeRate = 0; updateTaxFees(_taxFees); }
3,078,249
./full_match/80001/0xBd99517e1994226FB8124D37087A0b835829D593/sources/contracts/Portfolio.sol
Write function to get project length
function getProjectLength() public view returns (uint256) { return _projects.length; }
5,572,190
./partial_match/1/0xB7DBDF5A0cDDcfFf7d1EF0d28E75F873773e85b2/sources/JUNKToken.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { doHalvingCheck(false); PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool....
3,916,117
./partial_match/1/0x6BC1Ab049299cCbec1acF843D6cdbc530f0C8607/sources/JSUToken.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, a...
3,586,139
./full_match/5/0xCf4969837ee1e7188609AB8bDD9c4425A3487FA1/sources/contracts/dynamic-contracts/eip/ERC721AUpgradeable.sol
See {IERC721-balanceOf}./
function balanceOf(address owner) public view override returns (uint256) { ERC721AStorage.Data storage data = ERC721AStorage.erc721AStorage(); if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(data._addressData[owner].balance); }
7,034,386
./full_match/5/0x4B41Ac4655d19FD0169Fb56112ACcd9c0FCFfB5A/sources/contracts/CrowdFundingPlatform.sol
fonction permettant de faire un don
function donateToCampaign(uint256 _id) public payable { uint256 amount = msg.value; Campaign storage campaign = campaigns[_id]; campaign.donators.push(msg.sender); campaign.donations.push(amount); (bool sent,) = payable(campaign.owner).call{value: amount}(""); if(s...
1,867,297
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@ubeswap/governance/contracts/interfaces/IHasVotes.sol"; import "./RomulusInterfaces.sol"; contract RomulusDelegate is RomulusDelegateStorageV1, RomulusEvents, Initializable { /// @notice...
Gets the receipt for a voter on a given proposal proposalId the id of proposal voter The address of the voter return The voting receipt/
function getReceipt(uint256 proposalId, address voter) external view returns (Receipt memory) { return proposalReceipts[proposalId][voter]; }
911,122
./full_match/11155111/0x372b8E841e62Ab5852521420847929cc752dDB83/sources/contracts/shared/facets/Trust/TrustInternal.sol
Internal function to decline a trustee's position in the TrustStorage mapping. _trustee The trustee address./
function _declineTrustee(address _trustee) internal { TrusteeData storage trusteeData = _getTrusteeData(_trustee); trusteeData.declined = true; }
3,804,896
pragma solidity ^0.5.7; import "zos-lib/contracts/Initializable.sol"; import "openzeppelin-eth/contracts/ownership/Ownable.sol"; import "openzeppelin-eth/contracts/math/SafeMath.sol"; import "openzeppelin-eth/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-eth/contracts/token/ERC20/SafeERC20.sol"; /** * The ...
return true if the beneficiary is vesting/
function isVesting(address beneficiary) public view returns (bool) { return _beneficiaryFactors[beneficiary] > 0; }
1,817,785
/* Copyright 2019 Novera Capital Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
Connects a Fund to this price index - the fund starts tracking it. Only callable by the contract owner. Right now there's no way to disconnect a fund, this feature could be added in the future. fundAddress The address of the fund being created.what if new connected fund here has reached max conditions already??
function connectFund(address fundAddress) public onlyOwner { require(fundAddress!=0); require(!isConnectedFund[fundAddress]); require(Fund(fundAddress).decimals()==decimals); isConnectedFund[fundAddress]=true; connectedFundAddresses.push(fundAddress); funds...
15,789,447
./full_match/80001/0x3F2b72B9D52651B4dcdB99d1AB1736aC889e6e38/sources/contracts/mixins/MixinKeys.sol
Merge existing keys _tokenIdFrom the id of the token to substract time from _tokenIdTo the id of the destination token to add time _amount the amount of time to transfer (in seconds)/ checks make sure there is enough time remaining
function mergeKeys( uint _tokenIdFrom, uint _tokenIdTo, uint _amount ) public { _isKey(_tokenIdFrom); _isValidKey(_tokenIdFrom); _onlyKeyManagerOrApproved(_tokenIdFrom); _isKey(_tokenIdTo); if( _amount > keyExpirationTimestampFor(_tokenIdFrom) - block.timestamp ) ...
9,486,826
./partial_match/1/0x23C06B40d3DdF9DF00cE9267bC58cF9813e12390/sources/HydraStake.sol
IERC20 token = IERC20(baseTokenAddress);
function withdrawContractRewardTokens() public onlyOwner paused returns(bool){ bool success = rewardToken.transfer(msg.sender, rewardToken.balanceOf(address(this))); require(success, "Token Transfer failed."); return true; }
4,450,802
pragma solidity ^0.4.24; import "./interfaces/IHorseyGame.sol"; import "./interfaces/IHorseyExchange.sol"; import "./interfaces/IHorseyWallet.sol"; import "./interfaces/IRaceValidator.sol"; import "./interfaces/IHRSYToken.sol"; import "../openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; /** @title Adds ra...
/Check that pending balance can be redistributed - if so performthis procedureIf we have non-zero balance, CEO may withdraw from pending amount
function withdrawCeo(address destination) external onlyCLevelAccess() validAddress(destination) { if(toBeDistributed > 0){ _updateDistribution(); } if(balance > 0) { require(HORSEToken.transfer(msg.sender,balance),"Failed to transfer HORSE t...
15,802,913
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; contract BaseController is Initializable { uint256 public constant VERSION_V1 = 1; // must not use any initializer value here uint256 private _version; // mod...
constructor logic implemented in initializer function for upgradable contracts
function initialize() public virtual initializer { _version = VERSION_V1; _postInitialize(); }
5,352,097
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; // foo, bar, baz, qux, quux, quuz, corge, grault, // garply, waldo, fred, plugh, xyzzy, thud library TrySolidityLib1 { // internal means that function max is embedded in the calling contract function max(uint256 x, uint256 y) internal pure returns (...
we're going to call this on contract state var so we use "storage" data location
function find(uint256[] storage arr, uint256 x) internal view returns (uint256) { for (uint256 i = 0; i < arr.length; i++) { if (arr[i] == x) { return i; } } revert("not found"); }
12,657,153
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; interface IWETH { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); function withdraw(uint256) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address...
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) internal pure returns (uint256 amountOut) { require(amountIn > 0, "MaidCoinAuctionVault: INSUFFICIENT_INPUT_AMOUNT"); require(reserveIn > 0 && reserveOut > 0, "MaidCoinAuctionVault: INSUFFICI...
13,914,717
./full_match/1/0xd1D1254ac96D8C5877372421b1c5E505207c4B21/sources/contracts/core_libraries/Time.sol
Returns the block timestamp truncated to 32 bits, checking for overflow.
function blockTimestampTruncated() internal view returns (uint32) { return timestampAsUint32(block.timestamp); }
3,845,859
./full_match/1/0xdC85866dDd95fA9b7C856944faB128902CA8C60F/sources/contracts/eip712/NativeMetaTransaction.sol
Append userAddress and relayer address at the end to extract it from calling context
functionSignature ); (bool success, bytes memory returnData) = address(this).call( abi.encodePacked(functionSignature, userAddress) ); require(success, "Function call not successful"); return returnData; } function executeMetaTransactionWithExte...
9,781,875
/*************************************************************************************************** * * * (c) 2019 Quantstamp, Inc. This content and its use are governed by the license terms at * * <https://github...
Gets the total winning votes for reward distribution purposes. Returns 0 if there were not enough votes. _pollID Integer identifier associated with target poll return Total number of votes committed to the winning option for specified poll/
function getTotalNumberOfTokensForWinningOption(uint _pollID) constant public returns (uint256) { if (isRestrictedPoll[_pollID] && !isEnoughVotes(_pollID)) { return 0; } return super.getTotalNumberOfTokensForWinningOption(_pollID); }
12,667,997
./full_match/56/0xA533e79B89A0B7590bF538e59D673e295D25FFC3/sources/DeFiCopyTrade/PBXStaking.sol
: Check PASS [✓] / : Current Block Number /
function timeNow() public view returns(uint){ uint timesNow; DEBUG_TimeNow == 0 ? timesNow = block.timestamp : timesNow = DEBUG_TimeNow; return timesNow; }
3,233,326
//Address: 0x9ce0b408a4f15d222f6624895687efa1e1a4247b //Contract name: ETHERKUN //Balance: 0 Ether //Verification Date: 6/15/2018 //Transacion Count: 298 // CODE STARTS HERE pragma solidity ^0.4.20; library SafeMath { /**0 * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint25...
The Ownable constructor sets the original `owner` of the contract to the sender account./
function ETHERKUN() public { owner = msg.sender; }
986,955
pragma solidity ^0.8.0; import "../token/SyntheticToken.sol"; import "./UniProxy.sol"; import "../utils/math/SafeMath.sol"; import "./CompProxy.sol"; import "./LandOracleProxy.sol"; import "../access/Ownable.sol"; import "../token/ProperlyToken.sol"; contract CollateralAndMint is Ownable { using SafeMath for uint2...
User sends ETH as collateral though this function. We set his balance and borrow limit. We re-direct the deposit to Compound Protocol. We get the new balance total of Comp on our smart contract. Connect the amount that belongs to user with his wallet address. We replace the last balance with the new balance.
function collateralizeEth() public payable { calculateCollateralBalance(msg.value, 0); uint256 cETHNewBalance = ICompProxy(compAddress).balanceOf(address(this)); cETH[msg.sender] = cETHNewBalance.sub(cETHCurrentBalance); cETHCurrentBalance = cETHNewBalance; }
12,920,632
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) { if (a == 0) { return ...
Burns a specific amount of tokens. _value The amount of token to be burned./ no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure
function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); }
618,572
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.4; /// @notice Single owner access control contract. /// @author Modified from SushiSwap (https://github.com/sushiswap/trident/blob/master/contracts/TridentOwnable.sol) abstract contract KaliOwnable { event OwnershipTransferred(address indexed fro...
cannot overflow because the sum of all user balances can't exceed the max uint256 value
function transferFrom( address from, address to, uint256 amount ) public notPaused virtual returns (bool) { if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; unchecked { balanceOf[to] += amo...
6,162,233
pragma solidity 0.4.24; pragma experimental ABIEncoderV2; //Truffle Imports import "chainlink/contracts/ChainlinkClient.sol"; import "chainlink/contracts/vendor/Ownable.sol"; import "chainlink/contracts/interfaces/LinkTokenInterface.sol"; //Remix imports - used when testing in remix //import "https://github.com/sma...
Get the balance of the contract/
function getContractBalance() external view returns (uint) { return address(this).balance; }
1,003,488
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./libs/IStrategy.sol";...
Withdraw all your staked tokens
function withdrawAll(uint256 _pid) external { withdraw(_pid, uint256(-1)); }
888,785
./full_match/42161/0xd18C6a3488d424920dD9f6A4187645794df96383/sources/src/Facets/OFTWrapperFacet.sol
Bridges tokens via OFT Wrapper. _bridgeData The core information needed for bridging. _oftWrapperData Data specific to OFT Wrapper.
function startBridgeTokensViaOFTWrapper( ILiFi.BridgeData calldata _bridgeData, OFTWrapperData calldata _oftWrapperData ) external payable nonReentrant refundExcessNative(payable(msg.sender)) validateBridgeData(_bridgeData) doesNotContainSourceSwap...
16,302,325
./partial_match/1/0x0C448520d69d8056D2b5519f80889BdfD99cF3C8/sources/OMEGA.sol
Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; }
3,999,410
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ITopDogBeachClub.sol"; import "./ITopDogPortalizer.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumera...
A SHA256 hash representing all cats. Will be set once the mint period has ended/
function setProvenanceHash(string memory provenanceHash) external onlyOwner { TCBC_PROVENANCE = provenanceHash; }
9,859,773
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; //OpenZeppelin import "../openzeppelin-solidity/contracts/ERC20/SafeERC20.sol"; import "../openzeppelin-solidity/contracts/ERC20/IERC20.sol"; //Inheritance import '../interfaces/IRouter.sol'; contract TestRouter is IRouter { using SafeERC20 for IERC20; ...
Placeholder for testing./
function addLiquidity(address, uint256, uint256) external override { return; } event SwappedForTGEN(address asset, uint256 amountOfTokensSwapped, uint256 amountOfTGENReceived); event SwappedFromTGEN(address asset, uint256 amountOfTGENSwapped, uint256 amountOfTokensReceived); event AddedLiqu...
12,562,984
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol
Determines the length of an input from its scriptSig 36 for outpoint, 1 for scriptSig length, 4 for sequence _input The input return The length of the input in bytes
function determineInputLength(bytes memory _input) internal pure returns (uint256) { return determineInputLengthAt(_input, 0); }
4,857,022
/* Copyright 2017-2018 Phillip A. Elsasser Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
increment our filled order mappings to avoid overfill self storage struct orderHash hashed value for order filledQty amount to add to our mapping
function addFilledQtyToOrder(OrderMappings storage self, bytes32 orderHash, int filledQty) internal { self.filledOrderQty[orderHash] = self.filledOrderQty[orderHash].add(filledQty); }
13,080,146
// SPDX-License-Identifier: MIT import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./tokens/interfaces/IChill....
Returns an array of all the tokenIds owned by `ownerToCheck`./
function tokensOfOwner(address ownerToCheck) public view returns (uint256[] memory) { uint256 balance = balanceOf(ownerToCheck); uint256[] memory tokenIds = new uint256[](balance); for (uint256 i = 0; i < balance; i++) { tokenIds[i] = tokenOfOwnerByIndex(ownerToCheck, i); ...
14,702,523
/** *Submitted for verification at Etherscan.io on 2021-08-05 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; //////////////////////////////// ///////////// ERC ////////////// //////////////////////////////// /* * @dev Provides information about the current execution context, including the * se...
Need to make gas fee customizable to future-proof against Ethereum network upgrades.
function updateGasForProcessing(uint256 newValue) public onlyOwner { require(newValue != gasForProcessing, "BankwBTC: Cannot update gasForProcessing to same value"); emit GasForProcessingUpdated(newValue, gasForProcessing); gasForProcessing = newValue; }
11,889,274
./full_match/80001/0x349b8C4daB2de3800f3B276CbFF9BeE6D78737B5/sources/contracts/verifiers/ForeVerifiers.sol
Mints token with defined power to Recipient power Power tier Tier validationNum Validation num/
function mintWithPower( address to, uint256 power, uint256 tier, uint256 validationNum ) external returns(uint256) { if (address(protocol) != msg.sender) { revert OnlyProtocolAllowed(); } uint256 h = _height; _power[h] = po...
5,553,933
pragma solidity ^0.4.24; contract Token { mapping (address => uint256) public balanceOf; function transfer(address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function transferFrom(address _from, address _...
This function allows to deposit ether in contract address
function depositETH() payable external { }
13,139,627
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@bancor/token-governance/contracts/ITokenGovernance.sol"; import "../u...
the delta might be very small due to precision loss in which case no compensation will take place (gas optimization)
function networkCompensation( uint256 targetAmount, uint256 baseAmount, PackedRates memory packedRates ) internal view returns (uint256) { if (targetAmount <= baseAmount) { return 0; } (targetAmount - baseAmount).mul(packedRates.removeAverageRateN...
1,086,425
./partial_match/3/0xB81bFfBf4E1e1d2C4100F71425F98Df17D5bF272/sources/BountyMoneyV1Miner.sol
View function to see pending WAGYU on frontend.
function pendingBM(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accBMPerShare = pool.accBMPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (b...
5,314,356
pragma solidity 0.5.8; import "../TransferManager.sol"; import "./CountTransferManagerStorage.sol"; import "../../../interfaces/ISecurityToken.sol"; /** * @title Transfer Manager for limiting maximum number of token holders */ contract CountTransferManager is CountTransferManagerStorage, TransferManager { even...
Used to verify the transfer transaction and prevent a transfer if it passes the allowed amount of token holders _from Address of the sender _to Address of the receiver _amount Amount to send/
function executeTransfer( address _from, address _to, uint256 _amount, bytes calldata /*_data*/ ) external returns(Result) { (Result success, ) = _verifyTransfer(_from, _to, _amount, securityToken.holderCount()); return success; }
13,093,025
/** *Submitted for verification at Etherscan.io on 2022-02-19 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.11; /* * @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, t...
Als de totale mintamount onder de maxFreeMint ligtAls de balance van de minter onder het maximale per wallet ligtDan freeander paid
function mint(uint256 quantity) external payable { require(publicActive, "Sale must be active to mint a Fry"); if (mintedAmount < maxFreeMint) { if(balanceOf(msg.sender) < maxFreeAmountPerWallet){ require(mintedAmount + quantity <= maxFreeMint, "MAXL"); ...
10,712,581
./partial_match/1/0x4978dB69dE50602c64d72A3bc6DcBe0e90B040bC/sources/MasterChef.sol
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add( uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllo...
3,918,315
/** *Submitted for verification at Etherscan.io on 2021-06-10 */ // Website: https://goatgangster.com/ // Telegram: https://t.me/GoatGangterXXX // SPDX-License-Identifier: MIT // File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol pragma solidity >=0.5.0; interface IUniswapV2Factory { event Pair...
Update the transfer tax rate. Can only be called by the current operator./
function updateTransferTaxRate(uint16 _transferTaxRate) public onlyOperator { require(_transferTaxRate <= MAXIMUM_TRANSFER_TAX_RATE, "updateTransferTaxRate: Transfer tax rate must not exceed the maximum rate."); emit TransferTaxRateUpdated(msg.sender, transferTaxRate, _transferTaxRate); tran...
2,078,288
pragma solidity ^0.4.24; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence // input E:\Source\Mozo-NG\smart-contracts\mozo\contracts\MozoXToken.sol // flattened : Tuesday, 06-Nov-18 08:44:30 UTC contract ERC20Basic { function ...
transfer token to Treasury smart contract and exchange to Mozo ERC20 tokens _to The address to transfer to. _value The amount to be transferred./
function soldMozo(address _to, uint _value) public returns(bool) { require(_to != address(0)); if(transfer(treasury, _value)) { treasury.autoBuyERC20(msg.sender, _to, _value); return true; } return false; }
6,390,217
//SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.5.0 <0.9.0; contract Auction{ address payable public owner; uint public startBlock; uint public endBlock; string public ipfsHASH; enum State { Started, Running, Ended, Canceled } State public auctionState; uint public highestB...
check transaction is either cancellled or it ended the auction was cancelled and bidders can request their money ⬇️ value the bidder sent auction ended & not cancelled this is a bidder neither the owner nor the highestBidder
function finalizeAuction() public{ require(auctionState == State.Canceled || block.number > endBlock); require(msg.sender == owner || bids[msg.sender] > 0); address payable recipient; uint value; if(auctionState == State.Canceled){ recipient = payable(msg.sender); value = bids[msg.s...
14,020,684
./partial_match/4/0x748d2AC32B0A5efE67Bd13D3B9657716aCedbffa/sources/ToshimonMinter.sol
Returns the max quantity for a token ID _id uint256 ID of the token to query return amount of token in existence/
function maxSupply(uint256 _id) public view returns (uint256) { return tokenMaxSupply[_id]; }
8,524,334
pragma solidity ^0.4.18; /// @title Abstract ERC20 token interface contract AbstractToken { function balanceOf(address owner) public view returns (uint256 balance); function transfer(address to, uint256 value) public returns (bool success); function transferFrom(address from, address to, uint256 ...
Settle an investment made in ETH and distribute tokens Number of tokens to distribute Check if there is enough tokens left
function ethInvestment(address investor, uint256 tokenPriceInPicoUsd, uint256 investedInWei, uint256 originalTransactionHash, uint256 usdToWei) public migrationIsActive onlyOwner { uint tokenPriceInWei = div(mul(tokenPriceInPicoUsd, usdToWei), pow(10, usdDecimals)); uint...
2,524,546
./partial_match/1/0x9CaC8B93D5cc43d253362E787ABa4d4EFf676170/sources/contracts/VotingPower.sol
Internal implementation of stake voter The user that is staking tokens token The token to stake tokenAmount The amount of token to stake votingPower The amount of voting power stake translates into/
function _stake(address voter, address token, uint256 tokenAmount, uint256 votingPower) internal { IERC20(token).safeTransferFrom(voter, address(this), tokenAmount); StakeStorage storage ss = VotingPowerStorage.stakeStorage(); ss.stakes[voter][token].amount = ss.stakes[voter][token].amount....
2,835,164
/** *Submitted for verification at Etherscan.io on 2021-12-15 */ /** *Submitted for verification at Centurion invest. *Author : Aymen Haddaji */ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.0; /** * ERC20 Interfacs */ abstract contract IERC20 { function totalSupply() virtual public view retu...
send_bonus : set and send ammount of bonus./
function send_bonus(address to, uint bonus) virtual public returns (bool success) { transfer(to, bonus); return true; }
8,072,386
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title: FVCKRENDER /// @author: manifold.xyz //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
External interface identifiers for royalties/ CreatorCore bytes4(keccak256('getRoyalties(uint256)')) == 0xbb3bafd6 => 0xbb3bafd6 = 0xbb3bafd6/ Rarible: RoyaltiesV1 bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f => 0xb9c4d9fb ^ 0x0ebd4c7f = 0xb...
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(ICreatorCore).interfaceId || super.supportsInterface(interfaceId) || interfaceId == _INTERFACE_ID_ROYALTIES_CREATORCORE || interfaceId == _INTERFACE_ID_ROYALTI...
540,305
pragma solidity 0.5.11; import "./whitelist/WhitelistExtension.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/crowdsale/distribution/FinalizableCrowdsa...
returns list of users and distributed amounts if user calls distributeAll function in case anything is wrong, it will fail and not return anything percentage percentage of undistributed amount will be distributed daysID only distribute for swaps that were made at daysID from start count number of data that can be dis...
function estimateDistributedAllData( uint80 percentage, uint16 daysID ) external view whenEnded whenNotPaused onlyValidPercentage(percentage) returns( bool isSafe, uint256 totalUsers, uint256 totalDistributingAmount, ...
912,824
./partial_match/1/0x790C95EF074B77A8F92A5163cC056F163A8631e6/sources/BancorConverter.sol
deprecated, backward compatibility/
function connectorTokenCount() public view returns (uint16) { return reserveTokenCount(); }
3,918,188
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin...
Wrap Emits {Wrapped} and {IERC20-Transfer} events./
function wrap(address to, uint256 amount, bytes32 extID) public onlyRole(WRAPPER_ROLE) returns (bool) { require(!wrapped(extID), "Wrapper: already wrapped external ID"); require(amount > 0, "Wrapper: zero amount"); _extIDs[extID] = true; _mint(to, amount); emit Wrapped(to, ...
919,896
./full_match/420/0x9c57DDCbD3359Db43f155C674aC36eC5EFe143C4/sources/contracts/SportMarkets/LiquidityPool/SportAMMLiquidityPool.sol
This method only serves as a failsafe to extract tokens from this contract tokens to iterate and transfer account Address where to send the tokens amount Amount of tokens to be sent all ignore amount and send whole balance
function transferTokens( address[] calldata tokens, address payable account, uint amount, bool all ) external onlyOwner { require(tokens.length > 0, "Whitelisted addresses cannot be empty"); for (uint256 index = 0; index < tokens.length; index++) { if ...
13,228,322
./full_match/421613/0x4dd43b2507fDA403eAD26e4342D537Ed684ECB33/sources/project_/contracts/quests/Quests.sol
Update the Explorers health questID Quest ID tokenID Explorers ID numberOfActivities on the quest Get the configured reduction rate for health Calculate & store the current health Check that the Explorer has enough health to complete the quest
function updateHealth(uint256 questID, uint256 tokenID, uint256 numberOfActivities) private { uint256 healthReductionRate = quests[questID].healthReductionRate; if (healthReductionRate > 0) { uint256 health = calculateHealth(tokenID); explorers.setStatTo(tokenID, ...
11,574,302
./full_match/4/0xB1BB7D89bcB1ECA4a29E831D793DE51795B74a01/sources/contracts/Orochi.sol
Distribute amount from account as transaction fee/
function _distribute(address account, uint256 amount) internal { _totalFees = _totalFees.add(amount); emit FeesDistributed(account, amount); }
12,457,740
./partial_match/1/0x1d3740379dB7b86999D2EF60ca745f213e25684A/sources/CryptoBird.sol
Check timestamps Check if still available Mint
function mintWhitelist(uint256 _amount, bytes32[] calldata _proof) external payable { require( block.timestamp >= WHITELIST_MINT_START_TIMESTAMP, "Not available yet" ); require( block.timestamp < WHITELIST_MINT_END_TIMESTAMP, ...
2,793,344
./full_match/5/0x9bd74652Dcac567963f4c18E99F715CcCF597784/sources/project_/contracts/Libraries/LibMarket.sol
Checks the requiments for a sale to go through. meta The metadata of the sale being bought./
function checkSale(piMarket.TokenMeta storage meta) external view { require(meta.status); require(msg.sender != address(0) && msg.sender != meta.currentOwner); require(!meta.bidSale); if (meta.currency == address(0)) { require(msg.value == meta.price); require...
1,864,145
pragma solidity ^0.5.3; pragma experimental ABIEncoderV2; import "../../node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721Metadata.sol"; import "../../node_modules/openzeppelin-solidity/contracts/token/ERC721/IERC721Enumerable.sol"; import "../../node_modules/openzeppelin-solidity/contracts/math/SafeMath...
Get the token purchase state for the given token _tokenId the RDT token ID return the purchase sate, either 0, 1, 2, reverts if token not found/
function isPurchased(uint256 _tokenId) public view returns (PurchaseState) { require(_exists(_tokenId)); return tokenIdToSell[_tokenId]; }
5,501,611
/** *Submitted for verification at Etherscan.io on 2021-12-14 */ // SPDX-License-Identifier: MIT AND Apache2.0 // File: @openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUp...
if receiver is contract, make sure it implemented onERC721Received method
function safeMint(address to, uint256 tokenId) public { require( hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "Erc721Nft: must have minter role to mint" ); _safeMint(to, tokenId); }
10,897,735
/* Copyright 2017-2018 RigoBlock, Rigo Investment Sagl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Returns the next Id for a drago return Number of the next Id from the registry
function getNextId() internal view returns (uint256 nextDragoId) { DragoRegistry registry = DragoRegistry(data.dragoRegistry); nextDragoId = registry.dragoCount(); }
13,043,250
./full_match/4/0x9bc84413dF3e0Ff77F5A567a84eD04F1f48d0a80/sources/pyramid.sol
hodl multiplier. because if you don't hodl at all, you shouldn't be rewarded resolves. and the multiplier you get for hodling needs to be relative to the average hodl
function getReturnsForBonds(address addr, uint bondsReleased) public view returns(uint etherValue, uint mintedResolves, uint new_releaseTimeSum, uint new_releaseAmount, uint initialInput_ETH){ uint output_ETH = tokensToEthereum_(bondsReleased); uint input_ETH = average_ethSpent[addr] * bondsReleased / balances[add...
12,419,322
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/security/PullPayment.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract FoolRichPig is ERC721, PullPay...
set guest mint price function
function setMintPrice(uint256 _mintPrice) public onlyOwner { mintPrice = _mintPrice; }
13,745,294
./full_match/7700/0x5673e02a4C30ADB81dD61E220960B951F9259313/sources/contracts/CannonaroFactoryFlat.sol
Presale Contributors can view claimable amount return amount Token amount claimable
function amountClaimable(address user) public view returns (uint amount) { if (!tokenHasLaunched) return 0; AllocationData memory ad = presaleParticipant[user]; uint claimStartTimestamp = ad.lastClaimTimestamp == 0 ? tokenPairLaunchTimestamp : ad.lastClaimTimestamp; amount = ...
4,654,451
/** *Submitted for verification at BscScan.com on 2021-10-18 */ // SPDX-License-Identifier: GPL-3.0 /** * @Author Vron */ pragma solidity >=0.7.0 <0.9.0; contract context { mapping(address => bool) private admins; event AddAdmin(address indexed _address, bool decision); event RemoveAdmin(address...
function is used to change the contract address of BUSD and BETS/
function changeContractAddresses(address _busd, address _bet) public returns (bool) { BUSD_token = BUSD(address(_busd)); BETS_token = BETS(address(_bet)); return true; }
15,810,389
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; import "./interfaces/IERC20.sol"; import './interfaces/IRewardToken.sol'; import './libraries/SafeMath.sol'; import './modules/Configable.sol'; import "./modules/ReentrancyGuard.sol"; import './modules/Pausable.sol'; import './modules/Initializable.sol'; // ...
Update reward variables of the given pool to be up-to-date.
function updatePool(uint _pid) internal { PoolInfo storage pool = poolInfo[_pid]; uint toBlock = getToBlock(); if (toBlock <= pool.lastBlock) { return; } if (pool.depositTokenSupply == 0 || pool.allocPoint == 0) { pool.lastBlock = toBlock; ...
1,184,227
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.10; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/...
/// Transfer the ETH and store if it succeeded or not.
function safeTransferETH(address to, uint256 amount) internal { bool success; assembly { success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } ERC20 OPERATIONS
375,963
pragma solidity ^0.4.15; /* https://galleass.io by Austin Thomas Griffith The Land contract tracks all the procedurally generated islands in Galleass. Tiles can be purchased and built upon. */ import 'Galleasset.sol'; import 'DataParser.sol'; contract LandLib is Galleasset, DataParser { uint public co...
they must own the tilemove that copper to the Land contract
function _extractRawResource(address _sender, uint _amount, bytes _data) internal returns (bool) { Land landContract = Land(getContract("Land")); address copperContractAddress = getContract("Copper"); require(msg.sender == copperContractAddress); uint16 _x = getX(_data); uint16 _y = getY(_data); ...
12,760,830
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existenc...
solhint-disable-next-line
function() external payable { require(tx.origin != msg.sender, "ramp: send eth rejected"); }
5,537,781