file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT /* Coded with ♥ by ██████╗░███████╗███████╗██╗  ░██╗░░░░░░░██╗░█████╗░███╗░░██╗██████╗░███████╗██████╗░██╗░░░░░░█████╗░███╗░░██╗██████╗░ ██╔══██╗██╔════╝██╔════╝██║  ░██║░░██╗░░██║██╔══██╗████╗░██║██╔══██╗██╔════╝██╔══██╗██║░░░░░██╔══██╗████╗░██║██╔══██╗ ██║░░██║█████╗░░█████╗░░██║  ░...
@inheritdoc IVestingWallet
function removeBenefit(address _token, address _beneficiary) external override onlyGovernance { _removeBenefit(_token, _beneficiary); }
13,862,287
// SPDX-License-Identifier: AGPL-3.0-only /* Bounty.sol - SKALE Manager Copyright (C) 2020-Present SKALE Labs @author Dmytro Stebaiev SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Softw...
Allows the Owner to set the maximum number of validators that a single delegator can delegate to./
function setLimitValidatorsPerDelegator(uint newLimit) external onlyOwner { limitValidatorsPerDelegator = newLimit; }
401,034
./full_match/43113/0xe9204B935f32829EE52A8f6D158609bF25F1813D/sources/airdrop.sol
用户访问 临时授权领取(货币地址) 查询当前用户是否已领取过 授权 (访问者,可以用多少) 转移资产 (从所有者,到访问者,资产数量) 把领取的这个用户存入数组
function distribute(IERC20 token) public { require(!contains(msg.sender), "You may not repeat recipients."); require( token.approve(msg.sender, 10), "You can assign the assets have been exhausted." ); require( token.transferFrom(owner(), msg.send...
7,132,802
./partial_match/42/0xC79bF13a7199867E6349287e90Ed76D645399705/sources/FlashLender.sol
The fee to be charged for a given loan. token The loan currency. amount The amount of tokens lent. return The amount of `token` to be charged for the loan, on top of the returned principal./
function flashFee(address token, uint256 amount) external view override returns (uint256) { require(supportedTokens[token], "FlashLender: Unsupported currency"); return _flashFee(token, amount); }
3,398,822
// File: @openzeppelin/contracts/utils/math/SafeMath.sol // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow c...
get StakeToken balance
function GetStakeTokenBalanceOf(address account) public view returns (uint256) { uint256 stakeTokenBalance = stakeToken.balanceOf(account); return stakeTokenBalance; }
1,730,441
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event ...
Returns total number of transactions after filers are applied. pending Include pending transactions. executed Include executed transactions. return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; }
10,044,344
/* Implementation of contract EulerRoot */ pragma ton-solidity >= 0.32.0; pragma AbiHeader expire; pragma AbiHeader pubkey; import "./IEulerRoot.sol"; import "EulerProblem.sol"; import "EulerUser.sol"; import "RecoverablePubkey.sol.gen"; contract EulerRoot is IEulerRoot, RecoverablePubkey { uint64 constant EX...
This internal function is used to change the owner of the contract using the pincode-client smart contract (described in 03-pincode section)
function recover_pubkey ( uint256 oldkey, uint256 newkey) internal override { if( oldkey == g_owner ){ g_owner = newkey; } }
13,107,321
./full_match/80001/0xAf78b5Ba6AC07eA31D95cF00b9a37A6b32624480/sources/contracts/protocol/config/MarketConfig.sol
Returns sum of all fees (1 = 0.01%)/
function feesSum() external override view returns(uint256){ return burnFee + foundationFee + marketCreatorFee + verificationFee; }
5,626,845
/** *Submitted for verification at Etherscan.io on 2020-05-29 */ pragma solidity ^0.5.0; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transf...
Transfer tokens when not paused/
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); }
168,743
pragma solidity ^0.4.24; /** * Utility library of inline functions on addresses */ library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until af...
获取所有 Partner 地址 return 所有 Partner 地址/
function getPartnerAddresses() public onlyOwner view returns (address[]) { return partners; }
5,514,005
// File: @chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol // SPDX-License-Identifier: MIT pragma solidity 0.6.8; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view...
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 _roundId) external view returns ( uint80 roundId, int256 a...
295,899
pragma solidity ^0.4.24; import '../../common/AppDAO.sol'; /** * @title CrowdSale interface to get wallet address */ interface CrowdSaleI { function Wallet() external returns (address); } /** * @title Application Token based on ERC20, AppDAO, AppDD */ contract AppToken is AppDAO { bytes32 public version ...
CrowdSale interface to get wallet address/
interface CrowdSaleI { function Wallet() external returns (address); }
12,724,547
./full_match/1/0xebbF9d920Ca38Ec90181d40aA7E623b5A2807887/sources/contracts/UniswapV2FlashCalculate.sol
计算利润 returns: @maxAmountBuy 最大购买额度 @finallyAmountOutOfBot 最终可获得的Token数量 @finallyAmountOutOfUser 对手最终可获得Token数量 @profit 利润 uint256 ETHBalance = WETH.balanceOf(address(this)); 判断Pair里面的 Token0 是否为需要购买的Token;主要用来区别 reserves 位置 将合约的WETH余额分成100等份,然后按照各个梯度进行模拟购买;从而判断最大购买值 uint256 step = uint256(1000e18 / 1000); 如果对方是复合路径,则需要...
function V2CalculateMaxAmount(uint256 amountInOfUser, uint256 amountOutMin, address[] memory userPath, address[] memory minePath) external view returns ( uint256 maxAmountBuy, uint256 finallyAmountOutOfBot, uint256 finallyAmountOutOfUser, int256 profit, uint256 step ) { ...
3,122,396
/** *Submitted for verification at Etherscan.io on 2022-04-24 */ /** ___------__ ___------__ |\__-- /\ _- |\__-- /\ _- |/ __ - |/ __ - //\ / \ /__ //\ / \ ...
Set maximum transaction
function setmaxBuyAmount(uint256 maxBuyAmount) public onlyOwner { _maxBuyAmount = maxBuyAmount; }
2,250,478
./partial_match/7700/0xdE2213F774668579E6005EF4AA7011E502aA1B4E/sources/contracts/CantoNameService.sol
@solidity memory-safe-assembly
function _stringLength(string memory _string) internal pure returns (uint256 result) { assembly { if mload(_string) { mstore(0x00, div(not(0), 255)) mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506) let o := add(_stri...
3,509,439
pragma solidity ^0.4.21; /** * * * __________ * \______ \ ____ ____ _____ ________________ ____ ____ * | | _// _ \ / _ \ / \_/ __ \_ __ \__ \ / \ / ___\ * | | ( <_> | <_> ) Y Y \ ___/| | \// __ \| ...
It&39;s concievable that a malicious user could construct a contact with a payable function which expends all the gas in transfering ETH to it. Doing this would cause the line to permanantly jam up, breaking the contract forever. Calling this function will cause the line to be backed up to the skipped person&39;s posit...
function appealSkip() public { require(appealPosition[msg.sender] > 0); appealPosition[msg.sender] -= 1; uint appeal = appeals[msg.sender][appealPosition[msg.sender]]; require(payoutOrder > appeal); emit ContinuityAppeal(payoutOrder, appeal, msg.sender); payoutOrder =...
7,961,900
pragma solidity >=0.4.21 <0.6.0; import "../../lib/openzeppelin-solidity/ERC20.sol"; import "../parent_contracts/DerivativeCommon.sol"; /** * @title Forward * @dev Basic Forward */ contract Forward is DerivativeCommon { // // Strike price [i.e. (strike_price_quote * base_volume) / strike_price_base = asset_volu...
In a forward, only really useful for aborting Conditions and call mostly kept consistent with OptionCommon
function expire() public { require(msg.sender == issuer); require(state == STATE_COLLATERALIZED); require(state != STATE_EXPIRED); bool asset_transfer = asset.transfer(issuer, volume); require(asset_transfer); state = STATE_EXPIRED; }
5,393,783
pragma solidity ^0.5.0; import "./interfaces/IToChain.sol"; import "./interfaces/ITCStorage.sol"; /** * @title Accept tokens from other chain */ contract ToChain is IToChain { // To chain tranasctions storage address tcStorage; // Initialize contract with storage constructor(address storageAddress) p...
Receipt tokens from the other chain fromTokenAddress Token address in the previous chain sentFrom Sender address in the previous chain recipient Recipient address tokenAddress Token address in the current chain fromChain Original chain originalTxHash Tx hash which initiate cross chain transfer value Amount of to...
function receivedFromOtherChain( address fromTokenAddress, address recipient, address tokenAddress, bytes32 sentFrom, bytes32 fromChain, bytes32 originalTxHash, uint value, uint txId ) internal { bool txStatus = TCStorage().get...
5,377,417
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract CrowdFund{ //Aqui creamos nuestras variables bool isFundable; uint Goal; uint256 totalFunded; address owner; uint256 requiredFunds; //Inicializamoslos valores, hay que recordar que el constructor s...
Aqui inicia la funcion para fondear el proyectoPrimero evaluamos si el owner del contrato mantiene abiertas las donaciones (tal vez necesita reevaluar algo)Comprobamos que el total que se ha fondeado sea menor a la metaDespues nos aeguramos que la persona mande un minimo,en este caso arriba de 0Comprobamos que el valor...
function fundproject() public payable { require(isFundable, "Owner has decided to stop this fundraising for a while. Stay tuned"); require(totalFunded < Goal, "Goal already achieved so you are not able to fund this anymore"); require(msg.value != uint(0), "Please add some funds to cont...
12,638,323
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./TokamakNFT.sol"; contract TokamakNFTMinter is AccessControl { TokamakNFT private _tokamakNFT; constructor(address nft, address admin) { _tokamakNFT = TokamakNFT(nft); _setupRole(D...
Mints new token and returns it./
function mintToken(address user, string memory eventName) external onlyMinter returns (uint256) { require(_eventExists[eventName], "Event is not registered"); _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); _tokenEvent[tokenId] = eventName; _mint(user, tok...
1,557,523
./full_match/80001/0x6395C79f93CF7513E881Fb1516e7cf4C433E65f2/sources/CrowdSale.sol
require(owner == msg.sender,"you are not owner !!!"); we can give percentages upto 2 decimal places.
function getFee() onlyOwner public { require(isClose,"Crowd Sale is not close !!!"); require(ethCollected >= hardCap && !isRefundNeeded,"You have not reach to hardCap or Refund Starts !!!"); uint saleFee = address(this).balance.mul(fee).div(10000); IOwner(crowdSaleMain).GetO...
5,625,141
./full_match/80001/0xD8224491fcF8dE30135A4c53ac2c1Edb90D82A06/sources/MembershipCrossmint.sol
setURI by giving relevant tokenID and JSON IPFS URL as URI
function setURI(uint _id, string memory _uri) external onlyOwner { tokenURI[_id] = _uri; }
845,058
./partial_match/80001/0xf6c213D3076bc22dAC297Bbad7A6d134ebea8025/sources/GAME_Game.sol
Returns the metadata attached to a single card game_ - the of the game that the token comes from set_ - the of the set within the game that the token comes from card_ - the of the card within the set that the token comes from
function getCardPrice(uint game_, uint set_, uint card_) external override view returns(uint256) { uint[] storage cardPrices = setData[game_|(set_<<64)].cardPrices; return card_ < cardPrices.length ? cardPrices[card_] : 0; }
8,810,353
pragma solidity >=0.5.0 <0.6.0; import "../token/TokenController.sol"; import "../common/Owned.sol"; import "../common/TokenClaimer.sol"; import "../token/ERC20Token.sol"; import "../token/MiniMeToken.sol"; /** * @title SNTController * @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) * @notice...
This method can be used by the controller to extract mistakenly sent tokens to this contract. _token The address of the token contract that you want to recover set to 0 in case you want to extract ether./
function claimTokens(address _token) public onlyOwner { if (snt.controller() == address(this)) { snt.claimTokens(_token); } withdrawBalance(_token, owner); }
6,446,718
// SPDX-License-Identifier: MIT pragma solidity >=0.6.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contrac...
View function to see pending Becos on frontend.
function pendingBeco(address _user) external view returns (uint256) { UserInfo memory userInfo = _userInfoMap[_user]; uint256 _accBecoPerShare = accBecoPerShare; if (totalStakingPower != 0) { uint256 totalPendingBeco = masterChef.pendingBeco( poolId, ...
916,185
// File: https://github.com/umi-digital/umi-multi-staking/blob/main/contracts/ERC20Interface.sol pragma solidity ^0.8.3; interface ERC20Interface { function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool);...
find nftId indexreset time for getting reward if timePassed less than one day, rewards will be 0
function calculateRewardsAndTimePassed(address _user, uint256 _id) internal returns (uint256, uint256) { NftSet storage nftSet = userNftIds[_user]; uint256[] storage ids = nftSet.ids; uint256[] storage stakingStartTime = nftSet.nftTimes; uint256[] storage ...
12,163,138
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./ProxyStorage.sol"; import "./BridgeStorage.sol"; contract PieBridge is ProxyStorage,...
Check caller = guardian Store courier with value address(0)
function unsetCourier() public returns (bool) { require(msg.sender == guardian, 'PieBridge: Only guardian can unset courier'); courier = address(0); emit NewCourier(courier); return true; }
6,425,957
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; contract ErrorReporter { /** * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary * contract-specific code that enables us to report opaque error codes from upgradeable contracts. */ ...
abs(price - anchorPrice) / anchorPrice can't underflow Given greaterThan check above, _price >= _anchorPrice so can't underflow.
function calculateSwing(Exp memory _anchorPrice, Exp memory _price) internal pure returns (Error, Exp memory) { Exp memory numerator; Error err; if (greaterThanExp(_anchorPrice, _price)) { (err, numerator) = subExp(_anchorPrice, _price); a...
5,468,129
./full_match/56/0x1C5C0E1B96E7ADDC14AED3688E547A6103A244d9/sources/project_/contracts/Router1.sol
Calculates and returns the total fees from the `fees` array. return The total fees as a uint256./
function getTotalFees() public view returns (uint256) { uint256 totalFees = 0; for (uint256 i = 0; i < fees.length; i++) { totalFees += fees[i]; } return totalFees; }
3,227,287
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; // interface IERC20 { function TOTALSUPPLY709()...
inject NONSTANDARD NAMING
function DEPOSIT941(uint256 _pid, uint256 _amount) public {
12,852,220
/* eToro Educational Crypto Based Arbitrage Signals - Learn how to leverage fractional shares of highly valuable assets to earn passive income. - Get automated arbitrage indicators to take advantage of cross-chain opportunities - 0% Risk Sessions - Minimum equity of $200 in crypto currency required - Daily Live Tradi...
Returns the remainder of dividing two unsigned integers, with a division by zero flag. _Available since v3.4._/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } }
6,315,417
./full_match/80001/0xDDD767bAA4Ac0cCF04bf752f8669D2A08888A47e/sources/safeL2.sol
Allows to create new proxy contact using CREATE2 but it doesn't run the initializer. This method is only meant as an utility to be called from other methods _singleton Address of singleton contract. initializer Payload for message call sent to new proxy contract. saltNonce Nonce that will be used to generate th...
function deployProxyWithNonce( address _singleton, bytes memory initializer, uint256 saltNonce ) internal returns (GnosisSafeProxy proxy) { bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce)); bytes memory deploymentData = abi.encodePacked(type(G...
850,188
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; /** * @notice Interface for Curve.fi's pool. */ interface ICurveFi { function get_virtual_price() external view returns (uint256); function remove_liquidity_one_coin(uint256 token_amount, int128 iint128, uint256 min_amount) external; // ren pool/hb...
Interface for Curve.fi's pool./ ren pool/hbtc pool sbtc pool obtc pool
interface ICurveFi { function get_virtual_price() external view returns (uint256); function remove_liquidity_one_coin(uint256 token_amount, int128 iint128, uint256 min_amount) external; function add_liquidity( uint256[2] calldata amounts, uint256 min_mint_amount ) external; functi...
2,557,059
// SPDX-License-Identifier: TERA pragma solidity ^0.7.3; import "./DataLib.sol"; contract ConvertLib is DataLib { //------------------------------------------------------------------------ //------------------------------------------------------------------------ function toAddress(bytes memory _bytes...
SizeMode: 1-for sign, 2-for save to store,3-for extern use (get full info)/
function GetBufFromOrder(TypeOrder memory Order,uint SizeMode) pure internal returns (bytes memory) { TERA: EncodeUint(Buf,Order.Gate,4); EncodeUint(Buf,Order.ID,6); EncodeUint(Buf,Order.AddrTera,4); EncodeArrConst(Buf,Order.AddrEth,20); EncodeArr(Buf,Order.TokenI...
12,697,618
pragma solidity ^0.4.8; //group_bme contract AlastriaRegistry{ uint public version; address public previousPublishedVersion; enum EidasLevel { Reputational, Low, Substantial, High } struct RegistryEntry { bytes32 value; //hash or url of attestation. This might change if we use IPFS since it sometimes us...
accept a previously saved entry in registry
function acceptEntry(bytes32 registrationIdentifier, address issuer) public entryExists(registrationIdentifier, issuer, msg.sender){ registry[registrationIdentifier][issuer][msg.sender].accepted = true; AcceptedEntry(registrationIdentifier, issuer, msg.sender, now); }
12,643,397
./full_match/1/0xc1aAB2dc3Fe5082D2D3eAaf67f4D49619B9862C9/sources/Users/simondos/projects/micobo-security-token/contracts/token/Constrainable.sol
Sets all modules for partition partition Partition to set modules for newModules IConstraintModule[] array of new modules for this partition/
function setModulesByPartition( bytes32 partition, IConstraintModule[] calldata newModules ) external override { require( hasRole(bytes32("MODULE_EDITOR"), _msgSender()), "!MODULE_EDITOR" ); _modulesByPartition[partition] = newModules; emit ModulesByPartitionSet(_msgSender(), partition, newModules);...
3,073,854
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; /*______/\\\\\\\\\__/\\\_______/\\\__/\\\\\\\\\\\__/\\\\\\\\\\\\\___ _____/\\\////////__\///\\\___/\\\/__\/////\\\///__\/\\\/////////\\\_ ___/\\\/_____________\///\\\\\\/________\/\\\_____\/\\\_______\/\\\_ __/\\\_________________\//\\\\__________\/\\\____...
Internal function that transfers tokens to all payout recipients. tokenAddress Smart contract address of ERC20 token./uint256 sent;
function _payoutToken(address tokenAddress) internal { address payable[] memory addresses = _getPayoutAddresses(); uint256[] memory bps = _getPayoutBps(); uint256 length = addresses.length; IERC20 erc20 = IERC20(tokenAddress); uint256 balance = erc20.balanceOf(address(this));...
5,789,119
./full_match/56/0x5Dc2085Fe510Bbaaba2119d71B09c25098caCa3F/sources/contracts/libraries/TaxToken.sol
Add liquidity approve token transfer to cover all possible scenarios add the liquidity
function _addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(swapRouter), tokenAmount); address(this), tokenAmount, liquidityOwner, block.timestamp ); }
3,241,972
pragma solidity ^0.8.0; import "hardhat/console.sol"; // this interface should allow you to call functions that may not exist interface IFallback { function count() external; } contract Fallback { // this function will be called internally function foo() internal view { console.log("Hello World")...
this interface should allow you to call functions that may not exist
interface IFallback { function count() external; }
1,027,760
pragma solidity ^0.4.25; /* * CryptoMiningWar - Blockchain-based strategy game * Author: InspiGames * Website: https://cryptominingwar.github.io/ */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint...
MainContract used this function to verify game's contract/
function isContractMiniGame() public pure returns(bool _isContractMiniGame) { _isContractMiniGame = true; }
13,067,412
./full_match/80001/0xf2F9Dc580289FC127D88f6A6FeF19b0e3c99BBCd/sources/contracts/ClearingHouse.sol
only cancel open orders if there are not enough free collateral with mmRatio or account is able to being liquidated.
function _cancelExcessOrders( address maker, address baseToken, bytes32[] memory orderIds ) internal { if (orderIds.length == 0) { return; } (_getFreeCollateralByRatio(maker, IClearingHouseConfig(_clearingHouseConfig).getMmRatio()) < 0) || ...
9,454,016
//Address: 0x10a5f6dbd1f9e56fe09df25b1163cd299d5d2413 //Contract name: EthernautsExplore //Balance: 0.251 Ether //Verification Date: 4/24/2018 //Transacion Count: 727 // CODE STARTS HERE pragma solidity ^0.4.19; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Ethernauts con...
Assigns a new address to act as the COO. Only available to the current COO or CEO. _newCOO The address of the new COO
function setCOO(address _newCOO) external { require( msg.sender == ceoAddress || msg.sender == cooAddress ); require(_newCOO != address(0)); cooAddress = _newCOO; }
1,044,127
./partial_match/1/0x43c6eE9D5B2369C5484f69E2Eb3361466855beDd/sources/FabricaToken.sol
See {IERC1155-isApprovedForAll}./
function isApprovedForAll(address account, address operator) public view virtual override whenNotPaused returns (bool) { return _operatorApprovals[account][operator]; }
2,672,115
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; /** * todo create struct or contract for a mapping of addresses to byte32, for user account passwords! * libraries with internal functions have to function body injected into all callsites (this increases size an...
requireTrue(lhs.length > 0);requireTrue(lhs.length == rhs.length);
function or( bytes lhs, bytes rhs )internal pure returns( bytes memory ){ return lhs | rhs; }
12,960,342
// Sources flattened with hardhat v2.1.2 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ fun...
function funds the farm _farmAddress - function will operate on farm with this address _rewardToken - address of reward token _amount - funding the farm with this amount of tokens/ instance of erc20 contract approval of transaction
function _fundInternal( address _farmAddress, address _rewardToken, uint256 _amount ) internal { require( _farmAddress != address(0x0), "Farm's address can't be 0x0 address" ); IERC20 rewardToken = IERC20(_rewardToken); ...
11,958,851
./full_match/80001/0x93606Db8e1340eBa115633Cc8a031D379D7638C6/sources/contracts/dev/vendor/openzeppelin-solidity/v.4.8.0/contracts/utils/SafeCast.sol
Returns the downcasted int80 from int256, reverting on overflow (when the input is less than smallest int80 or greater than largest int80). Counterpart to Solidity's `int80` operator. Requirements: - input must fit into 80 bits _Available since v4.7._/
function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); require(downcasted == value, "SafeCast: value doesn't fit in 80 bits"); }
5,640,092
./full_match/1/0x46d9F045F60B1613bd4eC0D0eE2b3B47Cb6501d9/sources/src/TokenFactory.sol
checks if an upgrade is valid
function isValidUpgrade( address prevImpl, address newImpl ) external view returns (bool) { return upgrades[prevImpl][newImpl]; }
4,974,650
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; /* __________________________________ | | | $ + $ + $ + $ + $ + $ + $ + $ + $| |+ $ + $ + $ + $ + $ + $ + $ + $ + | | + $ + $ + $ + $ + $ + $ + $ + $ +| |$ + $ + $ + $ + $ + $ + $ + $ + $ | | $ + $ + $ + $ + $ + $ + $ + $ ...
Add a newly added token into managed list of tokens. tokenId Id of token to add./
function _addTokenToEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); }
9,978,709
./full_match/5/0xDd075Ee118E993A9C18806561635a5a74974F556/sources/project_/contracts/MetaWinnersDAC.sol
Overrides {BatchReveal._metadataIdsStartFromOne} to return True (when it does, revealed IDs will be offset and start from 1 - instead of 0)/
function _metadataIdsStartFromOne() internal pure override returns(bool){ return true; }
1,879,257
./full_match/8453/0xEF153cb7bfc04c657Cb7f582C7411556320098B9/sources/contracts/farm/SynthChef.sol
Pay or lockup pending Synth.
function payOrLockupPendingSynth(uint256 _pid) internal { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; if (user.nextHarvestUntil == 0 && block.timestamp >= startTimestamp) { user.nextHarvestUntil = block.timestamp + pool.harvestInte...
11,558,357
pragma solidity ^0.4.11; import "./Owned.sol"; contract CurrencyHedge is Owned { struct Hedge { address beneficiary; uint hedgeStart; // Seconds in Unix Epoch (since Jan 1, 1970) uint hedgeEnd; // Seconds in Unix Epoch bytes3 homeCurr; // Denoted with three letters (e.g. ...
recordTransaction: Add a transaction record to a particular hedge This should be verified outside of the contract. 'now' is an alias for block.timestamp, not current time
function recordTransaction(address _beneficiary, uint256 _index, uint64 _timeStamp, uint64 _txValue, uint64 _spotRate) public onlyOwner { require(allHedges[_index].hedgeEnd <= now); Transaction memory newTx = Transaction(_timeStamp, _txValue, _spotRate - allHedges[_index].refRate); allTx[_index].push(newTx)...
15,780,873
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; /** * Extremely simple, NOT FOR PRODUCTION, simulation for supply chain shipment notifications. * * The mock shipment scenario is that there are several shipping center locations registered as "suppliers". * Each supplier is registered by the authority t...
Get number of witnesses for a shipment and supplier/
function getSupplierWitnessCount(uint256 itemID, uint256 _supplierID) public view returns(uint256) { ShipmentTracking storage history = receivedShipments[itemID]; SupplierRecord storage rec = history.supplierRecords[_supplierID]; return rec.witnessCount; }
15,805,978
pragma solidity ^0.4.19; // /* CONTRACT */ contract SafeMath { function safeAdd(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function safeSub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function saf...
_________________________________________________________ seller limits check buyer limits check
function _slrByrLmtChk( address seller, uint amountTkns, uint priceOfr, address buyer) internal returns(bool success){ bool successSlrl; (successSlrl) = _chkSellerLmts( seller, amountTkns); bool successByrlAFinl; (successByrlAFinl) = _chkBuyerLmtsAndFinl( buyer, amountTkns,...
7,901,592
./partial_match/1/0x1A963Df363D01EEBB2816b366d61C917F20e1EbE/sources/src/CLMPriceOracle.sol
token_, the asset to be priced in terms of Canto return price, the price of the asset in terms of canto, in the case of failure, return 0
function getPriceNote(address token_, bool stable) internal view returns(uint) { erc20 token = erc20(token_); address pair; if (stable) { pair = getStablePair(token_); pair = getVolatilePair(note); } } else { uint price; if (pair == add...
2,594,950
// SPDX-License-Identifier: GPL-3.0 // Amended by HashLips /** !Disclaimer! These contracts have been used to create tutorials, and was created for the purpose to teach people how to create smart contracts on the blockchain. please review this code on your own before using any of the following ...
============================================================================= This will payout the owner 100% of the contract balance. Do not remove this otherwise you will not be able to withdraw the funds. ============================================================================= ==================================...
function withdraw() public payable onlyOwner { require(os); }
295,527
./full_match/80001/0x3c9f40E0C87b96E1B018B29622b4976e349CA19C/sources/contracts/Multisig.sol
Once a function has sufficient approvals, it needs to be signed before executed. transactionId the trx id of trx/ If it reaches the max approvals then automatically exectues the trx
function signTransaction(uint256 transactionId) public { require(transactionId < _transactions.length, "Invalid transaction ID"); Transaction storage transaction = _transactions[transactionId]; require(!transaction.executed, "Transaction already executed"); require(isOwner(msg.sender...
5,651,266
./partial_match/1/0x83C8E4e8b609BDd643b33D6f32fBD6E864fa64a2/sources/ProjectX.sol
Automatically removes tax and limits when renouncing contract. This makes it impossible to raise taxes from 0 just before renounce and bamboozle gamblers./ No need to update max tx / wallet because they are only check when `limited` is true.
function _renounceOwnership() internal override { _buyTax = 2; _saleTax = 4; limited = false; super._renounceOwnership(); }
15,936,316
./full_match/80001/0xd0674b72DEC23984526f9C502EDD91bb8b0317a1/sources/project:/src/contracts/Land.sol
Public View Functions
function getBuildings() public view returns (Building[] memory) { return buildings; }
841,728
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; contract xCVP is ERC20("", "") { u...
Burn xCVP token to withdraw CVP _share xCVP amount to burn return cvpSent The sent CVP amount/
function leave(uint256 _share) external returns (uint256 cvpSent) { uint256 totalShares = totalSupply(); cvpSent = _share.mul(cvp.balanceOf(address(this))).div(totalShares); _burn(msg.sender, _share); cvp.safeTransfer(msg.sender, cvpSent); }
1,008,658
./full_match/80001/0xDa21C3277F08773b124165632bf5FFd1651fd710/sources/contracts/proxy/ERC1155DaoProxy.sol
returns the fixed price status of the tokens. Signature for isOpenForFixedPrice(uint256,uint256) : `0x0ad0b958` tokenId id of the token. serialNo serial Number of the token. return fixed price status of the tokens./
function isOpenForFixedPrice( uint256 tokenId, uint256 serialNo ) public view returns (bool) { return _erc1155dao.getTokenBearer(tokenId, serialNo).fixedOrAuction == 1; }
9,494,929
./full_match/1/0x8E4Fc8F0d8895Adc6DC20bDc152e0B99364d9B26/sources/contracts/ohdatExchange.sol
TODO add tip. payable(address(owner)).transfer(totalPrice);
function unpause() public { require(hasRole(PAUSER_ROLE, msg.sender)); _unpause(); uint256[] memory mintNftTokenIds; require(_amount > 0,"The purchase amount of NFT must be more than 0!"); require(_amount <= 100,"The purchase amount of NFT must be less than 100!"); require(nftTokenId...
4,817,648
./full_match/80001/0xfc43C00168D257455be403f2cB206eD0b6A80F4D/sources/contracts/StakingApl.sol
require(addressStaked[_msgSender()] == true, "You are not participated");
function claimReward(uint256 stakeId) external returns (bool){ require(stakeInfos[stakeId].endTS < block.timestamp, "Stake Time is not over yet"); require(stakeInfos[stakeId].claimed == 0, "Already claimed"); uint256 stakeAmount = stakeInfos[stakeId].amount; uint8 rates = stakeInfos...
5,619,268
pragma solidity ^0.5.17; import "./Staking/SafeMath96.sol"; import "../openzeppelin/SafeMath.sol"; import "../openzeppelin/SafeERC20.sol"; import "./IFeeSharingProxy.sol"; import "./Staking/IStaking.sol"; contract FeeSharingProxy is SafeMath96, IFeeSharingProxy { using SafeMath for uint256; using SafeERC20 for IERC...
withdraw accumulated fee the message sender _loanPoolToken address of the pool token _maxCheckpoints maximum number of checkpoints to be processed _receiver the receiver of tokens or msg.sender /prevents processing all checkpoints because of block gas limit
function withdraw( address _loanPoolToken, uint32 _maxCheckpoints, address _receiver ) public { require(_maxCheckpoints > 0, "FeeSharingProxy::withdraw: _maxCheckpoints should be positive"); address user = msg.sender; if (_receiver == address(0)) { _receiver = msg.sender; } uint256 amount; uint...
7,285,472
./full_match/1/0x635C30A7A4C7F354Bd8ec3F6B1a79424F6040Dc7/sources/Napkin.sol
Enable or disable internal swaps Set "true" to enable internal swaps for trreasury
function setSwapEnabled(bool _enabled) external onlyOwner { swapEnabled = _enabled; }
8,345,507
./partial_match/1/0x11B23B2c7CcDf916B489323B814AdD16f82e510D/sources/PlanetStakingPool.sol
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "OwnershipManager: new owner is the zero address" ); _transferOwnership(newOwner); }
4,400,380
./full_match/1/0xC0eaA22Fdff044F38B79624D65F4eB68c7238703/sources/scripts/Campaign.sol
Initialize a new campaign. - Access control: External. Can only be called by the factory contract./
function initialize ( address _token, address _campaignOwner, uint256[4] calldata _stats, uint256[4] calldata _dates, uint256[3] calldata _liquidity, bool _burnUnSold, uint256 _tokenLockTime, uint256[6] calldata _tierWeights, uint256[6] cal...
3,183,377
./partial_match/1/0x1c288F6efc68b984D7A26Aba3Cdfd0C144517C70/sources/PEPEPUTIN.sol
OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); ...
4,380,316
./full_match/4/0x3ca5b514BEba80F20ebaf37293f442537bD7B5E1/sources/Benz/Bugatti.sol
SPDX-License-Identifier: Unlicensed
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint...
721,380
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/src/interfaces/IERC1155.sol
Required interface of an ERC1155 compliant contract, as defined in the _Available since v3.1._/
interface IERC1155 is IERC165 { event TransferSingle( address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value ); event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ...
8,451,474
pragma solidity ^0.4.24; import "../math/SafeMath.sol"; /** * @title SplitPayment * @dev This contract can be used when payments need to be received by a group * of people and split proportionately to some number of shares they own. */ contract SplitPayment { using SafeMath for uint256; uint256 private tota...
Release one of the payee's proportional payment. _payee Whose payments will be released./
function release(address _payee) public { require(shares_[_payee] > 0); uint256 totalReceived = address(this).balance.add(totalReleased_); uint256 payment = totalReceived.mul( shares_[_payee]).div( totalShares_).sub( released_[_payee] ); require(payment != 0); assert(...
13,046,277
pragma solidity ^0.5.8; // Importing OpenZeppelin's SafeMath Implementation import 'https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol'; contract TheCrowdChain { using SafeMath for uint256; Cause[] private causes; event CauseCreated( address causeAddress, ad...
Function to create a new cause /creating an object for cause contractpush in causes array created earlieremit CauseCreated event
function startCause(string calldata title, string calldata cause_type, string calldata description, uint goal) external{ Cause newCauses = new Cause(msg.sender, title, cause_type, description, goal); causes.push(newCauses); emit CauseCreated( address(newCauses), msg...
6,416,015
// Copyright 2021 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 ...
allows for the pool to act on its own behalf when producing blocks. pool needs to be both user and worker
function selfhire() external payable override { workerManager.authorize(address(this), address(pos)); workerManager.acceptJob(); payable(msg.sender).transfer(msg.value); }
2,576,919
pragma solidity ^0.5.7; // ------------------------------------------------------------------------ // Math library // ------------------------------------------------------------------------ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256){ uint256 c = a * b; assert...
------------------------------------------------------------------------ This mapping saves a block of code written out twice ------------------------------------------------------------------------
function _returnPageOfContent(string memory pageItem1, string memory pageItem2, string memory pageItem3, string memory pageItem4, string memory pageItem5, string memory pageItem6) internal pure returns(string memory,string memory,string memory,string memory,string memory,string memory) { return(pag...
6,403,621
./full_match/1/0xaBcf18BF1937e3d7Bac7Ac743b7829aD6aD6D2ca/sources/contracts/helpers/OwnableUpgradeable.sol
Initializes the contract setting the deployer as the initial owner./
function __Ownable_init(address _ownerOnInit) internal onlyInitializing { __Ownable_init_unchained(_ownerOnInit); }
17,053,634
./full_match/44787/0x08822Da015207E89647c4F0B5C0132c61f2C7733/sources/project_/contracts/UnergyLogicOperation.sol
Scaled value by 1e6;
function invoiceReport( address _projectAddr, uint256 income, uint256 _energyDelta, uint256 _energyTariff, uint256 _depreciationPercentage ) internal { DataStructure.Project memory project = unergyData.getProject(_projectAddr); DataStru...
13,270,996
pragma solidity ^0.4.23; import "../IDaoBase.sol"; import "./IProposal.sol"; import "../utils/UtilsLib.sol"; import "../tokens/StdDaoToken.sol"; library VotingLib { event Voted(address _who, bool _yes); event CallAction(); event DelegatedTo(address _sender, uint _tokensAmount); event DelegationRemoved(address _f...
store storage instance address _voter voter _isYes vote vote function/
function libVote(VotingStorage storage store, address _voter, bool _isYes) public { require(!isFinished(store)); require(!store.voted[msg.sender]); if(VotingType.Voting1p1v==store.votingType) { require(store.daoBase.isGroupMember(store.groupName, _voter)); } store.votes[store.votesCount] = Vote(_voter, ...
7,264,734
pragma solidity ^0.4.25; /** * @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...
Adds the owner role to provided address Requires owner role to interact _who is address to add role return A boolean that indicates if the operation was successful.
function addOwner(address _who) public onlyOwner returns (bool) { _setOwner(_who, true); }
1,465,550
pragma solidity ^0.4.18; // File: contracts/zeppelin-solidity-1.4/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 owne...
allows maxContribution to be modified
function setMaxContribution(uint256 _newMaxContribution) onlyOwner public { maxContribution = _newMaxContribution; }
12,589,090
./full_match/5/0x998bf0Eb2ee683020eC906FAF16f81Fc22641435/sources/contracts/core/connext/helpers/OZERC20.sol
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `_spender` cannot be the zero address. - `_spender` must hav...
function decreaseAllowance(address _spender, uint256 _subtractedValue) public virtual returns (bool) { _approve( msg.sender, _spender, allowances[msg.sender][_spender].sub(_subtractedValue, "ERC20: decreased allowance below zero") ); return true; }
1,904,030
./full_match/1/0xBc5FbB45A2bbB64d9B2EeBFa327284a35d5C5865/sources/src/SignedMintAuthorizer.sol
@inheritdoc IAuthorizeMints reverts when signature is not valid or recovered signer is not trustedtodo consider using an ERC712 typed signature here signedAuthorization contains encoded SignedMintAuthorization that a trusted signer has agreed upon
function authorizeMint(address minter, address to, bytes memory signedAuthorization) external view override returns (bool) { SignedMintAuthorization memory auth = abi.decode(signedAuthorization, (SignedMintAuthorization)); bytes32 signedHash = ECDSA.toEthSignedMessageHash(keccak256(abi.encodePacked...
16,402,622
// SPDX-License-Identifier: GPL-3.0-or-later // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() ex...
Burns tokens and sells Dai proceedings for fyDai. Pays as much debt as possible, then sells back any remaining fyDai for Dai. Then returns all Dai, and if there is no debt in the Controller, all posted Chai. Caller must have approved the proxy using`controller.addDelegate(yieldProxy)` and `pool.addDelegate(yieldProxy)`...
function removeLiquidityEarlyDaiPool(IPool pool, uint256 poolTokens, uint256 minimumDaiPrice, uint256 minimumFYDaiPrice) public { onlyKnownPool(pool); IFYDai fyDai = pool.fyDai(); uint256 maturity = fyDai.maturity(); (uint256 daiObtained, uint256 fyDaiObtained) = pool.burn(msg.sende...
2,125,898
./partial_match/1/0x59BC239cAb00CADd9b14f299835ae39E8B4B569c/sources/contracts/protocol/libraries/configuration/ReserveConfiguration.sol
Gets the stable rate borrowing state of the reserve self The reserve configuration return The stable rate borrowing state/
function getStableRateBorrowingEnabled( DataTypes.ReserveConfigurationMap storage self ) internal view returns (bool) { return (self.data & ~STABLE_BORROWING_MASK) != 0; }
15,931,728
./partial_match/1/0x1E3A682f5f9BDD87b88D28dc2eC9EDE002bfE95e/sources/vnxManager.sol
Retrieve the number of roles in the contract./
function totalRoles() external view returns(uint256) { return roles.length; }
3,979,000
./full_match/43113/0x9fc79C0e6c0175F2637D4E1371655C5b444b8Bde/sources/contracts/ERC721PresetMinterPauserAutoId_flat.sol
See {IERC721-balanceOf}./
function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), 'ERC721: balance query for the zero address'); return _holderTokens[owner].length(); }
7,134,679
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the am...
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 batch, uint256 pid) public { require(batch < batchInfo.length, "batch must exist"); require(pid < poolInfo[batch].length, "pool must exist"); PoolInfo storage pool = poolInfo[batch][pid]; UserInfo storage user = userInfo[batch][pid][msg.sender]; pool.stakingToke...
6,263,501
./full_match/11155111/0x311948178664d36A80e5C2248dB2d2b7ab4B525D/sources/project_/contracts/HashStorage.sol
Get the friendly name for a network _notary address of the account who saved the network _networkID network id return networkFriendlyName friendly name for the network
function getNetworkFriendlyName(address _notary, bytes32 _networkID) external view returns (string memory networkFriendlyName) { return networkFriendlyNames[getNetworkUID(_notary, _networkID)]; }
3,791,666
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@o...
Decrease length of a spiral Solidity 0.8.0 does the overflow check here automatically
function addLengthToSpiral(uint256 tokenId, uint256 addLength) external { require(msg.sender == spiralBitsContract, "CantCall"); require(spiralLengths[tokenId] > 0, "NoID"); require(spiralLengths[tokenId] + addLength < 10000000, "CantAdd"); spiralLengths[tokenId] = spiralLengths[tokenId] + addLength;...
1,006,495
./partial_match/42/0x1550D3ac7dc80d1aE1a87eC2b85e08f9FdBb3EcA/sources/Locks.sol
Extend Rent Time if Box is known : function override
function extendRentTime(string memory boxId) private{ Box storage box = boxes[boxId]; if(box.owner == msg.sender){ uint time = coutRentTime(msg.value); if(time > 0) box.timePeriod = box.timePeriod + time; else{ revert("Ammount ...
9,069,963
./full_match/80001/0x2f40a1f04be1a7d87e3651AD23F62B97B14D9C57/sources/contracts/Polyverse.sol
"0+3+Hooray! ", msg.sender, " sent ", token amount, " PUSH to you!" We are passing identity here: https:docs.epns.io/developers/developer-guides/sending-notifications/advanced/notification-payload-types/identity/payload-identity-implementations
function purchaseTicket(uint256 eventId) public payable { Event storage eventDetails = _events[eventId]; require(msg.value >= eventDetails.ticketPrice, "Not enough amount"); require( eventDetails.participants.length < eventDetails.maxParticipants, "Full event" ...
5,586,619
./partial_match/1/0xf9539C6e9Cdd31D2c5eF02052dA2DdF9C1bee757/sources/src/core/vaults/BaseVault.sol
Deposits the `asset` from msg.sender added to `creditor`'s deposit _amount is the amount of primary asset to deposit _creditor is the address that can claim/withdraw deposited amount/ pulling all collaterals from msg.sender An approve() by the msg.sender is required for all collaterals beforehand
function depositFor(uint256 _amount, address _creditor) external nonReentrant { if (_creditor == address(0)) _creditor = msg.sender; uint256 currentRound = _depositFor(_amount, _creditor); uint256[] memory amounts = _transferAssets(_amount, address(this), currentRound); emit Depos...
15,544,335
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "ERC721Enumerable.sol"; import "SafeMath.sol"; import "Counters.sol"; import "Ownable.sol"; import "Pausable.sol"; import "BPC.sol"; import "BPCSenderRecipient.sol"; import "ExternalFuncs.sol"; contract BPCLottery is ERC721, ERC777SenderRecipientMock, Ow...
Convert signed 64.64 fixed point number into signed 128.128 fixed point number. x signed 64.64-bit fixed point number return signed 128.128 fixed point number/
function to128x128(int128 x) internal pure returns (int256) { unchecked { return int256(x) << 64; } }
154,138
./partial_match/1/0xA472FcA97F969F656EC6928578106be7936CBD10/sources/contracts/MultiplierProxy.sol
setter to set the position of an implementation from the implementation position onwards
function _setImplementation(address _newImplementation) internal { require(msg.sender == proxyOwner()); bytes32 position = implementationPosition; assembly { sstore(position, _newImplementation) } }
9,177,791
./partial_match/1/0x80D186B4C786Ea66592b2c52e2004AB10CfE4CF3/sources/Lynx.sol
Set an Address as LP _lpAddress Address to set as LP _isLpAddress enable or disable address as an LP/
function setLpAddress( address _lpAddress, bool _isLpAddress ) external onlyOwner { isLpAddress[_lpAddress] = _isLpAddress; isDividendExempt[_lpAddress] = _isLpAddress; emit SetAddressAsLp(_lpAddress, _isLpAddress); }
2,861,743
./full_match/80001/0x6D1C8963dac5a0Fb42bbCb709cAe14dab9A3b5D8/sources/StakeManager2.sol
@inheritdoc IStakeManager/
function unstakeV2( address validator, Token.Type token, uint256 amount ) external validatorExists(validator) stakerExists(msg.sender) onlyNotLastBlock { Staker storage _staker = stakers[msg.sender]; amount = _staker.unstake(environment, validators[validator], token, amo...
860,713
./partial_match/42/0x8cDBd716d307eAaDdbc808A67bdaD90602C82978/sources/PaymentGateway.sol
Sender account claim the amount from the escorw when the payment expires senderId The sender unique ID generated by EPN destinationId The destination unique ID generated by EPN/
function refundEthAmount(uint256 senderId, uint256 destinationId) public { require (senderId != 0 && senderId != destinationId); require(epnToken.isRegistered(senderId) && epnToken.getOwnerOf(senderId) == msg.sender); uint256 mappingId = getUniqueId(senderId, destinationId); EscrowPa...
3,377,680
pragma solidity ^0.4.11; import './IProposal.sol'; import './Owned.sol'; /** A Proposal interface involving approval by one or more members. */ contract IMemberProposal is IProposal, Owned { mapping(address => bool) approvals; /** Returns whether the given member has approved the proposal. */ function isAppro...
Approves the proposal by the sender. /
function approve() public { approvals[msg.sender] = true; }
12,720,111
pragma solidity ^0.5.10; // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(...
Destroy this contract and recover any ether to the owner./
function destroy() public onlyOwner { selfdestruct(msg.sender); }
882,543
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 ch...
Sets the necessary permissions for a user to destroy tokens from a blacklisted account. _who The address of the account that we are setting permissions for./
function setBlacklistDestroyer(address _who) public onlyValidator { require(isPermission(DESTROY_BLACKLISTED_TOKENS_SIG), "Blacklist token destruction not supported by token"); setUserPermission(_who, DESTROY_BLACKLISTED_TOKENS_SIG); emit LogSetBlacklistDestroyer(_who); }
1,020,251
./full_match/80001/0xd18F4BcaF88c19570EaFb9376207ade8803BefC7/sources/_rarible/meta-tx/contracts/EIP712MetaTransaction.sol
Append userAddress at the end to extract it from calling context
(bool success, bytes memory returnData) = address(this).call(abi.encodePacked(functionSignature, userAddress)); require(success, "Function call not successful"); emit MetaTransactionExecuted(userAddress, msg.sender, functionSignature); return returnData; } function hashMetaTran...
863,887
pragma solidity 0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer...
returns the priority of the given orderID. The priority is the index of the order in the orderbook.
function orderPriority(bytes32 _orderID) external view returns (uint256) { return orders[_orderID].priority; }
1,044,490