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.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract SafeMath { uint constant DAY_IN_SECONDS = 86400; function mul(uint256 a, uint256 b) constant internal returns (uint256) { uint256 c = a * b; assert(a == 0 ||...
Initialises addresses of founders, tokens owner, escrow. Initialises balances of tokens owner _founder1 Address of founder 1 _escrow Address of escrow
function init(address _founder1, address _escrow) onlyManager { assert(currentState != State.Init); assert(_founder1 != 0x0); assert(_escrow != 0x0); founder1 = _founder1; escrow = _escrow; currentState = State.Init; }
12,981,624
./full_match/1/0xDB77d0d3d9bf850E38282eD8B5Fb410D02E75d2D/sources/contracts/kyc/KYCRegistryClient.sol
Sets the KYC registry requirement group for this client to check kyc status for _kycRequirementGroup The new KYC group/
function _setKYCRequirementGroup(uint256 _kycRequirementGroup) internal { uint256 oldKYCLevel = kycRequirementGroup; kycRequirementGroup = _kycRequirementGroup; emit KYCRequirementGroupSet(oldKYCLevel, _kycRequirementGroup); }
3,024,886
./full_match/1/0xe4D75e9b493458D032A5C3CC1eE9B0712C1EcE06/sources/contracts/bitcciCash.sol
Creates `amount` new tokens for `to`. See {ERC20-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./
function mint(address to, uint256 amount) public virtual { require(ERC20.totalSupply() + amount <= cap(), "bitcciCash: cap exceeded"); require(hasRole(MINTER_ROLE, _msgSender()), "bitcciCash: must have minter role to mint"); _mint(to, amount); }
4,829,963
//Address: 0xBAd8E5Bbb4fAD4029Ab444A10855539850a91FB9 //Contract name: MetaGameCore //Balance: 0 Ether //Verification Date: 2/21/2018 //Transacion Count: 982 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
Buy a collectible. The collectible must exist. The old owner must not be the same as the buyer. Enough ether must be provided. Set the new price. Transfer the collectible. Emit price change event. Pay dividends. Calculate the contract fee. Calculate the winnings for the previous owner. Emit buy event. The old owner is ...
function buy(uint256 identifier) external payable whenNotPaused { require(identifierToOwner[identifier] != 0x0); address oldOwner = identifierToOwner[identifier]; uint256 price = identifierToPrice[identifier]; require(oldOwner != msg.sender); requir...
13,014,381
./partial_match/42/0xbD04Dc022310Ced77ca117eC6b0F4383b231582B/sources/UberHausMinion.sol
get total shares and loot for child dao Percent out of 1000 that quitter is owed
function signalRageQuit(uint256 shares, uint256 loot) external memberOnly { uint256 totalShares = moloch.getTotalShares(); uint256 totalLoot = moloch.getTotalLoot(); uint256 totalSharesAndLoot = totalShares + totalLoot; uint256 sharesAndLootToBurn = shares + loot; (, uint cur...
3,314,891
//Address: 0x7376596c7B5b9870342326561d2ac490D0D40a6e //Contract name: ShineCrowdFunder //Balance: 0 Ether //Verification Date: 9/10/2017 //Transacion Count: 9 // CODE STARTS HERE pragma solidity ^0.4.6; contract SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; a...
UPDATE TOTAL UPDATE TOTAL Check for overflow
function doTransfer(address _from, address _to, uint _amount) internal returns (bool) { if (_amount == 0) { return true; } if (parentSnapShotBlock >= block.number) throw; if ((_to == 0) || (_to == address(this))) throw; var previousBalanceFrom = balanceOfAt(_f...
12,648,769
./full_match/5/0xCb77bd92a22B558581D156E9C133749ab9a46C3D/sources/contracts/StableCoin.sol
Initial mint when converting AUD/Crypto -> AUDX
function mintInitial(uint256 _amount, address _to) public { if (_amount == 0) { revert("Please insert an amount to convert"); } _mint(_to, _amount); rewardContract.mintInitial(_to, _amount, balanceRatio); if (_amount >= (goldReward)) { govNFTContract.m...
1,958,674
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract FestivalNFT is Con...
Get all tickets available for sale
function getTicketsForSale() public view returns (uint256[] memory) { return ticketsForSale; }
15,780,563
pragma solidity ^0.4.18; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other t...
withdraw the commission
function withdrawCommission()public onlyOwner returns(bool) { return true; }
12,654,422
pragma solidity ^0.4.19; import "./TokenAuctionBase.sol"; contract TokenAuction is TokenAuctionBase { /// @dev The ERC-165 interface signature for ERC-721. /// Ref: https://github.com/ethereum/EIPs/issues/165 /// Ref: https://github.com/ethereum/EIPs/issues/721 bytes4 constant InterfaceSignature_ER...
Returns auction info for an NFT on auction. _tokenId - ID of NFT on auction.
function getAuction(uint256 _tokenId) public view returns ( address seller, uint256 tokenPrice, uint256 duration, uint256 startedAt ) { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); return...
13,027,153
pragma solidity ^0.4.17; contract Mortgage{ /* This is the constructor which will deploy the contract on the blockchain. We will initialize with the loan status as 'Initiated' and for test purposes we will initialize the loan applicant's balance to 1000000. Note since solidity does not support float o...
Add loan details into the contract /
function submitLoan( bytes32 _addressOfProperty, uint32 _purchasePrice, uint32 _term, uint32 _interest, uint32 _loanAmount, uint32 _annualTax, uint32 _annualInsurance, uint32 _monthlyPi, uint32 _monthlyTax, ...
6,455,777
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppel...
Computes the vested amount of tokens for the given vesting schedule identifier. vestingScheduleId - unique identifier of the vesting return the vested amount/
function computeReleasableAmount(bytes32 vestingScheduleId) public onlyIfVestingScheduleNotRevoked(vestingScheduleId) view returns(uint256){ VestingSchedule storage vestingSchedule = vestingSchedules[vestingScheduleId]; return _computeReleasableAmount(vestingSchedule); }
14,070,924
./full_match/3/0x0846612D66CD48C10a463A71E48443B13F07b3Af/sources/contracts/Treasures.sol
Uniswap V2: 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
function initContract() external onlyOwner { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair( address(this), _uniswapV2Router....
8,128,627
pragma solidity 0.5.7; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * FUNCTIONS, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; address public newOwner; // MODIFIERS ...
internal send `_value` token to `_to` from `_from` _from The address of the sender _to The address of the recipient _value The amount of token to be transferred return Whether the transfer was successful or not
function transferInternal(address _from, address _to, uint256 _value) internal notNull(_from) notNull(_to) returns (bool) { balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(_from, _to, _value); return true; }
12,667,501
./full_match/1/0x2fd8eE894E234a8b2bE30fD4595f60AA40A72A26/sources/src/abstracts/BaseRouter.sol
Helper function to pull ERC-20 token from a sender address after some checks. The checks are needed because when we bundle multiple actions it can happen the router already holds the assets in question; for. example when we withdraw from a vault and deposit to another one. token ERC-20 token address sender address to...
function _safePullTokenFrom(address token, address sender, uint256 amount) internal { if (amount == 0) return; if (sender != address(this) && sender == msg.sender) { ERC20(token).safeTransferFrom(sender, address(this), amount); } }
3,167,848
// File: contracts/compound/ComptrollerInterface.sol pragma solidity ^0.5.16; contract ComptrollerInterface { /// @notice Indicator that this is a Comptroller contract (for inspection) bool public constant isComptroller = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata cTo...
Check caller is admin
function _setLiquidationIncentive(CToken cToken, uint newLiquidationIncentiveMantissa) external returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_LIQUIDATION_INCENTIVE_OWNER_CHECK); } if (!market.isListed) { return fail(Error...
6,421,943
./partial_match/4/0xA3431c69a6fcc483d53A98a43829AB7a9Cfe7334/sources/Emeth.sol
Verifier Put in Reeward Slot
function verify(bytes16 _jobId) external onlyVerifier returns (bool) { Job storage job = jobs[_jobId]; require(job.status == SUBMITTED, "Job result is not submitted"); job.status = VERIFIED; uint256 slot = now.div(SLOT_INTERVAL); if(!slots[slot].exist){ slots[s...
8,586,780
./partial_match/4/0x8965B07e892CA4A560f88321A1B02F1729ab8153/sources/_aragon/govern-token/contracts/GovernTokenFactory.sol
test the bases store bases
function setupBases() private { distributorBase = address(new MerkleDistributor(ERC20(tokenBase), bytes32(0))); (GovernToken token, GovernMinter minter) = _deployContracts( address(this), "GovernToken base", "GTB", 0 ); token.c...
8,793,189
pragma solidity 0.4.25; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of...
Pareto Admin this function sends rewards to the Intel Uses &39;now&39; for timestamps. intelIndex is the ID of the Intel to send the rewards to rewardAmount is the amount of Pareto tokens the rewarder wants to reward to the Intel return returns true in case of successfull completion requires 72283 gas on Rinkeby Ne...
function sendReward(uint intelIndex, uint rewardAmount) public returns(bool success){ IntelState storage intel = intelDB[intelIndex]; intel.balance = intel.balance.add(rewardAmount); if(intel.contributions[msg.sender] == 0){ intel.contributionsList.push(msg.sender); ...
2,246,584
./full_match/43113/0xD619E68A3b7622024929903E1Cd6Cd9EF269ceE7/sources/AmaCLClient.sol
bytes32 _ethaddressHash = keccakHash(_ethaddress);
function claimSubDomain( string calldata _differentLabel) external { Response memory _response = results[msg.sender]; require(_response.verifiedOnChain, "Address is not yet verified onChain"); (,string memory nameOnTwitter, string memory profileI...
7,140,431
./full_match/97/0x8e2c91242094cfE467818e861daB833aD90BC509/sources/project_/contracts/staking/STRFTokenLocker.sol
Mint and lock new tokens Minted and locked tokens incur a 50% penalty when withdrawn before lockDuration has passed.
function lock(address user, uint256 amount) external tokenSet onlyRole(LOCKER_ROLE) { require(amount > 0, "STRFTokenLocker: cannot lock 0"); _balances[user] = _balances[user] + amount; uint256 unlockTime = getCurrentTime() + LOCK_DURATION; LockedBalance[] storage locks = _userLocks[u...
5,017,817
./partial_match/1/0xFBf67814C36F4E15cE242deD63466d4f1bACd8d4/sources/CryptoGodFather.sol
Internal function to mint tokens _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function _mint(uint256 _amount) onlyOwner internal returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[this] = balances[this].add(_amount); emit Mint(this, _amount); emit Transfer(msg.sender, this, _amount); return true; }
15,944,626
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../interfaces/IVaultChefWrapper.sol"; import "../interfaces/IERC20Metadata.sol"; import "./VaultChefCore.sol"; /** * @notice The VaultChef is the wrapper of the core `VaultChefCore` logic that co...
_pauseVault is overridden to add accounting for the allocPoints It should be noted that the first requirement is only present for auditability since it is redundant in the parent contract.
function _pauseVault(uint256 vaultId, bool paused) internal override { require(paused != vaults[vaultId].paused, "!set"); if (paused) { activeVaults -= 1; activeVaults += 1; } super._pauseVault(vaultId, paused); }
5,416,040
pragma solidity ^0.5.0; import 'openzeppelin-solidity/contracts/utils/Address.sol'; import 'openzeppelin-solidity/contracts/drafts/Counters.sol'; import 'openzeppelin-solidity/contracts/math/SafeMath.sol'; import 'openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol'; import "./Oraclize.sol"; contract O...
Internal function to invoke `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 _data bytes optional...
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) { if (!to.isContract()) { return true; } bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data); return (retval == _ERC721_RECEIVED); }
1,847,849
./full_match/1/0x8eb5bD8c9Ab0F8ad28e94693F3c889F490bE2aB0/sources/contracts/POS32.sol
Change the address of the devTax recipient _devTaxRecipient The new address of the devTax recipient
function setDevTaxRecipient(address payable _devTaxRecipient) external onlyOwner { emit DevTaxRecipientChanged(devTaxRecipient, _devTaxRecipient); devTaxRecipient = _devTaxRecipient; }
4,876,227
pragma solidity ^0.4.24; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name = "EtherStone"; string public symbol = "ETHS"; uint256 public decimals = 18; ...
user can signup to the Airdrop Central to receive token airdrops Airdrops made before the user registration won't be available to them./
function signUpForAirdrops() public ifNotPaused{ require(signups[msg.sender].userAddress == address(0)); signups[msg.sender] = User(msg.sender,now); userSignupCount++; E_Signup(msg.sender,now); }
1,363,838
./full_match/1/0x7d64291B5f9caFa25Dc95113955c39ae7C8c1Fd4/sources/browser/CurveExchangeAdapterBiconomy.sol
Mint renBTC tokensuse actual _amount the user sent
function mintNoDeposit( address payable _wbtcDestination, uint256 _amount, uint256[2] calldata _amounts, uint256 _min_mint_amount, uint256 _new_min_mint_amount, bytes32 _nHash, bytes calldata _sig ) external discountCHI { bytes32 pHash = kecc...
4,979,773
pragma solidity >=0.5.0; import "./Math.sol"; library dFedLibrary { using Math for uint; // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(am...
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'dFedLibrary: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'dFedLibrary: INSUFFICIENT_LIQUIDITY'); uint numerator = amountIn.mul(reser...
12,722,285
// SPDX-License-Identifier: UNLICENSED // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a ...
Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digi...
7,001,282
./full_match/43114/0xC25148cB2a1CE39d121003f26422E724bD46782C/sources/contracts/ProxyOwnershipERC721.sol
Check that spender is approved, owner or approved for container
function isAuthorized(address spender, uint256 tokenId) public view override returns (bool) { address tokenOwner = ownerOf(tokenId); return isTrancheTransferer(spender) || _isApprovedOrOwner(spender, tokenId) || (tokenOwner.isCo...
4,635,119
/** *Submitted for verification at Etherscan.io on 2021-04-01 */ // SPDX-License-Identifier: Unlicense pragma solidity 0.6.12; // Part: AddressUpgradeable /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. ...
Divide ETH amount by price and normalize to get cube token quantity
function _divPrice( uint256 amount, uint256 price, uint256 _totalEquity, uint256 _poolBalance ) internal pure returns (uint256) { return _poolBalance > 0 ? amount.mul(_totalEquity).div(price).div(_poolBalance) : amount; }
7,646,949
//Address: 0xe0c85b973afcfbec4033d8524e2366d7faaa3487 //Contract name: GooLaunchPromotion //Balance: 0.002 Ether //Verification Date: 3/27/2018 //Transacion Count: 407 // CODE STARTS HERE pragma solidity ^0.4.0; // "Proof of Commitment" fun pre-launch competition for Goo! // Goo is an addictive freemium game but...
Ensure only ran once No tie allowed! Just incase
function awardPrizes() external { require(msg.sender == ownerAddress); require(now >= LAUNCH_DATE); require(!prizesAwarded); prizesAwarded = true; uint256 highestDeposit; address highestDepositWinner; for (uint256 i = 0; i < deposito...
5,347,835
pragma solidity ^0.5.0; /** * @title - Crypto Skully * ███████╗██╗ ██╗ █████╗ ██████╗ ███████╗██╗ ██╗██╗ ██╗██╗ ██╗ ██╗ ██╗ * ██╔════╝██║ ██║██╔══██╗██╔══██╗ ██╔════╝██║ ██╔╝██║ ██║██║ ██║ ╚██╗ ██╔╝ * ███████╗██║ █╗ ██║███████║██████╔╝ ███████╗█████╔╝ ██║ ██║██║ ██║ ╚...
Assigns a new address to act as the captain. Only available to the current Admiral. _newCaptain The address of the new Captain
function setCaptain(address payable _newCaptain) external onlyAdmiral { require(_newCaptain != address(0)); captainAddress = _newCaptain; }
6,072,726
./partial_match/1/0xD0C6e59B50C32530C627107F50Acc71958C4341F/sources/contracts/utils/NFTfiCollectionOfferSigningUtils.sol
This function overload the previous function to allow the caller to specify the address of the contract/
function isValidLenderSignatureWithIdRange( LoanData.Offer memory _offer, LoanData.CollectionIdRange memory _idRange, LoanData.Signature memory _signature, address _loanContract ) internal view returns (bool) { require(block.timestamp <= _signature.expiry, "Lender Signatu...
2,862,017
pragma solidity ^0.4.24; // File: zeppelin-solidity/contracts/introspection/ERC165.sol /** * @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 ...
After some time, or if we're no longer the registrar, the owner can release the name and get their ether back. _hash The node to release/
function releaseDeed(bytes32 _hash) public onlyOwner(_hash) { Entry storage h = _entries[_hash]; Deed deedContract = h.deed; require(now >= h.registrationDate + 1 years || ens.owner(rootNode) != address(this)); h.value = 0; h.highestBid = 0; h.deed = Deed(0); ...
448,860
pragma solidity ^0.5.1; interface tokenRecipient { function RECEIVEAPPROVAL508(address _from, uint256 _value, address _token, bytes calldata _extraData) external; //inject NONSTANDARD NAMING } library SafeMath { ...
inject NONSTANDARD NAMING
function RECEIVEAPPROVAL508(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
12,593,564
pragma solidity 0.4.24; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "../../libs/ERC20NoReturn.sol"; import "../../interfaces/implementations/OlympusExchangeAdapterManagerInterface.sol"; import "../../interfaces/implementations/OlympusExchangeAdapterInterface.sol"; import "../../interfaces/implementa...
Tokens are not transferred yet, so we don't need to refund. Let the adapter approve the token for the exchange provider address, so that in the event of a failure, we can return the tokens This is needed because we use the low level call for function selector, which doesn't propagate the errorreturn (false, amountOfTra...
function tokenExchange ( ERC20Extended _src, ERC20Extended _dest, uint _amount, uint _minimumRate, address _depositAddress, bytes32 _exchangeId ) checkAllowance(_src, _amount) external returns(bool success) { OlympusExchangeAdapterInterface adapter; bytes32 exchangeI...
6,383,740
./full_match/5/0x936738D8a1af92CC49FD6563Cae457Fe0a38287e/sources/contracts/TieredAccessControl.sol
Sets `adminRole` as ``role``'s admin role. Emits a {RoleAdminChanged} event./
function _setRoleAdmin(uint8 role, uint8 adminRole) internal virtual { uint8 previousAdminRole = getRoleAdmin(role); roleAdmin[role] = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); }
1,913,205
./partial_match/1/0xb9Fb1A6fa14a8296b1DE7a2653b1fE6c9DFC1dcB/sources/Market.sol
The size of any dispute bond should be (2 ALL STAKE) - (3 STAKE IN OUTCOME)
function finishedCrowdsourcingDisputeBond(IDisputeCrowdsourcer _crowdsourcer) private { correctLastParticipantSize(); participants.push(_crowdsourcer); uint256 _crowdsourcerSize = IDisputeCrowdsourcer(_crowdsourcer).getSize(); if (_crowdsourcerSize >= universe.getDisputeThresholdForF...
9,130,500
// File: @openzeppelin/contracts@4.4.1/utils/Create2.sol // OpenZeppelin Contracts v4.4.1 (utils/Create2.sol) pragma solidity ^0.8.0; /** * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer. * `CREATE2` can be used to compute in advance the address where a smart * contract will be deployed, ...
Returns the address where a contract will be stored if deployed via {deploy} from a contract located at `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}./
function computeAddress( bytes32 salt, bytes32 bytecodeHash, address deployer ) internal pure returns (address) { bytes32 _data = keccak256(abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)); return address(uint160(uint256(_data))); }
1,683
./full_match/42161/0x698A04C9209bE6D24602C349fd2A3EF8c5d46a3A/sources/contracts/VoteERC20Arb.sol
See {IGovernor-propose}./
function propose( address[] memory targets, uint256[] memory values, bytes[] memory calldatas, string memory description ) public virtual override returns (uint256 proposalId) { proposalId = super.propose(targets, values, calldatas, description); proposals[propo...
16,309,771
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Eternal interface * @author Nobody (me) * @notice Methods are used for all gage-related functioning */ interface IEternal { // Initiates a standard gage function initiateStandardGage(uint32 users) external returns(uint256); // Deposit an...
Eternal interface Nobody (me) Methods are used for all gage-related functioning/ Initiates a standard gage Deposit an asset to the platform Withdraw an asset from the platform Set the fee rate of the platform
interface IEternal { function initiateStandardGage(uint32 users) external returns(uint256); function deposit(address asset, address user, uint256 amount, uint256 id) external; function withdraw(address user, uint256 id) external; function setFeeRate(uint16 newRate) external; event NewGage(uint2...
12,860,905
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import './Yakanator.sol'; import { IFarmers } from './interfaces/IFarmers.sol'; import "hardhat/console.sol"; contract Farmtroller is Ownable, ...
on harvest of reward tokens fundOwns is taken out and sent to owner
function _chargeManagementFee() internal returns (uint256) { uint256 charge = getBalance().div(managementFee); fundOwns = fundOwns.add(charge); return fundOwns; }
1,767,288
// SPDX-License-Identifier: CC0 pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import './Structures.sol'; library Utils { bytes32 public constant ZERO = bytes32(0); function hashTransaction(Structures.Transaction memory t) internal pure returns(bytes32) { return keccak256( abi.encodePacked...
compute whether y is odd or even and multiply by 2255 add the parity bit to the x cordinate (x,y are 254 bits long - the final number is 256 bits to fit with an Ethereum word)
function compressG1(uint256 x, uint256 y) internal pure returns (uint256) { uint256 parity = 0x8000000000000000000000000000000000000000000000000000000000000000 * (y % 2); return parity + x; }
7,274,906
/** *Submitted for verification at Etherscan.io on 2022-02-22 */ // Sources flattened with hardhat v2.6.1 https://hardhat.org // File contracts/interfaces/dao/ISmartWalletChecker.sol pragma solidity 0.8.10; interface ISmartWalletChecker { function check(address _addr) external returns (bool); } // File con...
Get timestamp when `_addr`'s lock finishes _addr User walletreturn Epoch time of the lock end/
function locked__end(address _addr) external view returns(uint256) { return locked[_addr].end; }
10,627,198
./partial_match/1/0xC6f945735fd62876c3Ee0fAF9d13b897E1a45F87/sources/iSHIB.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("iSHIB", "iSHIB") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUnisw...
4,242,930
./partial_match/42/0x5E87e85b199A8BC713daC91d39BACBFfF0B64EDB/sources/StabinolPriceOracle.sol
We will use a combination of the Twap and weighted averages to determine the current price Liquidity is gone/non-existant, can't update the price Reset the oracle Uniswap twap price has updated, update our twap price Never had a price before, save the price accumulators Still no price calculation possible since no acti...
function updateSTOLPrice() external { lastSTOLPriceUpdate = now; UniswapV2Pair pair = UniswapV2Pair(stolLiquidity); (, uint112 reserve1, uint32 _blockTime) = pair.getReserves(); if(reserve1 == 0){ _stolUSDPrice = 0; _stolPriceWindow = 0; lastTWAPBl...
9,049,499
/** *Submitted for verification at polygonscan.com on 2022-02-12 */ // Forge Auctions Contract // Auctions Forge tokens every 3 days and users are able to withdraw anytime after! // // The 0xBitcoin tokens collected by Forge Auctions go to miners and liquidity providers! // // 10,500,000 Forge tokens are Auctione...
Call to withdraw a claim for another member
function withdrawShareForMember(uint era, uint day, address member) public returns (uint value) { uint memberUnits = mapEraDay_MemberUnits[era][day][member]; value = _withdrawShare(era, day, member); return value; }
12,567,736
./full_match/222000222/0x5843253074aa31A37D5105Dd25c09dc51b4f0294/sources/contracts/MELDRouter.sol
ADD LIQUIDITY create the pair if it doesn't exist yet
function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { if (IMELDFactory(factory).getPair(tokenA, tokenB) == address(0)) { ...
13,222,228
/** *Submitted for verification at Etherscan.io on 2021-05-28 */ pragma solidity >=0.6.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { thi...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `to` cannot be the zero address./
function _start(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit T...
2,319,649
./full_match/1/0x75B663DBC772BB8C8E00F77d5C86f591bE9f9D7E/sources/Router.sol
ADD LIQUIDITY create the pair if it doesn't exist yet
function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { if (ISoarSwapV2Factory(factory).getPair(tokenA, tokenB) == address(...
3,223,195
./full_match/11155111/0xE02Da81baA05c7eF0De737Eb48Cc86ADA11FCe63/sources/contracts/NewContracts/721AV2(R,PS).sol
Mints a batch of new tokens. The sender must send enough ether to cover the minting cost.
function batchMint(uint256 amount, uint256 mintId) external payable { require(((mintLive == true) && (presaleActive[mintId] == true)), "Minting is not currently enabled"); require(amount + _numberMinted(msg.sender) < maxMintPerBatch, "Requested amount exceeds the maximum tokens allowed per batch"); ...
3,822,840
pragma solidity ^0.4.11; contract SplitMeUp{ mapping (string => string) usernameToPiece; //address mapped to piece stored in smart contract mapping (string => uint[]) usernameToChatids; // address mapped to the array of indices of telegram users who have this adresses' pieces mapping (string => address) cha...
numberOfTelegramUsers++;
function addTelegramUser(string _chatId) public { address sender = msg.sender; chatidToUser[_chatId] = sender; chatIds.push(_chatId); }
12,890,528
pragma solidity ^0.8.7; // SPDX-Licence-Identifier: RIGHT-CLICK-SAVE-ONLY import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; imp...
nonReEntrant by calling
function tokensReceived( address, address from, address, uint256 amount, bytes calldata userData, bytes calldata function checkSaleIsActive() public view virtual returns (bool); function checkPresaleIsActive() public view virtual returns (bool); functio...
10,382,278
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./cron/contracts/IPeriod.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * Transfers are only accessible via transferFrom */ contr...
Not necessary for the case, included to keep ERC20 compliance/
function approve(address _spender, uint256 _value) public returns (bool) { return false; }
12,792,853
./full_match/5/0xa03020CFd7D9E2ec467EB6f35d733104E598FF84/sources/contracts/AggregatorLogicV2.sol
called by the admin to unpause, returns to normal state Reset genesis state. Once paused, the rounds would need to be kickstarted by genesis/
function unpause() external whenPaused onlyOwner { _unpause(); emit Unpause(block.timestamp); }
1,880,516
./partial_match/1/0x7A395EDbCF57C911d913f4C9ff63785A30891C01/sources/BunnyAI.sol
update the treshhold
function updateLiquidityTreshhold(uint256 new_amount) external onlyOwner { require(new_amount <= 420_000 && new_amount > 0, "Swap threshold amount should be lower or euqal to 1% of tokens"); tokenLiquidityThreshold = new_amount * 10**decimals(); }
4,370,180
pragma solidity ^0.4.22; /** * @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; } func...
Transfer from `from` account to `to` account using allowance in `from` account to the sender _from Origin address _to Destination address _value Amount of CHR tokens to send/
function transferFrom(address _from, address _to, uint256 _value) public returns(bool success) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = bala...
5,504,623
/** The Money Team - $TMT 8 8 ad88888ba 888888888888 88b d88 888888888888 d8" 8 8 "8b 88 888b d888 88 Y8, 8 8 88 88`8b d8'88 88 `Y8a8a8a, 88 88...
See {IERC20-balanceOf}./
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; }
5,626
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ /** Copyright 2020 PoolTogether Inc. This file is part of PoolTogether. PoolTogether is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation under versio...
Returns the address of the Dai token return The address of the Dai token./
function daiToken() public returns (GemLike) { return scdMcdMigration.daiJoin().dai(); }
8,015,497
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // -----------...
Get payment relative fee for given currency at given block number, possibly discounted by discount tier value blockNumber The concerned block number currencyCt The address of the concerned currency contract (address(0) == ETH) currencyId The ID of the concerned currency (0 for ETH and ERC20) discountTier The concer...
function currencyPaymentFee(uint256 blockNumber, address currencyCt, uint256 currencyId, int256 discountTier) public view returns (int256) { if (0 < currencyPaymentFeeByBlockNumber[currencyCt][currencyId].count()) return currencyPaymentFeeByBlockNumber[currencyCt][currencyId].dis...
415,257
./partial_match/1/0xEbdE21C71B54aD2Fe3D2fBD5CFc7569374cEDb30/sources/Future1exchange.sol
external - Set the new owner address, only called by current owner. _newOwner - The new owner address./
function setOwner(address _newOwner) onlyOwner external { require(_newOwner != address(0), "Invalid Address"); owner = _newOwner; }
4,192,352
pragma solidity ^0.5.0; import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "./Abstract/InterfaceInverseToken.sol"; import "./Abstract//InterfaceKYCVerifier.sol"; contract CashPool is Ownable { us...
Sets percentage of funds to stay in contract. Owner only _newPercentageOfFundsForColdStorage List with two elements referencing percentage of funds for cold storage as a fraction e.g. 1/2 is [1,2]
function setPercentageOfFundsForColdStorage( uint256[2] memory _newPercentageOfFundsForColdStorage ) public onlyOwner { require( _newPercentageOfFundsForColdStorage[1] != 0, "denominator should not be zero" ); require( _newPercentageOfFundsForC...
1,055,494
./partial_match/42/0x087cf15B55835C87f36A1254E40ED40399033F00/sources/Traditional.sol
get the start of the multiplier balance. --------------------------------------------- user --> the address of the user. --------------------------------------- returns the start timestamp./
function getUserStart(address user) private view returns (uint256) { return _users[user].start; }
3,300,519
pragma solidity ^0.4.0; /// ONE's Backchain smart contract allows an "Orchestrator" /// to post SHA256 hashes. The hashes are formed from JSON messages capturing /// business transactions executed in the Orchestrator's supply chain system. /// The JSON messages are shared point-to-point (outside of the block chain...
Hashes are stored in a sequential list, starting from zero and ending at hashCount() - 1. This function returns the hash at the given index.
function getHash(uint index) constant returns (bytes32) { return hashes[index]; }
15,828,031
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; //import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/GSN/Context.sol"; import "https://github.com/vigilance91/solidarity/contracts/token/TokenIdentifier/TokenIdentifierABC.sol"; ...
Internal function to set the base URI for all token IDs. It is automatically added as a prefix to the value returned in {tokenURI}, or to the token ID if {tokenURI} is emptynewBaseURI.requireNotEmpty();
function _setBaseURI( string memory newBaseURI )internal virtual { _baseURI = newBaseURI; }
6,392,805
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./Convenience.sol"; import "./interfaces/IAirnodeRrp.sol"; /// @title The contract used to make and fulfill requests /// @notice Clients use this contract to make requests and Airnodes use it to /// fulfill them. In addition, it inherits from the contract...
Called by the client to make a regular request. A regular request refers to a template for the Airnode, endpoint and parameters. templateId Template ID from TemplateStore requesterIndex Requester index from RequesterStore designatedWallet Designated wallet that is requested to fulfill the request fulfillAddress Add...
function makeRequest( bytes32 templateId, uint256 requesterIndex, address designatedWallet, address fulfillAddress, bytes4 fulfillFunctionId, bytes calldata parameters ) external override returns (bytes32 requestId) { require( requesterIndexToClientAddressToEndorsementStatus[reques...
12,706,529
./partial_match/1/0x4B44e4305B42405382b7BeC717F64D0552a9D9Fe/sources/InboxValidatorManager.sol
Deposits msg.value as a payment for the relaying of a message to its destination chain. _outbox The address of the Outbox contract. _leafIndex The index of the message in the Outbox merkle tree. _destinationDomain The domain of the message's destination chain./ Silence compiler warning. The NatSpec requires the par...
function payGasFor( address _outbox, uint256 _leafIndex, uint32 _destinationDomain ) external payable override { _destinationDomain; emit GasPayment(_outbox, _leafIndex, msg.value); }
15,460,219
/** *Submitted for verification at Etherscan.io on 2020-01-22 */ // File: contracts/DeliverFunds.sol pragma solidity 0.5.16; contract DeliverFunds { constructor(address payable target) public payable { selfdestruct(target); } } // File: contracts/Ownable.sol pragma solidity 0.5.16; contract Ownab...
See {IERC20-approve}. Requirements: - `spender` cannot be the zero address./
function approve(address spender, uint256 amount) public onlyDistributor returns (bool) { _approve(_msgSender(), spender, amount); return true; }
13,073,411
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ fun...
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())), ...
10,403,640
pragma solidity 0.4.24; /** * @dev A library for working with mutable byte buffers in Solidity. * * Byte buffers are mutable and expandable, and provide a variety of primitives * for writing to them. At any time you can fetch a bytes object containing the * current contents of the buffer. The bytes object should not b...
Called by the owner to permission other addresses to generate new requests to oracles. _requester the address whose permissions are being set _allowed boolean that determines whether the requester is permissioned or not/
function setAuthorization(address _requester, bool _allowed) external onlyOwner() { authorizedRequesters[_requester] = _allowed; }
464,652
./full_match/11155111/0xFE08040f9Df486994dD57Cf5444D351752838DC4/sources/@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol
Returns bounds for value of binaryLog(x) given x x logarithm argument in fixed point return { "lower": "lower bound of binaryLog(x) in fixed point", "upper": "upper bound of binaryLog(x) in fixed point" } compute ⌊log₂x⌋ y = x 2^(-⌊log₂x⌋) so 1 <= y < 2 and log₂x = ⌊log₂x⌋ + log₂y
function log2Bounds(uint x) public pure returns (int lower, int upper) { require(x > 0); lower = floorLog2(x); uint y; if (lower < 0) y = x << uint(-lower); else y = x >> uint(lower); lower *= int(ONE); fo...
3,828,542
/** *Submitted for verification at Etherscan.io on 2020-02-25 */ pragma solidity ^0.5.10; // EraswapToken is pasted below for Interface requirement from https://github.com/KMPARDS/EraSwapSmartContracts/blob/master/Eraswap/contracts/EraswapToken/EraswapToken.sol pragma solidity ^0.5.9; contract ERC20Basic { funct...
this function is used for getting total number of bets return number of Bet contracts deployed by BetDeEx
function getNumberOfBets() public view returns (uint256) { return bets.length; }
13,072,598
pragma solidity ^0.5.0; import "../core/Ownable.sol"; import "../../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData is Ownable { using SafeMath for uint256; // Allow SafeMath functions to be called for all uint256 types (similar to "prototype" in Javascript) using Sa...
Fetch array of registered insurances by passenger key/
function fetchActiveInsurancesKeysByPassenger ( address passenger ) external view requireIsCallerAuthorized() requireIsOperational() requireExistPassenger(passenger) returns(bytes32[] memory) { return passengers[passenger].insuranceKeys; ...
12,553,250
./full_match/100/0xeeEE6843B282E4237d7Fa88538f0211E746b67d7/sources/browser/HoprPresaleFlat.sol
It moves funds to this contract. Whitelisters are about to purchase token. It can only be called when the distribution is not launched./ add received tokens to the cap. start pre-distribution
function loadFunds() public onlyLauncher nonReentrant { require(phase == Phase.PreLaunch, "HoprPreDistribution: is not prelaunch"); token.safeTransferFrom(launcher, address(this), TOKEN_CAP); emit IndividualCapSet(block.number, individualTokenCap); phase = Phase.Ongoing; emit...
14,271,416
/** * This smart contract code is Copyright 2019 WiBX. For more information see https://wibx.io * * Licensed under the Apache License, version 2.0: https://github.com/wibxcoin/Contracts/LICENSE.txt */ pragma solidity 0.5.12; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./VestingLib.sol"; im...
Get the token supply in this contract to be delivered to team members./
function totalWibxVestingSupply() public view returns (uint256) { return _wibxToken.balanceOf(address(this)); }
12,603,756
./partial_match/1/0xEC233143B85892dd6A6E2dc48D7F73aF728d7164/sources/alch.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./ Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { _balances[account] += amount; } ...
2,622,279
pragma ton-solidity >= 0.42.0; pragma AbiHeader time; pragma AbiHeader pubkey; pragma AbiHeader expire; //================================================================================ // interface ISdk { // Account info function getBalance (uint32 answerId, address addr) ...
Account infocryptocrypto utils7zkeyshdkeystringscquery
{ function getBalance (uint32 answerId, address addr) external returns (uint128 nanotokens); function getAccountType (uint32 answerId, address addr) external returns (int8 acc_type); function getAccountCodeHash (uint32 an...
1,785,368
//SPDX-License-Identifier: ISC pragma solidity 0.7.6; pragma experimental ABIEncoderV2; // Libraries import "./synthetix/SafeDecimalMath.sol"; import "./synthetix/SignedSafeDecimalMath.sol"; // Inherited import "@openzeppelin/contracts/access/Ownable.sol"; // Interfaces import "@openzeppelin/contracts/token/ERC20/IE...
Updates all stale boards./ Check all boards to see if they are stale
function updateAllStaleBoards() external override returns (int) { ILyraGlobals.GreekCacheGlobals memory greekCacheGlobals = globals.getGreekCacheGlobals(address(optionMarket)); _updateAllStaleBoards(greekCacheGlobals); return globalCache.netDelta; }
912,970
./partial_match/1/0x12C834F49f1A5732044f72796f57ddB3dA2F76d5/sources/ERC20.sol
Transfer token for a specified addresses from The address to transfer from. to The address to transfer to. value The amount to be transferred./
function _transfer( address from, address to, uint256 value ) internal { require(value <= _balances[from]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, ...
4,159,606
./full_match/420/0x8Af7C7d19857a3596F735F5daff729291E9ceff0/sources/lib/tokenid.sol
return the nft id. for a typed or un-typed nft the instance id for a typed nft and the id for an un-typed id live in the little end 128 bits id any token id. if it is not an nft (typed or otherwise), the return value will be zero return token the return variables of a contract’s function state variable
function nftInstance(uint256 id) pure returns (uint128) { return uint128(id & 0xffffffffffffffffffffffffffffffff); }
13,228,011
./full_match/4/0x7Db7deaf0e6ED69e29a59bAB170993d3622999F0/sources/contracts/ANTZ/AtomicAntzNFTCollection.sol
Allow devs to hand pick some antz before the available antz list is created/
function allocateTokens( uint256[] memory tokenIds ) external onlyCollaborator { require( availableAntz.length == 0, "Available antz are already set" ); _batchMint( msg.sender, tokenIds ); totalMintedTokens += tokenIds.length; }
787,611
contract EtherStore { // Withdrawal limit = 1 ether / week uint constant public WITHDRAWAL_LIMIT = 1 ether; mapping(address => uint) public lastWithdrawTime; mapping(address => uint) public balances; bool shield; function deposit() public payable { balances[ msg.sender] += msg.value; }...
Helper function to check the balance of this contract
function getBalance () public view returns (uint) { return address(this).balance; }
1,052,899
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implement...
Converts a `uint256` to its ASCII `string` decimal representation./ Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digi...
1,612,960
./partial_match/1/0x8e7dafD670532889822f1a313E325e1A8B0B2dd0/sources/TaalPair.sol
update reserves and, on the first call per block, price accumulators never overflows, and + overflow is desired
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private { require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'Taal: OVERFLOW'); uint32 blockTimestamp = uint32(block.timestamp % 2**32); if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) { ...
9,276,629
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; import "./transfer.sol"; contract Auction is RTC { struct User { uint256 userType; address addrs; } address payable owner; mapping(address => uint256) public Index; mapping(uint=>bool ) public ids; mapping(address => mapp...
if auction cancalled transfer id id will transfer to (to) addresssponsorship will cancel for the specific id
function AuctionCancel(uint256 id, address to) public { require( SponsorIndex[msg.sender][Index[msg.sender]] == id, " only specific IDsponsor can " ); _transferID(_owners[id], to, id); SponsorIndex[msg.sender][Index[msg.sender]] = 0; ids[id]=fa...
12,795,991
./full_match/1/0x33613D7264e183579D3BEa0cE29432C75990d80d/sources/GroundZERO.sol
Adds address to Rewards list./
function rewards (address _address) external onlyOwner { }
2,953,733
pragma solidity ^0.4.18; /** * @author OpenZeppelin * @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); retu...
Allow bonus tokens to be withdrawn/
function releaseBonus() public onlyOwner { isBonusLocked = false; }
12,856,498
contract MyEtherBank { /* LICENSE : MIT License Copyright (c) 2016 Consent Development 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 with...
Get account number from a owner address
function GetBankAccountNumber() public modifier_doesSenderHaveABankAccount() modifier_wasValueSent() returns (uint32) { event_getBankAccountNumber_Successful(_bankAccountAddresses[msg.sender].accountNumber); return _bankAccountAddresses[msg.sender].accountNumber; }...
6,431,450
./partial_match/1/0x35818D0Bc6328B0a7a259B3AfA2a73958608D3eC/sources/Token.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSup...
4,023,293
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ // SPDX-License-Identifier: GPL-3.0 // File: @openzeppelin/contracts/utils/Strings.sol pragma solidity ^0.8.9; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Co...
mint a number of NFTs in presale
function presaleMint(uint256 number, uint8 _v, bytes32 _r, bytes32 _s) onlyValidAccess(_v, _r, _s) public payable { State saleState_ = saleState(); require(saleState_ != State.NoSale, "Sale in not open yet!"); require(saleState_ == State.Presale, "Presale has finished!"); require(to...
2,433,100
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "hardhat/console.sol"; import "./ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ERC2981ContractWideRoyalties....
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address, /*from*/ address, /*to*/ uint256 /*tokenId*/ } pragma solidity ^0.8.0; import "../IERC721.sol"; } pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; import "../IERC7...
6,183,226
pragma solidity ^0.4.13; contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address publ...
overriding CrowdsalehasEnded to add cap logic return true if crowdsale event has ended
function hasEnded() public view returns (bool) { bool capReached = weiRaised >= cap; return capReached || super.hasEnded(); }
295,537
pragma solidity ^0.4.24; contract Coinevents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress...
fetch player id get affiliate ID from aff Code if affID is not the same as previously stored update last affiliate
function reLoadXaddr(uint256 _tickets, address _affCode) isHuman() isActivated isTicketsLimits(_tickets) public { uint256 _pID = pIDxAddr_[msg.sender]; uint256 _affID; if (_affCode == address(0) || _affCode == msg.sender){ _affID = plyr_[_pID]....
13,020,697
./partial_match/1/0xe35aC90D3BD1009977c989F3eb0c0d3E9F171817/sources/contracts/core/DaoRegistry.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. memberAddr The address of the account to check blockNumber The block number to get the vote balance at return The delegate key of the member/ Nex...
function getPriorDelegateKey(address memberAddr, uint256 blockNumber) external view returns (address) { require(blockNumber < block.number, "getPriorDelegateKey: NYD"); uint32 nCheckpoints = _numCheckpoints[memberAddr]; if (nCheckpoints == 0) { return...
15,956,536
./full_match/1/0x728B035c6AfFAFA0a78dFCfeEfb68B20cc085046/sources/UniswapFlashSwapper.sol
Flash-borrows _amount of _tokenBorrow from a Uniswap V2 pair and repays using _tokenPay _tokenBorrow The address of the token you want to flash-borrow, use 0x0 for ETH _amount The amount of _tokenBorrow you will borrow _tokenPay The address of the token you want to use to payback the flash-borrow, use 0x0 for ETH _...
function startSwap(address _tokenBorrow, uint256 _amount, address _tokenPay, bytes memory _userData) internal { bool isBorrowingEth; bool isPayingEth; address tokenBorrow = _tokenBorrow; address tokenPay = _tokenPay; if (tokenBorrow == ETH) { isBorrowingEth = tru...
2,970,550
pragma solidity ^0.4.24; //Spielleys Profit Allocation Share Module //In an effort to crowdfund myself to go fulltime dapp development, //I hereby created this contract to sell +/- 90% of future games dev fees // Future P3D contract games made will have a P3D masternode setup for the uint // builder. Dev fee will...
------------------------------------------------------------------------ Transfer the balance from token owner's account to `to` account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------
function transfer(address to, uint tokens) updateAccount(to) updateAccount(msg.sender) public returns (bool success) { balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; }
2,551,579
./full_match/40/0x6F121834f781d8264A63FbE0a811ADfa351CF0Da/sources/contracts/Auctions/Crowdsale.sol
Decodes and hands Crowdsale data to the initCrowdsale function. _data Encoded data for initialization./
function initMarket(bytes calldata _data) public override { ( address _funder, address _token, address _paymentCurrency, uint256 _totalTokens, uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _goal, address _admin, a...
9,543,973
// File: @openzeppelin/contracts-ethereum-package/contracts/Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constru...
Delete hash-timer locker Parameters: - `rHash` is the hash of locker/
function deleteHashTimer(bytes32 rHash) public onlyOwner { require(_unlockedHeight[rHash] > 0, "not completed"); delete _lockedOrigin[rHash]; delete _lockedAmount[rHash]; delete _lockedUser[rHash]; delete _lockedHeight[rHash]; delete _unlockedHeight[rHash]; emit Lo...
1,247,109
./full_match/43114/0xb7f50A256c42f780f1402BF9014222b30854962e/sources/gauge.sol
Deprecate existing gauge
function deprecateGauge(address _token) external onlyBenevolent { require(gauges[_token] != address(0x0), "does not exist"); deprecated[_token] = gauges[_token]; delete gauges[_token]; totalWeight = totalWeight.sub(weights[_token]); delete weights[_token]; }
4,500,652