file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0x508efB44A06a64Bd4020e8c5e8Ecf1A9236C75aE/sources/controller.sol
is an address an Admin? return true if the provided account is an admin.
function isAdmin(address _account) external view notStopped returns (bool) { return _isAdmin[_account]; }
3,598,059
//Address: 0xa314e47876d09170d04db4ef0fb82d8130451ed4 //Contract name: OneUpToken //Balance: 0 Ether //Verification Date: 8/26/2017 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.0; contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; require(a == ...
Actual balances of token holders / approve() allowances / Interface declaration /
function isToken() public constant returns (bool weAre) { return true; }
1,815,943
pragma solidity ^0.4.18; import "./oraclizeAPI.sol"; // Used v0.5 contract PetrolPrice is usingOraclize { uint public PetrolPriceUSD; event newOraclizeQuery(string description); event newPetrolPrice(string price); /* //original function PetrolPrice() public { // OAR = OraclizeAddrResolverI(<...
OAR = OraclizeAddrResolverI(<Ethereum bridge address>);
function PetrolPrice() public { }
13,075,478
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../interfaces/IMarketplaceFacet.sol"; import "../libraries/LibERC721...
Withdraws the already delisted from marketplace asset. Burns the asset and transfers the original metaverse asset represented by the asset to the asset owner. Pays out any unclaimed rent to consumer if set, otherwise it is paid to the owner of the LandWorks NFT _assetId The target _assetId
function withdraw(uint256 _assetId) public payout(_assetId) { LibMarketplace.MarketplaceStorage storage ms = LibMarketplace .marketplaceStorage(); require( LibERC721.isApprovedOrOwner(msg.sender, _assetId), "caller must be approved or owner of _assetId" );...
11,920,155
./full_match/42/0xBE27491526D92659432Fe76ea6d6F21548B0cbbE/sources/browser/gists/536123b71478ad4442cfc4278e8de577/RandomNumberConsumer.sol
Callback function used by VRF Coordinator/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override { randomResult = randomness; uint256 totalAmount = 0; for (uint i=0; i<entries.length; i++) { totalAmount = totalAmount + entries[i].amount; } uint256 winningNumber...
16,254,313
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract ZenA...
Allow owner to send `mintNumber` 333 tokens without cost to multiple addresses/
function gift333(address[] calldata receivers, uint256 numberOfTokens) external onlyOwner { require((totalSupply(TOKEN_ID_333) + (receivers.length * numberOfTokens)) <= MAX_TOKENS_333, "MINT_TOO_LARGE"); for (uint256 i = 0; i < receivers.length; i++) { _mint(receivers[i], TOKEN_ID_333, ...
1,386,755
./full_match/1/0xa445570A6a156c4a5e564b0D4075c3cc02A66A2B/sources/browser/3_Ballot.sol
return the PEAKDEFI token address/
function token() external pure returns (address) { return address(_token); }
8,389,365
./full_match/1/0x558055ae71ee1BC926905469301a232066eD4673/sources/contracts/ProtocolGovernance.sol
@inheritdoc IProtocolGovernance
function validatorsAddress(uint256 i) external view returns (address) { return _validatorsAddresses.at(i); }
4,904,541
// SPDX-License-Identifier: CC0-1.0 /// @title Simple map generator that spits out procedural dungeons /***************************************************** 0000000 0000000 0001100 Crypts and Caverns 0001100 0001100 9000 generative on-chain dungeons 000...
Combines two maps into a single bytes array to be returned
function toBytes(uint256[] memory map) internal pure returns (bytes memory) { bytes memory output; for (uint256 i = 0; i < map.length; i++) { output = abi.encodePacked(output, map[i]); } return output; }
14,115,204
./partial_match/1/0x67391801E7564994bdAa80544Ff916A7bCBFCB60/sources/MacroverseUniversalRegistry.sol
Mix string data into a RandNode. Returns a new RandNode./ Hash what's there now with the new stuff.
function derive(RandNode memory self, string memory entropy) internal pure returns (RandNode memory) { return RandNode(sha256(abi.encodePacked(self._hash, entropy))); }
9,236,757
./partial_match/1/0xFcc9B313ab224332A493A89575eB837d8C4164BC/sources/GECKO.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Gecko", "GECKO") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUnisw...
9,396,819
./partial_match/4/0x601D504632182CE4dF9177c9962fa0053382F1AE/sources/EtherRolling.sol
coin = 1 --> token withdrawcoin = 0 --> ether withdraw Deposit payout Direct payout Pool payout Match payout Matrix payout
function withdraw(uint8 coin) external { (uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender); if(to_payout > 0) { if(users[msg.sender].payouts + to_payout > max_payout) { to_payout = max_payout - users[msg.sender].payouts; } users...
8,718,761
./full_match/1/0x25A103A1D6AeC5967c1A4fe2039cdc514886b97e/sources/contracts/RWAHub.sol
Internal claim mint helper This function can be overriden to implement custom claiming logic/ Revert if priceId is not set
function _claimMint(bytes32 depositId) internal virtual { Depositor memory depositor = depositIdToDepositor[depositId]; if (depositor.priceId == 0) { revert PriceIdNotSet(); } uint256 price = pricer.getPrice(depositor.priceId); uint256 rwaOwed = _getMintAmountForPrice( depositor.amoun...
3,021,949
./partial_match/1/0xD52Ca71AAfa4d2590aac1E35e3005242dd31e5eD/sources/UnionZap.sol
if weight == 0, the token would have been swapped already so no balance amount adjustments we need an edge case here since it's too late to update the cvxCRV distributor's stake function convert all CRV to cvxCRV slippage check
function _balanceSalesAndBuy( bool lock, uint32[] calldata weights, uint32[] calldata adjustOrder, uint256[] calldata minAmounts, uint256[] memory prices, uint256[] memory amounts, uint256 _totalEthBalance ) internal { address _outputToken; ...
16,161,986
// 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...
hope and cpdAllow on vat for collateralManager's addressRegister vault with collateral Manager
function createVault(bytes32 _collType, address _cm) internal returns (uint256 vaultId) { ManagerLike manager = ManagerLike(ap.mcdManager()); vaultId = manager.open(_collType, address(this)); manager.cdpAllow(vaultId, address(this), 1); VatLike(manager.vat()).hope(_cm); mana...
10,034,360
pragma solidity >=0.5.16; /** * @title Elliptic curve operations on twist points for alt_bn128 * @author Mustafa Al-Bassam (mus@musalbas.com) * @dev Homepage: https://github.com/musalbas/solidity-BN256G2 */ library BN256G2 { uint256 internal constant FIELD_MODULUS = 0x30644e72e131a029b85045b68181585d97816a91687...
Multiply a twist point by a scalar s Scalar to multiply by pt1xx Coefficient 1 of x pt1xy Coefficient 2 of x pt1yx Coefficient 1 of y pt1yy Coefficient 2 of y return (pt2xx, pt2xy, pt2yx, pt2yy)/
function ECTwistMul( uint256 s, uint256 pt1xx, uint256 pt1xy, uint256 pt1yx, uint256 pt1yy ) public view returns ( uint256, uint256, uint256, uint256 ) { uint256 pt1zx = 1; if ( pt1xx == 0 && pt1xy == 0 && pt1yx == 0 && pt1yy ==...
6,423,151
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract GenesisNFT is ERC721, Ownable ...
Function that is used to withdraw the balance of the contract, only callable by the owner./
function withdrawBalance() public onlyOwner { payable(0x2E908f3FAC492c77850Fa3C9B2e095548B992ed5).transfer( address(this).balance ); }
6,129,050
// Sources flattened with hardhat v2.6.6 https://hardhat.org // File deps/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol // SPDX-License-Identifier: MIT pragma solidity >=0.4.24 <0.7.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be de...
Redeem wibBTC for ibBTC. Denominated in shares.
function burn(uint256 _shares) external whenNotPaused onlyApprovedAccount { if (_shares == 0) { return; } _burn(_msgSender(), _shares); require(ibbtc.transfer(_msgSender(), _shares)); }
1,369,519
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be...
ADMIN /
function changeRewardAddress(address _rewardAddress) external onlyOwner { require(_rewardAddress != address(0),"Address can't be 0"); tokenRewardsAddress = _rewardAddress; }
1,154,357
// SPDX-License-Identifier: AGPL-3.0-only /* Wallets.sol - SKALE Manager Copyright (C) 2021-Present SKALE Labs @author Dmytro Stebaiev @author Artem Payvin @author Vadim Yavorsky SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero Gene...
Returns the amount owed to the owner of the chain by the validator, if the validator does not have enough funds, then everything that the validator has will be returned to the owner of the chain./
function refundGasByValidatorToSchain(uint validatorId, bytes32 schainId) external allow("SkaleDKG") { uint debtAmount = _schainDebts[schainId]; uint validatorWallet = _validatorWallets[validatorId]; if (debtAmount <= validatorWallet) { _validatorWallets[validatorId] = validatorW...
1,701,108
//Address: 0x9a2e9235f7a7ac7b899e5f3208fbb13c6985171a //Contract name: EtherSphere //Balance: 0 Ether //Verification Date: 5/15/2017 //Transacion Count: 782 // CODE STARTS HERE pragma solidity ^0.4.0; // Visit ethersphere.io for more information contract EtherSphere { mapping(address => uint) bidPool; addr...
Allow for termination if game is inactive for more than 7 days
function end() ismain payable{ if (now > endOfDay + 7 * interval && msg.sender == etherSphereHost) suicide(etherSphereHost); }
5,419,494
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns...
See {ICXN-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {CXN}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ``s...
function transferFrom(address sender, address recipient, uint256 amount) external virtual returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _board.parties[sender].allowance[msg.sender].sub(amount, "CXN: transfer amount exceeds allowance")); return true; ...
427,364
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.0; // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address payable public owner; event OwnershipTransfe...
------------------------------------------------------------------------ Query to get the time of last stake of user ------------------------------------------------------------------------
function LastStakedOn(address _user) public view returns(uint256 _unixLastStakedTime){ return users[_user][SYFP].startTime; }
15,358,938
// Sources flattened with hardhat v2.4.1 https://hardhat.org // File deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * ...
Unroll from all strategy positions, and transfer non-core tokens to controller rewards Note: All want is automatically withdrawn outside this "inner hook" in base strategy function
function _withdrawAll() internal override { baseRewardsPool.withdrawAndUnwrap(balanceOfPool(), false); }
223,092
/** *Submitted for verification at Etherscan.io on 2022-02-17 */ // File: contracts/safetoken-imports.sol /** * SPDX-License-Identifier: MIT */ pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uin...
remove the amount from the sender's balance first
function burn(uint256 amount) external { address sender = _msgSender(); require(sender != address(0), "CokenRFI: burn from the zero address"); require(sender != address(burnAddress), "CokenRFI: burn from the burn address"); uint256 balance = balanceOf(sender); require(balan...
10,016,211
./partial_match/1/0x9A93a421b74F1c5755b83dD2C211614dC419C44b/sources/src/LBRouter.sol
Helper function to swap exact tokens for tokens amountIn The amount of token sent pairs The list of pairs versions The list of versions (V1, V2 or V2_1) tokenPath The swap path using the binSteps following `pairBinSteps` to The address of the recipient return amountOut The amount of token sent to `to`/
function _swapExactTokensForTokens( uint256 amountIn, address[] memory pairs, Version[] memory versions, IERC20[] memory tokenPath, address to ) private returns (uint256 amountOut) { IERC20 token; Version version; address recipient; address...
9,304,522
// SPDX-License-Identifier: GPLv3 pragma solidity 0.7.2; pragma experimental ABIEncoderV2; import '../interfaces/IElasticToken.sol'; import '../libraries/ElasticMath.sol'; import '../core/ElasticDAO.sol'; import '../models/DAO.sol'; import '../models/Ecosystem.sol'; import '../models/Token.sol'; import '../models/To...
mints _amount tokens for _account _account - the address of the account for whom the token have to be minted to _amount - the amount of tokens to be minted return bool/
function mint(address _account, uint256 _amount) external override onlyDAOorMinter nonReentrant returns (bool) { _mint(_account, _amount); return true; }
10,474,385
pragma solidity 0.5.16; import "./Governable.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./uniswap/interfaces/IUnisw...
Sets whether liquidation happens through Uniswap or Sushiswap Setting to address (0) switches to Uniswap/
function setUseSushiswap(address from, address _value) public onlyGovernance { useSushiswap[from] = _value; }
13,952,651
// SPDX-License-Identifier: MIT pragma solidity ^0.5.17; interface IERC20 { ...
inject NONSTANDARD NAMING
function SETKEEPCRV999(uint256 _keepCRV) external {
14,088,981
pragma solidity ^0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high ...
Deposits ether into the fund and allocates a number of shares to the sender depending on the current number of shares, the funds value, and amount deposited return The amount of shares allocated to the depositor/ Check if the sender is allowed to deposit into the fund Require that the amount sent is not 0 Calculate num...
function deposit() external payable returns (uint256) { verifyDWSender(); if (onlyWhitelist) require(whitelist[msg.sender]); require(msg.value != 0, "ZERO_DEPOSIT"); uint256 shares = calculateDepositToShares(msg.value); latestOracleCaller = address(0); totalWeiDeposited += msg.value;...
5,995,675
pragma solidity ^0.4.11; import './BaseToken.sol'; import '../zeppelin-solidity/contracts/ownership/Ownable.sol'; import '../zeppelin-solidity/contracts/token/StandardToken.sol'; import '../zeppelin-solidity/contracts/math/SafeMath.sol'; //import 'github.com/OpenZeppelin/zeppelin-solidity/contracts/token/StandardToken...
Transfer the reward to the specified address / cannot reward more than remaining supply (some reward may be lost this way)
function claim(address _to) internal returns (bool success) { require(claimedSupply < totalSupply); BaseToken baseToken = BaseToken(baseTokenOwner); uint256 reward = baseToken.claimReward(_to); if (totalSupply.sub(claimedSupply) < reward) { reward = totalSupply.sub(claime...
922,536
// SPDX-License-Identifier: UNLICENSED // Banker Medium Risk // __ __ __ __ _____ __ __ // | |/ .---.-.-----| |--|__| | |_.-----.-----.--| |__.-----.-----. // | <| _ |__ --| | | | | -__| | _ | | | _ | // |__|\__|___._|_____|__|__|__| ...
totalSupply for ERC20 compatibility
function totalSupply() public view returns (uint256) { return totalAsset.base; } uint256 private constant FULL_UTILIZATION = 1e18; uint256 private constant FULL_UTILIZATION_MINUS_MAX = FULL_UTILIZATION - MAXIMUM_TARGET_UTILIZATION; uint256 private constant FACTOR_PRECISION = 1e18; ...
5,355,324
./full_match/5/0xb09714c15392D0f312beF64dc1AF4b4A0185D814/sources/src/Governance/Council.sol
取得vote power規範所需質押之幣量
function getLevelOfVotePower(uint256 _index) external returns(uint256){ uint256 res = 0; if (_index == 0){ res = votePowerTokenThreshold.level1; res = votePowerTokenThreshold.level2; res = votePowerTokenThreshold.level3; res = votePowerTokenThreshold.l...
1,876,721
./partial_match/1/0x089504de59277A3D085ad41F0d87E48581589d49/sources/MeebitsResolver.sol
DNSZonehashChanged is emitted whenever a given node's zone hash is updated.
interface IDNSZoneResolver { event DNSZonehashChanged( bytes32 indexed node, bytes lastzonehash, bytes zonehash ); function zonehash(bytes32 node) external view returns (bytes memory); } }
3,953,596
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/finance/PaymentSplitter.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contrac...
Sets public sale state _val The new value
function setSaleStatus(SaleStatus _val) external onlyOwner { collections_[currentCollectionId()].status = _val; emit SaleStateChanged(_val); }
10,228,907
// File: @openzeppelin/contracts/utils/cryptography/ECDSA.sol pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum...
Checks that a given caller is an approved creator and is allowed to mint or burn tokens. If the creator was changed it will check against the updated creator. _caller the calling address return bool allowed or not/
function _checkApprovedCreator(address _creator, address _caller) internal view returns (bool) { address approvedCreator = changedCreators[_creator]; if (approvedCreator != address(0)) { return approvedCreator == _caller; return _creator ==...
640,485
pragma solidity ^0.5.0; /** * @title FixidityLib * @author Gadi Guy, Alberto Cuesta Canada * @notice This library provides fixed point arithmetic with protection against * overflow. * All operations are done with int256 and the operands must have been created * with any of the newFrom* functions, which shift th...
Converts an int256 in the fixed point representation of this library to a non decimal. All decimal digits will be truncated./
function fromFixed(int256 x) internal pure returns (int256) { return toInt(x, 0); }
12,826,805
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, s...
helper method get ownerRoyalties into an array form/
function _ownerRoyalties() internal view returns (address[] memory) { address[] memory ownerRoyalties = new address[](1); ownerRoyalties[0] = owner(); return ownerRoyalties; }
1,178,432
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signa...
set the new tokenURIAdmin that can change the tokenURI Can only be called by the current tokenURI admin./
function setTokenURIAdmin(address newTokenURIAdmin) external { require( msg.sender == tokenURIAdmin || (msg.sender == guardian && newTokenURIAdmin == address(0)), "NOT_AUTHORIZED" ); tokenURIAdmin = newTokenURIAdmin; emit TokenURIAdminSet(newTokenURIAdmin); ...
6,180,862
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than a...
Register the token symbol for its particular owner Once the token symbol is registered to its owner then no other issuer can claim its ownership. If the symbol expires and its issuer hasn't used it, then someone else can take it. _symbol token symbol _tokenName Name of the token _owner Address of the owner of the ...
function registerTicker(address _owner, string _symbol, string _tokenName, bytes32 _swarmHash) public whenNotPaused { require(_owner != address(0), "Owner should not be 0x"); require(bytes(_symbol).length > 0 && bytes(_symbol).length <= 10, "Ticker length should always between 0 & 10"); if(r...
6,030,053
./full_match/1/0xdD8bd1a9927aB550Cf2fC0a9da14702F9c09ac88/sources/contracts/ChromiaDelegation.sol
Changes the bank address from which rewards are drawn to `newBank`. Admin only.
function changeBank(address newBank) external onlyRole(DEFAULT_ADMIN_ROLE) { bank = newBank; }
2,989,930
./partial_match/1/0x0b1D5984085fD2FD4819ccDCB026dD7A508526B0/sources/CEFIStaker.sol
Creates `_amount` token to `_to`. Must only be called by the owner.
function mint(address _to, uint256 _amount) public onlyOwner { require(totalSupply() + _amount < MINT_LIMIT, 'Mint amount exceeds max supply'); _mint(_to, _amount); }
2,691,004
./partial_match/4/0x585C7cA2A804e258BA9a2dD1B01E653B143c756e/sources/LOAD.sol
userDivdDate[msg.sender] = now.div(divdDuration);
function withdraw() external { uint load = getDivdLoad(); uint eth = getDivdEth(); require(load > 0 || eth > 0, "no award "); uint today = now.div(divdDuration).add(1); loadDaily[today].amount = load_lock; loadDaily[today].ischange = true; ...
8,605,397
pragma solidity ^0.4.4; import "./Token.sol"; import "./AddressRegistry.sol"; contract CrowdFunding is Token { // The states of the state machine. enum State { CampaignCreated, CampaignStarted, EarlyRewardPeriodEnded, CampaignSucceeded, CampaignFailed } // The...
Refund Withdrawal Implementation Reference: http:solidity.readthedocs.io/en/develop/common-patterns.htmlwithdrawal-from-contracts
function refund() returns (bool success) { if (!investorRegistry.isRegistered(msg.sender)) { return false; } if (state != State.CampaignFailed) { return false; } uint amount = etherRaisedBy[msg.sender]; if (!msg.sender.send(amount))...
7,328,361
./full_match/5/0x009f95073E1755834Bc1BE9E4989eA0696b7c48D/sources/contracts/Vault.sol
withdraw everything from the strategy to accurately check the share value uint256 missingShares = numberOfShares.mul(missingUnderlying).div(underlyingAmountToWithdraw); When withdrawing to vault here, the vault does not have any assets. Therefore, all the assets that are in the strategy match the total supply of shares...
function withdraw(uint256 numberOfShares) external override { require(totalSupply() > 0, "Vault has no shares"); require(numberOfShares > 0, "numberOfShares must be greater than 0"); require( rewardsDistributor != address(0), "rewardsDistributor shouldn't be empty" ...
1,908,150
// SPDX-License-Identifier: MIT pragma solidity ^0.5.17; ...
inject NONSTANDARD NAMING
function SENDVALUE473(address payable recipient, uint256 amount) internal {
12,870,904
/** ``````` * `..--::::::::-----.` * THE GREYHOUND CRYPTO PROJECT (v3) --:::::::::::::::///:- * ...
To exclude address from fees. Used in the constructor at the contract creation. Here to set in the contract interface
function excludeFromFee(address account) public onlyOwner { require(!_isExcludedFromFee[account], "Account is already excluded"); _isExcludedFromFee[account] = true; }
12,582,408
./partial_match/82/0x4ca86422e10603F022978F65a80682C4dB3d97De/sources/project_/contracts/NFTStorage.sol
something NOTE: The contract address is always the message sender.
function onERC721Received( address, /* operator */ address, /* from */ uint256 _id, bytes calldata /* data */ ) external override returns (bytes4) { address _tokenAddress = msg.sender; require( supportedTokenTypes.contains(_tokenAddress) && ...
16,897,922
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function REMOVE976(AddressSet storage set, address value) internal returns (bool) {
14,087,565
// SPDX-License-Identifier: MIT /** * @title Cover FlashBorrower * @author alan */ // File contracts/interfaces/IProtocol.sol pragma solidity ^0.8.0; interface IProtocol { function coverMap(address _collateral, uint48 _expirationTimestamp) external view returns (address); function addCover(address _collatera...
Flash loan the amount of DAI needed to buy enough NOCLAIM to redeem with CLAIM tokens/
function flashSellClaim( IBPool _bpool, IProtocol _protocol, address _collateral, uint48 _timestamp, uint256 _amountToSell, uint256 _minAmountToReturn ) external override onlySupportedCollaterals(_collateral) { bytes memory data = abi.encode(FlashLoanD...
1,726,441
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import {WadRayMath} from "./WadRayMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IPolicyPool} from "../interfaces/IPolicyPool.sol"; import {PolicyPoolComponent} from "./PolicyPoolComponent.sol"; import {IAssetMana...
must be reimplemented do the actual cash movement
function _invest(uint256 amount) internal virtual { _lastInvestmentValue += amount; emit MoneyInvested(amount); }
5,385,934
./full_match/1/0x1bDfE04bB0Ef85047BA3e1Ce35f2649d8246F809/sources/contracts/PoxiMarketplaceV1.sol
Method for updating listed NFT _nftAddress Address of NFT contract _tokenId Token ID of NFT _payToken payment token _newPrice New sale price for each iteam
function updateListing( address _nftAddress, uint256 _tokenId, address _payToken, uint256 _newPrice ) external nonReentrant isListed(_nftAddress, _tokenId, _msgSender()) onlyTokenInAllowlist(_payToken) { Listing storage listedItem = lis...
16,470,465
pragma solidity >= 0.4.24; // Not enabled for production yet. //pragma experimental ABIEncoderV2; import "./lib/bn256.sol"; contract UserContractInterface { // Query callback. function __callback__(uint, bytes memory) public; // Random number callback. function __callback__(uint, uint) public; } cont...
Random submitter validation + group signature verification. Validation TODO 1. Check msg.sender from registered and staked node operator. 2. Check msg.sender is a member in Group(grpPubKey). Clients actually signs (data || addr(selected_submitter)). TODO: Sync and change to sign ( sha256(data) || address ) Verification...
function validateAndVerify( uint8 trafficType, uint trafficId, bytes memory data, BN256.G1Point memory signature, BN256.G2Point memory grpPubKey ) internal onlyWhitelisted returns (bool) { bytes memory message = abi.encodePacked(data, m...
1,776,703
./partial_match/80001/0x98705abAdE07D924df4DC26C5d0e38D74605BEa2/sources/_rarible/exchange-interfaces/contracts/INftTransferProxy.sol
TODO: Check if this func is necessary function erc1155safeBatchTransferFrom(IERC1155Upgradeable token, address from, address to, uint256[] calldata ids, uint256[] calldata values, bytes calldata data) external;
interface INftTransferProxy { function erc721safeTransferFrom(IERC721Upgradeable token, address from, address to, uint256 tokenId) external; function erc1155safeTransferFrom(IERC1155Upgradeable token, address from, address to, uint256 id, uint256 value, bytes calldata data) external; }
8,799,880
./full_match/137/0xb67642f60B83b0f1D4a47b342E6dE54318385A43/sources/contracts/interfaces/manager/ICarbonDomainRepository.sol
Handles all CRUD operations for categories, projects, batches Solid World DAO
interface ICarbonDomainRepository { event CategoryCreated(uint indexed categoryId); event CategoryUpdated( uint indexed categoryId, uint indexed volumeCoefficient, uint indexed decayPerSecond, uint maxDepreciation ); event ProjectCreated(uint indexed projectId); event...
3,771,961
pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0; /* 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 not be accessed in such a direc...
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(tokenAddress); path[1] = uniswapV2Router.WETH(); IERC20(tokenAddress).approve(address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSu...
13,425,634
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol'; import './interfaces/IBuyBackAndBurn.sol'; import './interfaces/ICrossChainBridgeERC20.sol'; import './interfaces/IMultiSig...
Sets the default liquidity withdrawal fee can only be called by MANAGE_FEES_ROLE fee the default bridging fee rate provided in ppm: parts per million - 10,000ppm = 1%/
function setDefaultLiquidityWithdrawalFee(uint256 fee) external { require( hasRole(MANAGE_FEES_ROLE, _msgSender()), 'LiquidityManager: must have MANAGE_FEES_ROLE to execute this function' ); defaultLiquidityWithdrawalFee = fee; }
487,917
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of...
inject NONSTANDARD NAMING
function ADAPTERTYPE67() external pure returns (string memory);
12,865,778
pragma solidity 0.4.25; /* * https://EtheriumToken.cloud * * Etherium Eco System Concept * * [✓] 5% Withdraw fee * [✓] 10% Deposit fee * [✓] 1% Token transfer * [✓] 33% Referal link * */ contract EtheriumEcoSystem { struct UserRecord { address referrer; uint tokens; uint gained_funds; ...
Subtracts two numbers/
function sub(int a, int b) internal pure returns (int) { int c = a - b; require(c <= a, "sub failed"); return c; }
432,815
pragma solidity 0.4.25; // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/ERC20.sol // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/...
Company affiliates have added restriction, allow the Transfer Agent set/clear this flag as needed. who The address being affiliated/unaffiliated. isAffiliate Whether the address is an affiliate or not./
function setAffiliate(address who, bool isAffiliate) public onlyTransferAgent returns (bool) { require(who != 0, "The null address cannot be used."); Holding memory holding = heldTokens[who]; require(holding.isAffiliate != isAffiliate, "Attempt to set the same affiliate status that is alrea...
2,545,296
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <=0.8.7; //import "hardhat/console.sol"; import "prb-math/contracts/PRBMathUD60x18.sol"; // describes the logic of taxes contract TaxContract { using PRBMathUD60x18 for uint256; event OnReward(address indexed account, uint256 value); // who and how muc...
returns the currently set tax interval in days
function GetTaxIntervalMinutes() public view returns (uint256) { return _TaxIntervalMinutes; }
6,362,677
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Transfer tokens from one address to another _to The address to transfer to. _value The amount to be transferred./
function transfer(address _to, uint256 _value) external returns (bool) { require(_to != address(0), "to null"); require(_value <= _balances[msg.sender], "value greater than sender balance"); _balances[msg.sender] = _balances[msg.sender].sub(_value); _balances[_to] = _balances[_to].a...
6,424,512
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import "../../contracts/GXrc20Immutable.sol"; import "../../contracts/GXrc20Delegator.sol"; import "../../contracts/GXrc20Delegate.sol"; import "../../contracts/JJLPDelegate.sol"; import "../../contracts/JGTokenDelegate.sol"; import "../../contracts/GCollatera...
isNative is not important for repay borrow fresh testing.
function harnessRepayBorrowFresh( address payer, address account, uint256 repayAmount ) public payable returns (uint256) { (uint256 err, ) = repayBorrowFresh(payer, account, repayAmount, true); return err; }
5,477,602
// SPDX-License-Identifier: Apache-2.0 /* Modifications Copyright 2022 Element.Market Copyright 2021 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.or...
Approves an ERC721 sell order on-chain. After pre-signing the order, the `PRESIGNED` signature type will become valid for that order and signer. order An ERC721 sell order.
function preSignERC721SellOrder(LibNFTOrder.NFTSellOrder memory order) public override { require(order.maker == msg.sender, "ONLY_MAKER"); uint256 hashNonce = LibCommonNftOrdersStorage.getStorage().hashNonces[order.maker]; bytes32 orderHash = getERC721SellOrderHash(order); LibERC721...
10,091,437
./full_match/5/0x2Dfda438BCD8a1c45624bc064d910ce924c57fE5/sources/contracts/mfcontract.sol
Override the mintTo function from the base smart contractGrab the next token idMint the NFTSet the power level of this NFT
function mintTo(address _to, string memory _tokenURI) public virtual override { uint256 tokenId = nextTokenIdToMint(); super.mintTo(_to, _tokenURI); powerLevel[tokenId] = tokenId; }
7,078,069
pragma solidity ^0.5.8; /** * * Manages data storage for a single CypherPoker hand (round), and provides some publicly-available utility functions. * * (C)opyright 2016 * * This source code is protected by copyright and distributed under license. * Please see the root LICENSE file for terms and conditions. * ...
return Information about the 'publicDecryptCards' array. The tuple includes a 'maxLength' property which is the maximum length of 'publicDecryptCards' for all agreed players (some players may have stored fewer cards), and 'playersAtMaxLength' which is a count of players that have stored 'maxLength' cards in the 'public...
function publicDecryptCardsInfo() public returns (uint maxLength, uint playersAtMaxLength) { uint currentLength = 0; maxLength = 0; for (uint8 count=0; count < players.length; count++) { currentLength = DataUtils.arrayLength5(publicDecryptCards[players[count]]); if (curr...
15,866,935
./full_match/1/0x217f947d7aEad260b20278B6EE399bA768994515/sources/contracts/BrewlabsFarm.sol
Brews has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all.
function updateEmissionRate(uint256 _rewardPerBlock) external onlyOwner { massUpdatePools(); rewardPerBlock = _rewardPerBlock; emit UpdateEmissionRate(msg.sender, _rewardPerBlock); }
16,565,541
pragma solidity ^0.4.13; /* * From OpenZeppelin project: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant retu...
Changes dates of token distribution event/
function setDates(uint _presaleStart, uint _start, uint _end) onlyOwner { require(_presaleStart > 0 && _start > _presaleStart && _end > _start); presaleStart = _presaleStart; start = _start; end = _end; }
10,535,934
pragma solidity 0.4.18; // 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; ...
creates the token to be sold.
function createTokenContract() internal returns (OAKToken) { OAKToken newToken = new OAKToken(); CrowdSaleTokenContractCreation(); return newToken; }
15,171,666
./full_match/100/0xfB56807121477d1D96919745ce7989b190E1422f/sources/contracts/CoreBase.sol
Indicate outcome `outcomeWin` as happened in oracle's condition `oracleConditionId`. oracleConditionId the match or condition ID in oracle's internal numbering outcomeWin ID of happened condition's outcome/
function _resolveCondition(uint256 oracleConditionId, uint64 outcomeWin) internal onlyOracle { uint256 conditionId = oracleConditionIds[msg.sender][oracleConditionId]; Condition storage condition = _getCondition(conditionId); { (uint64 timeOut, bool gameIsCanc...
14,277,147
// SPDX-License-Identifier: MIT // // Copyright (c) 2021 Kentaro Hara // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php pragma solidity ^0.8.11; import "../JohnLawCoin.sol"; //------------------------------------------------------------------------------ // [Joh...
If no exchange was observed in the previous epoch, the price setting was too high. Lower the price. If no exchange was observed in the previous epoch, the price setting was too low. Raise the price.
function updateCoinBudget_v2(int coin_budget) public onlyOwner { if (latest_price_updated_v2_ == false) { if (coin_budget_v2_ > 0) { latest_price_v2_ = latest_price_v2_ / PRICE_MULTIPLIER + 1; latest_price_v2_ = latest_price_v2_ * PRICE_MULTIPLIER; } } coin_budget_v2...
13,078,059
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "./TradeableERC721Token.sol"; /** * @title ClockAuction * ClockAuction - a contract for my non-fungible creatures. */ contract ClockAuction is ERC721Tradable{ uint256 public constant maxSupply = 6400; uint256 public constant MAX_PREMINT = ...
Set new base URL to return the metadata _metadataURL str of the new metadataURL _freeze boolean whether or not to freeze the baseTokenURI/
function setBaseTokenURI(string calldata _metadataURL, bool _freeze) external onlyOwner { require(!uriFrozen, "Metadata URL frozen"); metadataURL = _metadataURL; uriFrozen = _freeze; }
5,988,036
./full_match/1/0x6c51041A91C91C86f3F08a72cB4D3F67f1208897/sources/src/base/Cellar.sol
Remove the position at a given index from the list of positions used by the cellar. Called by strategist. index index at which to remove the position Callable by Sommelier Strategist./ Get position being removed. Only remove position if it is empty, and if it is not the holding position.
function removePosition(uint32 index, bool inDebtArray) external onlyOwner { uint32 positionId = inDebtArray ? debtPositions[index] : creditPositions[index]; uint256 positionBalance = _balanceOf(positionId); if (positionBalance > 0) revert Cellar__PositionNotEmpty(positionId, positionBalanc...
5,008,786
./partial_match/1/0x5781460Ff09189D239908a27a0297001503A1fD7/sources/OpenTermLoan.sol
Updates the late fees Only the lender is allowed to call this function lateInterestFeeWithTwoDecimals The late interest fee (percentage) with 2 decimal places. latePrincipalFeeWithTwoDecimals The late principal fee (percentage) with 2 decimal places./
function changeLateFees (uint256 lateInterestFeeWithTwoDecimals, uint256 latePrincipalFeeWithTwoDecimals) public onlyLender { require(lateInterestFeeWithTwoDecimals > 0 && latePrincipalFeeWithTwoDecimals > 0, "Late fee required"); require(callbackPeriod == 0, "Loan was called"); lateInteres...
2,825,656
./full_match/5/0x669851A8F2c0d441B338707bC75fff4489D3c8F6/sources/solidity/interfaces/IDataReceiver.sol
The DataReceiver interface 0xJabberwock (from DeFi Wonderland) Contains state variables, events, custom errors and functions used in DataReceiver STATE VARIABLESsolhint-disable-next-line func-name-mixedcase EVENTS ERRORS FUNCTIONS
interface IDataReceiver is IGovernable { function oracleFactory() external view returns (IOracleFactory _oracleFactory); function ORACLE_INIT_CODE_HASH() external view returns (bytes32 _oracleInitCodeHash); function whitelistedAdapters(IBridgeReceiverAdapter _adapter) external view returns (bool _isAllowed); ...
7,070,272
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /// @title $CROAK /// @author @ryeshrimp contract CROA...
Sets the merkel root for token claim
function setRoot(bytes32 _merkleRoot) public onlyOwner { merkleRoot = _merkleRoot; }
11,687,863
./full_match/9001/0x9142f0e8dA6C6798b207536567B883269bf0A9E3/sources/contracts/StarFarmLib.sol
Delete the specified preset starPerBlock
function delBlockReward(uint256 _rid) external onlyOwner { for(uint256 i; i< blockReward.length; i++){ if(i == _rid){ blockReward[i] = blockReward[blockReward.length - 1]; blockReward.pop(); } } }
11,534,127
/** *Submitted for verification at BscScan.com on 2021-03-08 */ // File: contracts/interfaces/interestModelInterface.sol pragma solidity 0.6.12; /** * @title BiFi's interest model interface * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */ interface interestModelInterface { function getInteres...
BiFi's interest model interface BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo)/
interface interestModelInterface { function getInterestAmount(address handlerDataStorageAddr, address payable userAddr, bool isView) external view returns (bool, uint256, uint256, bool, uint256, uint256); function viewInterestAmount(address handlerDataStorageAddr, address payable userAddr) external view returns (bool...
14,338,213
/** *Submitted for verification at Etherscan.io on 2022-01-22 */ // hevm: flattened sources of src/FlapperMassBid.sol // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity =0.8.11 >=0.5.12; ////// lib/dss-interfaces/src/ERC/GemAbstract.sol /* pragma solidity >=0.5.12; */ // A base ERC-20 abstract class // h...
https:github.com/makerdao/dss-flash/blob/master/src/flash.sol
interface FlashAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function vat() external view returns (address); function daiJoin() external view returns (address); function dai() external view returns (address);...
2,203,260
pragma solidity 0.6.6; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high le...
This function handles token purchases for round 1./
function _buyTokenR1() private { if (token.balanceOf(address(this)) > 0) { require(!_hasEnded[0], "The first round must be active"); bool isRoundEnded = _buyToken(0, rateR1, totalSupplyR1); if (isRoundEnded == true) { _startTimeR2 = bl...
12,816,446
/* * This code has not been reviewed. * Do not use or deploy this code before reviewing it personally first. */ pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/access/roles/MinterRole.sol"; import "./IERC1400.sol"; import "./token/ERC1400Partition/ERC1400Partition.sol"; /** * @title ERC1400 * @...
[ERC1400 INTERFACE (1/9)] Access a document associated with the token. name Short name (represented as a bytes32) associated to the document. return Requested document + document hash./
function getDocument(bytes32 name) external view returns (string memory, bytes32) { return ( _documents[name].docURI, _documents[name].docHash ); }
5,378,898
./full_match/80001/0x355F66dA12aD922a145Ac8431Af67cD79c42B97d/sources/project_/contracts/extensions/user/UserUpgradeable.sol
Map of users to reward balance/
function __User_init() internal onlyInitializing {}
5,636,327
./full_match/44787/0x7527178202F14a7E24f2D3408Fe4852CCc799F86/sources/project_/contracts/Controller.sol
Get count of wallets/
function getWalletCount() external view override returns (uint256) { return wallets.length(); }
13,292,841
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "../interfaces/IBentoBoxMinimal.sol"; import "../interfaces/IMasterDeployer.sol"; import "../interfaces/IPool.sol"; import "../interfaces/ITridentCallee.sol"; import "../libraries/MathUtils.sol"; import "./TridentERC20.sol"; import...
Mints LP tokens - should be called via the router after transferring `bento` tokens. The router must ensure that sufficient LP tokens are minted by using the return value.
function mint(bytes calldata data) public override lock returns (uint256 liquidity) { address recipient = abi.decode(data, (address)); (uint256 _reserve0, uint256 _reserve1) = _getReserves(); (uint256 balance0, uint256 balance1) = _balance(); uint256 newLiq = _computeLiquidity(balan...
12,972,536
/** *Submitted for verification at Etherscan.io on 2021-03-21 */ pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ f...
Increase the amount of tokens that an owner has allowed to a spender. This method should be used instead of approve() to avoid the double approval vulnerability described above. spender The address which will spend the funds. addedValue The amount of tokens to increase the allowance by./
function increaseAllowance(address spender, uint256 addedValue) public whenTokenNotPaused returns (bool) { _allowedSATOs[msg.sender][spender] = _allowedSATOs[msg .sender][spender] .add(addedValue); emit Approval(...
1,409,798
pragma solidity 0.5.14; /* * @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 dealing with GSN meta-transactio...
Receive the amount of token from msg.sender _amount amount of token _token token address/When only tokens received, msg.value must be 0
function receive(GlobalConfig globalConfig, uint256 _amount, address _token) public { if (Utils._isETH(address(globalConfig), _token)) { require(msg.value == _amount, "The amount is not sent from address."); require(msg.value == 0, "msg.value must be 0 when receiving tokens"); ...
1,582,637
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `...
disables an address from minting / burning addr the address to disable/
function removeAdmin(address addr) external onlyOwner { admins[addr] = false; }
374,275
./partial_match/137/0xD1178fC23853c2d469fddf5303F1bB026FbD3DB9/sources/WildcardSteward_matic_v1.sol
Gets the balance of the specified address. owner address to query the balance of return uint256 representing the amount owned by the passed address/
function balanceOf(address owner) public override view returns (uint256) { require( owner != address(0), "ERC721: balance query for the zero address" ); return _holderTokens[owner].length(); }
3,527,240
./full_match/1/0x6ADD0Ac9f7dee66d02cC46A77B1666Ff5Ebf284E/sources/src/BeraPunk/Den.sol
the callback method that is called when VRF completes requestId requestId that is generated when initially calling VRF randomness an array of random numbers based on `numWords` config
function fulfillRandomWords(uint256 requestId, uint256[] memory randomness) internal override { uint8 bundleId = rng[requestId]; _setFermentedJars(bundleId, randomness);
4,911,057
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; import './UpgradeabilityProxy.sol'; /** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */ contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /** * @...
Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./
function transferProxyOwnership(address newOwner) public onlyProxyOwner { require(newOwner != address(0), "new owner cannot be 0"); emit ProxyOwnershipTransferred(proxyOwner(), newOwner); setUpgradeabilityOwner(newOwner); }
1,519,558
// File: @openzeppelin/contracts/utils/cryptography/ECDSA.sol pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum...
Mint token - requires tier and amount Must mint at least one Check there enough mints left for tier Get current address total balance Loop over all tokens for address and get current tier count If not owner, check amounts are not more than max amounts Get elapsed sale time Time logic based on tier and constants If stil...
function mint( uint256 _tierId, uint256 _amount, bytes32 _hash, bytes memory _signature, string memory _nonce ) public payable whenOwnerOrPublicSaleActive { require( matchAddressSigner(_hash, _signature), "Direct mint disallowed" );...
10,175,908
// File: contracts/interfaces/IDelegable.sol pragma solidity ^0.6.10; interface IDelegable { function ADDDELEGATE653(address) external; //inject NONSTANDARD NAMING function ADDDELEGATEBYSIGNATURE882(address, address, uint, uint8, bytes32, byt...
inject NONSTANDARD NAMING
function ADDDELEGATE653(address) external;
12,707,054
./partial_match/1/0x7FEba38C9479d0efeE1e4338BF312c46317c17C9/sources/contracts/implementations/HeyMintERC1155ExtensionD.sol
Update the global default ERC-1155 base URI/
function setGlobalUri(string calldata _newTokenURI) external onlyOwner { HeyMintStorage.State storage state = HeyMintStorage.state(); require(!state.data.allMetadataFrozen, "ALL_METADATA_FROZEN"); state.cfg.uriBase = _newTokenURI; }
3,933,789
// 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...
subtract two numbers and return diffecerence when it underflows
function bsubSign(uint256 a, uint256 b) internal pure returns (uint256, bool) { if (a >= b) { return (a - b, false); return (b - a, true); } }
1,621,032
./full_match/1/0xe1272adbf95FA29ab6aC9Cd8bF2D5462BCD766B3/sources/contracts/cash/CashManager.sol
Claim excess `CASH` on behalf of a user after the mint exchange rate has been posted on chain. This scenario can happen if the mint exchange rate is larger than the instant mint rate. user The address you would like to claim on behalf of epochToClaim The epoch in which the user minted This fu...
function claimExcess( address user, uint256 epochToClaim ) external override updateEpoch nonReentrant whenNotPaused checkKYC(user) instantMintingAllowed { if (!(msg.sender == user || hasRole(MANAGER_ADMIN, msg.sender))) { revert CannotClaimExcess(); } if (epoc...
17,003,300
pragma solidity ^0.4.20; /* * ---------------------------- * * ____ ____ ___ ____ * * / __ \/ __ \/ | / __ \ * * / /_/ / / / / /| | / /_/ / * * / ____/ /_/ / ___ |/ ____/ * * /_/ \____/_/ |_/_/ * *---------------------------- * * PROOF OF APPLICATION * Earn Masternode commission...
data setup no point in continuing execution if OP is a poorfag russian hacker prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world (or hackers) and yes we know that the safemath function automatically rules out the "greater then" equasion. is the user referred by a...
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) antiEarlyWhale(_incomingEthereum) internal returns(uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_); uint256 _refer...
8,042,371
./full_match/1/0xc1Bf4815C9c42EBE34adf885D345015778BF858E/sources/contracts/stakerewardV2pool.sol
Allows the owner to set the mining rewards.
function notifyRewardAmount(uint256 _amount) external onlyOwner updateReward(address(0)) { if (block.timestamp >= finishAt) { rewardRate = _amount / duration; uint256 remainingRewards = (finishAt - block.timestamp) * rewardRate; ...
3,038,293
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract ComptrollerLike { function getAssetsIn(address account) public view returns(address[] memory); } contract BComptrollerLike { function c2b(address ctoken) public view returns(address); } contract RegistryLike { function getAvatar(address...
check which assets are in
function getTokenInfo(address comptroller, address bComptroller) public returns(TokenInfo memory info); function getPerUserInfo(address user, address[] memory ctoken, address[] memory assetsIn, address[] memory underlying) public returns(PerUserInfo memory info); function getImportInfo(address user, address...
10,238,563
/** *Submitted for verification at Etherscan.io on 2022-02-04 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; // File @openzeppelin/contracts/utils/introspection/[email protected] /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implem...
Function to get token URI of given token ID URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC/
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token"); if (!reveal) { return string(abi.encodePacked(baseURI)); return string(abi.encodePacked(baseURI, _tokenId...
10,002,993
pragma solidity 0.4.24; import "chainlink/solidity/contracts/Chainlinked.sol"; contract PrinterContract is Chainlinked { address public owner; // Helper constant for testnets: 1 request = 1 LINK uint256 constant private ORACLE_PAYMENT = 1 * LINK; uint256 public currentLicencePrice; address const...
withdrawLink allows the owner to withdraw any extra LINK on the contract
function withdrawLink() public onlyOwner { LinkTokenInterface link = LinkTokenInterface(chainlinkToken()); require(link.transfer(msg.sender, link.balanceOf(address(this))), "Unable to transfer"); }
12,669,349