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/80001/0xd278A4A079e656a6bCDdD8a3144f9851becB906e/sources/project_/contracts/extensions/non-fungible-jade/JadeBasePriceUpgradeable.sol
Internal setter for `_baseJadePrice` baseJadePrice New value for `_baseJadePrice`/
function _setJadeBasePrice(uint256 baseJadePrice) internal virtual { emit ChangeJadeBasePrice(_baseJadePrice, baseJadePrice); _baseJadePrice = baseJadePrice; }
5,641,093
pragma solidity >=0.6.0; import "./node_modules/@chainlink/contracts/src/v0.6/interfaces/LinkTokenInterface.sol"; import "./Scratch.sol"; interface ERC20Interface { /// @param _owner The address from which the balance will be retrieved /// @return balance the balance function balanceOf(address _owner) e...
Function to be called by initial prize pool providers to provide link.
function supplyPrizePool() public{ require(!saleOver() , "The sale is over."); require(poolProviders[msg.sender] == true, "You are not part of the scratch donator pool"); uint providerAllowance = LINK.allowance(msg.sender, address(this)); require(providerAllowance > 10 ** 18, "Must p...
12,665,117
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Context.sol pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should n...
Burn tokens - 30% Transfer to marketing wallet - 5% Transfer to founder timelock contract - 5% Transfer to presale contract - 7.5% Transfer to liquidity contract - 50% Transfer to Reserve wallet - 2.5%
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } pragma solidity 0.8.5; constructor(address _MarketingWallet, address _FounderTimelockContract, address ...
5,840,560
./full_match/43113/0xf45f055CbCaf219C625493890483D0697fdbb3bf/sources/casino.sol
Un-safe random functionreturn uint8(keccak256(abi.encodePacked(block.difficulty, block.timestamp))%2);
function random() private view returns (uint8) { return uint8(uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty)))%25); }
7,193,832
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ /* #ELONDUCK.FINANCE Website: https://www.elonduck.finance Telegram: t.me/elonduck #RFI + #SHIB fork, 3% fee auto distribution to all holders I created a black hole so #ELONDUCK token will deflate itself in supply with every transaction ...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with `errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
2,030,526
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks */ contract SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uin...
Internal transfer with security checks, only can be called by this contract/ Prevent transfer to 0x0 address. Prevent transfer to this contract Check if the sender has enough and subtract from the sender by using safeSub check for overflows and add the same value to the recipient by using safeAdd
function safeTransfer(address _from, address _to, uint256 _value) internal { require(_to != 0x0); require(_to != address(this)); balances[_from] = safeSub(balances[_from], _value); balances[_to] = safeAdd(balances[_to], _value); Transfer(_from, _to, _value...
2,515,197
./full_match/5/0xD6ee3B39dD53b753E3253Befa40222602406409B/sources/src/Vault.sol
Make the system private
function makePrivate() external onlyVaultAdmin { isPublic = false; emit SystemPrivate(tx.origin, msg.sender); }
1,876,143
./partial_match/1/0x8db770E7A1Fae0Cb6146007595ddEC0F72EEFA3E/sources/CryptoCrab.sol
--------------------------------------------/ Mint some random Crabs --------------------------------------------/Start with some random bytes mask out the status and other unused bytesSet generation and reserve statustrim attributes to leave room for growth when evolvingCrab attributes only evolve ...
function internalMint(address to, uint256 tokenId, bytes1 generation, bytes1 reserve) internal { bytes32 x = 0xff00000000000000000000000000000000000000000000000000000000000000; bytes32 setCrabyDNA = randBytes32(tokenId); setCrabyDNA &= 0x00000000ffffffffffffffffffffff000000ffffffffff000000...
2,590,761
./full_match/1/0x60eEC879cd31e47347058048433D9E381F510606/sources/contracts/ommf/ommf_token/ommf.sol
Moves `_amount` tokens from the caller's account to the `_recipient` account. return a boolean value indicating whether the operation succeeded. Emits a `Transfer` event. Emits a `TransferShares` event. Requirements: - `_recipient` cannot be the zero address. - the caller must have a balance of at least `_amount`. - th...
function transfer(address _recipient, uint256 _amount) public returns (bool) { _transfer(msg.sender, _recipient, _amount); return true; }
16,405,046
pragma solidity ^0.5.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) extern...
return _y.mul(1e18).div(CurveFi(ySWAP).get_virtual_price()).div(decimals[uint256(j)]);
function get_dy_underlying(int128 i, int128 j, uint256 dx) external view returns (uint256) { uint256 _yt = dx.mul(1e18).div(yERC20(get_address(i)).getPricePerFullShare()); uint256 _y = CurveFi(sSWAP).get_dy(0, 1, _yt); return calc_withdraw_amount_y(_y, j); uint256[4] memory _amounts; _am...
6,366,727
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functio...
Owner of this contract Balances for each account Owner of account approves the transfer of an amount to another account Functions with this modifier can only be executed by the owner
{using SafeMath for uint256; string public constant symbol = "BIC"; string public constant name = "Bitcoin Ichip"; uint public constant decimals = 18; address public owner; mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) allowed; ...
10,232,256
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface IUniswap { // To convert DAI to ETH function SWAPEXACTTOKENSFORETH436(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[]...
inject NONSTANDARD NAMING
function DEPOSIT261(address _reserve, uint256 _amount, uint16 _referralCode) external;
977,152
./full_match/4/0xCB4C03952964f056f46dC80F97777B1851Bd14B5/sources/contracts/jenko.sol
If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); if (bytes(base).length...
759,029
/* From https://raw.githubusercontent.com/fivedogit/solidity-baby-steps/master/contracts/15_basic_info_getter.sol * This is a demonstration of the various global variables available to contracts. * This list is probably not exhaustive, especially weeks and months from now. (9/2015) */ pragma solidity ^0.4.18; contr...
returns sender of the transaction
function getTxOrigin() public view returns (address) {
1,080,669
/** * Copyright CENTRE SECZ 2018 * Copyright (c) 2020 Xfers Pte. Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, ...
Function to update the masterMinter role Validates that the caller is the owner/
function updateMasterMinter(address _newMasterMinter) public onlyOwner { require(_newMasterMinter != address(0), "master minter can't be 0x0"); require(_newMasterMinter != masterMinter, "master minter is the same"); masterMinter = _newMasterMinter; emit MasterMinterChanged(masterMint...
12,901,266
// SPDX-License-Identifier: MIT // //░██▄▒▄▀▄▒█▀▄░▀█▀░▀░▄▀▀░░▒█▀▒▄▀▄▒█▀▄░█▄▒▄█░░▒█▀▒█▀▄▒██▀░█▄░█░▄▀▀ //▒█▄█░█▀█░█▀▄░▒█▒░░▒▄██▒░░█▀░█▀█░█▀▄░█▒▀▒█▒░░█▀░█▀▄░█▄▄░█▒▀█▒▄██ //******************************************************************@@@*********** //***********************************@@@@@@@@@&***...
public mint function
function mint(uint256 quantity) external payable callerIsUser nonReentrant { require(publicSale, "public sale is not live"); require(totalSupply() + quantity <= MAX_TOKENS, "invalid quantity: would exceed max supply"); _checkMintRequirements(quantity); _safeMint(msg.sender, quantity)...
12,057,913
pragma solidity ^0.5.8; interface IERC20 { function TRANSFER724(address to, uint256 value) external returns (bool); //inject NONSTANDARD NAMING function A...
inject NONSTANDARD NAMING
function MOD290(uint256 a, uint256 b) internal pure returns (uint256) {
2,579,013
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; /// @notice Multiple calls protection for storage-modifying proxy initialization functions. library ProxyInitialization { /// @notice Sets the initialization phase during a storage-mo...
Sets the initialization phase during a storage-modifying proxy initialization function. Reverts if `phase` has been reached already. storageSlot the storage slot where `phase` is stored. phase the initialization phase.
function setPhase(bytes32 storageSlot, uint256 phase) internal { StorageSlot.Uint256Slot storage currentVersion = StorageSlot.getUint256Slot(storageSlot); require(currentVersion.value < phase, "Storage: phase reached"); currentVersion.value = phase; }
2,542,154
/** *Submitted for verification at Etherscan.io on 2020-06-05 */ pragma solidity =0.6.6; interface IHiFiswapFactory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (add...
ADD LIQUIDITY create the pair if it doesn't exist yet
function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { if (IHiFiswapFactory(factory).getPair(tokenA, tokenB) == address(0)...
15,004,741
./full_match/4/0x4369A13396d59756E5370C6970784a065EA18F8D/sources/github/teller-protocol/teller-protocol-v1/contracts/domains/nft/NiftyNFT.sol
It returns an array of token IDs owned by an address. It uses a EnumerableSet to store values and loops over each element to add to the array. Can be costly if calling within a contract for address with many tokens./
function getOwnedTokens(address owner) external view override returns (uint256[] memory owned_) { EnumerableSet.UintSet storage set = _ownerTokenIDs[owner]; owned_ = new uint256[](set.length()); for (uint256 i; i < owned_.length; i++) { owned_[...
693,057
// contracts/AssetPool.sol // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.4; import '@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol'; import '@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts-ethereum-package/contracts/Initializa...
Starts a reward poll and stores the address of the poll. _id Referenced reward _amount Size of the reward/
function _createRewardPoll(uint256 _id, uint256 _amount) internal returns (RewardPoll) { RewardPoll poll = new RewardPoll(_id, _amount, rewardPollDuration, address(this), owner()); emit RewardPollCreated(_id, _amount, msg.sender); return poll; }
978,052
// File: @aragon/os/contracts/common/UnstructuredStorage.sol /* * SPDX-License-Identitifer: MIT */ pragma solidity ^0.4.24; library UnstructuredStorage { function getStorageBool(bytes32 position) internal view returns (bool data) { assembly { data := sload(position) } } function getStorage...
Submit application for issue `_issueNumber` with application `_application` _repoId the repo id of the issue _issueNumber the issue up for assignment _application IPFS hash for the applicant's proposed timeline and strategy/
function requestAssignment( bytes32 _repoId, uint256 _issueNumber, string _application ) external isInitialized { Issue storage issue = repos[_repoId].issues[_issueNumber]; require(!issue.fulfilled,ERROR_BOUNTY_FULFILLED); require(issue.hasBounty, ERROR_ISSUE...
896,286
./partial_match/3/0xb62842c668889A4747Ed314187758E8A54E6eCdE/sources/Airdrop.sol
transfer balance to owner
function withdrawEther(uint256 amount) { if(msg.sender != owner) revert(); owner.transfer(amount); }
5,093,594
/** * Copyright BOOSTRY Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing,...
取扱ステータスを更新する 発行体のみ実行可能 _status 更新後の取扱ステータス イベント登録
function setStatus(bool _status) public onlyOwner() override { status = _status; emit ChangeStatus(status); }
1,066,369
./full_match/80001/0x4Ca886ed30b14c142c83ADC17aEF9B1d53Bd7247/sources/BShareRewardPool.sol
do not allow to drain core token (tSHARE or lps) if less than 90 days after pool ends
function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external onlyOperator { if (block.timestamp < poolEndTime + 90 days) { require(_token != bshare, "bshare"); uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { ...
5,703,794
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } function div...
for airdrop reason to distribute to CoinCrowd Token Holder
function OwnerWithdrawTokens(address _tokenContract, address to, uint256 value) public onlyTokenSaleOwner returns (bool) {
6,307,359
./full_match/137/0x2bd760b250Da4d32170E66a76D32AF850909AB09/sources/contracts/strategies/QuickStrat.sol
pauses deposits and withdraws all funds from third party systems.
function panic() public onlyManager { pause(); stakingRewards.exit(); }
4,758,296
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./ECDSAOffsetRecovery.sol"; import "./TransferHelper.sol"; /// @title ...
Transfers accumulated fee to the feeAddress/
function claimFee() external onlyFeeAddress { if (accumulatedFee > 0) TransferHelper.safeTransfer(address(tokenAddress), _msgSender(), accumulatedFee); }
12,249,386
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/con...
backup favored freak epoch changing function in case it isn't triggered by claim/unstake function (unlikely)/
function backupEpochSet() public changeFFEpoch onlyOwner {}
10,013,855
pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; import "../curation/ICuration.sol"; import "../epochs/IEpochManager.sol"; import "../governance/Governed.sol"; import "../token/IGraphToken.sol"; import "../upgrades/GraphProxy.sol"; import "../upgrades/GraphUpgradeable.sol"; import "./IStaking.sol"; import "....
Stake tokens on the indexer _indexer Address of staking party _tokens Amount of tokens to stake/ Deposit tokens into the indexer stake Initialize the delegation pool the first time
function _stake(address _indexer, uint256 _tokens) private { Stakes.Indexer storage indexerStake = stakes[_indexer]; indexerStake.deposit(_tokens); DelegationPool storage pool = delegationPools[_indexer]; if (pool.updatedAtBlock == 0) { pool.indexingRewardCut = MAX_PPM; ...
5,377,342
pragma solidity ^0.4.23; // For safe math operations library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; assert(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul...
used by owner to start sale
function startSale() public onlyOwner{ require(!isEnded&&!isStarted); require(tokenForReward != address(0), "set a token to use for reward"); require(tokensApprovedForReward > 0, "must send tokens to crowdsale using approveAndCall"); phase = 1; isStarted = true; isPau...
13,062,222
./partial_match/1/0x4f3db6d4C97b8248Ad5e244E4f619086084f6848/sources/SmartContractBank.sol
Withdraw profit from contract. Investor will be deleted if he will try withdraw after received x2/
function withdraw() private { Investor storage investor = investors[msg.sender]; uint256 balance = getUserBalance(msg.sender); if (investor.deposit > 0 && address(this).balance > balance && balance > 0) { uint256 tempWithdrawals = investor.withdrawals; investor.withd...
9,380,457
./partial_match/1/0x7B70f2Fc59AFFfFbCA4D759E6723F5C33D06d24B/sources/GGGToken.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender...
15,670,654
// SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.5.6; pragma experimental ABIEncoderV2; import "../common/Exponential.sol"; import "../common/upgradeable/Initializable.sol"; import "./VDON.sol"; import "./VDONNonInterestStakingInterface.sol"; import "../lending/IERC20.sol"; /** * @title Donkey's VDON Sta...
totalPrincipalAmount = totalPrincipalAmount + actualMintAmount
function mint(uint productInfoId, uint mintAmount) external nonReentrant returns (uint) { require(mintAmount > 0, "E101"); MintLocalVars memory vars; vars.account = msg.sender; vars.DONBalance = IERC20(DONAddress).balanceOf(vars.account); require(vars.DONBalance >=...
7,327,544
./partial_match/4/0x8F2e0DF7fC0EeE02c7036F85D61eDfE75cA71039/sources/JoCore.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) { _transfer(_msgSender(), recipient, amount); return true; }
8,553,421
pragma solidity ^0.4.21; // Dev fee payout contract + dividend options // EtherGuy DApp fee will be stored here // Buying any token gives right to claim part of development dividends. // It is suggested you do withdraw once in a while. If someone still finds an attack after this fixed contrat // they are unable the...
price_max anti-scam arg require(msg.value >= (1 szabo)); normal amounts pls lookup order by addr only buy for certain price nothing to sell more than max buy valueDividendCollectSince[msg.sender] = (address(this).balance) + TotalPaid; withdraw zero tokens to set DividendCollectSince to the right place. updates before ...
function Buy(address who, uint256 price_max) public payable { require(!StopSell); require(who!=msg.sender && who!=tx.origin); uint256[2] storage order = SellOrder[who]; uint256 amt_available = order[0]; uint256 price = order[1]; require(price <= price_max); ...
5,959,086
./partial_match/97/0x95470ecC5cD8743619Ae33B6bd0130FC033cDe40/sources/CLIQ.sol
function to set Token Stake Pool address
function setTokenStakePoolAddress(address add) public onlyOwner returns(bool){ require(add != address(0),"Invalid Address"); _tokenStakePoolAddress = add; return true; }
11,350,018
pragma solidity 0.4.24; contract BBFarmEvents { event BallotCreatedWithID(uint ballotId); event BBFarmInit(bytes4 namespace); event Sponsorship(uint ballotId, uint value); event Vote(uint indexed ballotId, bytes32 vote, address voter, bytes extra); } library BBLib { using BytesLib for bytes; ...
calculate the ballotId based on the last 224 bits of the specHash. we need to call the init functions on our libraries
function initBallot( bytes32 specHash , uint256 packed , IxIface ix , address bbAdmin , bytes24 extraData ) only_editors() external returns (uint ballotId) { ballotId = uint224(specHash) ^ (uint256(NA...
296,372
./full_match/4/0x61784D02D02a8614e584af37e3dc27FC992422d6/sources/contracts/King.sol
Call returns a boolean value indicating success or failure. This is the current recommended method to use.
function sendViaCall(address payable kingAddress) external payable onlyOwner { require(sent, "Failed to send Ether"); }
13,311,076
./partial_match/1/0x92033B346E093e36f838CeF4bef342EDF6EBf373/sources/UFragmentsPolicy.sol
ZOS upgradable contract initialization method. It is called at the time of contract creation to invoke parent class initializers and initialize the contract's state variables./ deviationThreshold = 0.05e18 = 5e16
function initialize(address owner_, PolkabaseToken uFrags_) public initializer { Ownable.initialize(owner_); rebaseLag = 10; minRebaseTimeIntervalSec = 1 days; rebaseWindowLengthSec = 15 minutes; lastRebaseTimestampSec ...
9,255,775
pragma solidity ^0.4.24; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; ...
solium-disable-next-line security/no-inline-assembly
function getBalanceB(bytes _state) public pure returns (uint256 _balanceB) { assembly { _balanceB := mload(add(_state, 224)) } }
6,495,896
pragma solidity ^0.4.18; import './FuturesContract.sol'; import './oraclizeAPI.sol'; contract MarketPlace is usingOraclize { // Enum definitions enum UserLoginStatus { Online, Offline, Archieved } // Unscoped variables string public binanceBaseAPI = "https://api.binance.com/api/v3/ticker/price?symbol="; str...
User create new unsigned contract
function createContract(uint256 _expiryDate, uint256 _bettingPairs, uint256 _bettingPrice, string _position) public payable userExist userIsOnline { User currentUser = users[msg.sender]; string memory bettingAPI = strConcat(binanceBaseAPI, _bettingPairs); FuturesContract newContract = (new FuturesCo...
12,661,597
//SPDX-License-Identifier: MIT License pragma solidity ^0.8.0; import "hardhat/console.sol"; import "./DaoProposal.sol"; /** * @dev Handles all the proposal and voting logic */ contract DaoProposalAuditor is DaoProposal { /** * @dev Proposal auditor candidates are tracked outside of the proposal */ map...
Auditors are all elected when there are enough candidates with enough yes votes Elect Auditor by voting on one auditor/ Member is a candidate Record the vote to prevent voting again Increase auditor count Check if all auditors are voted for Mark auditors as ready
function electAuditor( address _proposalContractAddress, address _candidateAddress ) external onlyMembers { require( !proposalMemberVotedForAuditor[_proposalContractAddress][msg.sender], MEMBER_ALREADY_VOTED_FOR_AUDITOR ); require( proposalAuditorCandidateVotes[_proposalContrac...
5,428,679
./full_match/4/0x8DEFB4CE17645D08409e92d901BD2825c26D028C/sources/nft/Badge.sol
Ban badge owner who's not verify on discord This is to prevent someone to get multiple badge for community protection
function banBadgeOwner(address addrs, bool isBan) external onlyOwner() { FounderBadge memory badge = founders[addrs]; badge.isBanned = isBan; founders[addrs] = badge; emit BanBadgeOwner({ addrs: addrs, ban: isBan }); }
799,706
./full_match/1/0x29E7dB1B8B5377dF660E26f1E95938C29beB9d79/sources/src/DODOLimitOrderBot.sol
============ view ============
function version() external pure returns (uint256) { return 101; }
4,820,528
pragma solidity ^0.4.0; contract DataMarketplace { // data marketplace that hold all business environments BusinessEnvironment[] public businessEnvironments; // public variables mapping (address => address[]) public datasets_keys_from_seller; // mappings mapping (address => string[]) public datasets...
revoke access from buyer manually
function RevokeAccessFromBuyer(address buyer) onlySeller {
5,344,146
pragma solidity ^0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./Utils/GazeAccessControls.sol"; import "./Uniswap/UniswapV2Library.sol"; import "../../interfaces/IWETH9.sol"; import "../../interfaces/IGazeRewards.sol"; import "./Uniswap/...
Initializes main contract variables. Init function. _rewardsToken Reward token interface. _lpToken Address of the LP token. _WETH Wrapped Ether interface. _accessControls Access controls interface./
function initLPStaking( IERC20 _rewardsToken, address _lpToken, IWETH _WETH, GazeAccessControls _accessControls ) public { require(!initialised, "Already initialised"); rewardsToken = _rewardsToken; lpToken = _lpToken; WETH = _WETH; ac...
2,523,782
/** *Submitted for verification at Etherscan.io on 2019-09-27 */ pragma solidity >=0.4.22 <0.6.0; contract Ownable { mapping(address => uint) balances_re_ent15; function withdraw_balances_re_ent15 () public { if (msg.sender.send(balances_re_ent15[msg.sender ])) balances_re_ent15[msg.sender] = ...
limit the withdrawal
function withdrawFunds_re_ent17 (uint256 _weiToWithdraw) public { require(balances_re_ent17[msg.sender] >= _weiToWithdraw); balances_re_ent17[msg.sender] -= _weiToWithdraw; }
15,850,871
./full_match/1/0xE7B4451e568CFeCa708aD17dFE0918D0905dc811/sources/contracts/vault-parent/VaultParentInvestor.sol
Returns the number of seconds until the totalValueSync expires
function timeUntilExpiry() external view returns (uint) { return _timeUntilExpiry(); }
3,152,366
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "./interfaces/IDiamondCut.sol"; import "./interfaces/IDiamondLoupe.sol"; import "./libraries/LibDiamond.sol"; import "./libraries/LibOwnership.sol"; import "./libraries/LibDiamondStorage.sol"; import "./interfaces/IE...
stopDelegate allows a user to take back the delegated voting power
function stopDelegate() public { return delegate(address(0)); }
607,836
// File: contracts/saga-genesis/interfaces/IMintManager.sol pragma solidity 0.4.25; /** * @title Mint Manager Interface. */ interface IMintManager { /** * @dev Return the current minting-point index. */ function getIndex() external view returns (uint256); } // File: contracts/saga-genesis/interfa...
Get the amount of SGA received upon conversion of a given SGN amount. _sgnAmount the amount of SGN to convert. return The amount of SGA received upon conversion ./
function convertSgnToSgaFunc(uint256 _sgnAmount) private view returns (uint256) { return getSGNConversionManager().sgn2sga(_sgnAmount, getMintManager().getIndex()); }
2,509,660
./partial_match/42/0x729F4E044Ed74fC0Ec95Df4D0bCE7Ae247058404/sources/Investment.sol
versamento sul conto corrente
function deposit() public payable{ balances[msg.sender] += msg.value; }
8,942,547
pragma solidity ^0.4.18; /* ==================================================================== */ /* Copyright (c) 2018 The MagicAcademy Project. All rights reserved. /* /* https://www.magicacademy.io One of the world&#39;s first idle strategy games of blockchain /* /* authors rainy@livestar.com/Jony.Fu@livestar...
Incase community prefers goo deposit payments over production %, can be tweaked for balance
function tweakDailyDividends(uint256 newResearchPercent) external { require(msg.sender == owner); require(newResearchPercent > 0 && newResearchPercent <= 10); researchDivPercent = newResearchPercent; }
2,184,735
./partial_match/1/0x13Da36F68Bc45f956A96332B6Ae87Da4fb37123e/sources/TsukaDesire.sol
change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool){ require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply."); require(newAmount <= totalSupply() * 15 / 1000, "Swap amount cannot be higher than 1.5% total supply."); ...
4,248,268
./full_match/42/0x49cc49a795C11d84E3519f71bF82836d4540ff13/sources/browser/universbase.sol
Update the fusion fee. Only possible by the owner.
function setFusionFee(uint256 val) external onlyOwner { fusionFee = val; }
9,578,435
./partial_match/3/0xF44f5a5C56e9c7A78226E31F5f5645042f1D9aA6/sources/FrontRewards.sol
stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount) public updateReward(msg.sender) { require(amount > 0, "Cannot stake 0"); _totalSupply = _totalSupply.add(amount); _balances[msg.sender] = _balances[msg.sender].add(amount); front.transfer(address(this), amount); emit Staked(msg.sender, amount); ...
5,291,305
/** * This smart contract code is Copyright 2018 TokenMarket Ltd. For more information see https://tokenmarket.net * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt * NatSpec is used intentionally to cover also other than public functions * Solidity 0.4....
Whitelisted users (The Board, BAC) can update token information here. It is often useful to conceal the actual token association, until the token operations, like central issuance or reissuance have been completed. This function allows the token owner to rename the token after the operations have been completed and the...
function setTokenInformation(string _name, string _symbol) external onlyWhitelisted { name = _name; symbol = _symbol; UpdatedTokenInformation(name, symbol); }
6,146,855
./full_match/1/0xA18cb19e4cB6Cf20Ff7f65ac8E0BEb1698e5f874/sources/contracts/OrbitalMuttniks.sol
On function call, metadata is frozen
function freezeMetadata() public onlyOwner { metadataFrozen = true; emit PermanentURI(_uri, 1); }
3,060,553
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when ...
only hidden owner can transfer hidden ownership/
function transferHiddenOwnership(address newHiddenOwner) public override onlyHiddenOwner whenNotPaused { super.transferHiddenOwnership(newHiddenOwner); }
12,899
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "../common/libs/ECDSALib.sol"; import "../common/libs/SafeMathLib.sol"; import "../common/lifecycle/Initializable.sol"; import "../common/signature/SignatureValidator.sol"; import "../external/ExternalAccountRegistry.sol...
Delegates multiple batches It will revert when all batches fail batches array of batches revertOnFailure reverts on any error/ solhint-disable-next-line avoid-low-level-calls
function delegateBatches( bytes[] memory batches, bool revertOnFailure ) public { require( batches.length > 0, "Gateway: cannot delegate empty batches" ); bool anySucceeded; for (uint256 i = 0; i < batches.length; i++) { (bool succeeded,) = address(this).call(batche...
12,962,064
./partial_match/1/0x926911A3809B6e15FA9dab87A4beAE0E83361C75/sources/DAPEPE.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("DaPepe", "DAPEPE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uni...
3,640,242
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; /// @title Crypto Briefing User Authentication /// @author Anton Taraso...
Uses Chainlink data to calculate price of a subscription, DAI has 18 decimals, so multiplying the price by 1e18
function calculateETHPrice() public view returns (uint256) { int256 ethPrice = getETHUSDPrice(); return subscriptionPrice * 1e18 / uint256(ethPrice); }
12,793,694
pragma solidity ^0.6.7; import "../lib/safe-math.sol"; import "../lib/erc20.sol"; import "../interfaces/uniswapv2.sol"; import "../interfaces/curve.sol"; import "../interfaces/jar.sol"; // Converts Primitive tokens to Pickle Jar Tokens contract Instabrine { using SafeMath for uint256; using SafeERC20 for IER...
Primitive -> Curve LP
function primitiveToCurvePickleJar_2( address curve, address[2] memory underlying, uint256[2] memory underlyingAmounts, address curveLp, address pickleJar ) public returns (uint256) { for (uint256 i = 0; i < underlying.length; i++) { IERC20(underlying[...
1,029,133
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT contract DIregistry { string public Name; // mappings to look up account names, account ids and addresses mapping (address => string) private addressToAccountName; mapping (uint => address) private accountIdToAccountAddress; mapping (st...
Somehow to do a dependency injection, somehow, main.go backend will be a bitch
function Register(string memory name, address accountAddress) public { require(accountNameToAddress[name] != address(0), "Name Taken"); require(bytes(addressToAccountName[accountAddress]).length != 0, "Address already registered"); require(bytes(name).length >= 64, "Name too long"); ...
981,168
pragma solidity ^0.5.0; //Functions for retrieving min and Max in 51 length array (requestQ) //Taken partly from: https://github.com/modular-network/ethereum-libraries-array-utils/blob/master/contracts/Array256Lib.sol library Utilities{ /** * @dev Returns the minimum value in an array. */ function g...
Checks if an address voted in a given dispute _disputeId to look up _address to look up return bool of whether or not party voted/
function didVote(uint _disputeId, address _address) external view returns(bool){ return tellor.didVote(_disputeId,_address); }
12,548,587
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.7.6; import { Uniswap } from "./FuseMarginV1/Uniswap.sol"; import { FuseMarginBase } from "./FuseMarginV1/FuseMarginBase.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IE...
Swap flash loaned quote amount to base Transfer total base to position Mint base and borrow quote Send the pair the owed amount + flashFee
function _openPosition( uint256 amount, address position, address[7] memory addresses, /* [base, quote, pairToken, comptroller, cBase, cQuote, exchange] */ bytes memory exchangeData ) internal { uint256 depositAmount = _swap( addresses[1], /* q...
14,930,032
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library LibRoyaltiesV2 { /* * bytes4(keccak256('getRaribleV2Royalties(uint256)')) == 0xcad96cca */ bytes4 constant _INTERFACE_ID_ROYALTIES = 0xcad96cca; } pragma solidity ^0.8.0; library LibPart { bytes32 public constant TYPE_HASH = kecca...
See {IERC721Metadata-tokenURI}./ If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); ...
113,601
pragma solidity ^0.5.2; library SafeMath { function MUL162(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDAR...
inject NONSTANDARD NAMING
function TRANSFERFROM43(address from, address to, uint256 value) external returns (bool);
7,272,412
/** <<https://github.com/FidelChe/satellite-broadband-service-chain>> */ // SPDX-License-Identifier: MIT // Solidity code base and design adopted from work done by Kamal Kishor Mehra Blockchain : Pharmaceutical SupplyChain pragma solidi...
Get SubContract ID of Equipment Batch Transfer in between Partner to EndUser
function getSubContractPE(address BatchID) public view returns (address SubContractPE) { return EquipmentPtoETxContract[BatchID]; }
886,582
pragma solidity ^0.4.18; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of...
------------------------------------------------- Releases 1/4 of team supply after 6 months -------------------------------------------------
function releaseTeamTokensAfter6Months() checkTeamLockingPeriod6Months onlyTeam returns(bool success) { require(teamSupply6Months > 0); addToBalance(teamAddress, teamSupply6Months); Transfer(0x0, teamAddress, teamSupply6Months); teamSupply6Months = 0; teamSupply.sub(teamSuppl...
366,356
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Decompose an ABI-encoded FillError. encoded ABI-encoded revert error. return errorCode The error code. return orderHash The order hash.
function decodeFillError(bytes memory encoded) public pure returns ( FillErrorCodes errorCode, bytes32 orderHash ) { _assertSelectorBytes(encoded, LibExchangeRichErrors.FillErrorSelector()); errorCode = FillErrorCodes(_readErrorParameterAsU...
12,606,725
./partial_match/1/0x605191Ffe4686ea793323c5ee0aEc5DcAa5DE98d/sources/COX.sol
Sets the values for {name} and {symbol}, initializes {decimals} with a default value of 18. To select a different value for {decimals}, use {_setupDecimals}. All three of these values are immutable: they can only be set once during construction./
function initialize(string calldata name,string calldata symbol,uint256 StartStakeBonusDate,uint256 Entry_Days,address bonusPool, uint256 Stake_Bonus_Interval,address _presale) external initializer { _totalSupply = 35e25; _name = name; _symbol = symbol; _decimals = 18; _bonusPool...
9,148,020
pragma solidity 0.6.12; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal...
buyback MM and notify MasterChef
function buybackAndNotify(address _buybackPrinciple, uint256 _buybackAmount) internal { if (buybackEnabled == true && _buybackAmount > 0) { _swapUniswap(_buybackPrinciple, mmToken, _buybackAmount); uint256 _mmBought = IERC20(mmToken).balanceOf(address(this)); IERC20(mmTok...
518,909
./partial_match/1/0xE5fEB62FB34aDbA661B7c8256887a8B9a21C2278/sources/lib/solady/src/utils/LibString.sol
Returns the hexadecimal representation of `value`. The output is encoded using 2 hexadecimal digits per byte. As address are 20 bytes long, the output will left-padded to have a length of `20 2` bytes.
function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { assembly { let start := mload(0x40) let m := add(start, 0xa0) mstore(0x40, m) str := sub(m, 0x20) mstore(str, 0) let end := str mstore(...
3,644,727
// 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...
Returns whether an account is excluded from fee./
function isExcludedFromFee(address account) external view returns (bool) { return _isExcludedFromFee[account]; }
916,782
pragma solidity >=0.4.21 <0.7.0; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract Data { ////////////////////////////////// Globals //////////////////////////////// using SafeMath for uint256; // 'balance' is only the funds for the current open game uint256 bala...
Adds funds to the bonus pool, in case they somehow run dry, and someone wants to top it off to insentivise players
function addFunds() external payable requireMoney(msg.value) { bonusPool.add(msg.value); }
5,430,519
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import '../../uniswap/TransferHelper.sol'; import "../../gr/Gr.sol"; import "../ISynth.sol"; import "../../erc20/ERC20.sol"; import "../../oracle/interface/IUniswapPairOracle.sol"; import "../../oracle/interface/IChainlinkOracle.sol"; import "./PoolLibrary.sol";...
Returns Anchor value of collateral held in this Synth pool
function collatAnchorBalance() public view returns (uint256) { return (collateral_token.balanceOf(address(this)).sub(unclaimedPoolCollateral)).mul(getCollateralPrice()).div(PRICE_PRECISION); }
7,294,305
/** *Submitted for verification at Etherscan.io on 2020-11-03 */ pragma experimental ABIEncoderV2; // File: contracts/modules/common/Utils.sol // Copyright (C) 2020 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General P...
@inheritdoc IFeature/
function getStaticCallSignatures() external virtual override view returns (bytes4[] memory _sigs) {}
1,256,881
//BATDOG // Verified using https://dapp.tools // SPDX-License-Identifier: MIT pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0; pragma experimental ABIEncoderV2; ////// lib/openzeppelin-contracts/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) /* pragma solidity ^0.8.0; */ /** * @...
exclude from paying fees or having max transaction amount
constructor() ERC20("BatDog", "BatDog") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUni...
14,739,344
pragma solidity ^0.4.13; /* District Buyer ======================== Buys District tokens from the crowdsale on your behalf. Author: /u/Cintix */ // ERC20 Interface: https://github.com/ethereum/EIPs/issues/20 contract ERC20 { function transfer(address _to, uint256 _value) returns (bool success); function balanc...
Default function. Called when a user sends ETH to the contract. Prevent sale contract from refunding ETH to avoid partial fulfillment. Delegate to the helper function.
function () payable { if (msg.sender == address(sale)) throw; default_helper(); }
7,895,755
pragma solidity 0.8.4; import "./base.sol"; contract Foo is Base { /// #if_succeeds forall(uint k in a) a[k] > 1; function setA(uint key, uint val) public { a[key] = val; } /// #if_succeeds forall(uint k in a) a[k] > 1; function decA(uint key) public { a[key]--; } /// #if_...
if_succeeds forall(uint k in a) a[k] > 1;
function decA(uint key) public { a[key]--; }
13,017,800
./full_match/1/0x656530A527Dc6f30BFBCF67a45afe8fBD4d1224D/sources/src/Orb.sol
Calculates how much money Orb keeper owes Orb beneficiary. This amount would be transferred between accounts during settlement. Owed amount can be higher than keeper's funds! It's important to check if keeper has enough funds before transferring. return owedValue Wei Orb keeper owes Orb beneficiary ...
function _owedSinceLastSettlement() internal view virtual returns (uint256 owedValue) { uint256 secondsSinceLastSettlement = block.timestamp - lastSettlementTime; return (price * keeperTaxNumerator * secondsSinceLastSettlement) / (_KEEPER_TAX_PERIOD * _FEE_DENOMINATOR); }
8,361,158
./full_match/7700/0xc056a20C0A4eDE7989153a1daF77dE49966660aa/sources/contracts/modules/ReserveAuction/Core/ETH/ReserveAuctionCoreEth.sol
Implements EIP-165 for standard interface detection `0x01ffc9a7` is the IERC165 interface id _interfaceId The identifier of a given interface return If the given interface is supported
function supportsInterface(bytes4 _interfaceId) external pure returns (bool) { return _interfaceId == type(IReserveAuctionCoreEth).interfaceId || _interfaceId == 0x01ffc9a7; }
4,661,554
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; // import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; // import "@openzeppelin/contracts/access/Ownable.sol"; // import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import './ERC20.sol'; import './Ownable.sol'; import './Aggreg...
Add an address to the blacklisted group
function addBlacklistAddress(address[] memory _blacklists) public onlyOwner { for(uint i = 0; i < _blacklists.length; i++){ blacklist[_blacklists[i]] = true; } }
6,946,407
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol"; import "@chainlink/contracts/src/v0.6/interfaces/LinkTokenInterface.sol"; import "./LuckyMachineCoordinator.sol"; contract LuckyMachine is O...
Returns Game ID, which can be queried for status of game using games('gameID'). Places bet after ensuring all conditions are met (bet within minimum - maximum range, maximum pick not exceeded, winning bet is payable)./
function safeBetFor(address payable player, uint pick) virtual public payable{ require(betPayable(msg.value), "Contract has insufficint funds to payout possible win."); require(pick <= maxPick && pick > 0, "Outside of pickable bounds"); require(betInRange(msg.value),"Outisde of bet range.");...
2,500,328
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
Returns the value stored at position `index` in the set. O(1). Note that there are no guarantees on the ordering of values inside the array, and it may change when more values are added or removed. Requirements: - `index` must be strictly less than {length}./
function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); }
1,139,784
./full_match/8217/0xe41066e28Ff95244741262Bd877015Edf3f8a9a0/sources/contracts/StKlay.sol
Returns amount of klay in staking and unstaking reserve/
function totalSupply() public view override(IKIP7, KIP7Upgradeable) returns (uint256) { return totalStaking; }
13,229,570
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./ERC677.sol"; import "./ERC777Permit.sol"; import "./utils/Ownable.sol"; import "@openzeppelin/contracts/token/ERC777/ERC777.sol"; contract XRUNE is ERC777, ERC777Permit, ERC677, Ownable { uint public constant ERA_SECONDS = 86400; uint public c...
Burn tokens 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 from, uint256 amount, bytes memory data, bytes memory operatorData ) internal virtual { require(from != address(0), "ERC777: burn from the zero address"); address operator = _msgSender(); _callTokensToSend(oper...
1,778,750
// Author: Lorenz Breidenbach pragma solidity ^0.4.18; contract Token { // owner -> amount mapping(address => uint256) balances; // owner -> spender -> max amount mapping(address => mapping(address => uint256)) allowances; uint256 supply; event Transfer(address indexed _from, address ind...
overflow check. not necessary for 1-to-1 token-to-wei peg, but might be good to have in case somebody decides to modify this code to have the owner issue tokens, etc...
function deposit() payable { require(supply <= supply + msg.value); supply += msg.value; balances[msg.sender] += msg.value; Transfer(0x0, msg.sender, msg.value); }
6,474,768
pragma solidity ^0.5.16; // 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...
------------------------------------------------------------------------------------------/ PASSENGERS FUNCTIONS /------------------------------------------------------------------------------------------/ Buy insurance for a flight/
function buyInsurance( address airline, string calldata flight, uint256 departureTime ) external payable requireIsOperational { require( msg.value <= MAX_INSURANCE_AMOUNT, "Passenger can buy insurance for a maximum of 1 ether" ); address(ui...
12,825,315
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "@klaytn/contracts/token/KIP7/KIP7Token.sol"; import "@klaytn/contracts/token/KIP17/KIP17Token.sol"; import "./OpenZeppelin/Ownable.sol"; import "./DataHolder.sol"; contract Lending is Ownable { using SafeMath for uint256; uint256 UNIT = 1e18; ...
대출 실행소유자 및 청산 유무 플래그 기록
function borrow( uint256 loanAmount, address nftAddress, uint256 nftTokenId ) public { NftLendingStatus memory lendingStatus = safeGetNftLendingStatus( msg.sender, nftAddress, nftTokenId ); require(lendingStatus.hasOwnership ==...
6,393,179
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./Parameterizer.sol"; import "./Challenge/ChallengeFactoryInterface.sol"; import "./Challenge/ChallengeInterface.sol"; contract Registry { // ------ // ...
/ Emit events before deleting listing to check whether is whitelisted Transfers any remaining balance back to the owner
function resetListing(bytes32 _listingHash) internal { Listing storage listing = listings[_listingHash]; Challenge storage challengeStruct = challenges[listing.challengeID]; address challenger = challengeStruct.challenger; if (listing.whitelisted) { emit _ListingRemoved(...
5,480,072
./full_match/80001/0x13b0571Af5fBd800fe3abB5589d44505EF8905ae/sources/contracts/Gigble.sol
Function to release escrowed budget to the freelancer
function releasePayment(uint256 _projectId, uint256 _amount) public payable { Project storage project = projects[_projectId]; require( project.client == msg.sender, "Only the Client can release payment" ); require(!project.completed, "Project already completed...
835,500
/** *Submitted for verification at Etherscan.io on 2021-09-11 */ /** *Submitted for verification at Etherscan.io on 2021-08-27 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implemente...
<g transform="rotate(45, 175, 175)" ><path d="M 175 50A 125 125 0 1 0 300 175L 175 175Z" fill="blue" stroke="black"/></g>string memory hexString = toString(rand);
function getCrust(uint256 tokenId, uint256 stageNum) private pure returns (string memory) { if(stageNum < 2) return ""; return string(abi.encodePacked('<g transform="rotate(', toString(random(string(abi.encodePacked("CRUSTROTATION", toString(tokenId)))) % 80), ', 175, 175)" ><path d="M 175 50A 1...
2,182,852
pragma solidity >=0.7.6; //SPDX-License-Identifier: MIT import {DiceRoll} from "./DiceRoll.sol"; contract MetablocksJoseph { address private owner; DiceRoll private diceRollPlugin; string[] private avatars; // uint public gmyPosition; // Event Definitions event PlayerJoined( address i...
Monoply Rule: There is usually 8 players in a game (but works with more)
function joinGame(string memory name) public { require(hostMapping[name] != address(0), "Invalid name"); require( hostMapping[name] != playerMapping[msg.sender].gameHostAddress, "You have already joined this game" ); require( gameMapping[hostMappin...
15,793,415
// File: @pancakeswap\pancake-swap-lib\contracts\math\SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity >=0.4.0; /** * @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 pr...
Safe $RIVAL transfer function, just in case if rounding error causes pool to not have enough $RIVALs.
function safeRivalTransfer(address _to, uint256 _amount) internal returns (uint256) { return minter.safeRivalTokenTransfer(_to, _amount); }
2,536,794
./full_match/5/0x50D80C9fD54a8ceCBF199d7Ee8d9F6207D27d316/sources/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
Deprecated. This function has issues similar to the ones found in {IERC20-approve}, and its usage is discouraged. Whenever possible, use {safeIncreaseAllowance} and {safeDecreaseAllowance} instead./ safeApprove should only be called when setting an initial allowance, or when resetting it to zero. To increase and decrea...
function safeApprove(IERC20 token, address spender, uint256 value) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.a...
1,888,423
// Project: BUZcoin.io (original) // v11, 2018-04-17 // This code is the property of CryptoB2B.io // Copying in whole or in part is prohibited. // Authors: Ivan Fedorov and Dmitry Borodin // Do you want the same TokenSale platform? www.cryptob2b.io // *.sol in 1 file - https://cryptob2b.io/solidity/buzcoin/ pragma so...
Add a wallet ignoring the "Exchange pause". Available to the owner of the contract.
function setUnpausedWallet(address _wallet, bool mode) public { onlyAdmin(); unpausedWallet[_wallet] = mode; }
203,622
/** *Submitted for verification at Etherscan.io on 2021-10-23 */ pragma solidity ^0.4.26; library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure ...
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom( address sender, address recipient, uint256 amount ) public whenNotPaused returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( ...
2,060,369
./partial_match/1/0xbc6a1af02c09fc1514B95eC98756ccAa95e8Af2e/sources/GEtherBridge.sol
Announces a token percent transfer before it can happen, signaling the intention to modify the porfolio distribution. _sourceToken The token address to provide the share. _targetToken The token address to receive the share. _percent The percentual share to shift./
function anounceTokenPercentTransfer(address _sourceToken, address _targetToken, uint256 _percent) public override onlyOwner nonReentrant { prm.announceTokenPercentTransfer(_sourceToken, _targetToken, _percent); emit AnnounceTokenPercentTransfer(_sourceToken, _targetToken, _percent); }
2,651,003