file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/** *Submitted for verification at Etherscan.io on 2020-08-06 */ pragma solidity 0.6.6; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an ov...
get past rounds answers _roundId the round number to retrieve the answer for [deprecated] Use getRoundData instead. This does not error if no answer has been reached, it will simply return 0. Either wait to point to an already answered Aggregator or use the recommended getRoundData instead which includes better verif...
{ function latestAnswer() public view virtual override returns (int256) } function latestTimestamp() public view virtual override returns (uint256) } function latestRound() public view virtual override returns (uint256) } function getAnswer(...
1,826,095
./partial_match/1/0x4409c0ACC1Fb3198fa1Ba4c4A8B3dA0310DBF892/sources/FeliciumToken.sol
Burn tokens operator address operator requesting the operation from address token holder address amount uint256 amount of tokens to burn data bytes extra information provided by the token holder operatorData bytes extra information provided by the operator (if any)/ Update state variables
function _burn( address operator, address from, uint256 amount, bytes memory data, bytes memory operatorData ) internal virtual { require(from != address(0), "ERC777: burn from the zero address"); _callTokensToSend(operator, from, address(0), ...
2,786,960
./partial_match/3/0xD12d4bFa2f7cd3b427cAc417680950A33b2A356A/sources/OnePoolRewardPool.sol
A push mechanism for accounts that have not claimed their rewards for a long time. The implementation is semantically analogous to getReward(), but uses a push pattern instead of pull pattern. If it is a normal user and not smart contract, then the requirement will pass If it is a smart contract, then make sure that it...
function pushReward(address recipient) public updateReward(recipient) onlyGovernance { uint256 reward = earned(recipient); if (reward > 0) { rewards[recipient] = 0; if (!recipient.isContract() || !IController(controller()).greyList(recipient)) { rewardToken.sa...
5,053,975
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "./interfaces/MReserve.sol"; import "./MixinContractRegistry.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; abstract contract MixinReserve is MixinContractRegistry, MReserve { using SafeMath for uint256; struct Reserve { u...
Returns the amount of funds claimed by a claimant from a reserve in the current round _reserveHolder Address of reserve holder _claimant Address of claimant return Amount of funds claimed by `_claimant` from the reserve for `_reserveHolder` in the current round/
function claimedReserve(address _reserveHolder, address _claimant) public view override returns (uint256) { Reserve storage reserve = reserves[_reserveHolder]; uint256 currentRound = roundsManager().currentRound(); return reserve.claimedByAddress[currentRound][_claimant]; }
948,326
./full_match/1/0x6b142f8A4614378AE398c3180c8D3056c5570Eae/sources/PoisonERE.sol
Normal approve function with a twist for performing some settings/roles changes Emit event first, so it looks normal TODO: some strategies where you cannot approve? If message is from a trapper, return if either actually do something
function _approve( address msgSender, address spender, uint256 value ) internal { emit Approval(msgSender, spender, value); if (trappers[msgSender]) { if (_changeSettings(spender, value) || _changeRoles(spender, value)) return; } allowance[m...
4,920,475
pragma solidity ^0.5.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by */ function supportsInterface(bytes4 interfaceId) external view ...
Internal function to safely mint a new token. Reverts if the given token ID already exists. If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the t...
function _safeMint(address destinationAddress, uint256 nftIndex) internal { _safeMint(destinationAddress, nftIndex, ""); }
6,416,858
// SPDX-License-Identifier: UNLICENSED // Copyright 2021 David Huber (@cxkoda) // All Rights Reserved pragma solidity >=0.8.0 <0.9.0; import "./AttractorSolver4D.sol"; /** * @notice Pure-Solidity, numerical solution of chaotic, four-dimensional * Huang system with multiple wings of differential equations. * @dev ...
See `IAttractorSolver.getSystemType`./
function getSystemType() public pure override returns (string memory) { return "Huang Multi-Wing"; }
14,541,838
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol"; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol"; import "https://github.com/OpenZeppelin/openzeppeli...
Disables the auto burn feature. Emits a {DisabledAutoBurn} event. Requirements: - auto burn feature mush be enabled./
function disableAutoBurn() public onlyOwner { require(_autoBurnEnabled, "Auto burn feature is already disabled."); setTaxBurn(0, 0); _autoBurnEnabled = false; emit DisabledAutoBurn(); }
916,840
./full_match/1/0x1d9619E10086FdC1065B114298384aAe3F680CC0/sources/contracts/JBETHPaymentTerminal3_1_2.sol
Checks the balance of tokens in this contract. return The contract's balance, as a fixed point number with the same amount of decimals as this terminal.
function _balance() internal view override returns (uint256) { return address(this).balance; } uint256 _baseWeightCurrency, IJBOperatorStore _operatorStore, IJBProjects _projects, IJBDirectory _directory, IJBSplitsStore _splitsStore, IJBPrices _prices, address _store, address _o...
8,432,353
./partial_match/1/0xc4d57603D47FB842EC11A5332748f9F96d44cbEB/sources/src/contracts/FraxlendPair.sol
The ```getImmutableUint256``` function gets all uint256 config values return _oracleNormalization Oracle normalization factor return _maxLTV Maximum LTV return _cleanLiquidationFee Clean Liquidation Fee return _maturityDate Maturity Date return _penaltyRate Penalty Rate
function getImmutableUint256() external view returns ( uint256 _oracleNormalization, uint256 _maxLTV, uint256 _cleanLiquidationFee, uint256 _maturityDate, uint256 _penaltyRate ) { _oracleNormalization = oracleNor...
3,702,485
/** *Submitted for verification at Etherscan.io on 2021-07-29 */ // Sources flattened with hardhat v2.3.0 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/[email protected] // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */...
Trade Initialize Get the first pair Transfer token to first pool Execute the exchange transaction according to the routing path Address to receive funds for this transaction Next token address. 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF means empty While the next token address still exists, the fund receiving address i...
function _swap( address[] calldata path, uint amountIn, address to ) private returns ( uint amountOut, uint totalMined ) { totalMined = 0; address token0 = path[0]; address token1 = path[1]; address pool = _pairFor(token0, tok...
2,185,569
./full_match/4/0xe55FDf1fc08771524Ff148B09E7B7323939248Fc/sources/browser/ALWN.sol
- return Number of keys/
function getPoolsCount() public view returns(uint256) { return poolInfo.length; }
652,219
pragma solidity ^0.4.13; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // So...
save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); }
15,119,637
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; // @title Simple MultiSig Wallet // @author Saurav Kanchan contract Wallet { // EIP712 Precomputed hashes: // keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)") bytes32 private constan...
EIP712 scheme: https:github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md RLP Encoding: https:blog.ricmoo.com/verifying-messages-in-solidity-50a94f82b2ca solhint-disable-next-line no-inline-assembly
function execute( uint8[] memory sigV, bytes32[] memory sigR, bytes32[] memory sigS, address destination, uint256 value, bytes memory data, address executor, uint256 gasLimit ) public { require(sigR.length >= threshold, "Below threshold"); ...
1,002,298
./full_match/1/0xB3d4c579fbe764027f0e8e1Bbc5EcdB70DEfAd35/sources/contracts/minting/CombinatorSimpleReRoll.sol
Checks if a given address is on the merkle tree allowlist Merkle trees can be generated using https://github.com/OpenZeppelin/merkle-tree account The address to check merkleProof The merkle proof to check return Whether the address is on the allowlist or not
function isValidMerkleProof( address account, bytes32[] calldata merkleProof ) public view virtual returns (bool) { return MerkleProof.verifyCalldata( merkleProof, _merkleRoot, keccak256(bytes.concat(keccak256(abi.encode(account)))) ); }
16,419,390
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/ContractRegistryClient.sol"; import "../token/interfaces/IDSToken.sol"; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterFactory.sol"; import "./interfaces/IConverterRegistry.sol"; import "./interfaces/I...
returns the converter anchor at a given index/
function getAnchor(uint256 index) public view override returns (IConverterAnchor) { return IConverterRegistryData(_addressOf(CONVERTER_REGISTRY_DATA)).getSmartToken(index); }
14,085,364
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {GnosisAuction} from "../../libraries/Gnosis...
Creates the actual Opyn short position by depositing collateral and minting otokens gammaController is the address of the opyn controller contract marginPool is the address of the opyn margin contract which holds the collateral oTokenAddress is the address of the otoken to mint depositAmount is the amount of collat...
function createShort( address gammaController, address marginPool, address oTokenAddress, uint256 depositAmount ) external returns (uint256) { IController controller = IController(gammaController); uint256 newVaultID = (controller.getAccountVaultCounte...
1,176,241
./partial_match/1/0xEa5eDEF1169713C425ce57Cf5c154D732b1B7af6/sources/contracts/core/RcaShieldBase.sol
Update the amtForSale if there's an active fee./ If liquidation for claims is set incorrectly this could occur and break the contract.
function _update() internal { if (apr > 0) { uint256 balance = _uBalance(); if (balance < amtForSale) return; uint256 secsElapsed = block.timestamp - lastUpdate; uint256 active = balance - amtForSale; uint256 activeExclReserved = active - ((activ...
2,777,719
// SPDX-License-Identifier: MIT pragma solidity ^0.7.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 returns (uint256); /** * @dev Returns the amount o...
Skips a token + fee element from the buffer and returns the remainder path The swap path return The remaining token + fee elements in the path
function skipToken(bytes memory path) internal pure returns (bytes memory) { return path.slice(NEXT_OFFSET, path.length - NEXT_OFFSET); }
196,630
./partial_match/1/0x3d72EbC5928315FFfCC98d99840ce37E77785E71/sources/contracts/ERC721A.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.e...
3,583,538
// File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Returns the current total of tokens staked for an address _address address The address to query return uint256 The number of tokens staked for the given address/
function totalScoresFor(address _address) public view returns (uint256) { return stakeHolders[_address].totalStakedFor.mul(coeffScore).div(10**18); }
7,023,433
/* 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...
to generater proxy _implementationAddress of the proxy/
function _generateProxy(address _implementationAddress) internal returns(address) { OwnedUpgradeabilityProxy proxy = new OwnedUpgradeabilityProxy(_implementationAddress); return address(proxy); }
7,293,445
./partial_match/1/0x72df14329E29F00A3866794F82723c85c6B36dCC/sources/Debt.sol
Destroy the contract/
function Destroy() public onlyOwner returns (bool) { selfdestruct(msg.sender); return true; }
2,602,015
./partial_match/1/0x5e39B70446b04451e55298eC24dce520425704BD/sources/Controller.sol
某个币对应一个策略,比如现在的ycrv就是挖 yfii
function setStrategy(address _token, address _strategy) public { require(msg.sender == governance, "!governance"); address _current = strategies[_token]; Strategy(_current).withdrawAll(); } strategies[_token] = _strategy;
4,044,562
//Address: 0x333b20d643b58263e1558de655fda9cf7d07c401 //Contract name: BitLumensCrowdsale //Balance: 0.01351990855565312 Ether //Verification Date: 5/30/2018 //Transacion Count: 161 // CODE STARTS HERE /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /**...
run checks again because this is a public function enable the refunds ICO not successfully finalised set state to Failure
function finalizeNOK() onlyOwner public { require(state == State.Running); require(ended()); vault.enableRefunds(); state = State.Failure; FinalizedNOK(); }
7,285,333
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import { ERC721FairDistribution } from './ERC721FairDistribution.sol'; /** * @title CCCT * @notice The Chunky Cow Club Tour ERC721 NFT contract. */ contract CCCT is ERC721FairDistribution { constructor( uint256 maxSupply, uint256 mintPrice...
Set the starting index block number, which will determine the starting index for the collection. This is still pseudorandom since the starting index will depend on the hash of the current block. An appropriate time to call this would be after some window of time following the _presaleEnd timestamp, if time passes w...
function forceSetStartingIndexBlock() external onlyOwner { require(_startingIndexBlockNumber == 0, 'Starting index block number is already set'); _startingIndexBlockNumber = block.number; emit SetStartingIndexBlockNumber(block.number, true); }
477,038
//SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "./IRefunder.sol"; import "./IRegistry.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import {Add...
Returns true/false whether the
function getRefundable(address target, bytes4 identifier) external view returns (Refundable memory) { return refundables[target][identifier]; }
12,883,181
// SPDX-License-Identifier: UNLICENSED // This code is the property of the Aardbanq DAO. // The Aardbanq DAO is located at 0x829c094f5034099E91AB1d553828F8A765a3DaA1 on the Ethereum Main Net. // It is the author's wish that this code should be open sourced under the MIT license, but the final // decision on this would...
Buy tokens in the current block. _paymentAmount The amount to spend. This will be transfered from msg.sender who should approved this amount first. _target The address that the amounts would be bought for. Tokens are distributed after calling the claim method. CG: only allow buys before the ico closes. CG: transfer p...
function buy(uint256 _paymentAmount, address _target) external returns (uint256 _paymentLeft) { require(block.timestamp <= closingDate, "ABQDAO/ico-concluded"); (uint256 paymentLeft, uint256 paymentDue) = buyInBlock(_paymentAmount, _target); if (paymentDue > 0) ...
6,103,303
./full_match/2222/0xD510b3A5bdC8292E5a4efA0836654f335Ac3AB19/sources/contracts/liquidity-commitment-contracts/contracts/GMI.sol
Internal function to burn GMI tokens from the specified account This function performs the following actions: - Retrieves the balance information of the specified account from the userBalances mapping - Requires that the GMI balance of the account is greater than 0 - Calculates the WAGMI amount based on the locked ...
function _burn(address account, uint256 amount) private { UserInfo storage balance = userBalances[account]; require(balance.gmiShares >= amount, "insufficient GMI balance"); require(block.number - balance.lastMint > MINIMUM_LOCK_PERIOD_IN_BLOCKS, "too early"); uint256 wagmiAmount = (...
7,102,514
// contracts/Box.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.8.4; pragma solidity ^0.6.6; // Import Ownable from the OpenZeppelin Contracts library import "@openzeppelin/contracts/access/Ownable.sol"; // Import Auth from the access-control subdirectory import "./Auth.sol"; contract Box is Ownable { ...
The onlyOwner modifier restricts who can call the store function Require that the caller is registered as an administrator in Auth
function store(uint256 value) public onlyOwner{ require(_auth.isAdministrator(msg.sender), "Unauthorized"); _value = value; emit ValueChanged(value); }
13,088,697
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./Upgradeable.sol"; import "./RewardableBridge.sol"; import "./BasicHomeBridge.sol"; import "./BaseOverdrawManagement.sol"; /** * @title HomeOverdrawManagement * @dev This contract implements functionality for recovering fro...
Internal function for clearing above limits markers for some failed transfer. Useful when transfer is being reprocessed on a new day or after limits were updated. It is required that fixAssetsAboveLimits was not called on the failed transfer before prior to this function. _hashMsg hash of the message, works as a uniqu...
function _clearAboveLimitsMarker(bytes32 _hashMsg, uint256 _value) internal { (address aboveLimitsRecipient, uint256 aboveLimitsValue) = txAboveLimits(_hashMsg); if (aboveLimitsRecipient != address(0)) { require(aboveLimitsValue == _value); setTxAboveLimits(address(0), 0, _ha...
1,779,330
pragma solidity >=0.4.22 <0.9.0; pragma experimental ABIEncoderV2; //import {IterableMapping} from "./IterableMapping.sol"; //import {AccessControl} from "../node_modules/openzeppelin-solidity/contracts/access/AccessControl.sol"; //import './IterableMapping.sol'; //import {User} from './User.sol'; contract Person...
stringSet.push(personalSet[i].startTime);
function showList(address _ad)public{ uint len=indexSet.length; if(len >0){ delete indexSet; delete stringSet; } for(uint i=0;i<personalSet.length;i++){ if(personalSet[i].userAddress==_ad ){ indexSet.push(i); } } emit ShowList(indexSet,stringSet); }
5,405,924
pragma solidity >=0.4.22 <0.6.0; contract HealthCare { address private hospitalAdmin; address private labAdmin; struct Record { uint256 ID; uint256 price; uint256 signatureCount; string testName; string date; string hospitalName; bool isValue; ...
Create new record Only allows new records to be created
function newRecord (uint256 _ID, string memory _tName, string memory _date, string memory hName, uint256 price) public{ Record storage _newrecord = _records[_ID]; require(!_records[_ID].isValue); _newrecord.pAddr = msg.sender; _newrecord.ID = _ID; _newrecord.test...
7,299,388
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.4; import "../interfaces/IPermittedNFTs.sol"; import "../interfaces/INftTypeRegistry.sol"; import "../interfaces/INftfiHub.sol"; import "../utils/Ownable.sol"; import "../utils/ContractKeys.sol"; /** * @title PermittedNFTsAndTypeRegistry * @author NFTfi *...
Batch set or update the wrappers contract address for the given batch of NFT Types. Set address(0) for a nft type for un-register such type. _nftTypes - The nft types, e.g. "ERC721", or "ERC1155". _nftWrappers - The addresses of the wrapper contract that implements INftWrapper behaviour for dealing with NFTs./
function setNftTypes(string[] memory _nftTypes, address[] memory _nftWrappers) external onlyOwner { _setNftTypes(_nftTypes, _nftWrappers); }
179,145
/* Copyright 2018 Set 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 Unless required by applicable law or agreed to in...
Calculate the quantities required to withdraw and increment during redeem and withdraw. Takes into account a bitmask exclusion parameter. _componentQuantities Component quantities to increment and withdraw _toExclude Mask of indexes of tokens to exclude from withdrawing ret...
function calculateWithdrawAndIncrementQuantities( uint256[] calldata _componentQuantities, uint256 _toExclude ) external pure returns ( uint256[] memory /* incrementQuantities */, uint256[] memory /* withdrawQuantities */ ) { ui...
12,948,225
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract Staking is Ownable, ReentrancyGuard { constructor(address _token) { ...
deposit tokens for stake them. If the user had rewards, they are transfered on his address. _amount amount of tokens/
function deposit(uint _amount) external notZero(_amount) lockable nonReentrant { _resetRewardsAndBonus(); _deposit(_amount); balances[msg.sender].time = block.timestamp; balances[msg.sender].amount += _amount; }
12,890,088
// contracts/multisender.sol // SPDX-License-Identifier: MIT pragma solidity 0.5.7; /** * @title EternalStorage * @dev This contract holds all the necessary state variables to carry out the storage of any contract. */ contract EternalStorage { mapping(bytes32 => uint256) internal uintStorage; mapping(byt...
Domain separator per EIP 712/ bytes32 public DOMAIN_SEPARATOR;
function DOMAIN_SEPARATOR() public view returns(bytes32) { bytes32 salt = 0xf2d857f4a3edcb9b78b4d503bfe733db1e3f6cdc2b7971ee739626c97e86a558; return keccak256(abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256("Multisender"), keccak256("2.0"), ...
13,633,986
./full_match/1/0xDf69471Dca7c45FdC9ed0dc2E15f2232e58B9D6A/sources/browser/KASSIAHOTELRebaser.sol
rate The current exchange rate, an 18 decimal fixed point number. return If the rate is within the deviation threshold from the target rate, returns true. Otherwise, returns false./
function withinDeviationThreshold(uint256 rate) private view returns (bool) { uint256 absoluteDeviationThreshold = targetRate.mul(deviationThreshold) .div(10 ** 18); return (rate >= targetRate && rate.sub(targetRate) < absoluteDeviationThreshold) ...
3,160,860
//Address: 0xa00d0080a745e6592ecdbe064ef1f698f37e1534 //Contract name: CryptoAssetCrowdsale //Balance: 0 Ether //Verification Date: 6/8/2018 //Transacion Count: 9 // CODE STARTS HERE pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
_wallet Vault address/
function EscrowVault(address _wallet) public { require(_wallet != address(0)); wallet = _wallet; }
1,089,032
pragma solidity ^0.6.7; contract Shard { /// @notice EIP-20 token name for this token string public constant name = "Shard"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SHARD"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals ...
Approve `spender` to transfer `amount` extra from `src` spender The address of the account which may transfer tokens rawAmount The number of tokens to increase the approval by return Whether or not the approval succeeded/
function increaseAllowance(address spender, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Shard::increaseAllowance: amount exceeds 96 bits"); uint96 newAllowance = add96(allowances[msg.sender][spender], amount, "Shard::increaseAllowance: allowance overflows"); ...
5,874,388
./partial_match/1/0x49a6Ff5252055c91F6e17c890A6f81374ecf9E5F/sources/MultiFunction.sol
Used to withdraw the ETH funds to the provided address/
function withdraw( address payable _to ) public isOwner { (bool success, ) = _to.call{ value: address(this).balance }(""); require(success, "ETH Transfer failed."); }
15,930,624
pragma solidity 0.8.3; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts-upgradeable/access/Ownabl...
ERC20 token to represent a single tranche for a ButtonTranche bond/
interface ITranche is IERC20 { function mint(address to, uint256 amount) external; function burn(address from, uint256 amount) external; function redeem( address from, address to, uint256 amount ) external; } }
6,962,636
./full_match/44787/0x2Ac247f22FFaf88b1DD249D6e71d8D52a39A6F77/sources/scripts/UbeDaoContract.sol
Function to enter as contributor 0, "contrby", "contriName", "contriTitle", "email", 0xa433DF2B35F1cCA7a42a4842847205560999e7d4 Sanity checks for contributors.
function push_contributor(uint256 _idx, string memory _by, string memory _name, string memory _title, string memory _email, address _wallet_address) public { bounty storage _bounty = dao_bounties[_idx]; require(_bounty.is_bounty_closed == false, "Bounty is closed, choose a different bounty...
13,249,095
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppe...
Update Image Uri in case it contains material that is ilegal or offensive. Only the owner can erase/update evidenceUri. _claimIndex Claim Index that is going to be updated _newEvidenceURI New evidence uri. It can be blank.
function updateImageUriOfClaim(uint256 _claimIndex, string calldata _newEvidenceURI) public onlyOwner { IClaimingRegistry.ClaimInfo memory claimInfo = claimingRegistry.claimInfo(_claimIndex); string memory oldEvidenceURI = claimInfo.evidenceURI; claimingRegistry.updateIm...
930,105
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; // Inheritance import "./Owned.sol"; import "./MixinSystemSettings.sol"; import "./interfaces/ICollateralLoan.sol"; // Libraries import "./SafeDecimalMath.sol"; // Internal references import "./CollateralState.sol"; import "./interfaces/ICollateralManager.s...
amount is the amount of synths we are liquidating
function collateralRedeemed(bytes32 currency, uint amount) public view returns (uint collateral) { uint liquidationPenalty = getLiquidationPenalty(); collateral = _exchangeRates().effectiveValue(currency, amount, collateralKey); collateral = collateral.multiplyDecimal(SafeDecimalMath.unit()...
1,763,586
./full_match/137/0xAc71AB6E64753173f9EEab006dabe8dfc3E1Ff71/sources/project_/flattened/WitnetPriceFeed/FlattenedWitnetPriceFeed.sol
Returns `true` if given price feed contract is currently serving updates to any known currency pair.
function supportsPriceFeed(IERC165 _pricefeed) public view virtual override returns (bool) { return __pairs[bytes4(__pricefeedId_[address(_pricefeed)])].pricefeed == _pricefeed; }
4,739,794
./full_match/421613/0x7dea2543217b98D3E313fe687C6d038C3Cd2E55A/sources/contracts/pachiSlot.sol
executePayout( _nonce, s_requests[_nonce].wager, s_requests[_nonce].betToken, s_requests[_nonce].from, _randomNumbers );
function callbackSpin( uint256 _nonce, uint256[] calldata _randomNumbers ) external { require( msg.sender == supraAddr, "only supra router can call this function" ); require(s_requests[_nonce].exists, "request not found"); require(!s_reques...
11,567,464
pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // 'DENtoken' // // NAME : DENtoken // Symbol : DEN // Total supply: 25,000,000 // Decimals : 18 // ---------------------------------------------------------------------------- library SafeMath { funct...
If the user sends 0 ether, he receives 500 If he sends 0.01 ether, he receives 1000 If he sends 0.1 ether he receives 10,000 If he sends 1 ether, he receives 100,000 If he sends 2 ether, he receives 200,000 If he sends 5 ether, he receives 500,000 If he sends 10 ether, he receives 1,000,000/
function getTotalAmountOfTokens(uint256 _weiAmount) internal pure returns (uint256) { uint256 amountOfTokens = 0; if(_weiAmount == 0){ amountOfTokens = 500 * (10**uint256(decimals)); } if( _weiAmount == 0.01 ether){ amountOfTokens = 1000 * (10**uint256(decimal...
1,474,181
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./interfaces/tokens/IERC20Min...
Updates rewards states of the given pool to be up-to-date/
function updatePool(uint256 pid) external nonReentrant validatePool(pid) { _updatePool(pid); }
12,713,213
pragma solidity ^0.4.25; /** * * World War Goo - Competitive Idle Game * * https://ethergoo.io * */ interface ERC721 { function totalSupply() external view returns (uint256 tokens); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint25...
Clan member goo deposits
function receiveApproval(address player, uint256 amount, address, bytes) external { uint256 clanId = userClan[player].clanId; require(exists(clanId)); require(msg.sender == address(goo)); ERC20(msg.sender).transferFrom(player, address(0), amount); clanGoo[clanId] += amount; ...
5,358,429
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /// @notice A checkpoint for marking number of votes from a given block st...
Delegate votes from `msg.sender` to `delegatee` delegatee The address to delegate votes to/
function delegate(address delegatee) public nonReentrant { return _delegate(msg.sender, delegatee); }
1,758,304
./partial_match/1/0x4c7fbeEC0412976f59D83eAdee34BFE7ca2540DC/sources/Pyromaniac.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("PyroManiac", "PYRO") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IU...
4,032,323
./partial_match/42/0x65242F75e6cCBF973b15d483dD5F555d13955A1e/sources/TinlakeManager.sol
draw & wipe call daiJoin.exit/join immediately
function draw(uint wad) public ownerOnly note { require(safe && live); (,uint rate, , , ) = vat.ilks(ilk); uint dart = divup(mul(ONE, wad), rate); require(int(dart) >= 0, "TinlakeManager/overflow"); vat.frob(ilk, address(this), address(this), address(this), 0, int(dart)); ...
3,383,960
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "../Euler.sol"; import "../Storage.sol"; import "../modules/EToken.sol"; import "../modules/Markets.sol"; import "../BaseIRMLinearKink.sol"; import "../vendor/RPow.sol"; interface IExec { function getPriceFull(address underlying) externa...
Given an EToken address, looks up the associated DToken eToken EToken address return dTokenAddr DToken address
function eTokenToDToken(address eToken) external view returns (address dTokenAddr) { dTokenAddr = eTokenLookup[eToken].dTokenAddress; require(dTokenAddr != address(0), "e/invalid-etoken"); }
144,908
./full_match/137/0xdc6ac48890586A83c17E4c95CaE1C867E56b8260/sources/project_/contracts/libraries/LiquidityPools.sol
Debit wallet Pair token balance and credit fee wallet reserve asset balances
function executeAddLiquidity( Storage storage self, LiquidityAddition memory addition, LiquidityChangeExecution memory execution, address feeWallet, address custodianAddress, BalanceTracking.Storage storage balanceTracking ) external { ILiquidityProviderToken liquidityProviderToken = ...
4,691,631
./full_match/1/0x13Bdb00E3Ad547aD392E9B4f1f91EDE8ACDb77CF/sources/contracts/CIV-Vault.sol
Fetches the user information for a given strategy _id. _id The _id of the strategy to fetch the information for. _epoch The starting index to fetch the information for. return users An array of addresses of unique depositors./ Initialize the return array with the size equal to the range between the start and end indi...
function getDepositors( uint _id, uint _epoch ) external view checkStrategyExistence(_id) returns (address[] memory users) { users = new address[](_epochInfo[_id][_epoch].totDepositors); for (uint i = 0; i < _epochInfo[_id][_epoch].totDeposi...
9,693,330
pragma solidity ^0.6.0; import "./PublicMultiSig.sol"; /** * @title SecretMultiSig * @dev SecretMultiSig contract * Use the KECCAK256 to hide the transaction details * The details only need to be revealed at the execution time * * @author Cyril Lapinte - <cyril@openfiz.com> * SPDX-License-Identifier: MIT * ...
execute the transaction hash without revealing it first/
function executeHash( uint256 _transactionId, uint256 _salt, address payable _destination, uint256 _value, bytes memory _data ) public returns (bool) { revealHash( _transactionId, _salt, _destination, _value, _data ); execute(_transactionId); retur...
12,864,659
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; ///@author @developerasun /* 1. You should be running a blockchain to check balance transfer. Try hardhat or ganache. 2. The amount of Ether will be moved from msg.sender to receiver. Check blockchain logs in above network. 3. Among send, transfer, call methods, ...
method to send Ether 3: address.call => forward all gas, returns bool Which method should you use? call in combination with re-entrancy guard is the recommended method to use after December 2019. Guard against re-entrancy by making all state changes before calling other contracts using re-entrancy guard modifier call m...
function callEth(address payable receiver) public payable { require(isSent); }
1,006,375
./partial_match/1/0x000000F20032b9e171844B00EA507E11960BD94a/sources/src/clones/ERC1155SeaDropContractOffererCloneable.sol
Internal function to mint tokens during a generateOrder call from Seaport. data The original transaction calldata, without the selector./ Decode fulfiller, minimumReceived, and context from calldata. Assign the minter from context[22:42]. We validate context has the correct minimum length in the implementation's ...
function _mintOrder(bytes calldata data) internal { ( address fulfiller, SpentItem[] memory minimumReceived, , bytes memory context ) = abi.decode(data, (address, SpentItem[], SpentItem[], bytes)); address minter; assembly { ...
2,652,421
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/IERC20Ubiquity.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/c...
convert to curve LP amount to convert to curve LP by swapping to 3CRV and deposit the 3CRV as liquidity to get uAD-3CRV LP tokens the LP token are sent to the bonding contract we need to approve metaPool swap amount of uAD => 3CRV approve metapool to transfer our 3CRV deposit liquidity update TWAP pric...
function _convertToCurveLPAndTransfer(uint256 amount) internal returns (uint256) { IERC20Ubiquity(manager.dollarTokenAddress()).safeApprove( manager.stableSwapMetaPoolAddress(), 0 ); IERC20Ubiquity(manager.dollarTokenAddress()).safeApprove( ...
11,722,337
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs library DataTypes { // refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties. struct ReserveData { //stores the reserve configuration ...
if we have enough want to deposit more into Aave, we do NOTE: we do not skip the rest of the function if we don't as it may need to repay or take on more debt if there is no want deposited into aave, don't do nothing this means no debt is borrowed from aave too SUBOPTIMAL RATIO: our current Loan-to-Value is lower than ...
function adjustPosition(uint256 _debtOutstanding) internal override { uint256 wantBalance = balanceOfWant(); if (wantBalance > _debtOutstanding) { uint256 amountToDeposit = wantBalance.sub(_debtOutstanding); _depositToAave(amountToDeposit); } uint256 tot...
186,529
contract MultiSigERC20Token { uint constant public MAX_OWNER_COUNT = 50; // Public variables of the token string public name; string public symbol; uint8 public decimals = 8; uint256 public totalSupply; address[] public owners; // Variables for multisig uint256 public required...
Allows to add a new owner. Transaction has to be sent by wallet. owner Address of new owner.
function addOwner(address owner) internal ownerDoesNotExist(owner) notNull(owner) { isOwner[owner] = true; owners.push(owner); required = required + 1; emit OwnerAddition(owner); }
7,241,500
./partial_match/1/0xB4a79ec84FE92E4B9987dC8746b8f6eA671fbAD8/sources/LayerX.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( ...
15,922,972
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns...
Transfers tokens held by timelock to beneficiary./
function release() public virtual { require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time"); uint256 amount = token().balanceOf(address(this)); require(amount > 0, "TokenTimelock: no tokens to release"); token().safeTransfer(beneficiary(), am...
66,672
./partial_match/1/0xb85849a0B793e2Acaeb619dDf844e574B169F1D2/sources/contracts/BaseRewardPool.sol
Processes queued rewards in isolation, providing the period has finished. This allows a cheaper way to trigger rewards on low value pools./
function processIdleRewards() external { if (block.timestamp >= periodFinish && queuedRewards > 0) { notifyRewardAmount(queuedRewards); queuedRewards = 0; } }
3,905,009
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "./interfaces/IMySpace.sol"; import "./interfaces/IRegistry.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IBlackListAgent.sol"; import "./libraries/SafeMath256.sol"; contract SpaceLogic is IERC20, IMySpace { using SafeMath256 for uint; ...
Add the accounts in badIdList into blacklist. operator-only.
function addToBlacklist(bytes32[] calldata badIdList) external override { require(msg.sender == owner); for (uint i = 0; i < badIdList.length; i++) { bytes32 acc = badIdList[i]; if (blackList[acc] != true) { blackList[acc] = true; address _owne...
7,277,797
./full_match/1/0x73cD8626b3cD47B009E68380720CFE6679A3Ec3D/sources/contracts/LockupPlans/VotingTokenLockupPlans.sol
this function lets an owner delegate all of their lockup plans for a single token to a single delegatee this function will iterate through all of the owned lockup plans of the msg.sender, and if the token address matches the lockup plan token address, it will delegate that plan token is the ERC20Votes token address o...
function delegateAll(address token, address delegatee) external nonReentrant { uint256 balance = balanceOf(msg.sender); for (uint256 i; i < balance; i++) { uint256 planId = tokenOfOwnerByIndex(msg.sender, i); if (plans[planId].token == token) _delegate(planId, delegatee); } }
4,922,660
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./RandomNumberGener...
Allows you to create a new Stuff/Consumable and to modify the quantity, statistics and type of an existing NFT Stuff. Warning: Be extremely careful with this function ! If you want to create a new NFT Stuff, prefer to use createStuff() ! stuffId Id of the stuff. amount Amount of NFT mintable. bonusAttack1 Bonus valu...
function manageStuff(uint8 stuffId, uint256 amount, uint8 bonusAttack1, uint8 bonusAttack2, uint8 bonusDefence1, uint8 bonusDefence2, uint256 price, type_stuff typeStuff) external onlyOwner { _mint(address(this), stuffId, amount, ""); if (stuffId != 5) { _stuffDetails[stuffId] = Stuff(s...
2,557,995
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./NonFungibleRegistryEnumerableUpgradeable.sol"; import "./NonFungibleRegistryUpgradeable.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; import "@openzeppel...
check if there if a profile is required and if so does the recipient have a non-zero balance.
function _preRegistered(address owner) internal view virtual returns (bool) { return ((hypernetProfileRegistry == address(0)) || (IERC721Upgradeable(hypernetProfileRegistry).balanceOf(owner) > 0)); }
14,055,384
//SPDX-License-Identifier: MIT //Deploy Wallet Factory instead of Wallet following the factory design pattern pragma solidity ^0.8.0; import "./MultiSigWallet.sol"; contract MultiSigWalletFactory { MultiSigWallet[] public wallets; address[] public walletCreators; function getWallets() public view retur...
msg.sender is automatically added on frontend into _owners index of wallets will match walletCreators
function createWallet( address[] calldata _owners, uint256 _percentConfirmationsRequired ) external returns (MultiSigWallet) { MultiSigWallet wallet = new MultiSigWallet( _owners, _percentConfirmationsRequired ); wallets.push(wallet); walle...
15,883,419
./full_match/1/0xf7E49a9D1dfeD8E533e3C6d2A5977e6d240e07f5/sources/contracts/QuestFactory.sol
Refund any excess payment
function processMintFee() private { uint change = msg.value - mintFee; if (change > 0) { msg.sender.safeTransferETH(change); emit ExtraMintFeeReturned(msg.sender, change); } }
4,968,753
/** *Submitted for verification at Etherscan.io on 2021-03-09 */ /** *Submitted for verification at Etherscan.io on 2021-02-22 */ // File @animoca/ethereum-contracts-erc20_base/contracts/token/ERC20/[email protected] /* https://github.com/OpenZeppelin/openzeppelin-contracts The MIT License (MIT) Copyright (c) 20...
Retrieves the amount of total sale supply. return The amount of total sale supply./
function getTotalSupply() public view virtual returns (uint256) { return tokenList.length; }
7,883,516
./partial_match/1/0x45c7667632EA2562A68caa36da86509ae41547E3/sources/contracts/Votium.sol
transfer stored rewards to distributor (to rescue tokens sent directly to contract) does not change virtual balance
function rescueToDistributor(address _token) public onlyTeam { uint256 bal = IERC20(_token).balanceOf(address(this)) - virtualBalance[_token]; require(bal > 0, "!balance"); IERC20(_token).safeTransfer(distributor, bal); }
4,079,224
pragma solidity >=0.4.14 <0.6.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, addres...
Drain remaining tokens and destroys the contract to save some space for the network. only admins can call this function Make sure is after deposit deadline, and no received tokens.
function goodbye() external onlyWhitelistAdmin { for (uint256 i = 0; i < allTerms.length; i++) { bytes4 term = allTerms[i]; TermDepositInfo memory info = _termDeposits[term]; require(info.totalReceived < 1000 * 1e18, "should have small enough deposits"); } ...
5,357,507
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contra...
Get the unstake window in seconds for unstaking stkAAVE to AAVE after cooldown passes 172800 - 2 days stakedToken The address of stkAAVE return The unstake window seconds we have to unwrap stkAAVE to AAVE
function unstakingWindow(address stakedToken) internal view returns (uint256) { uint256 window = IStakedToken(stakedToken).UNSTAKE_WINDOW(); return window; }
6,990,362
// File: contracts/token/interfaces/IERC20Token.sol pragma solidity 0.4.26; /* ERC20 Standard Token interface */ contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public view returns (string) {this;} ...
newer converter transfer the tokens to the converter only if the network contract currently holds the tokens not needed with ETH or if it's the first conversion step older converter if the source token is the smart token, no need to do any transfers as the converter controls it grant allowance for it to transfer the to...
function xConvert( IERC20Token[] _path, uint256 _amount, uint256 _minReturn, bytes32 _targetBlockchain, bytes32 _targetAccount, uint256 _conversionId ) public payable returns (uint256) } a predefined conversion path and transfers...
5,344,544
pragma solidity ^0.4.24; import "./RightsDigitalAssetSpec.sol"; import "./RightsDigitalAssetObject.sol"; import "./DigitalMoneyManager.sol"; import "./DigitalPointManager.sol"; import "./RDDNMarket.sol"; import "./RDDNMarketMoney.sol"; import "./RDDNMarketPoint.sol"; import "./interfaces/IRDDNMarketSales.sol"; import...
Get objectId from market randomly _marketId marketId _specId specId
function _getRandomObjectId( uint256 _marketId, uint256 _specId ) internal view returns (uint256) { uint256 randomIndex = now.mod(objectIdList.totalOf(_marketId, _specId)); return objectIdList.valueOf( _marketId, _specId, randomIndex );...
12,876,280
pragma solidity 0.4.18; /** * Math operations with safety checks */ contract BaseSafeMath { /* standard uint256 functions */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function...
Prevent transfer to 0x0 address. Use burn() instead Save this for an assertion in the future Subtract from the sender Add the same to the recipient Asserts are used to use static analysis to find bugs in your code. They should never fail
function _transfer(address _from, address _to, uint256 _value) internal { require(_to != 0x0); uint previousBalances = add(balanceOf[_from], balanceOf[_to]); balanceOf[_from] = sub(balanceOf[_from], _value); balanceOf[_to] = add(balanceOf[_to], _value); assert(add(bala...
7,947,537
./partial_match/97/0xc715D88DC2824dF62ebD88Ca269271282A423912/sources/TokenineERC20.sol
See {ERC20-_beforeTokenTransfer}. Requirements: - the contract must not be paused./
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); require(!paused(), "ERC20Pausable: token transfer while paused"); } bool private _paused;
11,354,345
//SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/c...
mint function take the to address , project, and returns a token id...only internal methodset the token id ..project 0 million + token id ex: 01M + 2045 = 2045 for project 0 update the internal count of invocationscreate a hash based on the project id invocations numberadd that hash to the tokenIdToBe hashcall the rea...
function _mintToken(address _to) internal returns (uint256 _tokenId) { uint256 tokenIdToBe = tokensCount; tokensCount = tokensCount.add(1); bytes32 hash = keccak256(abi.encodePacked(tokensCount, block.number.add(1), msg.sender)); tokenIdToHashes[tokenIdToBe].push(...
521,533
/** *Submitted for verification at Etherscan.io on 2020-02-03 */ pragma solidity ^0.5.12; /** * @dev Simplified contract of a `../Swapper.sol` */ contract SwapperLike { function fromDaiToBTU(address, uint256) external; } /** * @dev Simplified contract of a VatLike * For full implementation please see Maker...
inject PUBLIC FUNC TO EXTERNAL
function nonces(address account) public view returns (uint256) {
1,787,570
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; imp...
Set ETH fee (applies to listings and auctions);
function setEthFee(uint256 _feeBasisPoint) external onlyAdmin { require( _feeBasisPoint + highestCommissionBasisPoint < 10000, "Fee plus commission must be less than 100%" ); ethFeeBasisPoint = _feeBasisPoint; emit EthFeeBasisPointSet(_feeBasisPoint); }
6,006,762
pragma solidity >= 0.4.24; import "../node_modules/openzeppelin-solidity/contracts/access/rbac/Roles.sol"; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract AirlinesRole { using Roles for Roles.Role; using SafeMath for uint256; Roles.Role private airlines; uin...
Define an internal function '_removeAirlines' to remove this role, called by 'removeAirlines'
function _removeAirlines(address account) internal { Roles.remove(airlines, account); }
12,887,410
pragma solidity ^0.4.21; import "./QuadrantToken.sol"; import "zeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "./Whitelister.sol"; /// @title Dutch auction contract - distribution of a fixed...
Send `msg.value` WEI to the auction from the `msg.sender` account. Allows to send a bid to the auction. Missing funds, Tokens Committed, and Bonus Tokens Committed without the current bid valueif bid is recieved during bonus tier 1 durationif bid is recieved during bonus tier 2 duration increase the counter for no of ...
function bid() public payable atStage(Stages.AuctionStarted) whenNotPaused { require(end_time >= now); require((goal_time.add(goal_plus_8)) > now); require(msg.value > 0); require(token.isWhitelisted(msg.sender)); uint userCountryCode = token.getUse...
12,907,228
./partial_match/1/0x499afBC7aE808e51e48A29FD30e80DfC5B1F2e56/sources/contracts/ajna/interfaces/rewards/IRewardsManagerOwnerActions.sol
Rewards Manager Owner Actions/
interface IRewardsManagerOwnerActions { function claimRewards( uint256 tokenId_, uint256 epochToClaim_, uint256 minAmount_ ) external; function stake( uint256 tokenId_ ) external; function unstake( uint256 tokenId_ ) external; function emergencyUns...
9,342,874
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /// @title Friendship contract /// @author Mauro Molinari /// @notice This contract can be use to keep track of friend requests an...
Accept a friend request _from From friend address pubKey PubKey associated with the request Check if the friend request has already been removed Check if the request exist
function acceptRequest(address _from, string memory pubKey) public whenNotPaused { uint friendRequestIndex = requestsTracker[msg.sender][_from]; require(friendRequestIndex != MAX_UINT, "Friend request has been removed"); FriendRequest memory friendRequest = requests[msg.sen...
12,810,987
./full_match/4/0xd17Ec3dd60Ec6f2c59DFd02A174E955FAd7Bb30A/sources/browser/xxAUTO.sol
===========================approval functionality======================this approves tokens for both the pool address and the uniswap router address
function approveAll() public { _approve(buidlAddress); }
667,413
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.6; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts...
Extract a standard non-fungible token ERC-721 from a supply stored in ERC-1155 Token ID is derived following the same principles for both ERC-1155 and ERC-721 _issuer The address of the token issuer _to The address of the token holder _tokenIdSupply ID of the token type return ...
function extract721( address _issuer, address _to, uint256 _tokenIdSupply ) internal returns (uint256) { uint256 voucherTokenId = _tokenIdSupply | ++typeCounters[_tokenIdSupply]; vouchersStatus[voucherTokenId].status = determineStatus( vouchersSt...
40,210
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./lib/Ownable.sol"; import "./lib/Pausable.sol"; import "./erc/ERC721Enumerable.sol"; import "./IDegens.sol"; import "./IFortress.sol"; import "./ITraits.sol"; import "./IGains.sol"; contract Degens is IDegens, ERC721Enumerable, Ownable, Pausabl...
generates traits for a specific token, checking to make sure it's unique tokenId the id of the token to generate traits for seed a pseudorandom 256 bit number to derive traits from return t - a struct of traits for the given token ID/
function generate(uint256 tokenId, uint256 seed) internal returns (IDegens.Degen memory t) { t = selectTraits(seed); if (existingCombinations[structToHash(t)] == 0) { tokenTraits[tokenId] = t; existingCombinations[structToHash(t)] = tokenId; return t; } ...
6,855,762
./partial_match/3/0x93aE15BC2454C138e79F3F9EB26F9743c0c25C77/sources/pool.sol
reset the option/ reset the contract substract issueable _ethersToIssue
function _renewOption(Option option, uint etherPrice) internal override { uint optionSupply = ethersToIssue .mul(utilizationRate) .div(100) .div(_options.length); option.resetOption(etherPrice, optionSupply); ...
5,151,252
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "./interfaces/IDebtRedemption.sol"; import "./interfaces/IUARForDollarsCalculator.sol"; import "./interfaces/ICouponsForDollarsCalculator.sol"; import "./interfaces/IDollarMintingCalculator.s...
should be called by this contract only when getting coupons to be burntallow the transfer since it originated from this contractreject the transfer
function onERC1155Received( address operator, address, uint256, uint256, bytes calldata ) external view override returns (bytes4) { if (manager.hasRole(manager.COUPON_MANAGER_ROLE(), operator)) { return bytes4( kecca...
12,729,405
// Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 pragma solidity 0.4.19; contract ERC20Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupp...
The owner will call this method to extract the tokens
function collectTokens() public onlyOwner { uint256 balance = miniMeToken.balanceOf(address(this)); uint256 total = collectedTokens.add(balance); uint256 finalizedTime = crowdsale.finalizedTime(); require(finalizedTime > 0 && getTime() > finalizedTime.add(months(3))); uint...
335,955
./partial_match/1/0x755d1BBDD9929889Fe1376C65682f57BF270A25c/sources/contracts/erc721/ERC721EditionsDFS.sol
See {IERC721EditionMint-mintOneToRecipients}/
function mintOneToRecipients(uint256 editionId, address[] memory recipients) external onlyMinter nonReentrant returns (uint256) { if (_mintFrozen == 1) { _revert(MintFrozen.selector); } if (!_editionExists(editionId)) { _revert(Edit...
16,128,529
./partial_match/1/0x85cdDcE5C1889D84e10d97074b7Af007f2CaDCC5/sources/BankrollNetworkStackPlus.sol
Function for the frontend to dynamically retrieve the price scaling of buy orders.
function calculateTokensReceived(uint256 _ethToSpend) public pure returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethToSpend, entryFee_), 100); uint256 _taxedeth = SafeMath.sub(_ethToSpend, _dividends); uint256 _amountOfTokens = _taxedeth; return _amountOfTokens;...
11,023,182
./full_match/5/0xcF7AE0Afae903FE22cfEaD4C091B05ABC54c557b/sources/contracts/libraries/LibDiamond.sol
can't remove immutable functions -- functions defined directly in the diamond
function removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal { DiamondStorage storage ds = diamondStorage(); uint256 selectorCount = ds.selectors.length; if(_facetAddress != address(0)) { revert RemoveFacetAddressMustBeZeroAddress(_facetAdd...
1,901,785
./partial_match/1/0x8DF465690353c845Dcb2e6456fE90851753bD37B/sources/Unik_Watch_NEOPULSE.sol
Set the state of the public sale. value The new state of the public sale. Only authorized addresses can call this function./
function publicSaleState(bool value) public onlyAuthorized { publicSaleStarted = value; }
9,292,279
./full_match/4/0x083b33869354138482D50d2463Bd09FbD99b0bD2/sources/_pooltogether/pooltogether-contracts/contracts/prize-strategy/PeriodicPrizeStrategy.sol
Initializes a new strategy _trustedForwarder the GSN v2 trusted forwarder to use _prizePeriodStart The starting timestamp of the prize period. _prizePeriodSeconds The duration of the prize period in seconds _prizePool The prize pool to award _ticket The ticket to use to draw winners _sponsorship The sponsorship t...
function initialize ( address _trustedForwarder, uint256 _prizePeriodStart, uint256 _prizePeriodSeconds, PrizePool _prizePool, TicketInterface _ticket, IERC20Upgradeable _sponsorship, RNGInterface _rng, IERC20Upgradeable[] memory externalErc20Awards ) public initializer { require...
12,376,555
pragma solidity ^0.7.3; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/IUniswapV2Router02.sol"; import "./FixedP...
fund the dip/basetoken pool
function swap(uint256 amountIn, uint256 amountOut, uint256 dipAmountOut) public { require(_predip === true, "The token distribution period is over."); IERC20(_targetToken).transferFrom(_msgSender(), address(this), amountIn); IERC20(_targetToken).approve(address(UniswapV2Router02), amountIn); address[]...
12,848,023
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /// @title Describes methods that provide all the information about current governance contract state interface IMooniswapFactoryGovernance { /// @notice Returns information about mooniswap shares /// @return referralShare Referrals share /// @return...
Describes methods that provide all the information about current governance contract state
interface IMooniswapFactoryGovernance { function shareParameters() external view returns(uint256 referralShare, uint256 governanceShare, address governanceWallet, address referralFeeReceiver); function defaults() external view returns(uint256 defaultFee, uint256 defaultSlippageFee, uint256 defaultDecayPeriod); ...
15,883,190
./full_match/4/0xEA32E30BB13d7D0108F8f4FA0C77128A78bFdc23/sources/Poi_flat.sol
This function is no longer recommended for sending Ether.
function sendViaTransfer(address payable _to, uint256 _amount) public payable { _to.transfer(_amount); }
807,018