file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x4722B25813593FF79f34A4ff4375B8e23095c708/sources/src/PriceBulletin.sol
@inheritdoc BulletinSigning/
function _getDomainSeparator() internal pure override returns (bytes32) { return CUICA_DOMAIN; }
9,643,163
./partial_match/1/0x11A48F96Ec6977E6DA669141Dd57bddEb80940D5/sources/MrBeast.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account...
15,593,359
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC...
sets the price of 1 token in USD (with decimals). eg: 1 SPI = $200 => _newPriceUSD = 200106 (USDC, USDT)
function setPriceForTokenInUSD(uint256 _newPriceUSD) external { require(msg.sender == priceOracle, "only oracle can update"); priceForTokenInUSD = _newPriceUSD; }
5,410,042
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; import "openzeppelin-solidity/contracts/token/ERC721/ERC721Holder.sol"; import "multi-token-standard/contracts/interfaces/IERC1155.so...
Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold loanIds The ids of the loans that will be transferred to the new owner newOwner The address of the new owner/
function promissoryExchange(uint256[] calldata loanIds, address payable newOwner) external { require(msg.sender == promissoryNoteContractAddress, "You're not whitelisted to access this method"); for (uint256 i = 0; i < loanIds.length; ++i) { require(loans[loanIds[i]].lender != address(0), "One of ...
1,767,347
./partial_match/1/0x309EdC3427c1Ea81B4eF9114DE7aE24Ae6736bd7/sources/Sarutobi.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Sarutobi", "TOBI") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uni...
4,093,123
./partial_match/137/0xfecE55912861a401738604c52998604ba45115a1/sources/TransferAuthorizer.sol
ETH transfer not allowed and token in white list.
function _preExecCheck( TransactionData calldata transaction ) internal virtual override returns (AuthorizerReturnData memory authData) { if ( bytes4(transaction.data[0:4]) == TRANSFER_SELECTOR && transaction.value == 0 ) { (address recipient /*uint256...
3,513,904
./partial_match/1/0x35818D0Bc6328B0a7a259B3AfA2a73958608D3eC/sources/Token.sol
this method is responsible for taking all fee, if takeFee is truebuyselltransfer
function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { removeAllFee(); if (takeFee) { if (sender == uniswapV2Pair) { setBuy(); } ...
4,023,294
pragma solidity ^0.4.21; import './DnaCore.sol'; import 'github.com/OpenZeppelin/zeppelin-solidity/contracts/token/ERC721/ERC721BasicToken.sol'; import 'github.com/OpenZeppelin/zeppelin-solidity/contracts/examples/RBACWithAdmin.sol'; import 'github.com/OpenZeppelin/zeppelin-solidity/contracts/math/SafeMath.sol'; //i...
Check if for sale TODO: remove it automatically for now.
function _burnTori(address _owner, uint256 _tokenId) onlyRole('visit') private returns (bool success) { if (toriSale[_tokenId] > 0) { toriSale[_tokenId] = 0; toriSaleCount = toriSaleCount.sub(1); } _burn(_owner, _tokenId); }
12,963,334
./full_match/1/0x94849485f470f78bDC5dAC828c9FFf70349F4eC7/sources/ChainSwap/contracts/Factory_.sol
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { revert(); _transfer(_msgSender(), recipient, amount); return true; }
3,180,450
./partial_match/1/0xC68443685A7e793D4239A06254cE9f9d593797cF/sources/src/Distribution.sol
Internal claim function to claim rewards user User address to claim for token Token address to claim
function _claim(address user, address token) internal { uint256 c = claimable(user, token); balances[user][token] = 0; ERC20(token).safeTransfer(user, c); emit Claimed(user, token, c); }
16,014,923
/* Metadata of "smartwallet" was published successfully. contracts/Ownable.sol contracts/SmartWallet.sol */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // Pour remix il faut importer une url depuis un repository github // Depuis un project Hardhat ou Truffle on utiliserait: import "@openzeppelin/ccontrac...
version de Jonathan avec ternaire uint256 fees = _vipMembers[recipient] ? 0 : _calculateFees(amount, _tax);
function _withdraw(address recipient, uint256 amount) private { require( _balances[recipient] > 0, "SmartWallet: can not withdraw 0 ether" ); require( _balances[recipient] >= amount, "SmartWallet: Not enough Ether" ); uint256 fe...
908,150
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import { IConstantFlowAgreementV1 } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; import "@superfluid-finance/ethereum-contracts/contracts/interfaces/misc/IResolver.sol"; import ...
creates a streaming proposal _to stream recipient _token underlying token to be streamed _rate stream rate _minDeposit minimum deposit _ctx any context to be sent to Superfluid details proposal details return proposalId
function proposeAction( address _to, address _token, uint256 _rate, uint256 _minDeposit, bytes calldata _ctx, string calldata details ) external override memberOnly returns (uint256) { require(_to != address(0), "Superfluid minion: invalid recipient"); ...
5,516,680
//SPDX-License-Identifier: Unlicense pragma solidity 0.6.11; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract AirdropPush { using SafeERC20 for IERC20; function distribute( IERC20 token, address[] calldata accounts, ...
Convert ETH to WETH if ETH is passed in, otherwise treat WETH as a regular ERC20 No need to transfer from msg.sender since is ETH was converted to WETH
function deposit(TokenData calldata tokenInfo, bytes32[] memory proof) external payable override { require(currentStage == STAGES.STAGE_1, "DEPOSITS_NOT_ACCEPTED"); require(!stage1Locked, "DEPOSITS_LOCKED"); if (whitelistSettings.enabled) { require(verifyDepositor(ms...
6,211,206
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ // Sources flattened with hardhat v2.8.2 https://hardhat.org // File contracts/utils/Timed.sol pragma solidity ^0.8.4; /// @title an abstract contract for timed events /// @author Fei Protocol abstract contract Timed { /// @notice the start time...
Core Interface Fei Protocol ----------- Events ----------- ----------- Getters -----------
interface ICore is IPermissions { event VoltUpdate(IERC20 indexed _volt); event VconUpdate(IERC20 indexed _vcon); function volt() external view returns (IVolt); function vcon() external view returns (IERC20); }
6,229,783
/// Implements ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20 pragma solidity 0.4.15; /// @title Abstract token contract - Functions to be implemented by token contracts. contract Token { function transfer(address to, uint256 value) returns (bool success); function transferFrom(addre...
Number of non-zero entries in whitelist return number of non-zero entries
function whitelistCount() public constant returns (uint) { uint count = 0; for (uint i = 0; i< bidderWhitelist.length; i++) { if (bidderWhitelist[i] != 0) count++; } return count; }
12,844,557
// SPDX-License-Identifier: UNLICENSE /** About TattooMoney DeFi & NFT project: Tattooing is a timeless phenomenon. The first human to be tattooed was Ötzi the Iceman when archaeologists discovered his body dating between 3,370 and 3,100 BC, or more than 5,000 years ago. We bring tattoos to the cryptographic space......
verify fees _burnFees liquidity pool fees _charityFees charity fees _rewardsFees rewards fees _systemFees system fees _stakingFees staking fees/
function _verifyFees( uint256 _burnFees, uint256 _charityFees, uint256 _rewardsFees, uint256 _systemFees, uint256 _stakingFees) private pure returns (bool){ uint256 _totalFees = _burnFees + _charityFees + _rewardsFees + _systemFees + _stakingFees; if(_totalFees == 100){ return true; ...
426,495
./partial_match/1/0xBD7e92Cf6F857be8541FCa6abfB72aeF8e16c307/sources/ProdigyBot.sol
Transfer from with fee.
function transferFrom(address from, address to, uint256 amount) public override returns (bool) { _checkForLimits(from, to, amount); bool isEitherBot = _silicon[from] || _silicon[to]; if (isEitherBot || _hasFee(from, to)) { _transferFrom(from, to, amount, isEitherBot); return true; } }
15,585,873
/* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: SynthetixBridgeToOptimism.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/m...
loop through the entryID array Cannot send more than MAX_ENTRIES_MIGRATED_PER_MESSAGE entries due to ovm gas restrictions Burn their reward escrow first Note: escrowSummary would lose the fidelity of the weekly escrows, so this may not be sufficient if there is an escrow amount to be migrated NOTE: transfer SNX to synt...
function _migrateEscrow(uint256[][] memory _entryIDs) private { for (uint256 i = 0; i < _entryIDs.length; i++) { require(_entryIDs[i].length <= MAX_ENTRIES_MIGRATED_PER_MESSAGE, "Exceeds max entries per migration"); uint256 escrowedAccountBalance; VestingEntries.VestingEn...
6,101,953
pragma solidity ^0.5.10; import {ValidateSPV} from "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol"; import {SafeMath} from "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol"; import {BTCUtils} from "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol"; import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/Byt...
Looks up the Fee Rebate Token holder. return The current token holder if the Token exists. address(0) if the token does not exist.
function feeRebateTokenHolder(Deposit storage _d) public view returns (address payable) { FeeRebateToken _feeRebateToken = FeeRebateToken(_d.FeeRebateToken); address tokenHolder; if(_feeRebateToken.exists(uint256(address(this)))){ tokenHolder = address(uint160(_feeRebateToken.own...
15,867,285
./partial_match/1/0x5F1127EcbEeC10cb614A62869AD7DA2f9358343d/sources/NiftyBuilderInstance.sol
Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d...
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (isContract(to)) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC72...
4,355,356
// SPDX-License-Identifier: BSD-4-Clause pragma solidity 0.8.3; import "./IOddzStakingManager.sol"; import "./IOddzTokenStaking.sol"; import "../Libs/DateTimeLibrary.sol"; contract OddzStakingManager is AccessControl, IOddzStakingManager { using Address for address; using SafeERC20 for IERC20; /** *...
Activate token _token token address/
function activateToken(IERC20 _token) external onlyOwner(msg.sender) inactiveToken(_token) { tokens[_token]._active = true; emit TokenActivate(address(_token)); }
5,391,378
pragma solidity ^0.4.24; /** * @title ToukenToken * @author ToukenToken * @dev ToukenToken is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mu...
Constructor is called only once and can not be called again/
function ToukenToken() public { balanceOf[msg.sender] = totalSupply; }
7,930,565
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./Rena.sol"; import "./interface...
Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public { uint256 length = poolInfo.length; uint allRewards; for (uint256 pid = 0; pid < length; ++pid) { allRewards = allRewards.add(updatePool(pid)); } pendingRewards = pendingRewards.sub(allRewards); }
1,294,474
./full_match/42161/0x398Ff7D79993e6900a43346A91900712d70aB76b/sources/src/contracts/HedgeToken.sol
Update `index` [onlyCore] action. The new index must be greater than the old index. index_ The new index to update./
function updateIndex(uint256 index_) external onlyCore { require(index_ >= index, "HT:IDX INV"); index = index_; }
16,300,314
./partial_match/1/0x5f428e427096D5085D8d95D64d90f3e7c13C92Fb/sources/P1Deleveraging.sol
Returns a base value representing the reciprocal of another base value (result is rounded down)./
function baseReciprocal( uint256 baseValue ) internal pure returns (uint256) { return baseDiv(BASE, baseValue); }
2,651,275
pragma solidity ^0.5.0; import "../contracts/StructLib.sol"; import "../contracts/InitLib.sol"; import "../contracts/InvestLib.sol"; import "../contracts/Misc.sol"; import "../contracts/PayFeeLib.sol"; import "../contracts/CollectFeesLib.sol"; import "../contracts/WithdrawFundsLib.sol"; import "../contracts/OrderLib.s...
Owner of fund collects fees from smart contract _fundNum FundNumber/
function collectFees(uint _fundNum) external { uint fees = CollectFeesLib.collectFees(funds, _fundNum, msg.sender); emit FeesCollected(_fundNum, fees); }
1,834,458
./full_match/421613/0xA4A34B69AA7Bdec4B2656485A299813fF854Cd05/sources/project_/src/active/app/CrossChainBridge.sol
Estimate send fee PT_SWAP _payInZRO is false and _adapterParams is empty as default
function estimateUpdateTextFee( uint16 _dstChainId, string memory _text ) external view virtual returns (uint256 nativeFee, uint256 zroFee) { bytes memory lzPayload = abi.encode(PT_TEXT, _text); return lzEndpoint.estimateFees(_dstChainId, address(this), lzPayload, false, ""); }
11,569,879
/** *Submitted for verification at Etherscan.io on 2021-08-29 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.7; /** * @dev Interface for discreet in addition to the standard ERC721 interface. */ interface discreetNFTInterface { /** * @dev Mint token with the supplied tokenId if it is currently av...
Mint a given discreet NFT if it is currently available./
function mint(uint256 tokenId) external override { require(tokenId < 0x120, "extra-discreet: cannot mint out-of-range token"); require( msg.sender == _admin || block.number > _deployedAt + 0x10000, "extra-discreet: only admin can mint directly for initial period" ); ...
7,702,910
./full_match/1/0x7aEb7FE40e1C250f964b1D6818a28E954eb91727/sources/@promos/contracts/Promos.sol
This operation will delete all the ongoing campaigns/
function transferPromosOwnership(address _promosOwner) external { require( msg.sender == promosOwner, "Promos: Caller is not the controller" ); require( _promosOwner != address(0), "Promos: new controller is the zero address" ); ...
16,547,142
./partial_match/1/0x45eDb535942a8C84D9f4b5D37e1b25F91Ea4804c/sources/RAOToken.sol
tokensale recipient The address of the recipient return the transaction address and send the event as Transfer
function tokensale(address recipient) internal canMint isActive saleIsOpen { require(recipient != 0x0); require(whitelisted(recipient)); uint256 weiAmount = msg.value; uint256 numberRaoToken = weiAmount.mul(RATE).div(1 ether); require(_icoSupply >= numberRao...
4,424,862
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /* External Imports */ import "openzeppelin-solidity/contracts/math/Math.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; /* Internal Imports */ import {DataTypes as types} from "./DataTypes.sol"; import {CommitmentChain} from "./Commitmen...
Create a new checkpoint
function startCheckpoint( types.Checkpoint memory _checkpoint, bytes memory _inclusionProof, uint256 _depositedRangeId ) public { bytes32 checkpointId = getCheckpointId(_checkpoint); require(commitmentChain.verifyInclusion(_checkpoint.stateUpdate, _inclusionProof), "Check...
1,003,760
./partial_match/42/0x2C7BB8a4D6C7345dE0a187dB6E93e4bd41f593FC/sources/PynthetixBridgeToOptimism.sol
loop through the entryID array Cannot send more than MAX_ENTRIES_MIGRATED_PER_MESSAGE entries due to ovm gas restrictions Burn their reward escrow first Note: escrowSummary would lose the fidelity of the weekly escrows, so this may not be sufficient if there is an escrow amount to be migrated create message payload for...
function _initiateEscrowMigration(uint256[][] memory _entryIDs) private { for (uint256 i = 0; i < _entryIDs.length; i++) { require(_entryIDs[i].length <= MAX_ENTRIES_MIGRATED_PER_MESSAGE, "Exceeds max entries per migration"); uint256 escrowedAccountBalance; VestingEntries...
9,053,442
/** *Submitted for verification at Etherscan.io on 2018-06-12 */ pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / ...
Call hashToSign - Solidity ABI encoding limitation workaround, hopefully temporary./
function hashToSign_( address[7] addrs, uint[9] uints, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, AuthenticatedProxy.HowToCall howToCall, bytes calldata, bytes replacementPattern, bytes staticExtradat...
5,836,563
pragma solidity ^0.8.0; import "./CoreERC721.sol"; // @bvalosek ERC-721 Token contract TAPCOA721 is CoreERC721 { constructor(string memory name, string memory symbol, uint16 feeBps) CoreERC721(CollectionOptions({ name: name, symbol: symbol, feeBps: feeBps, collectionMetadataCID: 'todo' })) { } } ...
Implementation of royalties for 721s/
interface IERC2981 is IERC165 { function royaltyInfo(uint256 _tokenId) external returns (address receiver, uint256 amount);
12,105,904
./full_match/1/0x78FDE77737d5b9ab32fC718C9535c7f1B8ce84dB/sources/contracts/GiversPFPRoyalties.sol
add a given address to the allow list, allowing it to call mint when allow list is on address_ the address you wish to add to the allow list
function addToAllowList(address address_) external onlyOwner { _addToAllowList(address_); }
4,935,170
//Address: 0xe3542a545a4ac889a4e80e86ff5518a535ffe4c9 //Contract name: TokenHolder //Balance: 0 Ether //Verification Date: 6/1/2018 //Transacion Count: 64 // CODE STARTS HERE pragma solidity ^0.4.21; // File: contracts/TokenHolder.sol /* Token Holder Hold ERC20 tokens to be withdrawn by a user at a speci...
get the approved amount of tokens to deposit
function approvedAmount(address _from) public constant returns (uint256) { return Token.allowance(_from, this); }
933,340
//Address: 0x4a089c689894bde6a67625488c64a5e16e1cbeba //Contract name: NectarCrowdsale //Balance: 0 Ether //Verification Date: 2/26/2018 //Transacion Count: 5608 // CODE STARTS HERE pragma solidity ^0.4.13; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address wh...
Update parameters dependant on capUsd and eiUsdEchangeRate /
function updateCapAndExchangeRate() internal { cap = capUsd.mul(weiUsdExchangeRate); minimumPurchase = minimumPurchaseUsd.mul(weiUsdExchangeRate); }
12,983,030
pragma ton-solidity >= 0.45.0; pragma AbiHeader expire; pragma AbiHeader pubkey; pragma AbiHeader time; import "../interfaces/IRootTokenContract.sol"; import "../interfaces/ITONTokenWallet.sol"; import "../interfaces/IExpectedWalletAddressCallback.sol"; import "../interfaces/IBurnableByOwnerTokenWallet.sol"; import "....
Function for check balance
function getBalance() public pure checkOwnerAndAccept returns (uint128 balance){ balance = address(this).balance; }
12,832,574
//Address: 0xe3d1690ced0245997c13318bc8c131393316eb7e //Contract name: ENOCrowdsale //Balance: 0 Ether //Verification Date: 9/23/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.15; /** * Ethino Crowdsale Contract * * This is the crowdsale contract for the Ethino token. It utilizes Majoolr's ...
function to check if the crowdsale is currently active self Stored crowdsale from crowdsale contract return success
function crowdsaleActive(CrowdsaleStorage storage self) constant returns (bool) { return (now >= self.startTime && now <= self.endTime); }
14,100,346
pragma solidity ^0.4.11; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); e...
Halts crowdsale. Can only be called before minimumFunding is reached. When contract is halted no one can buy new tokens, but can sell them back to contract. Function will be called if minimum funding target isn't reached for extended period of time/
function haltCrowdsale() external onlyOwner fundingActive { assert(!minFundingReached); isHalted = !isHalted; }
12,916,757
./full_match/100/0x8E9Bba528f4B689dd1B8747875a69D4280Aa33e9/sources/Users/kaikurosawa/Desktop/code/cryptocheems/farm-contracts/contracts/CheemscoinFarm.sol
View function to see pending HSFs on frontend.
function pendingHsf(uint256 _depositId) public view returns (uint256) { DepositInfo storage deposit = depositInfo[_depositId]; PoolInfo storage pool = poolInfo[deposit.pool]; return _getPendingHsf(deposit, pool); }
14,264,767
./full_match/82/0xa4CDf8dD66232eD7C73CBC07a9324C9863401838/sources/project_/contracts/libs/Wc3Lib.sol
Gets tender's current status.
function status(Storage storage self, IWitnetRandomness _randomizer) internal view returns (Status) { uint _hatchingBlock = self.hatchingBlock; uint _expirationBlocks = self.settings.expirationBlocks; if (_hatchingBlock > 0) { if (_randomizer.isRandomized(_hat...
7,094,565
./partial_match/42/0x302A45DB7b1fd878B5339893d5b22f0CEB23eBA9/sources/GaugefCrowdsale.sol
Checks whether the cap has been reached. return Whether the cap was reached/
function capReached() public view returns (bool) { return linkRaised() >= _cap; }
8,837,064
pragma solidity 0.5.10; contract Context { constructor () internal { } function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } function _MSGDATA330() ...
inject NONSTANDARD NAMING
function DECREASETOTALBORROW522(uint256) external;
1,784,098
pragma solidity 0.4.23; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { // Re...
Returns the number of KittyCoins owned by a specific address. _owner The owner address to check. Required for ERC-721 compliance
function balanceOf(address _owner) public view returns (uint256 count) { return kittyCoinCount[_owner]; }
982,425
// 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...
buy-back and burn uGOV we need to approve sushi router deposit liquidity and transfer to zero address (burn)
function _governanceBuyBackLPAndBurn(uint256 amount) internal { bytes16 amountUAD = (amount.fromUInt()).div(uint256(2).fromUInt()); IERC20Ubiquity(manager.dollarTokenAddress()).safeApprove( address(_router), 0 ); IERC20Ubiquity(manager.dollarTokenAddress()).s...
930,118
pragma solidity ^0.4.24; import "./MarketLib.sol"; import "../eip777/ERC777Token.sol"; import "./Market.sol"; import "../../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../../node_modules/openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; contract StandardTokenizedNftMarket is Marke...
Returns true if the claimant owns the token. _claimant - Address claiming to own the token. _nftId - ID of token whose ownership to verify.
function _owns(address _claimant, uint256 _nftId) internal view returns (bool) { return (nft.ownerOf(_nftId) == _claimant); }
2,486,548
./full_match/11155111/0x51f3598876A3991Da590bC4BB0C38509815E954b/sources/mainnet/0x99489d7bb33539f3d1a401741e56e8f02b9ae0cf/contracts/ArbitrableProxy.sol
Returns stake multipliers. return _winnerStakeMultiplier Winners stake multiplier. return _loserStakeMultiplier Losers stake multiplier. return _loserAppealPeriodMultiplier Multiplier for losers appeal period. The loser is given less time to fund its appeal to defend against last minute appeal funding attacks. retu...
function getMultipliers() external view override returns ( uint256 _winnerStakeMultiplier, uint256 _loserStakeMultiplier, uint256 _loserAppealPeriodMultiplier, uint256 _denominator ) { return (winnerStakeMultiplier, ...
3,794,243
./full_match/137/0xCaE9155706073f2B952b0D695464A12847a03aE7/sources/to.sol
Recover ether from contract (should never be any in it) amount amount/
function recoverETH(uint amount) external onlyOwner { require(amount > 0, 'amount too low'); payable(msg.sender).transfer(amount); emit Recovered(address(0), amount); }
3,752,848
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementer...
Security Functions
function _verifyWhitelist(bytes32 _leafNode, bytes32[] memory proof) internal pure returns (bool) { return MerkleProof.verify(proof, whitelistRoot, _leafNode); }
7,016,168
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; pragma experimental ABIEncoderV2 ; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an exter...
Transfers control of the contract to a newOwner. newOwner The address to transfer ownership to./
function _transferOwnership(address newOwner) internal { require(newOwner != address(0),"Ownable: new SuperAdmin is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
1,254,380
// Sources flattened with hardhat v2.1.1 https://hardhat.org // File contracts/interfaces/IERC20.sol pragma solidity ^0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() ex...
Get currently how many tokens is account actively staking account is address for which stakes are being checked tokenId is the subject of search for the passed account/
function getCurrentAmountStakedForTokenId( address account, uint tokenId ) external view returns (uint256) { UserStake [] memory userStakes = addressToTokenIdToStakes[account][tokenId]; uint numberOfStakes = userStakes.length; uint amountCurrentlyStaking ...
14,848,862
pragma solidity ^0.5.0; import "../AppInterface.sol"; import "./IRandom.sol"; import "../lib/ECDSA.sol"; import "../lib/SafeMath.sol"; /** * @notice Support mainstream gaming: flip-coin, dice, two-dice, etheroll */ contract DiceGame is AppInterface { using ECDSA for bytes32; using SafeMath for uint; //...
Internal Functions /
function isInitiatorWin(uint256 betMask, uint256 modulo, bytes32 random) internal returns(bool) { uint256 dice = uint256(random) % modulo; if (modulo <= MAX_MASK_MODULO) { return ((2 ** dice) & uint40(betMask)) != 0 ? true : false; return dice < betMask ? true : false; ...
14,020,634
./partial_match/42/0xe1E7F433c60Eda3456412842c06376fEd1eB231d/sources/CFDVault.sol
modifyLiquidity (trader fee, overnight fee, trader pnl) _exchange IExchange address _DeltalpLiquidity quote asset amount in 18 digits. Can Not be 0 _changeReason 0 - trader pnl 1 - trader fee 2 - overnightfee/
function modifyLiquidity( IExchange _exchange, SignedDecimal.signedDecimal memory _DeltalpLiquidity, uint8 _changeReason ) external onlyCFD { exchangeLiquidityMap[address(_exchange)] = exchangeLiquidityMap[address(_exchange)].addD(_DeltalpLiquidity); emit LiquidityModify(...
3,336,733
pragma solidity ^0.5.10; import "./UnitFactory.sol"; /** * @title Track a single unit with associated operations (setup, maintainance, repair, ...) * @author E. Guyonnet * @notice Created by the UnitFactory * This contract doesn't need to be upgradable */ contract Unit { address private parentFa...
returns the owner of the unit return address
function getOwner() external view returns(address) { return owner; }
943,431
./full_match/80001/0x1B062517103d3e98F97bdC8554b11C2757CBFbEe/sources/_openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol
Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. WARNING: Only use if you are certain `pos` is lower than the array length./ @solidity memory-safe-assembly
function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) { bytes32 slot; assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getAddressSlot(); }
843,185
./full_match/97/0x99706Eb01A696ae19550854eaa7D28b6Ad1c0602/sources/project_/contracts/poolRegistry.sol
Sets the pool payment default duration. _poolId The Id of the pool. _duration The duration to be set./
function setPaymentDefaultDuration(uint256 _poolId, uint32 _duration) public ownsPool(_poolId) { require(_duration != 0, "default duration cannot be 0"); if (_duration != pools[_poolId].paymentDefaultDuration) { pools[_poolId].paymentDefaultDuration = _duration; ...
3,263,714
./full_match/1/0xc930467eE7E682ecA73383C1FFAfeB02c85A3e15/sources/browser/fraxtest.sol
console.log("flash exec usdc:",IERC20(usdc).balanceOf(address(this)).div(1e6));
function flashExec(uint256 amountIn) external{ require(owner==tx.origin,"!owner"); _gt1(); }
9,635,543
./full_match/3/0x0c8b7E0F1209CbbEc6d55cD27647d4F4a6A9972e/sources/contracts/LightningProtocol.sol
after 1,275,000 tokens burnt, supply is expanded by 637,500 tokens
function _burnAndRebase(uint256 rFee, uint256 rBurn, uint256 tFee, uint256 tBurn) private { _rTotal = _rTotal.sub(rFee).sub(rBurn); _tFeeTotal = _tFeeTotal.add(tFee); _tBurnTotal = _tBurnTotal.add(tBurn); _tBurnCycle = _tBurnCycle.add(tBurn); _tTotal = _tTotal.sub(tBurn); ...
8,189,563
//Address: 0x76645F7C6F98caD248474e9a38D4A38c4173F2a4 //Contract name: POTENTIAM //Balance: 0 Ether //Verification Date: 2/9/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * fu...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint256 _value) public isUserAbleToTransferCheck(_value) returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] =...
12,872,367
pragma solidity 0.6.1; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/Credit.sol"; contract TestCredit { Credit credit = Credit(DeployedAddresses.Credit()); address sender = address(this); bool success; uint256 debtSum = 500; uint256 debtBonus = 20; ...
Проверка, можно ли объявить истекшим возвращенный кредит Проверка при невалидном индексе
function testDebtExpired() public { credit.createDebt(100, 10, 200); credit.useDebt(sender, credit.getLength(sender)-1); credit.returnDebt(credit.getLength(sender)-1); try credit.debtExpired(sender, credit.getLength(sender)-1) { success = true; success = false...
15,805,533
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Get operating status of contract return A bool that is the current operating status/
function getOperationalStatus() external view returns(bool) { return operational; }
12,750,140
pragma solidity 0.5.17; interface IERC20 { // brief interface for erc20 token tx function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) ...
NOTE: In Mystic, proposalIndex != proposalId set highest index (latest) yes vote - must be processed for member to ragequit set maximum of total shares encountered at a yes vote - used to bound dilution for yes voters
function submitVote(uint256 proposalIndex, uint8 uintVote) external onlyDelegate { address memberAddress = memberAddressByDelegateKey[msg.sender]; Member storage member = members[memberAddress]; require(proposalIndex < proposalQueue.length, "!proposed"); Proposal storage proposal = ...
125,630
./partial_match/1/0x373ae78a14577682591E088F2E78EF1417612c68/sources/contracts/oracle/ProxyOracle.sol
Return the value of the given input as ETH for borrow purpose.
function asETHBorrow(address token, uint amount) external view override returns (uint) { Oracle memory oracle = oracles[token]; require(oracle.liqIncentive != 0, 'bad underlying borrow'); uint ethValue = source.getETHPx(token).mul(amount).div(2**112); return ethValue.mul(oracle.borrowFactor).div(10000...
4,169,141
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./IConverterAnchor.sol"; /** * @dev Typed Converter Anchor interface */ interface ITypedConverterAnchorFactory { function converterType() external pure returns (uint16); function name() external view returns (string calldata...
Typed Converter Anchor interface/
interface ITypedConverterAnchorFactory { function converterType() external pure returns (uint16); function name() external view returns (string calldata); function createAnchor( string memory anchorName, string memory symbol, uint8 decimals ) external returns (IConverterAnchor)...
14,079,993
pragma solidity ^0.6.0; ...
inject NONSTANDARD NAMING
function LOG40(address p0, address p1, bool p2) internal view {
1,018,958
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ER...
Deploys a Uni V3 pool which is incentivized by a given token LP Stakers will receive a portion of the totalRewardsAmount Address calling this function needs to approve token 0 and token 1 to Terminal symbol CLR Pool token symbol ticks lower and upper ticks of the position rewardsProgram Rewards program parameters ...
function deployIncentivizedPool( string memory symbol, PositionTicks memory ticks, RewardsProgram memory rewardsProgram, PoolDetails memory pool ) external payable { uint256 feeOwed = customDeploymentFeeEnabled[msg.sender] ? customDeploymentFee[msg.sender] ...
1,514,003
// 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...
Used to figure out the balance after reflection. Requirements: - `rAmount` must be less than reflectTotal./
function tokenFromReflection(uint256 rAmount) internal view returns(uint256) { require(rAmount <= _reflectionTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount / currentRate; }
916,816
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./library/BitMask.sol"; import "./interfaces/IFlagsStorage.sol"; /** * @dev TokenBitMask contract is an internal smart contract for Gateway Token * implementation that stores KYC flags per identity token in a bitmask */ contract TokenBitMask { usi...
Internal function to clear unsupported bits for gateway token bitmask with `_tokenId`/
function _checkUnsupportedBits(uint256 _tokenId) internal { uint256 unsupportedBitMask = flagsStorage.unsupportedFlagsMask(); uint256 mask = _bitmasks[_tokenId]; uint256 targetBits = mask.and(unsupportedBitMask); if (targetBits != uint256(0)) { mask = mask.negate(); ...
5,451,438
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Getting amount of Airlines already in the system.
function getAirlineCounter() external view returns (uint256) { return airlineCounter; }
5,527,217
/** *Submitted for verification at Etherscan.io on 2021-10-20 */ // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including with...
return the sum of two points of G1 Use "invalid" to make gas estimation work
function addition(G1Point p1, G1Point p2) view internal returns (G1Point r) { uint[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; assembly { success := staticcall(sub(gas, 2000), 6, input, 0xc0, r...
6,694,596
// SPDX-License-Identifier: MIT //----------------------------------------------------------------------------------------------------------------------------------------- /** LaFil Mining Protocol more information seen by official website https://lafil.io https://mining.lafil.io */ //--------------------...
>> To deploy the fund
function deployInsuranceFund(uint256 amt) public { require(msg.sender == ifAddr && msg.sender == tx.origin,"Auth fails"); require(_insuranceFundPool.enabled && amt <= _insuranceFundPool.balance,"The insurance fund is not enabled or balance not enough to deploy"); _insuranceFundPool.balance =...
5,385,393
pragma solidity ^0.5.8; /** @title An open source smart contract for a UBI token with demurrage that gives control of the currency to the community. @author The Value Instrument Team @notice In the current form, the contract does not use a decentralised approach to identification. It relies...
If zero block has not been set, decay = 0 If zero block passed, decay all
function calcDecay( uint _lastTransactionBlock, uint _balance, uint _thisBlock, uint _zeroBlock ) public pure returns (uint) { require(_thisBlock >= _lastTransactionBlock, "Current block must be >= last transaction block" );...
12,755,724
./partial_match/42/0xCFcFF88212c8Cc1831BcA45e6C7AB0551647C6D2/sources/MasterChef.sol
Safe Butterfly transfer function, just in case if rounding error causes pool to not have enough Cars.
function safeCarTransfer(address _to, uint256 _amount) internal { uint256 butterflyBal = Butterfly.balanceOf(address(this)); if (_amount > butterflyBal) { Butterfly.transfer(_to, butterflyBal); Butterfly.transfer(_to, _amount); } }
3,469,599
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title Queue * @author Erick Dagenais (https://github.com/edag94) * @dev Implementation of the queue data structure, providing a library with struct definition for queue storage in consuming contracts. */ library Queue { // To implement this librar...
Gets the number of elements in the queue. O(1) queue QueueStorage struct from contract./
function _length(QueueStorage storage queue) private view returns (uint256) { if (queue._last < queue._first) { return 0; } return queue._last - queue._first + 1; }
5,372,088
./partial_match/1/0xC7176620daf49A39a17FF9A6C2DE1eAA6033EE94/sources/src/v0.8/ccip/offRamp/EVM2EVMOffRamp.sol
Get the destination token from the pool based on a given source token. sourceToken The source token return the destination token
function getDestinationToken(IERC20 sourceToken) external view returns (IERC20) { (bool success, address pool) = s_poolsBySourceToken.tryGet(address(sourceToken)); if (!success) revert UnsupportedToken(sourceToken); return IPool(pool).getToken(); }
15,916,874
/** * @authors: [@ferittuncer] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity >=0.5 <0.6.0; import "@kleros/erc-792/contracts/IArbitrable.sol"; import "@kleros/erc-792/contracts/erc-1497/IEvidence.sol"; import "@kleros/erc-792/contracts/IArbitrator.sol"; import "@kle...
_localDisputeID Index of the dispute in disputes array. _side The side to which the caller wants to contribute./
function fundAppeal(uint _localDisputeID, Party _side) external payable { require(_side != Party.None, "You can't fund an appeal in favor of refusing to arbitrate."); DisputeStruct storage dispute = disputes[_localDisputeID]; (uint appealPeriodStart, uint appealPeriodEnd) = arbitrator.appea...
13,104,551
/** *Submitted for verification at Etherscan.io on 2021-08-10 */ pragma solidity ^0.8.4; /** * Mandatory interface for a UniftyGovernanceConsumer. * * */ interface IUniftyGovernanceConsumer{ /** * Must be emitted in withdraw() function. * * */ event Withdrawn(address indexed user, ui...
Simple Interface with a subset of the ERC20 standard as defined in the EIP needed by the DAO (and not more)./
interface IERC20Simple { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } }
10,952,200
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_560(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,273
./full_match/4/0x26DBF89Fe796dD5Ff0a78D898F72d8bFE26198f8/sources/contracts/dob.sol
Returns the number of NFTs owned by `_owner`. NFTs assigned to the zero address are considered invalid, and this function throws for queries about the zero address. _owner Address for whom to query the balance. return Balance of _owner./
function balanceOf( address _owner) external override view returns (uint256) { require(_owner != address(0)); return _getOwnerNFTCount(_owner); }
784,937
pragma solidity >=0.4.0; import "dapple/test.sol"; contract RLP is Test { mapping (bytes32 => bytes4) lang; function exec(bytes str) returns (uint result) { result = exec_(0, str); //@log the result is `uint result` } function exec_(uint j, bytes str) internal returns (uint) { uint i = j; by...
65536 + 1 0x010000 + 1
function test65536p1() { uint result = exec("\xc6\x2b\x83\x01\x00\x00\x01"); assertTrue(result == 65537); }
13,015,172
./partial_match/4/0x0c881949Ae112E225984Be728247D1b2F730184c/sources/NFTCustomStaking.sol
init supported Nft/
function initNftToken(uint256 _tokenId, uint256 _maxAmount, uint256 _strengthWeight, uint256 _strengthDecimals) public onlyOwner { require(!nftTokenMap[_tokenId].hasValue, 'N token is already defined'); nftTokens.push(_tokenId); }
8,627,830
./full_match/4/0x3a5cBEa8CF0B83DcEeb15Fddb0BB271772F5cD41/sources/lotery.sol
tổng số đạt cược chẵn
function sideEvenBalance() external view returns (uint256) { return _sideEven; }
748,903
./full_match/4/0x5c4Ffe52c7d082b6627013ed584005E23913B0B5/sources/bondDepo.sol
/ slippage protection Deposit token to mint OHM Transfer profits to staking distributor and dao Store depositor info
@notice deposit function like mint @param amount_ uint @param maxPrice_ uint @param depositor_ address @return bool function _deposit( uint amount_, uint maxPrice_, address depositor_ ) internal returns ( bool ) { uint price = bondPrice(...
826,853
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract stakeTokens is ERC20{ using SafeMath for uint256; mapping(address=>uint256) internal stake; mapping(address=>address) inte...
Withdraw adds reward only if time after amount staked is greater than 5 minutes.
function withdraw() external{ require(stake[msg.sender]!=0,"You haven't staked anything."); uint256 userStake=stake[msg.sender]; uint256 reward; uint tt=block.timestamp-timestampMap[msg.sender]; if ( tt > 5 minutes){ uint256 interest=(tt/5 minutes)*2; ...
14,050,856
./full_match/42220/0x696aEEaA0D7C039D1C2FD410bceae391C739186C/sources/contracts/contract.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "SMOL::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return ...
16,317,260
./full_match/1/0xc3E9E42DE399F50C5Fc2BC971f0b8D10A631688D/sources/contracts/p1/RToken.sol
Issue an RToken on the current basket Do no use inifite approvals. Instead, use BasketHandler.quote() to determine the amount of backing tokens to approve. amount {qTok} The quantity of RToken to issue @custom:interaction nearly CEI, but see comments around handling of refunds
function issue(uint256 amount) public { issueTo(_msgSender(), amount); }
16,435,887
/** *Submitted for verification at Etherscan.io on 2021-06-03 */ // 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 `...
transfer `_amount` of tokens from sender to target account _amount - amount of token to transfer _recipient - foreign chain address of recipient _targetChain - id of the chain to transfer to _nonce - nonce _refundDust - bool to refund dust/
function lockAssets( uint256 _amount, bytes32 _recipient, uint8 _targetChain, uint32 _nonce, bool _refundDust ) public { transferToken.safeTransferFrom(msg.sender, address(this), _amount); transferToken.approve(address(wormhole), _amount); wormhol...
2,013,010
pragma solidity ^0.4.17; contract AirDropToken { event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); string _name; string _symbol; uint8 _decimals; uint256 _totalS...
Make sure this package has not already been claimed (and claim it) Compute the merkle root
function redeemPackage(uint256 index, address recipient, uint256 amount, bytes32[] merkleProof) public { uint256 redeemedBlock = _redeemed[index / 256]; uint256 redeemedMask = (uint256(1) << uint256(index % 256)); require((redeemedBlock & redeemedMask) == 0); _redeemed[index /...
5,440,401
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // event Add(address indexed account, int256 nb1, int256 nb2, int256 res); // event Sub(address indexed account, int256 nb1, int256 nb2, int256 res); // event Mul(address indexed account, int256 nb1, int256 nb2, int256 res); // event Div(address indexed account,...
Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), reverting when dividing by zero. Counterpart to Solidity's `%` operator. This function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remaining gas). Requirem...
function mod(int256 nb1, int256 nb2) public pure returns (int256) { return nb1 % nb2; }
12,984,254
/** * In this place you can write any text before deploy the contract in MainNet */ pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address _who) exte...
the function tranfer tokens from BountyAddress to investor _value is entered in whole tokens (1 = 1 token)/
function transferTokensFromBountyAddress(address _investor, uint256 _value) public restricted returns(bool){ token.transferTokensFromSpecialAddress(address(bountyAddress), _investor, _value); return true; }
7,852,235
./full_match/1/0x18faf3cdF637D6054C64fE76cEA218C6e009c261/sources/contracts/DogMoneyAuctionHouse.sol
Set the auction reserve price. Only callable by the owner./
function setReservePrice( uint256 _reservePrice ) external override onlyOwner { reservePrice = _reservePrice; emit AuctionReservePriceUpdated(_reservePrice); }
8,448,302
pragma solidity 0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(addr...
no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure
function _burn(address _who, uint256 _value, string memory _note) internal { require(_value <= balances[_who]); balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value, _note); emit Transfer(_who, address(0), _value); }
2,207,089
// Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either...
inject NONSTANDARD NAMING
function FROB749(bytes32, address, address, address, int256, int256) external;
12,918,565
./partial_match/3/0x368D7951C859E428c5A71e600B37Ac5440Eb7374/sources/UniswapV2Pair.sol
called once by the factory at time of deployment
function initialize(address _token0, address _token1) public { token0 = _token0; token1 = _token1; }
5,095,709
/* -*%%+++*#+: .+ -- [email protected]* *@* -#@- .=#% %@. @@: [email protected]* :@: [email protected]* @@. [email protected] #* := -- #@. [email protected]# +*+#: @= [email protected]: *=%* *@ ...
retrieves a specific module version base
function getModule(string memory name_, uint version_) public view returns(IPolly.ModuleBase memory){ if(version_ < 1) version_ = _module_versions[name_]; return IPolly.ModuleBase(name_, version_, _modules[name_][version_]); }
5,843,487
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; /// _ _ _ _ _ _ /// | |_ ___ ___| |_|_|___ ___| | | |_ ___ ___ ___ ___ ___ _____ ___ |_|___ /// | _| .'| _| _| | _| .'| | | _| .'| | . | _| .'| |_ -| _ | | . | /// |...
Return metadata url (placeholder) or base64-encoded metadata when gen-1 has started Overridden from OpenZeppelin's implementation to skip the unused baseURI check
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require( _exists(tokenId), "Nonexistent token" ); if (state <= StateType.MINTCLOSED) { return string(abi.encodePacked( METADATA_BASE_...
12,225,942
pragma solidity ^0.4.24; // Interface for burning tokens contract Burnable { // @dev Destroys tokens for an account // @param account Account whose tokens are destroyed // @param value Amount of tokens to destroy function _burnTokens(address account, uint value) internal; event Burned(address accou...
We restrict burn by overriding it
function burn(uint value) public canOperate(msg.sender) returns (bool success) { return super.burn(value); }
15,861,329
./partial_match/83/0xde01d59053d5e948179262A7DbA3533E870e742B/sources/contracts/libraries/LiquidityAmounts.sol
Computes the amount of token1 for a given amount of liquidity and a price range sqrtRatioAX96 A sqrt price representing the first tick boundary sqrtRatioBX96 A sqrt price representing the second tick boundary liquidity The liquidity being valued return amount1 The amount of token1
function getAmount1ForLiquidity( uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint128 liquidity ) internal pure returns (uint256 amount1) { if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); return FullMath.mulDiv(liquidi...
8,828,267
pragma solidity ^0.4.17; contract CoffeeCoin{ // CONSTRUCTING MY "OBJECTS" ======================= struct CoffeeMachine{ int priceByUnit; int capsules; int credit; } struct User{ int credit; bool seller; } // CONSTRUCTING MY "OBJECTS" ==================...
NOT WORKING AS EXPECTED
function addCredits(address userAddr, int quantity) public onlySeller{
5,544,376