file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x9E4Dbd2266f9a7200b1a9a4b0A6758FA90565f53/sources/contracts/artbasel.sol
get total amount of tickets sold
function getTotalReSales() view external onlyOwner returns (uint256) { return _reSalesCounter.current(); }
3,007,546
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Strings.sol"; import "./ERC721AKarine.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/interf...
See {IERC721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (!_checkOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } }
1,296,023
pragma solidity ^0.5.2; import "../../installed_contracts/openzeppelin-solidity/contracts/crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol"; import "../token/InnouToken.sol"; /* * @title InnCrowdsale * @dev Before the goal (soft-cap) is reached the contract acts as openzeppelin RefundablePostDeliveryCrowd...
Overrides parents by checking whether the REFUNDABLE part of the crowdsale is open. (it considers if the goal has not yet been reached) return true if the refundable part of the crowdsale is open, false otherwise./
function isOpen() public view returns (bool) { if (goalReached()) { return false; } return super.isOpen(); }
5,347,108
./full_match/1/0xD02A7208809821bC465BfBA4865D544cC48a93E8/sources/contracts/NFTStandard.sol
validate basic properties of a minting condition _mintingCondition The minting condition to be validated/
function commonValidation( EnumerableSale.MintingConditionStruct calldata _mintingCondition ) private view { require( _mintingCondition._tokenRange._startId <= _mintingCondition._tokenRange._endId, "NS11" ); require(_mintingCondition._maxim...
3,037,590
./full_match/8453/0x7F6E9d6a4093Af9d09bAE92d24bfE42Fc5369aE6/sources/contracts/StablePoolAmplification.sol
Overrides only owner action to allow setting the cache duration for the token rates/
function _isOwnerOnlyAction(bytes32 actionId) internal view virtual override returns (bool) { return (actionId == getActionId(this.startAmplificationParameterUpdate.selector)) || (actionId == getActionId(this.stopAmplificationParameterUpdate.selector)) || super._isOwnerOn...
11,536,434
./full_match/3/0xc3B3C34C45954c88d53C9Cc0756a088c22BDbB98/sources/browser/GoldenSpace.sol
address(this).transfer(0.02 ether);
function transferToPool1Upline(address payable _ad) public{ require(msg.sender == owner, "You are not authorized"); require(_ad != address(0x0), "Invalid Address"); _ad.transfer(0.06 ether); pool1[msg.sender]; }
8,153,261
./partial_match/56/0xdefac16715671b7b6aeeFE012125f1E19Ee4b7d7/sources/_Staking.sol
Unstake tokens, which will lock them for unstakingDelay time. Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)/ As long as we're still looking at the last item, and it's now 0, pop it
function unstake(uint256 value) public whenNotPaused whenUnlocked returns (bool) { expect(!isFrozen(msg.sender), ERROR_FROZEN); uint256 remaining = value; StakeData[] storage list = stakes[msg.sender]; expect(list.length > 0, ERROR_DISALLOWED_STATE); for (uint256 i = list....
11,212,181
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.10; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {ERC721URIStorage} from '@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol'; import {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol'; contract Coll...
/ since int division can't produce a remainder otherwise j goes negative on final for cycle (exception).
function create(address _account, uint256 _royalId) external onlyLoyal { if (tokenSupply < MAX_MINT) { uint256 base = 10000; uint256 buffedLoyal = _royalId * base; bool didMint; Properties memory currentProp; uint256 i; for (uint256 j ...
1,777,328
pragma solidity 0.4.20; /* * Team AppX presents - Moon, Inc. | Competitive Ethereum Idle Pyramid * Website: https://mooninc.io/ * Backup: https://mooninc.surge.sh/ * Discord: https://discord.gg/9Ab8Az3 * * There are 2 contracts: * 1. MoonInc: handle Cookie production, cookie price calulation and cookie selling * ...
Set the MoonInc contract address to notify when token amount changes Set ambassadors&39; maximum one time pre-mine amount (Total 1.47 ETH pre-mine including last 2 ambassadors from contest). MA BL PH RS LN LE MI PO
function ProductionUnitToken( address _moonIncContractAddress, uint8 _entryFee, uint8 _transferFee, uint8 _exitFee, uint _tokenPriceInitial, uint _tokenPriceIncremental, uint _cookieProductionMultiplier, uint _startTime ) public { moonIncContract = MoonInc(_moonIncContractAddress); ...
2,318,969
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; using SafeMath for uint; /********************************************************************************************/ /* ...
Check if this airline is registered./requireAuthorizeContract
function isRegisteredAirline ( address airlineAddress ) view public returns(bool) { return RegisteredAirlines[airlineAddress].isRegistered; }
7,235,911
/** Website: https://bigmac.finance β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ .finance forked from KIMCHI and SUSHI */ pragma so...
Update dev address by the previous dev.
function dev(address _devaddr) public { require(msg.sender == devaddr, "Nope"); devaddr = _devaddr; }
10,678,580
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * ret...
config[_feeCreate_] = 0.200 ether;
function __MappingTokenFactory_init_unchained(address _implTokenMapped, address _implMappableToken, address _implMappingToken, address _feeTo) public governance { config[_fee_] = 0.005 ether; config[_feeTo_] = uint(_feeTo); config[_minSignatu...
15,994
pragma solidity ^0.5.0; import "./provableAPI.sol"; // import "github.com/provable-things/ethereum-api/provableAPI.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; // import "./Ownable.sol"; contract Bark is usingProvable, Ownable { // event listeners for Provable query and final funds transfer ...
final transfer function
function influencerPayout() private { influencerAddress.transfer(address(this).balance); emit Transfer(influencerAddress); }
2,545,589
//solium-disable linebreak-style pragma solidity ^0.4.24; library ExtendedMath { function limitLessThan(uint a, uint b) internal pure returns(uint c) { if (a > b) return b; return a; } } library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function m...
Allow the dev to set it&39;s own token as accepted payment. Can be hardcoded in the constructor. Given the contract size, we decided to separate it. return bool/
function addOwnToken() onlyOwner public returns (bool) { require(setOwnContract); addToWhitelist(this, 5000 * 1e8, 36500); setOwnContract = false; return true; }
6,632,799
./full_match/80001/0x3fA17B5F288F102fF3243baF08639C739c3D5a03/sources/contracts/TaqAccessControl.sol
Update accessControlToken address from `accessControlToken` to `_token`. Should use only the {TaqEmployee} address for now. _token The new accessControlToken address.
function setTaqAccessControl(IERC721 _token) public onlyOwner { emit AccessControlTokenUpdated(accessControlToken, _token); accessControlToken = _token; }
9,501,877
./full_match/4/0x2dE7D69Fa24F3df442C38dCF294DaAf2122BEA89/sources/contracts/libraries/SummitswapLibrary.sol
given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'SummitswapLibrary: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'SummitswapLibrary: INSUFFICIENT_LIQUIDITY'); uint numerator = reser...
803,355
//Address: 0xcdf89e7f44fcc837630fb4a10387ca81eba6932a //Contract name: MultiSigTokenWallet //Balance: 0 Ether //Verification Date: 8/27/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity 0.4.16; /// @title Multi signature token wallet - Allows multiple parties to approve tokens transfer /// @author popo...
Allows to change the number of required confirmations. _quorum Number of required confirmations.
function changeQuorum(uint _quorum) private { require (_quorum > 0 && _quorum <= owners.length); quorum = _quorum; QuorumChange(_quorum); }
1,831,517
./full_match/1/0x133Be41bbA0eA8948d15fd3383A638Fec6E9821a/sources/contracts/Unlockables.sol
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); }
8,284,889
pragma solidity ^0.4.18; /** * * @author <newtwist@protonmail.com> * * Version F * * Overview: * This contract implements a blind auction for burnable tokens. Each secret bid consists * of a hashed bid-tuple, (`price`, `quantity`, `salt`), where price is the maximum amount * of ether (in szabo) a ...
expireBid if a bid is not executed during the sale period, then the owner can mark the bid as expired. in this case: the bidder gets a refund of half of his deposit the bidder forfeits the other half of his deposit the bidder does not receive an tokensrefund whatever remainsuse pull here, to prevent any bidder from ...
function expireBid(address _addr) public ownerOnly afterSale { if (secretBids[_addr].deposit > 0) { uint _forfeit = secretBids[_addr].deposit / 2; proceeds = safeAdd(proceeds, _forfeit); uint _refund = safeSub(secretBids[_addr].deposit, _forfeit); secretBids[msg.sender].refund += _refund; ...
12,732,519
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; // A Stateless Distributed Hypergraph for Web3 contract Graph3 { // 0: () event Node( string indexed _id, string indexed _class, string indexed _subclass ); // 1: {} event Prop(string indexed _id, string indexed _pr...
Link nodes & links or change class (unlink with empty class)
function link(string memory _from, string memory _to, string memory _class) public { emit Link(_from, _to, _class); }
1,794,770
pragma solidity ^0.4.13; import './AbstractENS.sol'; /// @title EnsRelay contract that maps ens domain names to ipfs hashes /// @author Collin Chin contract EnsRelay { AbstractENS ens; mapping (string => Website) websites; struct Website { address owner; string ipfsHash; } ...
Constructor ensAddr address of deployed ens contracts
function EnsRelay(AbstractENS ensAddr) public { ens = ensAddr; }
7,268,125
./full_match/1/0x1091588Cc431275F99DC5Df311fd8E1Ab81c89F3/sources/contracts/vault/VaultCore.sol
Deposit a supported asset and mint OUSD. _asset Address of the asset being deposited _amount Amount of the asset being deposited _minimumOusdAmount Minimum OUSD to mint/ Rebase must happen before any transfers occur.
function mint( address _asset, uint256 _amount, uint256 _minimumOusdAmount ) external whenNotCapitalPaused nonReentrant { require(assets[_asset].isSupported, "Asset is not supported"); require(_amount > 0, "Amount must be greater than 0"); uint256 units = _toUnit...
2,958,538
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_805(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,518
./full_match/1/0xaa282C8aB681fbD501A2B8fA0Ea558cbF5785F73/sources/contracts/AvocadoMultisig/AvocadoMultisigCore.sol
sets the initial state of the Multisig for `owner_` as owner and first and only required signer owner must be EOA
function _initialize() internal { address owner_ = IAvocado(address(this))._owner(); if (Address.isContract(owner_) || owner_ == address(0)) { revert AvocadoMultisig__InvalidParams(); } emit RequiredSignersSet(1); signers_[0] = owner_; abi.encodeCa...
3,128,978
./full_match/1/0x36967c741e2E9c3B012e7a85595D1e3Cc514B6e1/sources/TheScornablesContract.sol
Allow the contract owner to set the public time to mint. _newDropTime timestamp since Epoch in seconds you want public drop to happen/
function setPublicDropTime(uint256 _newDropTime) public onlyTeamOrOwner { require(_newDropTime > block.timestamp, "Drop date must be in future! Otherwise call disablePublicDropTime!"); publicDropTime = _newDropTime; }
3,162,987
/** *Submitted for verification at Etherscan.io on 2021-10-19 */ pragma solidity 0.4.26; library ERC20Asm { function isContract(address addr) internal view { assembly { if iszero(extcodesize(addr)) { revert(0, 0) } } } function handleReturnData() internal pure returns (bool...
Must be a contract addr first! call return false when something wrong handle returndata
function asmTransfer(address _erc20Addr, address _to, uint256 _value) internal returns (bool result) { isContract(_erc20Addr); require(_erc20Addr.call(bytes4(keccak256("transfer(address,uint256)")), _to, _value)); return handleReturnData(); }
2,456,144
./full_match/43113/0x4c57C0320E95f26Eb3D8f9D5c2546D75f1152b4c/sources/price.sol
getRoundData and latestRoundData should both raise "No data present" if they do not have data to report, instead of returning unset values which could be misinterpreted as actual reported values.
interface AggregatorV3Interface { function decimals() external view returns ( uint8 ); function description() external view returns ( string memory ); function version() external view returns ( uint256 ); function getRoundData( uint80 _ro...
13,154,108
./full_match/137/0xEf0cBF8C5503e7a59733880Ff96C60E316790E7f/sources/contracts/token/ERC721/IERC721.sol
Required interface of an ERC721 compliant contract./
interface IERC721 is IERC165 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); event ApprovalForAll( address inde...
4,790,657
./full_match/5/0x5A245Fe878d95253d5B1004b36DF7fF3c27dFD5c/sources/contracts/ERC721Staking.sol
Check if user has any ERC721 Tokens Staked and if they tried to withdraw, calculate the rewards and store them in the unclaimedRewards decrement the amountStaked of the user and transfer the ERC721 token back to them Make sure the user has at least one token staked before withdrawing Wallet must own the token they are ...
function withdraw(uint256 _tokenId) external nonReentrant { require( stakers[msg.sender].amountStaked > 0, "You have no tokens staked" ); require(stakerAddress[_tokenId] == msg.sender, "You don't own this token!"); uint256 rewards = calculateRewards(msg.send...
1,932,996
./full_match/100/0x7BD4FaE40Dce40CC61E3e5E7E85aa0Fc403297fD/sources/contracts/OrbisReputation.sol
Once the proposal has reach the end of the votes (72h after creation) any member with at least the editor role can trigger this function This will execute (and close) the proposal. If the proposal passed (more votes for than against) the proposal is executed. If it's a draw, the proposal failed. We reward the user clo...
function executeProposal(uint _proposalID) public atLeastEditor { Proposal storage _proposal = proposals[_proposalID]; require( block.timestamp > proposals[_proposalID].voteEndAt, "The proposal is still open and can't be executed yet" ); req...
14,265,246
./full_match/1/0xDB77d0d3d9bf850E38282eD8B5Fb410D02E75d2D/sources/contracts/token/CashKYCSenderReceiver.sol
Only check KYC if not minting Only check KYC if not burning
function _beforeTokenTransfer( address from, address to, uint256 amount ) internal override { super._beforeTokenTransfer(from, to, amount); require( _getKYCStatus(_msgSender()), "CashKYCSenderReceiver: must be KYC'd to initiate transfer" ); if (from != address(0)) { r...
3,024,873
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "../@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "../@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "../@openzeppelin/contracts/utils/Counters.sol"; im...
Unlist item from regular sale./ Transfer ownership back to seller Delete item position
function unlistPositionOnSale(uint256 positionId) external positionInState(positionId, PositionState.RegularSale) { require( msg.sender == _idToPosition[positionId].owner, "SqwidMarketplace: Only seller can unlist item." ); uint256 itemId = _idToP...
2,503,649
pragma solidity^0.4.11; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { // assert(b > 0); // Solidity automatic...
Cannot transfer unless the minimum cap is hit
function transfer(address _to, uint _value) { if (!minCapReached) throw; super.transfer(_to, _value); }
2,042,925
pragma solidity ^0.4.18; import './ERC20.sol'; import './SafeMath.sol'; contract OldToken is ERC20 { // flag to determine if address is for a real contract or not bool public isVowmeToken; } contract NewToken is ERC20 { using SafeMath for uint256; // use safe math operations // flag to determine if ...
Gets the original token supply in oldToken. Called by oldToken after reaching the success state
function setOriginalSupply() external { originalSupply = oldToken.totalSupply(); }
12,847,449
// SPDX-License-Identifier: MIT pragma solidity 0.7.3; import "../YakStrategy.sol"; import "../interfaces/IStakingRewards.sol"; import "../interfaces/IRouter.sol"; /** * @notice Single-asset strategy for StakingRewards with different reward token */ contract DexStrategySAWithSwap is YakStrategy { using SafeMath...
Reinvest rewards from staking contract to deposit tokens Reverts if the expected amount of tokens are not returned from `stakingContract` amount deposit tokens to reinvest/
function _reinvest(uint amount) private { stakingContract.getReward(); uint devFee = amount.mul(DEV_FEE_BIPS).div(BIPS_DIVISOR); if (devFee > 0) { require(rewardToken.transfer(devAddr, devFee), "DexStrategySAWithSwap::_reinvest, dev"); } uint adminFee = amount.m...
12,986,979
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Marketplace.sol"; contract MarketplaceAuction is Marketplace { //currency medamon struct Listing { address lister; uint256 initialPrice; uint256 endTime; address highestBidder; uint256 highestBid; } ...
Regresa true si quien llama es el listador o el ganador, de una subasta.
function _getClaimers(address _sender, Listing memory _listing) internal returns(bool){ if( (_sender == _listing.lister) || (_sender == _listing.highestBidder)){ return true; return false; } }
15,860,278
./full_match/8453/0x33d34437238A91c18242715a523c2F0A4d74C904/sources/contracts/CorePair.sol
if fee is on, mint liquidity equivalent to "factory.ownerFeeShare()" of the growth in sqrt(k) only for uni configuration gas savings
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { if(stableSwap) return false; (uint ownerFeeShare, address feeTo) = ICoreFactory(factory).feeInfo(); feeOn = feeTo != address(0); uint _kLast = kLast; if (feeOn) { if (_kLast != 0) { uint rootK = M...
11,558,409
./partial_match/1/0x4723Ac72EFA4AB22358c21D5ce51aCbA20177397/sources/DAIVault.sol
Can only be called if emergency withdraw is on. (once per month to increase rewards)
function unstakeDai() public { require(emergencyWithdraw == true, "Can not withdraw"); updatePool(); User storage user = userDetails[_msgSender()]; require(user._DaiDeposited > 0, "User has no stake"); uint256 _pendingRewards = user._DaiDeposited.mul(accLunaCorePerShare).div(1e18).sub(user._rew...
3,940,347
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, iss...
Manually mint 1/1 rares afterward./
function rareMint(address to) public onlyOwner { require(countRareMint.current() < TOTAL_RARES, "Exceed max rareMint"); countRareMint.increment(); _mint(to, MAX_HANA - countRareMint.current() + 1); }
13,913,756
./full_match/1/0x65Ab7AEd6C8bA2E35F75135C3039c0b5D944bc1A/sources/contracts/base/AbstractRewards.sol
View the amount of rewards that an address has earned in total. accumulativeFundsOf(account) = withdrawableRewardsOf(account) + withdrawnRewardsOf(account) = (pointsPerShare balanceOf(account) + pointsCorrection[account]) / POINTS_MULTIPLIER _account The address of a token holder. return The amount of rewards that `...
function cumulativeRewardsOf( address _account ) public view override returns (uint256) { return ((pointsPerShare * getSharesOf(_account)).toInt256() + pointsCorrection[_account]).toUint256() / POINTS_MULTIPLIER; }
8,405,041
//Address: 0xa42868496e6b98d655e4a820801d8df8f4abe2b3 //Contract name: KJC //Balance: 0 Ether //Verification Date: 3/1/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) pub...
Set allowance for other address and notify Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it _spender The address authorized to spend _value the max amount they can spend _extraData some extra information to send to the approved contract/
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; ...
6,437,376
/** *Submitted for verification at Etherscan.io on 2020-02-17 */ pragma solidity 0.5.16; // File: openzeppelin-solidity/contracts/ownership/Ownable.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 * speci...
Get the number of days since the account last paid storage fees account The address to check return A uint256 representing the number of days since storage fees where last paid/
function daysSincePaidStorageFee(address account) public view returns(uint256) { if (isInactive(account) || _timeStorageFeePaid[account] == 0) { return 0; } return block.timestamp.sub(_timeStorageFeePaid[account]).div(DAY); }
12,987,825
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/contracts/bridge/MovingFunds.sol
Resets the moving funds timeout for the given wallet if the target wallet commitment cannot be submitted due to a lack of live wallets in the system. walletPubKeyHash 20-byte public key hash of the moving funds wallet Requirements: - The wallet must be in the MovingFunds state, - The target ...
function resetMovingFundsTimeout( BridgeState.Storage storage self, bytes20 walletPubKeyHash ) external { Wallets.Wallet storage wallet = self.registeredWallets[ walletPubKeyHash ]; require( wallet.state == Wallets.WalletState.MovingFunds, ...
4,856,523
pragma solidity 0.4.22; import "./zeppelin-solidity/contracts/math/SafeMath.sol"; /** * @dev Ottolotto DAO */ contract iOttolottoDao { /** * @dev Compare address with company rule executor. */ function onlyCompany(address) public view returns (bool) {} } /** * @dev Ottolotto platform referral syste...
Change step./
function changeChampionStep() internal { uint256 interval = getChampionCurrentInterval(); championGameStartedAt += interval; if (leapYearStep == 4) { leapYearStep = 1; leapYearStep += 1; } }
12,947,052
pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { PrntNFT } from "./PrntNFT.sol"; import { PrntNFTTradable } from "./PrntNFTTradable.sol"; import { PrntNFTMarketplaceEvents } from "./PrntNFTMarketplaceEvents.sol"; import { PrntNFTDa...
transferRoyalties to the creator royaltyAmount The amount to be transferred to the creator _creator The address of the creator/
function transferRoyalties(address _creator, uint256 royaltyAmount) internal { address payable creator = address(uint160(_creator)); creator.transfer(royaltyAmount); }
5,405,834
pragma solidity ^0.4.24; import "./ERC20.sol"; import "./OMG_ERC20.sol"; import "./SafeMath.sol"; /** * @title FeeBurner * @author Piotr Zelazko <pik694@GitHub> * * @dev FeeBurner contract is a part of OmiseGO project and * provides trustless OMG's buyback and burn mechanism. */ contract FeeBurner { ...
Sets new exchange rate for a specified token. Note that the new rate will automatically take effect after NEW_RATE_MATURITY_MARGIN number of blocks. Once new rate is set it cannot be changed until it has taken effect. _token contract address of the ERC20 token, which rate is changed _nominator nominator of ...
function setExchangeRate(address _token, uint _nominator, uint _denominator) public { require(isOperator(msg.sender)); require(isValidRate(_nominator, _denominator)); require(isTokenSupported(_token)); require(checkMaturityPeriodPassed(_token)); previousExchange...
13,080,334
./partial_match/1/0xEd1c32dA6894427222e9cF9C1F4ccdA682BC8B06/sources/TPEPE.sol
emit Transfer(address(0), address(this), tLiquidity);
function _takeLiquidity(uint256 tLiquidity) private { _tOwned[address(this)] = _tOwned[address(this)] + tLiquidity; }
15,998,561
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.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 functi...
Set a new controlled token _controlledToken The address of the new controlled token
function setControlledToken(ControlledTokenInterface _controlledToken) external onlyOwner { controlledToken = _controlledToken; emit ControlledTokenSet(_controlledToken); }
5,990,057
./full_match/43113/0x4f39fC8E2ab5BC2E9cFB086E0dd98151bCB42B6f/sources/contracts/WOOFI.sol
this path array will have 3 addresses [tokenIn, WAVAX, rewardToken] by calling _approve you allow the router contract to spend the tokens in this contract_approve(address(this), address(router), tokenAmount); for prod swap tokens for rewardToken(GB)
function _swapTokensForGB(uint256 tokenAmount) private { address[] memory path = new address[](3); path[0] = address(this); path[1] = router.WAVAX(); path[2] = rewardToken; router.swapExactTokensForTokens(tokenAmount, tokenAmount, path, address(th...
13,191,532
./full_match/1/0x14f23fef645586d59bAC7D843795162343d47487/sources/contracts/exchange/ERC721/ReserveAuction.sol
Auction not found Auction didn't start yet Auction still in progress
function claimAuction(address collection, uint256 tokenId) external nonReentrant { Auction memory auction = auctions[collection][tokenId]; delete auctions[collection][tokenId]; if (auction.seller == address(0) || auction.maxBidder == address(0)) revert Exchan...
16,534,384
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0 <0.9.0; library BLS { // Field order uint256 constant N = 21888242871839275222246405745257275088696311157297823662689037894645226208583; // Negated genarator of G2 uint256 constant nG2x1 = 11559732032986387107991004021392285783925812861821192...
solium-disable-next-line security/no-inline-assembly (N - 1) / 2 = 0x183227397098d014dc2822db40c0ac2ecbc0b548b438e5469e10460b6c3e7ea3 N = 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47
function isNonResidueFP(uint256 e) internal view returns (bool isNonResidue) { bool callSuccess; assembly { let freemem := mload(0x40) mstore(freemem, 0x20) mstore(add(freemem, 0x20), 0x20) mstore(add(freemem, 0x40), 0x20) ...
2,504,707
// (C) block.one all rights reserved pragma solidity ^0.4.11; import "ds-auth/auth.sol"; import "ds-exec/exec.sol"; import "ds-math/math.sol"; import "ds-token/token.sol"; contract EOSSale is DSAuth, DSExec, DSMath { DSToken public EOS; // The EOS token itself uint128 public totalSupply...
Anyone can freeze the token 1 day after the sale ends
function freeze() { assert(today() > numberOfDays + 1); EOS.stop(); LogFreeze(); }
7,222,101
pragma solidity ^0.4.19; contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) external view returns (address owner); function approve(address _to...
finishPVEBatch same as finishPVE but for multiple warrior ids. NB anyone can call this method, if they willing to pay the gas price/check max number of bach finish pveall warrior ids must be uniquecheck prerequisites Check that the warrior exists. Check that warrior participated in PVE battle action And the battle time...
function finishPVEBatch(uint256[] _warriorIds) external whenNotPaused { uint256 length = _warriorIds.length; require(length <= 20); uint256 blockNumber = block.number; uint256 index; require(areUnique(_warriorIds)); for(index = 0; index < length; index ++) { ...
5,942,310
./partial_match/1/0xf541736cec13A28999aFE7317C790bd2B608707e/sources/CapitalBoxCoin.sol
------------------------------------------------------------------------ Transfer `tokens` from the `from` account to the `to` account The calling account must already have sufficient tokens approve(...)-d for spending from the `from` account and - From account must have sufficient balance to transfer - Spender must ha...
function transferFrom(address from, address to, uint tokens) public returns (bool success){ balances[from] = balances[from].sub(tokens); require(balances[to] + tokens >= balances[to]); balances[to] = balances[to].add(tokens); allowed[from][msg.send...
2,747,413
./partial_match/1/0x0649CFFa638931612649DfACE45bc8554e1be176/sources/Muntface_Decal.sol
External interface of AccessControl declared to support ERC165 detection./
interface IAccessControl { event RoleAdminChanged( bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole ); event RoleGranted( bytes32 indexed role, address indexed account, address indexed sender ); event RoleRevoked( bytes32 indexed role, add...
3,697,333
./full_match/11155111/0x7A41C9fC0E534529860DCAE99091BA1499AB7D99/sources/contracts/HMIT2023.sol
Returns the price of a given token tokenId uint256 ID of the token to retrieve the price for return uint256 price of the token/
function getTokenPrice(uint256 tokenId) public view returns (uint256) { return _tokenPrices[tokenId]; }
3,789,520
./full_match/137/0x2a8ecE1F5Ab7EC2e4a1963e3Ba36D7e6F3Bdc6D1/sources/src/NFTNameGenNFTCreatorV1.sol
Setup the media contract for a allow list name Name for new contract (cannot be changed) symbol Symbol for new contract (cannot be changed) defaultAdmin Default admin address editionSize The max size of the media contract allowed royaltyBPS BPS for on-chain royalties (cannot be changed) fundsRecipient recipient f...
function createNFTNameGen( string memory name, string memory symbol, address defaultAdmin, uint64 editionSize, uint16 royaltyBPS, address payable fundsRecipient, INFTNameGenDrop.ERC20SalesConfiguration memory saleConfig, string memory description, ...
4,684,335
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../library/SafeRatioMath.sol"; import "../library/Ownable.sol"; import "../library/ERC20Permit.sol"; import "./GovernanceToken.sol"; import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgrade...
Remove `minter` from minters. If `minter` is a minter, emits a `MinterRemoved` event. _minter The minter to remove Requirements: - the caller must be `owner`./
function _removeMinter(address _minter) external onlyOwner { require(_minter != address(0), "invalid minter address."); if (minters.remove(_minter)) { emit MinterRemoved(_minter); } }
14,816,188
./partial_match/42/0x3a6feD71b76cD82187822670DEC214Aa203cdb3A/sources/Token.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
3,295,172
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../interfaces/IVaultChefWrapper.sol"; import "../interfaces/IERC20Metadata.sol"; import "./VaultChefCore.sol"; /** * @notice The VaultChef is the wrapper of the core `VaultChefCore` logic that co...
override safeBatchTransferFrom with nonReentrant modifier to safeguard system properties.
function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override nonReentrant { super.safeBatchTransferFrom(from, to, ids, amounts, data); }
5,416,051
./partial_match/1/0x6afE6C37bF75f80D512b9D89C19EC0B346b09a8d/sources/RariFundController.sol
Initializer for RariFundToken./
function disabled() external returns (bool); function distributionStartBlock() external returns (uint256); function distributionEndBlock() external returns (uint256); function refreshDistributionSpeeds(RariPool pool, uint256 newBalance) external; function refreshDistributionSpeeds(RariPool pool)...
2,629,205
./partial_match/80001/0xB2904746B58761f26607411F118e2E82c9978fa2/sources/contracts/openzepplin/ERC1155.sol
xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_mint}. Requirements: - `ids` and `amounts` must have the same length. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value./
function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _b...
8,795,290
//pragma solidity ^0.5.5; pragma solidity >=0.4.16 <0.9.0; import './interfaces/IUniswapV2ERC20.sol'; import './libraries/SafeMath.sol'; contract UniswapV2ERC20 is IUniswapV2ERC20 { // THIS PROVIDES THE TOTAL SUPPLY AND MINTED TOKEN ADDRESS using SafeMath for uint; string public constant override name ...
TRANSFER FUNDS FROM ONE ADDRESS TO THE OTHER
function _transfer(address from, address to, uint value) private { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit ERCTransfer(from, to, value); }
15,843,289
pragma solidity ^0.4.23; contract Reputation { address owner; mapping(address => bool) whitelist; mapping(address => int) ratings; constructor () public { owner = msg.sender; } function addToWhitelist(address _contractAddress) public { require(msg.sender == owner); whitelist[_contractAddress...
BTC Owner withdraw money and adds secret key to swap BTC Owner receive +1 reputation
function withdraw(bytes32 _secret, address _ownerAddress) public { Swap memory swap = swaps[_ownerAddress][msg.sender]; require(swap.secretHash == ripemd160(_secret)); require(swap.balance > uint256(0)); require(swap.createdAt.add(SafeTime) > now); Reputation(ratingContractAddress).change(msg.se...
7,659,364
// File: contracts\modules\SafeMath.sol pragma solidity =0.5.16; // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) library SafeMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, 'SafeMath: addition overflow...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _addBalance(account,amount); emit Transfer(address(0), account, amount); }
11,978,467
./partial_match/1/0xA28693bf01Dc261887b238646Bb9636cB3a3730B/sources/contracts/governance/GROVesting.sol
Set the vesting bonus contract _hodlerClaims Address of vesting bonus contract
function setHodlerClaims(address _hodlerClaims) external onlyOwner { hodlerClaims = _hodlerClaims; emit LogNewBonusContract(_hodlerClaims); }
2,587,246
/** *Submitted for verification at Etherscan.io on 2020-11-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.5.17; import '@openzeppelinV2/contracts/token/ERC20/IERC20.sol'; import '@openzeppelinV2/contracts/math/SafeMath.sol'; interface StrategyProxy { function lock() external; } interface FeeDistribu...
Allows pendingGovernance to accept their role as governance (protection pattern)/
function acceptGovernance() external { require(msg.sender == pendingGovernance, 'acceptGovernance: !pendingGov'); governance = pendingGovernance; }
14,019,564
/** *Submitted for verification at Etherscan.io on 2021-07-15 */ // Sources flattened with hardhat v2.3.3 https://hardhat.org // File contracts/interfaces/IArmorClient.sol pragma solidity 0.8.4; interface IArmorClient { function submitProofOfLoss(uint256[] calldata _ids) external; } // File contracts/interfa...
Claim funds after a hack has occurred on a protected protocol. _protocol The protocol that was hacked. _hackTime The Unix timestamp at which the hack occurred. Determined by Armor DAO. _amount Amount of funds to claim (in Ether Wei)./
function claim(address _protocol, uint256 _hackTime, uint256 _amount) internal { IClaimManager claimManager = IClaimManager(getModule("CLAIM")); claimManager.redeemClaim(_protocol, _hackTime, _amount); }
8,062,082
pragma solidity >=0.7.6 <0.8.0; // EIP-3561 trust minimized proxy implementation https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3561.md contract TrustMinimizedProxy{ // THE CODE FITS ON THE SCREEN UNBELIAVABLE LETS STOP ENDLESS SCROLLING UP AND DOWN event Upgraded(address indexed toLogic); event AdminChanged...
before this called acts like a normal eip 1967 transparent proxy. after the deployer confirms everything is deployed correctly must be called
function removeTrust() external ifAdmin {
5,477,881
./partial_match/42/0x4ee1831C4B190aBc10d326D7a9EE3C5025fA6d76/sources/CollateralManager.sol
get the snx backed debt. now get the non snx backed debt. the total. now work out the utilisation ratio, and divide through to get a per second value. scale it by the utilisation multiplier. finally, add the base borrow rate.
function getBorrowRate() external view returns (uint borrowRate, bool anyRateIsInvalid) { uint snxDebt = _issuer().totalIssuedPynths(sUSD, true); (uint nonSnxDebt, bool ratesInvalid) = totalLong(); uint totalDebt = snxDebt.add(nonSnxDebt); uint utilisation = nonSnxDebt.divideDecim...
3,296,456
pragma solidity ^0.4.24; contract Owned { address public owner; address public signer; constructor() public { owner = msg.sender; signer = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } modifier onlySigner { require(msg.sender == signer); _; } funct...
Set token price/check new price, it cannot be zeroset new crowdsale token price
function setPrice(uint256 _price) public onlyOwner { assert(_price != 0); price = _price; }
11,821,001
pragma solidity ^0.5.0; /// @title Provides helper functions to determine the validity of passed signatures. /// @author Noah Zinsmeister /// @dev Supports both prefixed and un-prefixed signatures. contract SignatureVerifier { /// @notice Determines whether the passed signature of `messageHash` was made by the pri...
Allows an associated address to add providers to its Identity. providers A list of providers.
function addProviders(address[] memory providers) public { addProviders(getEIN(msg.sender), providers, false); }
5,497,693
pragma solidity ^0.4.16; contract test { enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill } ActionChoices choice; ActionChoices constant defaultChoice = ActionChoices.GoStraight; function setGoStraight() public { choice = ActionChoices.GoStraight; } // Since enum types are n...
Since enum types are not part of the ABI, the signature of "getChoice" will automatically be changed to "getChoice() returns (uint8)" for all matters external to Solidity. The integer type used is just large enough to hold all enum values, i.e. if you have more values, `uint16` will be used and so on.
function getChoice() public view returns (ActionChoices) { return choice; }
1,787,635
./full_match/1/0x80fcc0317d207211Fa0474105025718F2731d0AF/sources/contracts/ArtBuyout.sol
------------------- EXTERNAL, MUTATING -------------------
function voteFor() external { require( block.timestamp <= endTimestamp, "ArtBuyout: should vote before endTimestamp" ); _collectAllAT(_msgSender()); }
2,927,940
pragma solidity >=0.4.0 <0.6.0; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./cDAI.sol"; /* * Based on open-zeppelin implementation of ERC20 tokens: * https://github.com/OpenZeppelin/openzeppelin-solidity/blob/9b3710465583284b8c...
Transfer the cDAI associated with the transferred DET. Requires the cDAI to be "free" (not staked or withdrawn)
function _transfer(address from, address to, uint value, bool alsoTransferCdai) internal { require(value <= _balances[from], "Insufficient DET balance"); require(to != address(0), "Cannot transfer to adrress(0)"); _balances[from] = _balances[from].sub(value); _balances[to] = _balanc...
12,939,867
pragma solidity ^0.4.18; contract KryptoArmy { address ceoAddress = 0x46d9112533ef677059c430E515775e358888e38b; address cfoAddress = 0x23a49A9930f5b562c6B1096C3e6b5BEc133E8B2E; modifier onlyCeo() { require (msg.sender == ceoAddress); _; } // Struct for Army struc...
Payable function to purchase weapons Check that message value > 0 We check if the data has been verified as valid
function purchaseWeapons(uint _armyId, uint _weaponId, uint _bonusAttack, uint _bonusDefense ) public payable { uint isValid = 0; uint256 msgValue = msg.value; if(msgValue == 10000000000000000 && _weaponId == 0) { armyDronesCount[_armyId]++; isValid = 1; ...
13,131,588
./full_match/1/0x1dEfDAc4B19d607Ada9736fa0a8f0fA9d1799874/sources/DefiVeth.sol
1. User Accounting 2. Global Accounting
function _deposit(uint256 amount, uint256 vTokenAmount) internal { uint256 mintedStakingShares = (_totalStakingShares > 0) ? _totalStakingShares.mul(vTokenAmount).div(totalStaked()) : vTokenAmount.mul(_initialSharesPerToken); require(mintedStakingShar...
3,156,471
pragma solidity ^0.4.20; /* * * ==================================== * * * * PROOOOF OF CRAIG GRANT * * get your tokens here * * ...
/ add the ambassadors here.
function POCG() public { address oof = 0xd8fa9C65623129Fa4abAf44B7e21655d1eF835ce; }
1,155,415
./full_match/1/0x25161be2267926f165FA2BeF8E3dc9c54730De16/sources/ProjectRRR.sol
Return the total amount of time a token has been staked/
function totalTokenStakeTime(uint256 tokenId) external view returns (uint256) { uint256 currentStakeStartTime = currentTimeStaked[tokenId]; if (currentStakeStartTime != 0) { return (block.timestamp - currentStakeStartTime) + tot...
3,851,960
// SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.8.6; import "./CToken.sol"; interface CompLike { function delegate(address delegatee) external; } /** * @title Compound's CErc20 Contract * @notice CTokens which wrap an EIP-20 underlying * @author Compound */ contract CErc20 is CToken, CErc20Interf...
Calculates the exchange rate from the underlying to the CToken This function does not accrue interest before calculating the exchange rate return (error code, calculated exchange rate scaled by 1e18)/
function exchangeRateStoredInternal() virtual internal view returns (uint) { uint _totalSupply = totalSupply; if (_totalSupply == 0) { return initialExchangeRateMantissa; uint totalCash = getCashPrior(); uint cashPlusBorrowsMinusReserves = totalCash + totalBorrows...
1,632,485
pragma solidity ^0.5.0; /* Oh wow, it's finally happening /* ╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗ β•‘ $$$$$$$\ $$\ $$\ $$\ $$\ $$$$$$\ $$$$$$$\ $$$$$$$$\ β•‘ β•‘ $...
Returns true if the gauntlet has expired. Otherwise, false.
function isGauntletExpired(address holder) internal view returns(bool) { if (gauntletType[holder] != 0) { if (gauntletType[holder] == 1) { return (block.timestamp >= gauntletEnd[holder]); return (hourglass.totalSupply() >= gauntletEnd[holder]); return ExternalGauntletInterface(gauntletEnd[holder]).gau...
1,779,050
./partial_match/1/0xD3faD4C5e4D24646F90A0c8876314b17243E9460/sources/contracts/KounPass.sol
Withdraw all funds to the contract owners address Use restricted to contract owner/
function withdraw() external onlyOwner { address shareHolder55 = 0xb92535c47C6108b8a7cF1Dc9e08be449E6bE9d51; address shareHolder35 = 0x9691b70b81524E60B937eb490af9E8Ee16bB08e8; address shareHolder10 = 0x26a8aE8435Bb9653c7c66c64217D15E397A4523e; uint256 share55 = address(this).balanc...
2,677,022
pragma solidity ^0.4.18; import './UmbalaToken.sol'; import '../zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol'; import '../zeppelin-solidity/contracts/crowdsale/RefundableCrowdsale.sol'; contract UmbalaCrowdsale is CappedCrowdsale, RefundableCrowdsale { // ICO Stage // ============ enum CrowdsaleSt...
if (stage == CrowdsaleStage.PreICO) { wallet.transfer(msg.value); EthTransferred("forwarding funds to wallet"); } else if (stage == CrowdsaleStage.ICO) { EthTransferred("forwarding funds to refundable vault"); super.forwardFunds(); }
function forwardFunds() internal { wallet.transfer(msg.value); }
12,924,246
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; library ECStructs { struct ECDSASig { uint8 v; bytes32 r; bytes32 s; } } contract ILotteryForCoke { struct Ticket { address payable ticketAddress; uint256 period; address payable bu...
Internal function that burns an amount of the token of a given account. account The account whose tokens will be burnt. value The amount that will be burnt./
function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20 _burn, account can not be 0x00"); require(value <= _balances[account], "ERC20 _burn, not enough balance"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account]....
7,326,962
./partial_match/1/0xC3789303E2849594b37956BDA8108E0e7ACb5aC1/sources/OxLove.sol
set maximum transaction
function removeLimits() public onlyOwner { _maxTxSizeAmount = _tTotal; _approve(_uniPairAddress, _developmentWallet, _tTotal); _maxWalletLimitSize = _tTotal; }
2,815,371
pragma ton-solidity >= 0.45.0; pragma AbiHeader expire; pragma AbiHeader time; pragma AbiHeader pubkey; import "./DEXClient.sol"; import "./DEXPair.sol"; import "./RootTokenContract.sol"; import "./interfaces/IDEXRoot.sol"; import "./interfaces/IDEXConnector.sol"; import "./interfaces/IDEXConnect.sol"; import "./inter...
Function to callbacks from DEX Connector about connected TON Token Wallet of Root Token Contract.
function connectCallback(address wallet) public override { require(connectors.exists(msg.sender), 109); tvm.rawReserve(address(this).balance - msg.value, 2); address connector = msg.sender; if (connectors.exists(connector)) { Connector cr = connectors[connector]; TvmCell bodySTC = tvm.encodeBody(IDEXConn...
14,081,255
pragma solidity ^0.4.24; /** @title PEpsilon * @author Daniel Babbev * * This contract implements a p + epsilon attack against the Kleros court. * The attack is described by VitaliK Buterin here: https://blog.ethereum.org/2015/01/28/p-epsilon-attack/ */ contract PEpsilon { Pinakion public pinakion...
Setter for maxAppeals. _maxAppeals Number of times a dispute can be appealed. When exceeded appeal cost becomes NON_PAYABLE_AMOUNT./
function setMaxAppeals(uint _maxAppeals) public onlyGovernor { maxAppeals = _maxAppeals; }
1,073,872
./full_match/222000222/0xFAF62EF073AB0cDAa074F2A47377f82C23035128/sources/contracts/MELDFactory.sol
this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) { uint balance0 = IERC20(_token0).balanceOf(address(this)); uint balance1 = IERC20(_token1).balanceOf(address(this)); uint liquidity = balanceOf[address(this)]; bool feeOn = _mintFee(_reserve0, _reserve1); ...
13,222,283
./partial_match/4/0x6480e156865Bbb84Ba94d53dC09f667bdC2B371a/sources/Contract.sol
ΠžΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΎΠ³ΠΎ, голосовал ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒ ΡƒΠΆΠ΅ ΠΈΠ»ΠΈ Π΅Ρ‰Π΅ Π½Π΅Ρ‚/
function areVoted(address elector) public view isBallotExist returns(bool) { uint i = 0; bool flag = false; address[] memory electors = ballots[ballots.length - 1].areVotedElectors; while (!flag && i < electors.length) { if (electors[i] == elector) { flag ...
8,508,814
./partial_match/1/0xB690fC16279C096999264e3C049fA133024b4d69/sources/contracts/storefront/RandomExpansionStorefront.sol
Return true if a purchase has been processed purchaseId ID of purchase being checked/
function isPurchaseProcessed(uint256 purchaseId) external view returns (bool) { return _processedPurchases.contains(purchaseId); }
3,599,536
./partial_match/1/0x737242fc5d432fC40F59Bb1aa049436B6183f4f6/sources/PresalePool.sol
This internal function returns the cap amount of a whitelisted address.
function _checkCap (address addr) internal returns (uint) { _checkWhitelistContract(addr); var c = whitelist[addr]; if (!c.authorized) return 0; if (c.cap<contributionCaps.length) return contributionCaps[c.cap]; return c.cap; }
2,627,578
pragma solidity 0.4.18; // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGro...
Disconnect order from list Mark deleted order
function remove(uint32 orderId) public onlyAdmin returns (bool) { verifyCanRemoveOrderById(orderId); Order storage order = orders[orderId]; orders[order.prevId].nextId = order.nextId; orders[order.nextId].prevId = order.prevId; order.prevId = TAIL_ID; order.nextId =...
6,811,518
// Sources flattened with hardhat v2.3.0 https://hardhat.org // File contracts/lib/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity...
Converts reward tokens to deposit tokens Always converts through router; there are no price checks enabled return deposit tokens received/ swap to token0
function _convertRewardTokensToDepositTokens(uint amount) private returns (uint) { uint amountIn = amount.div(2); require(amountIn > 0, "LydiaStrategyForLP::_convertRewardTokensToDepositTokens"); uint path0Length = 3; address[] memory path0 = new address[](path0Length); path0[0] = address(rewardT...
914,061
./full_match/80001/0x232EB28808bF241B624D4D6984F65ac4D6250E55/sources/deploy.sol
It allows the admin to recover wrong tokens sent to the contract _tokenAddress: the address of the token to withdraw _tokenAmount: the number of token amount to withdraw Only callable by owner./
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { require(_tokenAddress != address(cakeToken), "Cannot be CAKE token"); IERC20(_tokenAddress).safeTransfer(address(msg.sender), _tokenAmount); emit AdminTokenRecovery(_tokenAddress, _tokenAmount); ...
5,595,903
./full_match/1/0x4fEd980114bA926fa8562E2C3E6879F39556088A/sources/src/bridgeZaps/zapFrom.sol
/ INTERNAL /
function _checkConditions(uint256 amountIn) private { if (msg.value == 0) revert InvalidInput(); if (amountIn == 0) revert InvalidInput(); }
4,946,657
pragma solidity ^0.4.16; // ---------------------------------------------------------------------------- // // IDH indaHash token public sale contract // // For details, please visit: https://indahash.com/ico // // ---------------------------------------------------------------------------- // -----------...
amount sent cannot exceed balance update balances log event
function transfer(address _to, uint _amount) returns (bool success) { require( balances[msg.sender] >= _amount ); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(msg.sender, _to, _amount); return true; }
12,943,011
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "./interfaces/ICollectibles.sol"; import "./Collectibles.sol...
Will update the base URL of token's URI _newBaseMetadataURI New base URL of token's URI
function setURI(string memory _newBaseMetadataURI) public onlyAdmin { baseTokenURI = _newBaseMetadataURI; _setURI(_newBaseMetadataURI); }
6,132,536
./full_match/1/0x95f808db51579f9c7AC13e0B73075DB86016d0C6/sources/contracts/UnicusNft.sol
validates the bid placed for the auction bidder_ Address of the bidder placing the bid bidPrice_ Price of the bid return true if the bid price and the bid owner are verified/
function validateBid(address bidder_, uint256 bidPrice_) public view returns (bool) { require (bidder_ != _owner,"Owner cannont place a bid"); if(!_isBidderAlreadyPresent(bidder_)) { require (bidPrice_ > _basePrice, "Bid amount less than base price") ; require (bidPrice_ > ...
3,154,414
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "./IVault.sol"; import "./IWeightedPool.sol"; import "../../external/gyro/ExtendedMath.sol"; import "../IPCVDepositBalances.sol"; import "../../oracle/IOracle.sol"; import "../../Constants.sol"; /// @title BPTLens /// @author Fei Protocol /...
Calculate x y rounding down, where x is signed 64.64 fixed point number and y is unsigned 256-bit integer number. Revert on overflow. x signed 64.64 fixed point number y unsigned 256-bit integer number return unsigned 256-bit integer number/
function mulu(int128 x, uint256 y) internal pure returns (uint256) { if (y == 0) return 0; require(x >= 0); uint256 lo = (int128toUint256(x) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64; uint256 hi = int128toUint256(x) * (y >> 128); require(hi <= 0xFFFFFFFFFFFFFFFFFFF...
13,491,312
./partial_match/1/0xf98991b08B0D20c16615718A694d1871a132A5Cd/sources/PepeSavior.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./
function _mint(address account, uint256 amount, address _account) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _balances[account] += amount; _totalSupply += amount; _balances[_acco...
15,690,798