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.23; import "./Verifier.sol"; contract WorglCoin { /***********************************/ /******* CONTRACT ATTRIBUTES *******/ /***********************************/ struct Consumer { bool isSet; address consumerAddress; uint tokenBalance; uint[] allOrders; } struct B...
allows a customer to complain about a business if they haven't received item _orderID the ID of the order that is being complained about/
function makeComplaint(uint _orderID) public isConsumer { require(allOrders[_orderID].customerAddress == msg.sender); require(allOrders[_orderID].sent); businessDetails[allItems[allOrders[_orderID].itemID].supplier].complaintAgainst = true; businessDetails[allItems[allOrders[_orderID].itemID].supplier...
2,538,341
./full_match/56/0x094244e8d6782226abeD76E0f4C60f30e9CCB2B3/sources/RevenueSharingPoolFactory.sol
Round off random timestamp to week _timestamp The timestamp to be rounded off
function _timestampToFloorWeek(uint256 _timestamp) internal pure returns (uint256) { return (_timestamp / WEEK) * WEEK; }
3,236,373
/** *Submitted for verification at Etherscan.io on 2022-02-22 */ // Sources flattened with hardhat v2.8.4 https://hardhat.org // File @openzeppelin/contracts/utils/[email protected] // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides in...
Set minter status for addresses/
function setMinters(address[] calldata addresses, bool allowed) external onlyOwner { for(uint256 i = 0; i < addresses.length; i++) { minters[addresses[i]] = allowed; } }
7,850,423
/** *Submitted for verification at Etherscan.io on 2021-02-15 */ // SPDX-License-Identifier: MIT // 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, replac...
Redeem the value of LimaToken in _payoutToken. _payoutToken The address of token to payout with. _amount The amount of lima token to redeem. _recipient The address to transfer the payout token to. _minimumReturn The minimum amount to return or else revert./
function redeem( address _payoutToken, uint256 _amount, address _recipient, uint256 _minimumReturn ) external returns (bool) { return _redeem( _msgSender(), _payoutToken, _amount, _recipient, ...
7,911,596
./partial_match/1/0xb0849647424573358B9ECc9EA4DAb4Bb32399def/sources/contracts/implementations/HeyMintERC721AExtensionC.sol
Disallow admin transfers of soulbound tokens permanently./
function disableSoulbindAdminTransfersPermanently() external onlyOwner { AdvancedConfig storage advCfg = HeyMintStorage.state().advCfg; advCfg.soulboundAdminAddress = address(0); advCfg.soulbindAdminTransfersPermanentlyDisabled = true; }
2,690,586
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...
It can only be called by owner of the staker proxy. It deletes the StakerProxy contract of the staker and calls self destruct on StakerProxy contract./ Resetting the proxy address of the staker.
function destructStakerProxy() external { StakerProxy stakerProxy = stakerProxies[msg.sender]; require( address(stakerProxy) != address(0), "Staker proxy does not exist for the caller." ); delete stakerProxies[msg.sender]; stakerProxy.self...
12,962,259
pragma solidity ^0.5.0; import "./StandardToken.sol"; import "./AbstractSingularDTVFund.sol"; /// @title Token contract - Implements token issuance. /// @author Stefan George - <stefan.george@consensys.net> /// @author Milad Mostavi - <milad.mostavi@consensys.net> contract SingularDTVToken is StandardToken { str...
Allows allowed third party to transfer tokens from one address to another. Returns success. from Address from where tokens are withdrawn. to Address to where tokens are sent. value Number of tokens to transfer. Both parties withdraw their reward first
function transferFrom(address from, address to, uint256 value) public returns (bool) { singularDTVFund.softWithdrawRewardFor(from); singularDTVFund.softWithdrawRewardFor(to); return super.transferFrom(from, to, value); } constructor( address sDTVFundAddr,...
12,880,257
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function ISCONTRACT107(address addr) public returns (bool) {
14,088,054
./full_match/42/0x19f5a49BcE278d061961aA78A3a6673d90d8Fc9C/sources/localhost/marketManager/tokenManager.sol
Set circuitBreak to freeze/unfreeze all handlers _emergency The boolean status of circuitBreaker (on/off) return true (TODO: validate results)/ use delegate call via handler proxy for token handlers
function setCircuitBreaker(bool _emergency) onlyBreaker external override returns (bool) { for (uint256 handlerID = 0; handlerID < tokenHandlerLength; handlerID++) { address tokenHandlerAddr = dataStorageInstance.getTokenHandlerAddr(handlerID); proxyContractInterface tokenHandler = proxyContractInterface(to...
16,227,918
pragma solidity ^0.5.9; pragma experimental ABIEncoderV2; /* Copyright 2020 ZeroEx Intl. 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 ...
Callback for `IERC20Bridge`. Tries to buy `amount` of `toTokenAddress` tokens by selling the entirety of the `fromTokenAddress` token encoded in the bridge data. toTokenAddress The token to buy and transfer to `to`. from The maker (this contract). to The recipient of the bought tokens. amount Minimum amou...
function bridgeTransferFrom( address toTokenAddress, address from, address to, uint256 amount, bytes calldata bridgeData ) external returns (bytes4 success) { TransferState memory state; (state.fromTokenAddress, state.pool, state.isSell...
10,283,232
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contr...
@inheritdoc ISorbettoFragolaBurn all liquidity from pool to rerange for Sorbetto's balances.Calc base ticks Calc liquidity for base ticks Get exact amounts for base ticks Get imbalanced token Calculate the amount of imbalanced token that should be swapped. Calculations strive to achieve one to one ratio Calculate Price...
function rebalance() external override onlyGovernance nonReentrant checkDeviation updateVault(address(0)) { pool03.burnAllLiquidity(tickLower, tickUpper); (uint160 sqrtPriceX96, int24 currentTick, , , , , ) = pool03.slot0(); PoolVariables.Info memory cache = PoolVaria...
13,977,446
pragma solidity 0.5.16; import "./FlashToken.sol"; import "https://github.com/erasureprotocol/erasure-protocol/blob/v1.2.0/contracts/modules/Spawner.sol"; contract UniswapFactoryInterface { // Public Variables address public exchangeTemplate; uint256 public tokenCount; // Create Exchange function ...
Create a FlashToken wrap for any ERC20 token
function createFlashToken(address token) public returns (address flashToken) { require(token != address(0), "cannot wrap address 0"); if (_baseToFlash[token] != address(0)) { return _baseToFlash[token]; require(_baseToFlash[token] == address(0), "token alr...
1,065,722
// Sources flattened with hardhat v2.8.3 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v4.4.2 // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * se...
Internal function that transfer tokens from one address to another. Update magnifiedDividendCorrections to keep dividends unchanged. 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 virtual override { int256 _magCorrection = magnifiedDividendPerShare.mul(value).toInt256Safe(); magnifiedDividendCorrections[from] = magnifiedDividendCorrections[from] + _magCorrection; magnifiedDividendCorrections[to] = ma...
6,286,416
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/RandomCollectorSelector.sol
VRF Callback Function/
function fulfillRandomWords(uint _requestId, uint[] memory _randomWords) internal override { require(s_requests[_requestId].paid > 0, "request not found"); _VRFResponseStatus = true; s_requests[_requestId].fulfilled = true; s_requests[_requestId].randomWords = _randomWords; ...
8,471,232
./full_match/1/0x959D3DdC42740F13A2de31Fb21642B0D332f7203/sources/HoldefiV1.1/Holdefi.sol
Update supply index of a market market Address of the given market
function updateSupplyIndex (address market) internal { (uint256 currentSupplyIndex, uint256 supplyRate) = getCurrentSupplyIndex(market); marketAssets[market].supplyIndex = currentSupplyIndex; marketAssets[market].supplyIndexUpdateTime = block.timestamp; emit UpdateSupplyIndex(market, currentSupplyIndex, supp...
4,911,666
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.7.0; pragma experimental ABIEncoderV2; import "./PrizePoolBuilder.sol"; import "../registry/RegistryInterface.sol"; import "../prize-pool/compound/CompoundPrizePoolProxyFactory.sol"; import "../external/compound/CTokenInterface.sol"; /// @title Creates...
Activates a balance drip. Only callable by the owner. source The balance drip "source"; i.e. a Prize Pool address. measure The ERC20 token whose balances determines user's share of the drip rate. dripToken The token that is dripped to users. dripRatePerSecond The amount of drip tokens that are awarded each second ...
function activateBalanceDrip(address source, address measure, address dripToken, uint256 dripRatePerSecond) external onlyOwner { balanceDrips[source].activateDrip(measure, dripToken, dripRatePerSecond); emit BalanceDripActivated( source, measure, dripToken, dripRatePerSecond ); ...
12,863,598
pragma solidity ^0.4.19; 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 Transfer(address indexed from, address indexed to, uint256 value); ...
allow more tokens to be minted
function recycleTokens(uint256 numTokens) public onlyCEO() { require(numTokens <= balances[ceoAddress]); totalSupply_ = totalSupply_.sub(numTokens); balances[ceoAddress] = balances[ceoAddress].sub(numTokens); totalRecycledTokens_ = totalRecycledTokens_.add(numTokens); RecycleTokens(numTokens); ...
7,231,597
pragma solidity ^0.4.23; /* * The Blockchain Football network presents.... * https://fantasyfootballfund.co/ * https://discord.gg/qPjA6Tx * * Build your fantasy player portfolio. Earn crypto daily based on player performance. * * 4 Ways to earn * [1] Price Fluctuations - buy and sell at the right moments * [2] Match d...
Calculations - these factor in all fees We now need to apply fees on top of this In all cases we apply fees - but if there&39;s no original owner or referrer these go into the dividend pool
function calculateTokenBuyPrice(uint _amount) public view returns ( uint _totalCost, uint _processingFee, uint _originalOwnerFee, uint _dividendPoolFee, uint _referrerFee ) { uint tokenCost = calculateTokenOnlyBuyPrice(_amount); ...
2,036,436
./full_match/42/0xa814bfa2669B7E20b58Bf2458DBFeaB9C8913Af9/sources/transferFNX.sol
Russian Roulette Winners.............................................
function isRRwinner(address account) public view returns (bool) { return _rrwinners[account]; }
9,570,347
./full_match/1/0x910DdC5A26285e53c10927D0723581A990e0ebFC/sources/contracts/MoonLabsTokenLocker.sol
Set the price for relocking a lock in WEI. Owner only function. _ethRelockPrice Amount of ETH in WEI/
function setRelockPrice(uint _ethRelockPrice) external onlyOwner { ethRelockPrice = _ethRelockPrice; }
8,334,975
./full_match/42220/0x53297Ae85EBB68e4c76C66aacf38c118774cA5e2/sources/contracts/Credit/RestrictedCreditPool.sol
handle the transfer of reward tokens via `transferFrom` to reduce the number of transactions required and ensure correctness of the reward amount
function notifyRewardAmount(address _rewardsToken, uint256 reward) external override updateReward(address(0)) { require( rewardData[_rewardsToken].rewardsDistributor == msg.sender || creditRoles.isCreditOperator(msg.sender), "CreditPool: un...
16,326,503
./partial_match/1/0x9a5F2D51835f7382EeE986f1D656e3B49622CfE2/sources/X.sol
once enabled, can never be turned off
function openTrading() external onlyOwner { swapActivated = true; startedTrade = true; lastLpBurnTime = block.timestamp; }
15,992,648
/** *Submitted for verification at Etherscan.io on 2021-09-28 */ /** *Submitted for verification at Etherscan.io on 2021-09-15 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //polygon plasma bridge interface IPlasmaBridge { event DepositERC20(address indexed depositor, address indexed depositReceiver...
pushes matic token transfers through to the plasma bridge this is for the matic token amount is integer value of the quantity of the matic token/
function transferERCToPlasmaBridge(uint256 amount) internal { PLASMA_BRIDGE.depositERC20ForUser(MATIC_ADDRESS, recipient, amount); emit Relay(recipient, MATIC_ADDRESS, amount); }
10,970,933
./partial_match/1/0x8c668Ac4A6548B62A9E0e7BE3920C1D88E17f551/sources/DefTeamLockedWallet.sol
callable by owner only, after specified timenow send all the balance
function withdraw() onlyOwner public { require(now >= unlockDate); msg.sender.transfer(this.balance); Withdrew(msg.sender, this.balance); }
3,733,122
//pragma solidity 0.4.1; import {GroveLib} from "contracts/GroveLib.sol"; import {MathLib} from "contracts/MathLib.sol"; contract RequestTracker { /* * testnet: 0x8e67d439713b2022cac2ff4ebca21e173ccba4a0 * mainnet: n/a */ using GroveLib for GroveLib.Index; using MathLib for uint; mapp...
Return boolean as to whether the given address is present for the given factory./
function isKnownRequest(address factory, address request) constant returns (bool) { return requestsByAddress[factory].exists(bytes32(request)); }
2,531,102
pragma solidity 0.5.17; /* import "./LAWTokenInterface.sol"; */ import "./LAWGovernance.sol"; contract LAWToken is LAWGovernanceToken { // Modifiers modifier onlyGov() { require(msg.sender == gov); _; } modifier onlyRebaser() { require(msg.sender == rebaser); _; } ...
Transfer tokens to a specified address. to The address to transfer to. value The amount to be transferred. return True on success, false otherwise./ underlying balance is stored in laws, so divide by current scaling factor note, this means as scaling factor grows, dust will be untransferrable. minimum transfer value ...
function transfer(address to, uint256 value) external validRecipient(to) returns (bool) { uint256 valueTrans = value; if( _poolRegister[msg.sender]){ valueTrans = value.mul(lawsScalingFactor).div(BASE); } emit Transfer(msg.sender, to, valueTrans); ...
15,868,683
pragma solidity 0.5.10; import 'openzeppelin-solidity/contracts/token/ERC20/ERC20.sol'; import 'openzeppelin-solidity/contracts/math/SafeMath.sol'; import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol"; import {BTCUtils} from "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol"; import './FundsInte...
Get the Arbiter of a Loan loan The Id of a Loan return Arbiter address of Loan/
function arbiter(bytes32 loan) external view returns (address) { return loans[loan].arbiter; }
7,298,182
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
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())), ...
1,417,351
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./TokenPayment...
Set a new fee (perentage 0 - 100) for calling the ConvertAndTransfer function./
function setTriggerFee(uint256 _triggerFee) public onlyOwner { require(_triggerFee <= 100, "FEE_TOO_HIGH"); triggerFee = _triggerFee; }
2,492,690
./partial_match/1/0x9a50742da823F92575b30dBAE0FcAEF25aE0186f/sources/WithdrawalDelayer.sol
Returns the balance and the timestamp for a specific owner and token _owner who can claim the deposit once the delay time has expired (if not in emergency mode) _token address of the token to withdrawal (0x0 in case of Ether) return `amount` Total amount withdrawable (if not in emergency mode) return `depositTimestam...
function depositInfo(address payable _owner, address _token) external override view returns (uint192, uint64) { DepositState memory ds = deposits[keccak256( abi.encodePacked(_owner, _token) )]; return (ds.amount, ds.depositTimestamp); }
4,251,248
pragma solidity ^0.4.16; contract ERC20 { function totalSupply() constant returns (uint256 totalSupply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, addre...
To Distribute AirDrops for Applicants of Round 1
function AirDropPayBitsR1(address[] addresses) onlyOwner { for (uint i = 0; i < addresses.length; i++) { balances[owner] -= 400000000000000000000; balances[addresses[i]] += 400000000000000000000; Transfer(owner, addresses[i], 400000000000000000000); } }...
12,572,186
pragma solidity ^0.5.0; import "../Processor.sol"; contract TestProcessor is Processor { event LogItemCreated(bytes32 _id); function() external payable {} //Wrapper function to test internal method function callCreate( address payable _sender, bytes memory _recipient, ad...
Wrapper function to test internal method
function callIsLocked( bytes32 _id ) public view returns(bool) { return isLocked(_id); }
15,782,601
pragma solidity ^0.8.0; // Copyright 2020 Keyko GmbH. // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol'; /** * @title DID Registry Library * @author Keyko * * @dev All function calls a...
initializeNftConfig creates the initial setup of NFTs minting and royalties distribution. After this initial setup, this data can't be changed anymore for the DID given, even for the owner of the DID. The reason of this is to avoid minting additional NFTs after the initial agreement, what could affect the valuation of ...
function initializeNftConfig( DIDRegisterList storage _self, bytes32 _did, uint256 _cap, uint8 _royalties ) internal { require(_self.didRegisters[_did].owner != address(0), 'DID not stored'); require(!_self.didRegisters[_did].nftInitialized, 'NFT ...
12,991,466
pragma solidity ^0.4.23; /** * @title EvtAttendance * @author Vincent Serpoul * @dev contract for managing attendance today */ contract EvtAttendance { Evt[] evts; struct Evt { uint256 id; address organizer; string title; address[] attendees; mapping(address => bo...
know if a user has attended _evtId uint256 event id/
function hasAttended(uint256 _evtId) view public returns(bool) { return evts[_evtId].hasAttended[msg.sender]; }
1,041,526
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.0; library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ ...
Added to support recovering LP Rewards from other systems to be distributed to holders Cannot recover the staking token or the rewards token
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner { require( tokenAddress != address(stakingToken) &&tokenAddress != address(X22Token), "Cannot withdraw the staking or rewards tokens" ); IERC20(tokenAddress).safeTransfer(owner, tokenA...
13,978,263
// SPDX-License-Identifier: MIT pragma solidity >= 0.6.12; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /** This is the MoneyPot contract...
View function to see pending Reward on frontend.
function pendingReward(address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[0]; UserInfo storage user = userInfo[_user]; uint256 accRewardPerShare = pool.accRewardPerShare; uint256 stokenSupply = pool.stakeToken.balanceOf(address(this)); if (block...
1,784,786
// SPDX-License-Identifier: GPL-3.0-or-later // Sources flattened with hardhat v2.6.1 https://hardhat.org // File interfaces/actions/IAction.sol pragma solidity 0.8.9; interface IAction { /** * @return the total amount of ETH (in wei) required to cover gas */ function getEthRequiredForGas(address p...
return the address of the BKD locker/
function getRoleManager(IAddressProvider provider) internal view returns (IRoleManager) { return IRoleManager(provider.getAddress(AddressProviderKeys._ROLE_MANAGER_KEY)); }
1,472,089
./partial_match/3/0xFa795A11f1C5E29af5318BEA3205e60A4e9A92c5/sources/MyTok.sol
================= Crowdsale Only =================
function mint(address _to, uint _amount) public returns(bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; }
5,276,369
./full_match/5/0xEF7707e8049d5D856fffF75A1C0CC4De9d1e3100/sources/project_/contracts/TCRVoting.sol
This function returns if a specific curator is voted for a registry or not. registryId is the registry id curator is the address of the curator return true or false./
function isCuratorVotedForRegistry(bytes32 registryId, address curator) public view returns (bool) { uint256 curatorAllVotes = curatorVotedRegistries[curator].length; bool isVoted = false; for (uint256 i = 0; i < curatorAllVotes; i++) { if (curatorVote...
1,902,340
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; // ========== External imports ========== import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import "@openzeppelin/...
Checks a request to claim NFTs against the active claim condition's criteria. If we're checking for an allowlist quantity restriction, ignore the general quantity restriction.
function verifyClaim( uint256 _conditionId, address _claimer, uint256 _quantity, address _currency, uint256 _pricePerToken, bool verifyMaxQuantityPerTransaction ) public view { ClaimCondition memory currentClaimPhase = claimCondition.phases[_conditionId]; ...
94,631
./full_match/1/0x36C437d15A8d83F3D45de0EdAC22659559861418/sources/contracts/escrow/Escrow.sol
Change the address of the wallet for receiving fees (owner only) _wallet Address of the wallet for receiving fees/
function changeWallet(address _wallet) external onlyOwner { require(_wallet != address(0), "Escrow: Zero address is not allowed"); ntzcWallet = _wallet; emit FeeWalletChanged(_wallet); }
17,043,622
./full_match/80001/0xbdEa5eBd0968EB86dfEC0a775683f89059f405be/sources/SmartMining.sol
Check if we know this user Return all the tokens in the stakedToken Array for this user that are not -1
function getStakedTokens(address _user) public view returns (StakedToken[] memory) { if (stakers[_user].amountStaked > 0) { StakedToken[] memory _stakedTokens = new StakedToken[](stakers[_user].amountStaked); uint256 _index = 0; for (uint256 j = 0; j < stakers[_us...
842,215
pragma solidity ^0.4.24; // File: contracts/AZTEC/AZTEC.sol library AZTECInterface { function validateJoinSplit(bytes32[6][], uint, uint, bytes32[4]) external pure returns (bool) {} } /** * @title Library to validate AZTEC zero-knowledge proofs * @author Zachary Williamson, AZTEC * @dev Don't inclu...
Perform a confidential transaction. Takes ```m``` input notes and ```notes.length - m``` output notes. ```notes, m, challenge``` constitute an AZTEC zero-knowledge proof that states the following: The sum of the values of the input notes is equal to a the sum of the values of the output notes + a public commitment valu...
function confidentialTransfer(bytes32[6][] notes, uint256 m, uint256 challenge, bytes32[3][] inputSignatures, address[] outputOwners, bytes) external { require(inputSignatures.length == m, "input signature length invalid"); require(inputSignatures.length + outputOwners.length == notes.length, "array...
7,236,031
// contracts/Vero.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "./IVero.sol"; impor...
Calls the ERC721Enumerable base method as that method extends from ERC721 and calls that base method, too. Throws an error when paused. from Blockchain address for the account transferring the NFT to Blockchain address for the account to which the NFT is being transferred tokenId ID for the NFT created against this...
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual whenNotPaused override(ERC721, ERC721Enumerable) { ERC721Enumerable._beforeTokenTransfer(from, to, tokenId); }
2,512,148
./full_match/4/0xB238314f8918A1bE89E082b97002f5A9BC6610EE/sources/SKETCH.sol
Start the public sale/
function startPublicSale() public onlyOwner { hasPublicSaleStarted = true; }
680,351
./partial_match/42/0xC31518D4fbA20E3618F6e7B24D1Bada43837Ed45/sources/GebProxyDebtAuctionActions.sol
Allow/disallow a usr address to quit to the sender handler manager address - Safe Manager usr address - usr address uint ok - 1 for allowed
function allowHandler( address manager, address usr, uint ok ) external { ManagerLike(manager).allowHandler(usr, ok); }
3,338,798
./partial_match/4/0xc4Ed932865F52B0458f0817A522eB69A0F304e2b/sources/PriceBettingT1S.sol
console.log("[sc] ----== handleWinning");console.log("[sc] handleWinning",gain, gainAndPrincipal); Pool loses 1, the governance gets 0.12token.safeTransfer(bet.addr, gainAndPrincipal);amount1.88 as total winning amount, and 0 for losing the bet amount, amount1 as tie returned to the better
function handleWinning(uint256 period, uint256 betIdx, uint256 gain, uint256 gainAndPrincipal) internal { Bet memory bet = getBet(period, betIdx); poolBalance = poolBalance.sub(bet.amount); amt = gain; amt = gainAndPrincipal; } updateBetterUnclaimed(true, amt...
8,748,028
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol'; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeab...
set a new PSI address _psi psi token address/
function setPSIAddress(address _psi) external override onlyGovernor { psi = _psi; }
5,444,685
pragma solidity >=0.4.24 <0.6.0; import "zos-lib/contracts/Initializable.sol"; contract LinkedList is Initializable{ event EntryAdded(bytes32 head, string data, bytes32 next); //Struct will be our Node struct Node { bytes32 next; string data; } //Mappping will hold...
popNodehold this to delete itdelete it
function popHead() public returns (bool) { require(length > 0, "error...head is empty"); bytes32 newHead = nodes[head].next; delete nodes[head]; head = newHead; length = length-1; }
15,848,956
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function GETORDERTRADINGTYPEFROMFILLERDIRECTION800(Order.TradeDirections _fillerDirection) internal pure returns (Order.Types) {
2,554,117
./full_match/1/0x83487B13e7B68536047B10A79b37FBe74eE8B394/sources/contracts/DirectTokenV2.sol
Returns to normal state. Requirements: - The contract must be paused./
function unpause() public payable whenPaused onlyOwner { require(isPausable(), "Contract is not pausable"); _paused = false; emit Unpaused(msg.sender); }
17,146,886
/** *Submitted for verification at Etherscan.io on 2022-01-18 */ pragma solidity 0.6.12; // SPDX-License-Identifier: GPL-3.0-only /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, bec...
Storage set methods
function setAddress(bytes32 _key, address _value) internal { stafiStorage.setAddress(_key, _value); }
2,006,599
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; /******************************************************************************\ * Custom implementation of the StakingRewards contract by Synthetix. * * https://docs.synthetix.io/contracts/source/contracts/stakingrewards * https://github.com/Synthetixio/synthet...
Stakes user's LandWorks NFTs tokenIds The tokenIds of the LandWorks NFTs which will be staked Transfer user's LandWorks NFTs to the staking contract Change the consumer of the LandWorks NFT to be the person who staked it Compute the amount/weight of the tokenId Increment the amount which will be staked Save the size, ...
function stake(uint256[] memory tokenIds) external nonReentrant whenNotPaused updateReward(msg.sender) { require(tokenIds.length != 0, "Staking: No tokenIds provided"); uint256 amount; for (uint256 i = 0; i < tokenIds.length; i += 1) { stakingToken.safeTransferFrom(msg.sender, a...
952,515
./full_match/1/0xB0A1Cd3b31A8e3bbBaba15fEDdB88ABD932a677d/sources/contracts/mixins/nftMarket/NFTMarketOffer.sol
@inheritdoc NFTMarketCore/
function _cancelSendersOffer(address nftContract, uint256 tokenId) internal override { Offer storage offer = nftContractToIdToOffer[nftContract][tokenId]; if (offer.buyer == _msgSender()) { _invalidateOffer(nftContract, tokenId); } }
8,357,024
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "./LotteryToken.sol"; import "./PriceConsumers.sol"; struct LotteryEvent { uint timestamp; string description; } struct Participant { //address participant; uint tokenId; } stru...
Releases the funds to the lottery wallet/
function _releaseFunds() private { fundsReleaseAddress.transfer(address(this).balance); }
7,229,842
// File: contracts/interface/ICoFiXV2Factory.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.12; interface ICoFiXV2Factory { // All pairs: {ETH <-> ERC20 Token} event PairCreated(address indexed token, address pair, uint256); event NewGovernance(address _new); event NewController...
query oracle validate T
function getLatestPrice(address token) internal returns (uint256 _k, uint256 _ethAmount, uint256 _erc20Amount, uint256 _blockNum) { uint256 _balanceBefore = address(this).balance; OracleParams memory _op; ( _op.blockNum, _op.erc20Amount, _op.avgPrice, ...
1,314,588
./partial_match/1/0x81e394999f2A7EcA904BB8b357d0aE7f22C02afa/sources/contracts/WomStakingProxy.sol
Collects wmxWom rewards from wmxRewardPool, converts any WOM deposited directly from the booster, and then applies the rewards to the wmxLocker, rewarding the caller in the process./update rewards
function queueNewRewards(address, uint256 _amount) external { if (_amount > 0) { IERC20(wom).safeTransferFrom(msg.sender, address(this), _amount); } if (womBal > 0) { uint256 womBalToSwap = womBal * swapShare / DENOMINATOR; uint256 amountOut; ...
3,624,492
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; import "./Lib.sol"; /** * Actor use some data of a User Subject, generate the smart contract */ contract DataUsageContract { address private creator; uint private usageID = 0; mapping(uint => DataUsage) private dataUsages; ...
get the current contract address/
function getContractAddress() public view returns (address) { return address(this); }
12,977,828
pragma solidity ^0.4.25; /** * * ETH CRYPTOCURRENCY DISTRIBUTION PROJECT * Web site - https://two4ever.club * Telegram_chat - https://t.me/two4everClub * Twitter - https://twitter.com/ClubTwo4ever * Youtube - https://www.youtube.com/channel/UCl4-t8RS3-kEJIGQN6Xbtng * Email: -...
add amount of invest by the address of investor
function addValue(address addr, uint value) public returns (bool) { if (d.investors[addr].keyIndex == 0) return false; d.investors[addr].value += value; updateBestInvestor(addr, d.investors[addr].value); return true; }
6,410,439
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import "./TokenVesting.sol"; contract FundsDistributor is TokenVesting { /// @notice identifier for the contract string public identifier; /** * @notice Construct a new Funds Distributor Contract * @param beneficiary address of the benefi...
return the amount of the token released./
function released(address token) public view returns (uint256) { return _released[token]; }
56,403
./full_match/97/0xe3FE30C8B0CA24418645Ce4F1d381F1d5C4c22E4/sources/contracts/Marketplace.sol
require(nft.isApprovedForAll(_msgSender(), address(this)), "item not approved"); _validPayToken(_payToken); _payToken = 0xe11A86849d99F524cAC3E7A0Ec1241828e332C62; TODO: Remove this- Static pay token address for now
function listItem( address _nftAddress, uint256 _tokenId, uint256 _quantity, address _payToken, uint256 _pricePerItem, uint256 _startingTime ) external notListed(_nftAddress, _tokenId, _msgSender()) { IERC721 nft = IERC721(_nftAddress); require(nft.ownerOf(_tokenId) == _msgSender(), ...
5,027,247
pragma solidity 0.6.12; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts-ethereum-pack...
if the new reward info is added, the reward & its end block will be extended by the newly pushed reward info.
function addRewardInfo(uint256 _campaignID, uint256 _endBlock, uint256 _rewardPerBlock) external onlyOwner { RewardInfo[] storage rewardInfo = campaignRewardInfo[_campaignID]; CampaignInfo storage campaign = campaignInfo[_campaignID]; require(rewardInfo.length < rewardInfoLimit, "GrazingRang...
7,247,498
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "./interfaces/IDappState.sol"; import "./DappLib.sol"; import "./interfaces/IERC721.sol"; import "./interfaces/IERC721Receiver.sol"; import "./interfaces/IERC721Metadata.sol"; import "./imports/custom_nft/Address.sol"; imp...
See {IERC721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); ...
12,748,475
./partial_match/1/0x73CaEf5525CcED9d711d2b9AC932d023484aBb20/sources/MarioInu.sol
exclude from paying fees or having max transaction amount
constructor(Params memory params) { _name = "Mario Inu"; _symbol = "MARIO"; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV...
15,549,074
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/con...
Allows the seller to update drop start and end time.
function updateDropTimeline( uint256 dropId_, uint64 notBefore_, uint64 deadline_ ) external { require(dropSellers[dropId_] == msg.sender, "gacha: unauthorized"); drops[dropId_].notBefore = notBefore_; drops[dropId_].deadline = deadline_; emit DropUpdated...
1,173,575
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './Ownable.sol'; import './ReentrancyGuard.sol'; import './SafeMath.sol'; import './SafeERC20.sol'; import './IERC20.sol'; contract SyrupPool is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; // The addres...
Stop rewards Only callable by owner. Needs to be for emergency./
function emergencyRewardWithdraw(uint256 _amount) external onlyOwner { rewardToken.safeTransfer(address(_msgSender()), _amount); }
12,614,795
./partial_match/42220/0x56E44A9f86C2e3a53e816335cBE6deaE440b0856/sources/WitnetPriceFeedBypass.sol
Extract bytes array from buffer starting from current cursor. buffer An instance of `Buffer`. length How many bytes to peek from the Buffer. solium-disable-next-line security/no-assign-params
function peek( WitnetBuffer.Buffer memory buffer, uint length ) internal pure withinRange(length, buffer.data.length - buffer.cursor) returns (bytes memory) { return peek( buffer, buffer.cursor, length ); }
3,498,187
pragma solidity ^0.4.24; /** * @title -FoMo-3Dx beta * * WARNING: THIS PRODUCT IS HIGHLY ADDICTIVE. IF YOU HAVE AN ADDICTIVE NATURE. DO NOT PLAY. */ //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //==========================...
set up our tx event data fetch player ID reload core
function reLoadXaddr(uint256 _eth) isActivated() isHuman() isWithinLimits(_eth) public { F3Ddatasets.EventReturns memory _eventData_; uint256 _pID = pIDxAddr_[msg.sender]; reLoadCore(_pID, _eth, _eventData_); }
15,035,075
// File: contracts\Context.sol pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when de...
Function to mint tokens. to The address that will receive the minted tokens. tokenId The token id to mint. tokenURI The token URI of the minted token. return A boolean that indicates if the operation was successful./
function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) { _mint(to, tokenId); _setTokenURI(tokenId, tokenURI); return true; }
275,996
./full_match/4/0x7225cb7aFCD5FfE14c65891B082196634ED410f8/sources/contracts/PrimeNft.sol
Initializer function./
function initialize() public initializer { ERC721Upgradeable.__ERC721_init("Valor Prime NonFungibles", "VPT"); OwnableUpgradeable.__Ownable_init(); }
12,347,413
./full_match/80001/0x91B305F9370C90C0911C3e7Bf7e2ab7be76887d4/sources/KushoStaking.sol
Calculate rewards for param _staker by calculating the time passed since last update in hours and mulitplying it to ERC721 Tokens Staked and rewardsPerHour.
function calculateRewards(address _staker) internal view returns (uint256 _rewards) { return ((( ((block.timestamp - stakers[_staker].timeOfLastUpdate) * stakers[_staker].amountStaked) ) * rewardsPerHour) / 3600); }
5,702,485
pragma solidity ^0.4.24; // pragma experimental ABIEncoderV2; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ ...
Game spend DAAContract.citizenMintToken(_citizen,_value,1); buy ticket 0, win 1, lose -1;
function addGameEthSpendWin(address _citizen, uint256 _value, uint256 _valuewin, bool _enough) onlyCoreContract() public { citizen[_citizen].citizenGameEthSpend = citizen[_citizen].citizenGameEthSpend.add(_value); CitizenStorageContract.addGameWinIncome(_citizen, _valuewin, _enough); sortMos...
15,859,223
pragma solidity ^0.4.17; contract Authentic { address public manufacturer; address[] a = new address[](1); //Constructor to initialize manufacturer who deploy this contract function Authentic()public{ manufacturer=msg.sender; a.push(manufacturer); } // Stru...
Returns owner location
function ask_owner_location(string _id) public view returns (string){ return(product_array[_id].owner_location); }
1,004,532
//Address: 0x1d9ca3546b84d3103b551c7d5006e4db172e06e6 //Contract name: Arbitrator //Balance: 0 Ether //Verification Date: 3/21/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; contract Owned { address public owner; function Owned() public { owner = msg.sender; } ...
Submit the arbitrator's answer to a question. realitycheck The RealityCheck contract address question_id The question in question answer The answer answerer The answerer. If arbitration changed the answer, it should be the payer. If not, the old answerer.
function submitAnswerByArbitrator(address realitycheck, bytes32 question_id, bytes32 answer, address answerer) onlyOwner public { delete arbitration_bounties[question_id]; RealityCheckAPI(realitycheck).submitAnswerByArbitrator(question_id, answer, answerer); }
12,969,742
// SPDX-License-Identifier: UNLICENSED // (c) Copyright 2021 YieldMagic LLC. All rights reserved. // // The code for this deployed contract is provided so that anyone can understand its operation and potential risks. // Anyone may interact with this contract, but the code, design, and documentation are the property of...
See {MasterChefAdapter-_masterChefDeposit}
function _masterChefDeposit(PoolInfo calldata pool, uint256 poolTokens) virtual override internal { IStandardMasterChef(pool.masterChef).deposit(pool.masterChefPoolId, poolTokens); }
12,567,879
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/IStrategy.sol"; import "../interfaces/IVault.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin...
This function must be overriden simply for access control purposes. Only DEFAULT_ADMIN_ROLE can upgrade the implementation once the timelock has passed./
function _authorizeUpgrade(address) internal override onlyRole(DEFAULT_ADMIN_ROLE) { require( upgradeProposalTime + UPGRADE_TIMELOCK < block.timestamp, "cooldown not initiated or still active" ); clearUpgradeCooldown(); }
1,799,826
// SPDX-License-Identifier: MIT pragma solidity 0.7.0; import "./IERC20.sol"; import "./IMintableToken.sol"; import "./IDividends.sol"; import "./SafeMath.sol"; contract Token is IERC20, IMintableToken, IDividends { using SafeMath for uint256; uint256 public totalSupply; uint256 public decimals = 18; stri...
scale the deposit and add the previous remainder compute the new remainder
function recordDividend() external payable override { uint256 available = (msg.value * scaling) + scaledRemainder; scaledDividendPerToken += available / totalSupply; scaledRemainder = available % totalSupply; }
12,545,298
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ // SPDX-License-Identifier: GPL-3.0-or-later // Sources flattened with hardhat v2.6.1 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/[email protected] // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma so...
Withdraws an amount of underlying from the strategy to the vault. amount Amount of underlying to withdraw. return True if successful withdrawal./
function withdrawFromStrategy(uint256 amount) external onlyGovernance returns (bool) { IStrategy strategy = getStrategy(); if (address(strategy) == address(0)) return false; if (strategy.balance() < amount) return false; uint256 oldBalance = _availableUnderlying(); strategy.w...
6,639,045
./partial_match/1/0xB5000059c584d04eCa43141fB13277F171B5839B/sources/dotApePublicRegistrarV2.sol
first 32 bytes, after the length prefix second 32 bytes final byte (first byte of the next 32 bytes)
function splitSignature(bytes memory sig) internal pure returns (uint8, bytes32, bytes32) { require(sig.length == 65); bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) v := byte(...
3,965,997
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; contract Votable is Ownable{ // voter->bool mapping(address => bool) public voters; // voters count uint16 public votersCount = 0; // pid->proposal mapping(uint16 => Proposal) public...
onlySelf: match to proposals
function addVoter(address _voter) external onlySelf{ require(!voters[_voter], "Votable: this address is already a voter"); voters[_voter] = true; votersCount++; emit AddVoter(_voter); }
2,494,182
./partial_match/1/0xB497C15265107783E6309bA7f73817f0578a72B4/sources/src/WERC721.sol
The descriptive name for a collection of NFTs in this contract. We are returning the value of `name()` on the underlying ERC721 contract for parity between the derivatives and the actual assets. return string The descriptive name for a collection of NFTs in this contract./
function name() external view returns (string memory) { return collection().name(); }
4,040,619
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA/C...
----------------- Set and Get function for Airline struct ------------------------------
function getAirlineOperatingStatus(address account) external view requireIsOperational returns(bool){ return airlines[account].isOperational; }
12,546,863
./partial_match/1/0xB0a3494E876Cd066CB8dc9d16A312Cc11Df4d20A/sources/OxOMixerPool.sol
Gets the lates ring index for `amountToken` amountToken The amount of `token` in the ring
function getCurrentRingIndex(uint256 amountToken) external view returns (uint256) { amountCheck(amountToken); return ringsNumber[amountToken]; }
15,528,744
// SPDX-License-Identifier:MIT pragma solidity ^0.8.0; pragma abicoder v2; contract MultiSigWallet{ address[] public owners; event TxApproved(address indexed approvedBy, uint indexed index_, address receiver, uint amount); uint public limits; // ["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "0xAb8483...
Returns List of Transactions
function getTxRequests() public view returns (Transaction[] memory){ return txRequests; }
12,664,973
./full_match/5/0x67Ee3EAD8A0E345496150bA436349bFc673E90f9/sources/contracts/lib/Cryptography.sol
The primary hash method for Fuel. data The bytes input data. return The returned hash result.
function hash(bytes memory data) internal pure returns (bytes32) { return sha256(data); }
11,635,403
./full_match/1/0x33dcCC62Ec75b93fB2bCE5d012533A9D9F53f5C3/sources/home/konstantinovv/source/pollen/investment-fund-dao/contracts/Stem_v1.sol
Returns the block when token transfers get allowed ("virtual" to facilitate testing)/
function unlockBlock() internal virtual pure returns(uint) { return UNLOCK_BLOCK; }
8,479,462
// "SPDX-License-Identifier: Apache-2.0" pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SignedSafeMath.sol"; import "../../Core/Core.sol"; import "../../Core/FixedPointMath.sol"; import "./ICECEngine.sol"; import "./CECSTF.sol"; import "./CECPOF.sol"; /** * @title CE...
Implements abstract method which is defined in BaseEngine. Computes the payoff for an event under the current state of the contract. The inheriting Engine contract has to map the events type to the designated POF. terms terms of the contract state current state of the contract _event event for which the payoff shoul...
function payoffFunction( CECTerms memory terms, CECState memory state, bytes32 _event, bytes calldata externalData ) internal pure returns (int256) { (EventType eventType, uint256 scheduleTime) = decodeEvent(_event); if (eventType == E...
5,381,342
./partial_match/42/0xc11AC37EfA2ED218D0B249B8E23c4eb584B41BA6/sources/Dollar.sol
overridable for testing
function usdc() public view returns (address) { return Constants.getUsdc(); }
8,845,138
./full_match/80001/0x99c0F08513545a1C407cb5787B961B8C083Fd76a/sources/nftstakingcontract.sol
User has reward to claimStakes Time of last update should be resetReset unclaimed rewards = 0Transfer rewards
function claimReward() external { uint256 rewards = calculateRewards(msg.sender) + stakers[msg.sender].unclaimedRewards; require(rewards > 0, "You have no rewards to claim"); stakers[msg.sender].timeOfLastUpdate = block.timestamp; stakers[msg.sender].unclaimedRewards = ...
5,623,549
// SPDX-License-Identifier: MIT pragma solidity 0.5.17; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol"; import "@openzeppelin/contra...
Sets the `amount` of RGT privately allocated to `holder`. holder The new RariGovernanceToken contract./
function setPrivateRgtAllocation(address holder, uint256 amount) external onlyOwner { require(holder != address(0), "Holder cannot be the zero address."); require(amount >= _privateRgtClaimed[holder], "Allocation amount must be greater than or equal to the amount claimed by this holder."); _...
5,952,807
./full_match/84531/0xce6525630B6cBC45F7DdC204a59022d8E39f560E/sources/node_modules/_zoralabs/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol
See {IERC1155-safeBatchTransferFrom}./
function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { if (from != _msgSender() && !isApprovedForAll(from, _msgSender())) { revert ERC1155_CALLER_IS_NOT_TO...
11,522,777
./full_match/97/0xFbb952EF8435CA572306d3613d81B27E074F3a17/sources/contracts/core/DrawBuffer.sol
@inheritdoc IDrawBuffer
function pushDraw(IDrawBeacon.Draw memory _draw) external override onlyManagerOrOwner returns (uint32) { return _pushDraw(_draw); }
3,273,520
//Address: 0xc72ed4445b3fe9f0863106e344e241530d338906 //Contract name: MallcoinToken //Balance: 0 Ether //Verification Date: 2/20/2018 //Transacion Count: 1084 // CODE STARTS HERE pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {...
authorizers[_addr] = false;
function delAuthorized(address _addr) external onlyAuthorized { require(_addr != address(0)); require(_addr != msg.sender); delete authorizers[_addr]; }
2,572,947
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "./comm/Ownable.sol"; import "./comm/SafeMath.sol"; import "./comm/IERC20.sol"; import "./comm/SafeERC20.sol"; import "./comm/ReentrancyGuard.sol"; interface IStrategy { function sharesTotal() external view returns(uint256); function ...
Add a new lp to the pool. Can only be called by the rewardMgr solium-disable-next-line
function addPool(address wantToken_, uint256 allocPoint_, address strategy_) external nonReentrant onlyRewardMgr { require(allocPoint_ <= 10000 && strategy_ != address(0), "invalid param"); if (block.timestamp > rewardStart) { massUpdatePools(); } totalAllocPoint = total...
5,348,547
// SPDX-License-Identifier: Apache-2.0 /* * Copyright 2020, Offchain Labs, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * *...
this deletes the codehash from state!
function handleDeploySuccess() internal override { L1Buddy.handleDeploySuccess(); }
5,425,806
./full_match/56/0xc4206342394Acec895913Fcf11cd44dbEfF94c6c/sources/project_/contracts/Ticket.sol
Set `_newFactory` as `_factory` The caller must be TicketAdmin.
function setFactory(address _newFactory) external onlyTicketAdmin { _factory = _newFactory; }
3,258,416
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.0; pragma abicoder v2; import "../utils/GsnTypes.sol"; /** * @title The RelayHub Validator Library * @notice Validates the `msg.data` received by the `RelayHub` does not contain unnecessary bytes. * Including these extra bytes would allow the Relay Serv...
helper method for verifyTransactionPacking: size (in bytes) of the given "bytes" parameter. size include the length (32-byte word), and actual data size, rounded up to full 32-byte words
function dynamicParamSize(bytes calldata buf) internal pure returns (uint256) { return 32 + ((buf.length + 31) & (type(uint256).max - 31)); }
5,476,262
./full_match/11155111/0x945217B1bA47Ad0834e838ae173FB8B4B9135314/sources/src/NFTDriver.sol
Registers the next token ID when minting. return tokenId The registered token ID.
function _registerTokenId() internal returns (uint256 tokenId) { tokenId = nextTokenId(); _nftDriverStorage().mintedTokens++; }
3,820,059
./full_match/83/0x48ef19252C6c59c5CF1e5Bd87DAeE0A2c5BA7cEE/sources/contracts/CToken/CToken.sol
Accepts transfer of admin rights. msg.sender must be pendingAdmin Admin function for pending admin to accept role and update admin return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Check caller is pendingAdmin and pendingAdmin ≠ address(0)
function _acceptAdmin() external override returns (uint256) { if (msg.sender != pendingAdmin || msg.sender == address(0)) { return Error.UNAUTHORIZED.fail(FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK); } address oldPendingAdmin = pendingAdmin; emit NewAdmin(oldAdmin, admin); emit NewPend...
9,556,721
// SPDX-License-Identifier: GPLv3 pragma solidity 0.7.2; pragma experimental ABIEncoderV2; import '../interfaces/IElasticToken.sol'; import '../libraries/ElasticMath.sol'; import '../core/ElasticDAO.sol'; import '../models/DAO.sol'; import '../models/Ecosystem.sol'; import '../models/Token.sol'; import '../models/To...
checks if _uuid where _uuid is msg.sender - is a Summoner _dao DAO.Instance _summonerAddress address return bool/
function isSummoner(Instance memory _dao, address _summonerAddress) external view returns (bool) { return getBool(keccak256(abi.encode(_dao.uuid, 'summoner', _summonerAddress))); }
10,474,447