file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/137/0x48304908669633459c9381CB538Ff7bffF3a8e43/sources/darkUSD.sol
Returns X dUSD = 1 USD
function dusd_price() public view returns (uint256) { return oracle_price(PriceChoice.dUSD); }
3,525,546
./full_match/137/0x088AcC3e5733c12096B64Ac48C04bbe05957Ab30/sources/ERC1155.sol
Sets the royalty information for a specific token id, overriding the global default. Requirements: - `tokenId` must be already minted. - `receiver` cannot be the zero address. - `feeNumerator` cannot be greater than the fee denominator./
function setRoyaltyFee(address receiver, uint96 feeNumerator) external virtual override { require(receiver != address(0), "ERC2981: invalid receiver"); require(msg.sender == operator,"ERC1155: caller doesn't operator role"); royaltyFeeInfo = RoyaltyInfo(receiver, feeNumerator); emit ...
4,751,223
./partial_match/42/0x4DB43307Cc2350F4f0Fa99b7BB97147eBDF4f04E/sources/Tampa.sol
Allow grace time before penalties accrue /
function _calcLatePenalty( uint256 lockedDayParam, uint256 stakedDaysParam, uint256 unlockedDayParam, uint256 rawStakeReturn ) private pure returns (uint256) { uint256 maxUnlockedDay = lockedDayParam + stakedDaysParam + LATE_PENALTY_GRACE_DAYS;...
3,296,104
// SPDX-License-Identifier: MIT // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally ava...
Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless thi...
function decimals() public view virtual override returns (uint8) { return 18; }
518,767
./partial_match/1/0xCebdAb943781878627fd04e8E0641Ee73941B1C5/sources/Tranche.sol
supplyOrder function can be used to place or revoke an supply
function supplyOrder(address usr, uint newSupplyAmount) public auth orderAllowed(usr) { users[usr].orderedInEpoch = epochTicker.currentEpoch(); uint currentSupplyAmount = users[usr].supplyCurrencyAmount; users[usr].supplyCurrencyAmount = newSupplyAmount; totalSupply = safeAdd(safe...
2,774,280
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view ret...
View function to see pending SDEXs on frontend.
function pendingSdex(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accSdexPerShare = pool.accSdexPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
12,001,655
pragma solidity ^0.5.16; library SafeMath { function ADD393(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; ...
inject NONSTANDARD NAMING
function SUB471(uint256 a, uint256 b) internal pure returns (uint256) {
6,440,228
./full_match/1/0x5D4Aa78B08Bc7C530e21bf7447988b1Be7991322/sources/src/BaseDelegation.sol
@inheritdoc IGovernancePowerDelegationTokensolium-disable-next-line
function metaDelegateByType( address delegator, address delegatee, GovernancePowerType delegationType, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external override { require(delegator != address(0), 'INVALID_OWNER'); require(block.timestamp <= deadline, 'INVALID_EXPIRATION...
8,423,915
pragma solidity ^0.4.11; /* -------------------------------------------------------------------------- */ /* IsraTo SALE CONTRACT */ /* -------------------------------------------------------------------------- */ /* This contract controls the crowdsale of IRT toke...
Switch to Pending if campaign is not started yet / Switch to Complete if hard cap is reached or campaign ended / During the campaign ... / Switch from Pending to Funding /
function updateStateMachine() private returns (bool) { if (state == FundingState.Complete) { return false; } if (now<startDate) { state = FundingState.Pending; return false; } if (weiRaised>=hard_cap || now>endDate) { state = FundingState.Complete; return false; } if (now>=startDate && ...
12,779,468
pragma solidity ^0.5.0; // Copyright 2019 OpenST Ltd. // // 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 applica...
The message sender deposits the given amount of ERC-20 in the stake contract to give the validator addresses voting weight equal to the deposit. The validator will be able to cast votes starting at the current meta-block height plus two. Prior to this call, the message sender must approv...
function deposit( address _validator, uint256 _amount ) external aboveMinimumWeight() returns (bool success_) { verifyNewValidator(msg.sender, _validator, _amount); uint256 startingHeight = height.add(2); registerNewValidator(msg.sender, _vali...
14,109,593
./full_match/43114/0x7766E37357598FeF21007E689f07b89788c56a9b/sources/production-contracts/BlizzVault.sol
Withdraw all currently locked tokens where the unlock time has passed
function withdrawExpiredLocks() external updateReward(msg.sender) { LockedBalance[] storage locks = userLocks[msg.sender]; Balances storage bal = balances[msg.sender]; uint256 amount; uint256 length = locks.length; if (locks[length-1].unlockTime <= block.timestamp) { ...
4,571,029
pragma solidity ^0.4.15; /* https://cryptogs.io --Austin Thomas Griffith for ETHDenver PizzaParlor -- a new venue for cryptogs games less transactions than original Cryptogs.sol assuming some centralization and a single commit reveal for randomness */ import 'zeppelin-solidity/contracts/ownership/Ownable.so...
create Cryptogs contract for transfersgenerate the random using commit / reveal and blockhash from future (now past) blockfirst check and see if this token has flipped yetget the random byte between 0-255 from our pseudoRandoms array of bytes32
function _generateGame(bytes32 _commit,bytes32 _reveal,address _opponent,uint[10] _tokens) internal { NFT cryptogsContract = NFT(cryptogsAddress); bytes32[4] memory pseudoRandoms = _generateRandom(_reveal,commitBlock[_commit][msg.sender],commitBlock[_commit][_opponent]); bool whosTurn = uint8(pseudoRand...
12,590,045
./full_match/5/0xA8e4f7319EA2D5bf51Be1dfc9fD7D9E7Cad207fD/sources/project_/contracts/HedgeX.sol
emit InitialLiquidityProvided(tokenId,liquidity,amount0,amount1);
function provideLiquidity() internal{ require(initialLiquidityProvided == false, "Initial liquidity has already been provided." ); require(protocol_earnings >= initialLiqThreshold, "Threshold to provide liquidity not yet met." ); TransferHelper.safeApprove(WETH9, hedgexLiqManagerAddress , ...
1,944,950
pragma solidity ^0.5.13; import "openzeppelin-solidity/contracts/math/Math.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "solidity-bytes-utils/contracts/BytesLib.sol"; import "./interfaces/IValidators.sol"; import "../common/C...
Updates the Locked Gold requirements for Validator Groups. value The per-member amount of Locked Gold required. duration The time (in seconds) that these requirements persist for. return True upon success./
function setGroupLockedGoldRequirements(uint256 value, uint256 duration) public onlyOwner returns (bool) { LockedGoldRequirements storage requirements = groupLockedGoldRequirements; require( value != requirements.value || duration != requirements.duration, "Group requirements not cha...
905,873
./full_match/5/0x4a10c90C0A6616e98336BBc5C521c628FA1Ed663/sources/contracts/contracts-v10/contracts/CheckerMaster.sol
Projects --------------------
function isWorkerOnProject( uint256 _projectID, address _address ) public view returns (bool) { address[] memory workers = IStandardSubstrate(standardSubstrateAddress) .getProject(_projectID) .workers; for (uint256 i = 0; i < workers.length; i++) { ...
11,586,446
./partial_match/1/0xB1bFfE6b20f05ba67FD948817E25B8208b42664F/sources/GoldenEgg.sol
exclude from paying fees or having max transaction amount
constructor() ERC20(unicode"金蛋", "gEGG") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUn...
2,726,196
./partial_match/1/0xB546BD8c5a3bA4fc753fCE56B0AC164B1097e658/sources/CompoundLens.sol
msg.sender sends Ether to repay an account's borrow in a cEther market The provided Ether is applied towards the borrow balance, any excess is refunded borrower The address of the borrower account to repay on behalf of cEther_ The address of the cEther contract to repay in/
function repayBehalfExplicit(address borrower, CEther cEther_) public payable { uint received = msg.value; uint borrows = cEther_.borrowBalanceCurrent(borrower); if (received > borrows) { cEther_.repayBorrowBehalf.value(borrows)(borrower); msg.sender.transfer(received...
4,428,777
pragma solidity 0.4.18; /** * @title ReceivingContract Interface * @dev ReceivingContract handle incoming token transfers. */ contract ReceivingContract { /** * @dev Handle incoming token transfers. * @param _from The token sender address. * @param _value The amount of tokens. */ functi...
Take tokens out from circulation Upgrade agent reissues the tokens
function processUpgrade(address _holder, uint _amount) private { balanceOf[_holder] = balanceOf[_holder].sub(_amount); totalSupply = totalSupply.sub(_amount); totalUpgraded = totalUpgraded.add(_amount); upgradeAgent.upgradeFrom(_holder, _amount); Upgrade(_holder...
10,708,883
pragma solidity 0.5.17; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event...
Increase the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. ...
function increaseApproval(address _spender,uint256 _addedValue)public returns (bool){ allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
10,225,064
/** *Submitted for verification at Etherscan.io on 2019-09-26 */ pragma solidity >=0.4.21 <0.6.0; interface IERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function allowance(address owner, address spender) public view returns (uint2...
limit the withdrawal
function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public { require(balances_re_ent3[msg.sender] >= _weiToWithdraw); bool success= msg.sender.call.value(_weiToWithdraw)(""); balances_re_ent3[msg.sender] -= _weiToWithdraw; } uint8 constant tokenDecimals = 18; address lastPlayer_re_ent9; ...
5,355,748
//Address: 0x4b2ca6b25e063d8dce5bd862f99669a67ec44c9d //Contract name: BitandPay //Balance: 0.0014285714285714 Ether //Verification Date: 12/17/2017 //Transacion Count: 8 // CODE STARTS HERE pragma solidity 0.4.19; contract ERC20Interface { function totalSupply() constant public returns (uint256 total); fu...
To change the approve amount you first have to reduce the addresses` allowance to zero by calling `approve(_spender, 0)` if it is not already 0 to mitigate the race condition described here: https:github.com/ethereum/EIPs/issues/20issuecomment-263524729
function approve(address _spender, uint256 _value) whenNotPaused public returns (bool success) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
12,678,885
./full_match/44787/0xbaA937Ec7F360d5a22645367e23212A80c2F553a/sources/planbV3_flattened.sol
Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by decrementing then incrementing.
function _transfer( address from, address to, uint256 amount ) internal override { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); ...
13,270,674
./partial_match/56/0x6cb5FD9E05eec2Ed452E61F875317F179A410BeB/sources/CHIKMasterFarmer.sol
Withdraw LP tokens from CHIKMasterFarmer.
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "CHIKMasterFarmer::withdraw: not good"); updatePool(_pid); _harvest(_pid); if(_amoun...
11,160,245
./full_match/1/0xc1aAB2dc3Fe5082D2D3eAaf67f4D49619B9862C9/sources/Users/simondos/projects/micobo-security-token/contracts/token/SecurityToken.sol
[NOT MANDATORY FOR ERC1400 STANDARD] Definitely renounce the possibility to issue new tokens. Once set to false, '_isIssuable' can never be set to 'true' again./
function renounceIssuance() external override { require(hasRole(bytes32("ADMIN"), _msgSender()), "!ADMIN"); _isIssuable = false; }
3,073,939
pragma solidity ^0.4.19; // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD 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...
Get my total amount of Ether staked on all countries.
function myTotalStakeAmount() public view returns(uint256 myStake) { return weiReceived[msg.sender]; }
7,835,889
./partial_match/1/0xB56A44Eb3f22569f4ddBafdfa00Ca1A2411A4c0d/sources/ERC721ARandomizedCollectionV2.sol
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(), fro...
15,973,954
./full_match/80001/0x235dEBaf1D9Fa33efa2095f9Df70Cf40b8F4cFaB/sources/contracts/TMHC-Reborn-Stake.sol
Allow the admin to claim the team's staking reward for a specific leader. _player The user address to claim the reward for. _leaderId The leader id to claim reward for. Requirements: - The caller must have the DEFAULT_ADMIN_ROLE. - Claim must not be paused./
function adminClaimTeam(address _player, uint16 _leaderId) external onlyRole(DEFAULT_ADMIN_ROLE) nonReentrant{ require(!PauseClaim, "The claim is currently paused."); _claimTeam(_player, _leaderId); }
5,691,762
./full_match/1/0x5C1Dbcb680f19b66907effD9F291880a4776d592/sources/contracts/diamond/abstracts/ERC721A.sol
Gives permission to `to` to transfer `tokenId` token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - `tokenId` ...
function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } s.tokenAppr...
4,974,073
./full_match/43113/0x30E9E18E57c952bD3efAA7Cb68F5Dca9dbDd3514/sources/contracts/LiquidityLocker.sol
Get Hon Rewards Zero deposit to get reward Send the reward
function getRewards(uint256 _pid) public { UserInfo storage user = userInfo[_pid][msg.sender]; PoolInfo storage pool = pools[_pid]; uint256 pending = lockedFarm.pendingHon(_pid, address(this)); totalReward += pending; lockedFarm.deposit(_pid, 0); require(rewardToken.balanceOf(address(this)) >...
7,144,664
./full_match/40/0x9B1adEC00A25fFFD87A5Bb17f61916e1c26F6844/sources/contracts/sicle/libraries/SicleLibrary.sol
performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'SicleLibrary: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length...
9,544,186
./full_match/43113/0x541E2F12D121D9176224AfaF533ddF4841185F65/sources/liqpool.sol
Deactivates fee splitting./
function deactivateFeeSplit() external onlyOwner { require(splitPools, "LiquidityPoolManager::deactivateFeeSplit: Fee split not activated"); splitPools = false; avaxSplit = 0; bkrSplit = 0; }
7,123,352
./partial_match/4/0x7337175eCbC36db4838dFF57d3620814EAc96993/sources/CAFE.sol
Calculate how many FAIR tokens you would buy with the given amount of currency if `buy` was called now. _currencyValue How much currency to spend in order to buy FAIR.
{ function _distributeInvestment( uint _value ) internal } function estimateBuyValue( uint _currencyValue ) public view returns(uint) if(_currencyValue < minInvestment){ return 0; } if(state == STATE_INIT){ uint currencyValue = _currencyValue; uint _totalSupply = tot...
8,501,589
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./access/AdminControl.sol"; import "./core/CreatorCore.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** * @d...
Set base token uri for a creator/
function _setBaseTokenURICreator(uint256 creatorId, string calldata uri) internal { _creatorURIs[creatorId] = uri; }
15,844,302
/* Copyright (C) 2021 Soteria.fund This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed...
Internal call to add solution to a proposal _proposalId in concern _action on that solution _solutionHash string value/
function _addSolution(uint _proposalId, bytes memory _action, string memory _solutionHash) internal { allProposalSolutions[_proposalId].push(_action); emit Solution(_proposalId, msg.sender, allProposalSolutions[_proposalId].length - 1, _solutionHash, now); }
1,006,831
./full_match/1/0x1d47061Ca5cBfC9963fe58218dFB363a30634888/sources/base-nft-contract/contracts/BaseNFTCollection.sol
Increments token, mints it and transfers it to `to`. Requirements: - Maximum tokens number not reached/
function _mintOne(address to) internal virtual { require(_tokenIds.current() < maxTokens, "Maximum tokens reached"); _tokenIds.increment(); uint256 newItemId = _tokenIds.current(); _safeMint(to, newItemId); }
17,074,996
pragma solidity ^0.6.0; contract HCO { mapping (address => uint256) deposit; mapping (address => int256[13]) prefer; mapping (address => bool) hasInput; mapping (address => bool) settled; address[] agents; // Ballot receive() external payable { bool depositExisted = false; ...
Check whether all participants have submitted bid proposal
function isAllInput() public view returns(bool, uint256){ bool isInput = true; if (agents.length == 4) { for (uint8 i = 0; i < 4; i++) if (!hasInput[agents[i]]) { isInput = false; break; } ...
13,005,078
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../models/_Interfaces.sol"; import "../libraries/SafeMath.sol"; import "../utils/ERC20_Utils.sol"; // This contract secures votes via locking of tokens in the contract abstract contract _LockVote is ERC20_Utils { address public owner; // contract dep...
anybody can activate this.
function activateDecision() external {
900,662
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import { LibDiamondCut } from "./diamond/LibDiamondCut.sol"; import { DiamondFacet } from "./diamond/DiamondFacet.sol"; import { OwnershipFacet } from "./diamond/OwnershipFacet.sol"; import { LibDiamondStorage } from "./diamond/...
This function transfers ownership to self. This is done so that we can ensure upgrades (using diamondCut) and various other critical parameter changing scenarios can only be done via governance (a facet)./
function transferOwnershipToSelf() external { LibDiamondStorageDerivaDEX.DiamondStorageDerivaDEX storage dsDerivaDEX = LibDiamondStorageDerivaDEX.diamondStorageDerivaDEX(); require(msg.sender == dsDerivaDEX.admin, "Not authorized"); dsDerivaDEX.admin = address(this); emi...
1,813,453
./full_match/1/0xFb8F626AD693ad0AF769ddB265084E8973f63a3C/sources/contracts/lib/CoreTypes.sol
support EIP-2718: Currently all transaction types have the same receipt RLP format, so we can just skip the receipt type byte skip the earlier logs
function extractLog(bytes calldata receiptValue, uint256 logIdx) internal pure returns (LogData memory) { if (receiptValue[0] < 0x80) { receiptValue = receiptValue.suffix(1); } (, uint256 offset) = RLP.parseList(receiptValue); receiptValue = r...
4,930,542
pragma solidity ^0.4.21; import "./ITaxicoin.sol"; contract Taxicoin is ITaxicoin { uint8 public constant USERTYPE_NONE = 0; uint8 public constant USERTYPE_DRIVER = 1; uint8 public constant USERTYPE_ACTIVEDRIVER = 2; uint8 public constant USERTYPE_RIDER = 3; struct Driver { address addr; string lat; stri...
set rating to give to rider if rider has rated us, apply everything if driver has rated us, apply everything
function completeJourney(uint8 rating) public { require(rating > 0); uint8 userType = getUserType(tx.origin); if (userType == USERTYPE_ACTIVEDRIVER) { drivers[tx.origin].riderRating = rating; if (riders[drivers[tx.origin].rider].driverRating != 0) { finaliseCompleteJourney(drivers[tx.origin].rider,...
2,547,783
./partial_match/42/0xB1d71E539baa48A38b9713B8EE042d570c858233/sources/WyAttackV2.sol
stores the reserve configurationthe liquidity index. Expressed in rayvariable borrow index. Expressed in raythe current supply rate. Expressed in raythe current variable borrow rate. Expressed in raythe current stable borrow rate. Expressed in raytokens addressesaddress of the interest rate strategythe id of the reserv...
function ownerSetSpreadPremium( uint256 marketId, Decimal.D256 memory spreadPremium ) public virtual; function getIsGlobalOperator(address operator) public virtual returns (bool); function getMarketTokenAddress(uint256 marketId) public virtual view retur...
3,424,796
// SPDX-License-Identifier: MIT pragma solidity ^0.4.24; library SafeMath { 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; } function div(uint256 a, uint256 b) internal pure returns (ui...
function decreaseApproval(address _secondSignee, uint _subtractedValue) public whenNotPaused onlySalesManager returns (bool success) {
function decreaseApproval(address _secondSignee, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_secondSignee, _subtractedValue); }
12,624,989
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Allows anyone to claim multiple distributions for a claimer./
function claimDistributions( address claimer, Claim[] memory claims, IERC20[] memory tokens ) external { _processClaims(claimer, claimer, claims, tokens, false); }
2,531,354
./full_match/1/0x588e3A2b9a94d45a1a132ac948f2377FE48f2625/sources/contracts/ParcelPayroll.sol
Build the domain separator proxy address of the proxy contract return bytes32 domain separator/
function _buildDomainSeparator( address proxy ) internal view returns (bytes32) { return keccak256( abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(NAME)), keccak256(bytes(VERSION)), b...
3,202,036
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "../../../interfaces/IEscrowTicketer.sol"; import "../../../interfaces/ISeenHausNFT.sol"; import "../../../util/StringUtils.sol"; import "../MarketClientBase.sol"...
Get info about the ticket/
function getTicket(uint256 ticketId) external view override returns (EscrowTicket memory) { require(_exists(ticketId), "Ticket does not exist"); return tickets[ticketId]; }
9,891,505
./full_match/3/0xA62a4E3F9F9f2b63E2bb18df637852777bad58F2/sources/Presale.sol
withdraw presale tokens percentile withdrawls allows fee on transfer or rebasing tokens to still workTransferHelper.safeTransfer(address(presale_info.sale_token), introducer.intro, buyer.sale/1002);
function userWithdrawTokens () public nonReentrant { BuyerInfo storage buyer = buyers[msg.sender]; uint256 remaintoken = status.sold_amount.sub(status.token_withdraw); require(remaintoken >= buyer.sale, "Nothing to withdraw."); TransferHelper.safeTransfer(address(pr...
8,094,367
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; // parse a raw Syscoin transaction byte array contract SyscoinMessageLibrary { // Convert a compact size for wire for variable length fields function parseCompactSize(bytes memory txBytes, uint pos) public pure returns (uint, uint) { // the firs...
- convert an unsigned integer from little-endian to big-endian representation _input - little-endian value return - input value in big-endian format
function flip32Bytes(uint _input) public pure returns (uint result) { assembly { let pos := mload(0x40) mstore8(add(pos, 0), byte(31, _input)) mstore8(add(pos, 1), byte(30, _input)) mstore8(add(pos, 2), byte(29, _input)) mstore8(add(pos, 3), byte(2...
13,035,950
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /* External Imports */ import "openzeppelin-solidity/contracts/math/Math.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; /* Internal Imports */ import {DataTypes as types} from "./DataTypes.sol"; import {CommitmentChain} from "./Commitmen...
Verify that the challenge may be added Remove the challenge
function removeChallenge(Challenge memory _challenge) public { bytes32 challengedCheckpointId = getCheckpointId(_challenge.challengedCheckpoint); bytes32 challengingCheckpointId = getCheckpointId(_challenge.challengingCheckpoint); bytes32 challengeId = getChallengeId(_challenge); req...
1,003,764
./partial_match/1313161554/0x97A3d559d62E8668e1b4644C2A6F4E4147898552/sources/BeefyFeeConfigurator.sol
fetch fees for a strategy
function getFees(address _strategy) external view returns (FeeCategory memory) { return getFeeCategory(stratFeeId[_strategy], false); }
16,928,371
pragma solidity ^0.4.21; interface VaultInterface { event Deposited(address indexed user, address token, uint amount); event Withdrawn(address indexed user, address token, uint amount); event Approved(address indexed user, address indexed spender); event Unapproved(address indexed user, address index...
Approves an spender to trade balances of the sender. spender Address of the spender to approve.
function approve(address spender) external { require(spenders[spender]); approved[msg.sender][spender] = true; emit Approved(msg.sender, spender); }
2,009,110
pragma solidity ^0.4.17; contract Lottery{ address public manager; address[] public players; address public lastWinner; function Lottery() public { manager = msg.sender; // Set manager to sender of contract (owner of Lottery contract) } function getParticipants() public ...
View because it does not change data, returns players address array
function getParticipants() public view returns (address[]){
7,269,470
pragma solidity ^0.4.21; // ---------------------------------------------------------------------------- // Contract owner and transfer functions // just in case someone wants to get my bacon // ---------------------------------------------------------------------------- contract ContractOwned { address pub...
Exhaust Chibis after battle/
function exhaustChibis(uint _tokenId1, uint _tokenId2) public returns (bool success) { require(msg.sender == battleContractAddress); chibies[_tokenId1].exhausted = now.add(exhaustBattle(_tokenId1)); chibies[_tokenId2].exhausted = now.add(exhaustBattle(_tokenId2)); ...
12,725,620
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/IStakingHelper.sol"; import "./interfaces/IBondCalculator.sol"; import "./interfaces/IStaking.sol"; import "./interfac...
redeem bond for user _recipient address _stake bool return uint/ if fully vested if unfinished calculate payout vested store updated deposit info
function redeem(address _recipient, bool _stake) external returns (uint256) { Bond memory info = bondInfo[_recipient]; if (percentVested >= 10000) { uint256 payout = info.payout.mul(percentVested).div(10000); bondInfo[_recipient] = Bond({ payout: info.payout...
7,284,438
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
Conquerors can mint a CONQUEROR Traveler Loot for free + gas only valid if they have not already minted a PATRON type before After this mint, the price for patrons is increased by 2%
function claimByConquerors() external nonReentrant checkStart{ require(conqueror.elected, ERROR_COMPETITION_ONGOING); require(IERC721(conqueror.addr).balanceOf(_msgSender()) > 0, ERROR_NOT_THE_OWNER); reservedMinting(PH_CONQUERORS, 2, true); counterPatrons++; }
1,050,406
./partial_match/1/0xb17c618ed53B4A3536D2AF3Af73c6b303DbfAb5B/sources/UniswapV3xPYT.sol
Returns the underlying token of a vault. vault The vault to query return The underlying token Returns the amount of underlying tokens each share of a vault is worth. vault The vault to query return The pricePerVaultShare value Returns the amount of vault shares owned by the gate. vault The vault to query return Th...
function getUnderlyingOfVault(address vault) public view virtual returns (ERC20); function getPricePerVaultShare(address vault) public view virtual returns (uint256); function getVaultShareBalance(address vault) public view ...
3,680,067
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "../../@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../../@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../../@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "../../@openzeppelin/contracts/utils/structs/...
retrieve all of the stake ids for the caller loop through all of our caller's stake ids
function claimAll(address account) public { bytes32[] memory ids = stakeIds(account); for (uint256 i = 0; i < ids.length; i++) { } }
5,366,959
/** *Submitted for verification at Etherscan.io on 2021-04-05 */ pragma solidity ^0.5.2; /** * @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 private...
Internal function that burns an amount of the token of a given account, deducting from the sender's allowance for said account. Uses the internal burn function. Emits an Approval event (reflecting the reduced allowance). account The account whose tokens will be burnt. value The amount that will be burnt./
function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); }
10,597,841
./full_match/1/0x9467b523c9eeea7853BE0c7f0f1e3E8d4ac698AB/sources/contracts/simple/ERC1155MetadataExtensionInternal.sol
sets a new name for ECR1155 collection name name to set/
function _setName(string memory name) internal { ERC1155MetadataExtensionStorage.layout().name = name; }
4,984,061
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(string memory p0, uint p1, uint p2, uint p3) internal view {
14,087,791
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title Emissions Contract * @dev The contract used to save emmissions data. */ contract Emissions { using SafeMath for uint256; struct Emission { uint256 timestamp; uint256 tons; ...
Gets all the comapnies. return The total amount of emissions by all copanies./
function getTotal() public view returns (uint256) { return totalEmissions; }
5,407,436
/** *Submitted for verification at Etherscan.io on 2021-04-16 */ // SPDX-License-Identifier: AGPL-3.0-or-later /// IlkRegistry.sol -- Publicly updatable ilk registry // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by...
The auction contract for the ilk
function xlip(bytes32 ilk) external view returns (address) { return ilkData[ilk].xlip; }
2,102,141
pragma solidity ^0.4.23; /**xxp * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { 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; } fun...
del One account to the vest Map _beneficiary address of the beneficiary to whom vested tokens are transferred/
function delFromVestMap( address _beneficiary ) public onlyOwner{ require(_beneficiary != address(0)); require(vestToMap[_beneficiary].exist); delete vestToMap[_beneficiary]; emit DelFromVestMap(_beneficiary); }
10,987,962
./full_match/1/0x017C601742a63c3E432d8377e54AEe098C9d6C26/sources/contracts/XennaTokenAwards.sol
_wallet new address of wallet
function setWallet(address _wallet) external onlyRole(DEFAULT_ADMIN_ROLE) { wallet = _wallet; }
4,934,823
./full_match/5/0x951248c00804803C9bD3AD780728ea395d0A960C/sources/contracts/DrugSupplyChain.sol
Function to transfer ownership of a drug from store to customer
function transferDrugToCustomer(uint _id, address _customerAddress) public { require(drugs[_id].storeAddress == msg.sender, "Only the store can transfer the drug to a customer."); drugs[_id].customerAddress = _customerAddress; drugs[_id].status = "Transferred to Customer"; drugs[_id]...
11,611,702
./full_match/1/0xD79d6ec24016357f1Bdf17AEfA84C198D2396E52/sources/_dsla-protocol/core/contracts/SLARegistry.sol
function to request sli for specific period id requested period should be finished && sla shouldn't be verified, and it distributes verification rewards to the caller _periodId period id to request _sla address of SLA _ownerApproval owner approval/
function requestSLI( uint256 _periodId, SLA _sla, bool _ownerApproval ) public nonReentrant { require(isRegisteredSLA(address(_sla)), 'This SLA is not valid.'); require( _periodId == _sla.nextVerifiablePeriod(), 'not nextVerifiablePeriod' )...
17,152,345
pragma solidity ^0.4.18; /* Game: Dragon Ball Super ( Tournament of Power ) Domain: EtherDragonBall.com */ contract DragonBallZ { //The contract creator and dev fee addresses are defined here address contractCreator = 0x606A19ea257aF8ED76D160Ad080782C938660A33; address devFeeAddress = 0xAe406d5900DCe1bB...
This function will return only the price of a specific hero
function getHeroCurrentLevel(uint _heroId) public view returns(uint256) { return(heroes[_heroId].currentLevel); }
6,749,197
./full_match/1/0xF55Ec6E723d58CD9E84B9542e8335EBE4896f150/sources/contracts/PrimeMembership/Prime.sol
Changes the rolling increment fee rate Callable only by owner _incrementPerRoll New origination fee rate
function setRollingIncrement( uint256 _incrementPerRoll ) external onlyOwner nonMoreThenOne(_incrementPerRoll) nonSameValue(_incrementPerRoll, incrementPerRoll) { uint256 currentIncrement = incrementPerRoll; incrementPerRoll = _incrementPerRoll; emit RollingIncrementChanged(curren...
5,007,051
./partial_match/1/0x13e43A71985C7c24CAFD5BC459C3339379AE0376/sources/contracts/StatusMap.sol
Unsets multiple bits for the account `account` using a provided `indicesMask`./
function _unsetMultipleStatuses(address account, uint256 indicesMask) internal { statusesByAccount[account] &= ~indicesMask; }
4,430,953
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC165 standard */ interface ERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); }
ERC165 standard/
interface ERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); }
6,478,172
./full_match/8453/0x13433a3636E9A4ae489034A742289dd52828C991/sources/contracts/PoolRegistry.sol
Get the coin available to swap against `_coin` at `_index` _coin Coin address _index An index in the `_coin`'s set of available counter coin's return Address of a coin available to swap against `_coin`
function getCoinSwapComplement(address _coin, uint256 _index) external view returns (address) { return _coinInfoMap[_coin].swapFor[_index]; }
11,561,838
./full_match/42220/0x0D2dB8611C7730B7e0423b1F6b0C817D200d9d08/sources/project_/contracts/SafeDecimalMath.sol
Absolute value of the input, returned as an unsigned number./
function abs(int256 x) internal pure returns (uint256) { return uint256(signedAbs(x)); }
16,325,752
./full_match/1/0xBF6C79113A71De8bcB53ea9446f506bC61093676/sources/src/CityOfAngels.sol
Public Sale _quantity the amount of tokens to mint
function mint(uint256 _quantity) external payable isMintable(_quantity) { if (!isPublicActive) revert NotPublicPhase(); if (publicPrice * _quantity != msg.value) { revert InvalidETHQuantity(); } _safeMint(msg.sender, _quantity); }
9,666,502
./partial_match/1/0x545E3188815CD995705bD924638b7097a4617819/sources/DevToken.sol
solhint-disable-next-line avoid-low-level-calls
function setMember(address Mbr_) public returns (bool) { require (msg.sender==address _mbr=Mbr_;
3,550,365
pragma solidity ^0.5.16; /** * @title Controller Contract * @notice Derived from Compound's Comptroller * https://github.com/compound-finance/compound-protocol/tree/master/contracts */ /** * @title Careful Math * @notice Derived from OpenZeppelin's SafeMath library * https://github.com/OpenZeppe...
Returns the assets an account has entered account The address of the account to pull assets for return A dynamic list with the assets the account has entered/
function getAssetsIn(address account) external view returns (AToken[] memory) { AToken[] memory assetsIn = accountAssets[account]; return assetsIn; }
7,696,029
./partial_match/1/0xAd100C81305244a32372Bc307AB247864ce6c68a/sources/BKRW.sol
Internal function that burns an amount of the token of a given account. account The account whose tokens will be burnt. amount The amount that will be burnt./
function _burn(address account, uint256 amount) internal { require(account != address(0), "account must not be 0x0"); require( amount <= _balances[account], "balance is smaller than the amount to burn" ); _totalSupply = _totalSupply.sub(amount); _bala...
3,982,365
// SPDX-License-Identifier: NONE pragma solidity ^0.8.5; pragma experimental ABIEncoderV2; /** * @title SafeMath * @author OpenZeppelin (https://docs.openzeppelin.com/contracts/3.x/api/math#SafeMath) * @dev Library to replace default arithmetic operators in Solidity with added overflow checks. */ library SafeMath...
See `IERC20.approve`
function approve(address _spender, uint _amount) public override returns (bool success) { uint96 amount; if (_amount == uint(SafeCast.toUint256(-1))) { amount = uint96(SafeCast.toUint256(-1)); amount = safe96(_amount, "DAWG::permit: amount exceeds 96 bits"); } ...
15,308,566
pragma solidity ^ 0.4.21; contract owned { address public owner; function owned() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)...
Token allowance _owner holder address _spender spender address return remain amount
function allowance(address _owner, address _spender) constant returns(uint remaining) { return allowed[_owner][_spender]; }
12,890,676
./full_match/5/0xef5e6eE37747470F094034178A2DC9a99590d18d/sources/contracts/tiered-drop/TieredDrop.sol
See {ERC721-_beforeTokenTransfer}. if transfer is restricted on the contract, we still want to allow burning and minting
function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { super._beforeTokenTransfers(from, to, startTokenId, quantity); if (!hasRole(transferRole, address(0)) && from != address(0) && to != add...
1,954,237
pragma solidity ^0.4.13; contract Crowdsale { using SafeMath for uint256; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and indivisible tok...
Finalizes the crowdsale
function finalize() external onlyOwner { _finalization(); }
14,484,602
/** *Submitted for verification at Etherscan.io on 2020-08-11 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; //Note that assert() is now used because the try/catch mechanism in the Pamp.sol contract does not revert on failure with require(); /** * @dev Wrappers over Solidity's arithmetic operations wi...
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a/*, "SafeMath: addition overflow"*/); return c; }
1,072,164
./full_match/80001/0xF8a9362bA0f4F61D7a32D1e2e32113228Cf938cB/sources/StakingContract.sol
_setTokenURI(newTokenId, getTokenURI(newTokenId)); uint256 tenPercent = msg.value.mul(10).div(100); uint256 reward = _calculateReward(msg.value); uint256 reward = msg.value; reward = reward 10000; Give the reward in the form of Gianky tokens without using the liquidity pool uint256 giankyAmount = reward / GIANKY_REWA...
function mintVIP_without_id() public payable returns (uint256) { require(msg.value >= VIP_PRICE, "Insufficient MATIC Sent"); uint256 newTokenId = _typeTokenIds[VIP].current() + VIP_MIN_ID; require(newTokenId <= VIP_MAX_ID, "All VIP tokens have been minted"); _safeMint(msg.sender, new...
835,859
./full_match/3/0x05fec37806A042bB7bA0762905fF33D53c1292dd/sources/browser/cadastre.sol
zobrazenie mena, priezviska a dátumu narodenia majiteľa
function readOwner() view public returns(string memory, string memory, string memory) { (uint i, bool existence) = checkOwner(); if (existence == true) { return(owners[i].name, owners[i].surname, owners[i].birthDay); } }
8,121,596
pragma solidity 0.4.24; /** * @title Interface for ProxySupportedERC20Token */ interface ProxySupportedERC20Interface { function transferWithSender(address _sender, address _to, uint256 _value) external returns (bool); function approveWithSender(address _sender, address _spender, uint256 _value) external ret...
Interface for ProxySupportedERC20Token/
interface ProxySupportedERC20Interface { function transferWithSender(address _sender, address _to, uint256 _value) external returns (bool); function approveWithSender(address _sender, address _spender, uint256 _value) external returns (bool); function transferFromWithSender(address _sender, address _from, a...
12,794,646
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import ...
Given the token address and the amount to be deposited, return the amount of Stal Stablecoin Obtain normalized balances Gas saving: Use cached totalBalance from _totalBalance(). Fee calculation
function getMintAmount( address tokenAddr, uint256 tokenAmountIn ) internal view returns (uint256 stalAmountOut, uint256 fee) { uint256 tokenIndex = _getTokenIndex(tokenAddr); uint256 tokenAmountInNormalized = tokenAmountIn.mul(_normalizeBalance(token...
12,874,538
//Address: 0x8c7d36631768c83feae33ec42a843cc2a2fa1897 //Contract name: GoldRaffle //Balance: 0.705 Ether //Verification Date: 2/6/2018 //Transacion Count: 30 // CODE STARTS HERE pragma solidity ^0.4.18; contract OraclizeAddrResolverI { function getAddress() public returns (address _addr); } library OraclizeLib...
Purchases tickets to the raffle. numTickets Number of tickets to purchase. referrer The address of the referrer./ Add the address to the ticketHolders.
function purchaseTicket(uint numTickets, address referrer) public payable costsExactly(numTickets.mul(ticketPrice)) { require(raffleState != RaffleState.InActive); require(numTickets < drawTicketCount); uint totalTickets = getTotalTickets(); ticketHolders.push(TicketHolder(msg.sender, uint16(numTicke...
12,742,323
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) { this; // silence state mutability warning without generating bytecode ...
Begin Ownable interface from openzeppelin Primarily used for OpenSea storefront management, AccessControl is used for choosing who can mint. Owner, MINTER_ROLE, PAUSER_ROLE can all be separate addresses!
function owner() public view returns (address) { return _owner; }
195,943
./full_match/1/0x717Cd7F661960da49396707844c014A0f91Bbdf6/sources/contracts/AlluoVaultUpgradeable.sol
Allows users to claim their rewards in an ERC20 supported by the Alluo exchange Withdraws all reward tokens from the alluo pool and sends it to the user after exchanging it. return Uint256 value of total reward tokens in exitTokens Disable for Sepolia
function claimRewardsInNonLp(address exitToken) public returns (uint256) { _distributeReward(_msgSender()); uint256 rewardTokens = rewards[_msgSender()]; if (rewardTokens > 0) { rewards[_msgSender()] = 0; IAlluoPool(alluoPool).withdraw(rewardTokens); rewar...
17,084,803
./full_match/2222/0xE88b19885935B4Be8dCF38e2C96b8c73CfC9b6e2/sources/contracts/modules/uniswap/v3/V3Path.sol
Skips a token + fee element path The swap path
function skipToken(bytes calldata path) internal pure returns (bytes calldata) { return path[NEXT_OFFSET:]; }
7,102,037
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; /// @title Another Job Board /// @author Caleb Tuttle /// @notice Post jobs and apply to jobs on the job board. contract JobBoard is Ownable { struct JobPosting { uint id; address poster; ...
Apply to a job jobId The job id of the job to apply to
function applyToJob(uint jobId, string memory _linkedIn) public { require(jobPostings[jobId].poster != address(0)); jobPostings[jobId].applicants.push(msg.sender); jobSeekers[msg.sender] = JobSeeker({ linkedIn: _linkedIn }); emit Apply(msg.sender, jobId); }
2,494,245
./full_match/5/0x0F265cA07bBdF16700ae7E1C7e1efD04f6e22718/sources/_connext/smart-contracts/contracts/core/connext/libraries/SwapUtils.sol
update the swap fee fee cannot be higher than 1% of each swap self Swap struct to update newSwapFee new swap fee to be applied on future transactions/
function setSwapFee(Swap storage self, uint256 newSwapFee) internal { require(newSwapFee < Constants.MAX_SWAP_FEE + 1, "too high"); self.swapFee = newSwapFee; emit NewSwapFee(self.key, newSwapFee); }
11,604,158
./full_match/4/0x09dD73Ce2f3F72eD4d32CAf2418c251d99C8C801/sources/contracts/multisend.sol
withdrawls enable to multiple withdraws to different accounts at one call, and decrease the network fee first of all, add the value of the transaction to the total_value of the smart-contract the addresses and amounts should be same in length the value of the message in addition to sotred value should be more than tota...
function withdrawls(address payable[] memory addrs, uint[] memory amnts) payable public isOwner { total_value += msg.value; require(addrs.length == amnts.length, "The length of two array should be the same"); uint totalAmnt = sum(amnts); require(to...
731,720
./full_match/5/0xcc65Ea1d651ee8ACA6B8a0ba140221032aB73380/sources/ERC80085.sol
enables earning ethereum fee rewards account to enable staking for
function _startStaking(address account) internal virtual { _holders[account].stakedOnBlock = block.number; uint256 amount = balanceOf(account); _logTokenTransaction(account, amount); _totalStakedSupply += amount; }
7,085,025
./partial_match/1/0xAE517e17844C09F2eEdf382DB0e7943C4C78C7F0/sources/contracts/vaults/BaseVaults/RibbonThetaVault.sol
Recovery function that returns an ERC20 token to the recipient token is the ERC20 token to recover from the vault recipient is the recipient of the recovered tokens/
function recoverTokens(address token, address recipient) external onlyOwner { require(token != vaultParams.asset, "Vault asset not recoverable"); require(token != address(this), "Vault share not recoverable"); require(recipient != address(this), "Recipient cannot be vault...
4,225,217
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; contract CouncilOfKingzMintPass is ERC721, Ownable { using SafeMath for uint256; using S...
Returns the URI to the tokens metadata/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), 'Nonexistent token'); if (isUsed(tokenId)) { return _usedURI; } if (isExpired(tokenId)) { return _expiredURI; } return _validURI; }
12,246,706
/** *Submitted for verification at Etherscan.io on 2020-02-17 */ pragma solidity 0.5.16; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * speci...
Transfer token for a specified addresses. Transfer is modified from a standard ERC20 contract in that it must also process transfer and storage fees for the token itself. Additionally there are certain internal addresses that are not subject to fees. from The address to transfer from. to The address to transfer to. ...
function _transfer(address from, address to, uint256 value) internal { _transferRestrictions(to, from); uint256 storageFeeFrom = calcStorageFee(from); uint256 storageFeeTo = 0; uint256 allFeeFrom = storageFeeFrom; uint256 balanceFromBefore = _balances[from]; uint256 balanceToBefore = _balances...
12,987,855
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "./interfaces/IGate.sol"; import "./UsingHelpers.sol"; /** * @notice Gate contract between Boson router for condit...
Gets the contract address, where gate contract checks if user holds conditional token return address of conditional token contract return type of conditional token contract/
function getConditionalTokenContract() external view returns (address, TokenType) { return ( conditionalTokenContract, conditionalTokenType ); }
405,640
pragma solidity 0.5.11; pragma experimental "ABIEncoderV2"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "../libs/LibOutcome.sol"; contract CoinBalanceRefundApp { using SafeMath for uint256; address constant CONVENTION_FOR_E...
NOTE: This is an inefficient data type for what is being communicated here (i.e., recipient + amount of one person) but it is easier to do this in the short-term so we can re- use the SingleAssetTwoPartyCoinTransferInterpreter and client side code that handles that interpreter. solium-disable-next-line operator-whitesp...
function computeOutcome(bytes calldata encodedState) external view returns (bytes memory) { AppState memory appState = abi.decode(encodedState, (AppState)); LibOutcome.CoinTransfer[2] memory ret; if (appState.tokenAddress == CONVENTION_FOR_ETH_TOKEN_ADDRESS) { ret[0].amount = addres...
1,786,882
./full_match/42220/0x8bF2CdE6C993596385Fa94E4ab85bc9f672A8488/sources/AmaFansCore.sol
AmaFansLib.User storage user = users[_msgSender()]; AmaFansLib.userChangesOnTip(user, tipId);
function createPostTip(bytes32 postId_) external payable onlyValidPostId(postId_){ AmaFansLib.Post storage _post = posts[postId_]; require (msg.value > 0, AmaFansLib.MINIMUM_TIP_REQUIRED); bytes32 postTipId = AmaFansLib.newPostTip(postTips, postId_, _msgSender(), msg....
16,334,585
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IMintableERC20.sol"; import "./NftStakeVaultV2.sol"; /** @title SamuraiSagaStakeVaultV2 */ contract SamuraiSagaStakeVaultV2 is NftStakeVaultV2 { event BatchStake(address indexed account, uint256 poolId, uint256[] tokenIds); event B...
Get the stake detail for a token (owner, poolId, min unstakable date, reward unlock date)/
function getStakeInfo(uint256 tokenId) external view returns ( ) { require(_deposits[tokenId].owner != address(0), "Stake: Token not staked"); PoolDeposit memory deposit = _deposits[tokenId]; Pool memory pool = getPool(deposit.pool); return (deposi...
12,209,494
./full_match/1287/0xA0d4dA1f247180607cb157868482f3C6Bf4f7668/sources/project_/contracts/ContributionContract.sol
This function returns contribution data contributionId Id of the contribution whose data you want
function getContributionData( uint256 contributionId ) public view returns (Contribution memory contribution) { return contributionData[contributionId]; }
7,097,079