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/97/0xD013d3E87ddb6100C51814e01992C80807e4dCBc/sources/project_/contracts/staking/TokenStaker.sol
Withdraw tokens from TokenStaker.
function withdraw(uint256 pid, uint256 amount) external stakingStarted(pid) { PoolInfo storage poolInfo = _poolInfo[pid]; UserInfo storage userInfo = _userInfo[pid][msg.sender]; require(userInfo.amount >= amount, "TokenStaker: insufficient balance"); _updatePool(pid); uint256...
3,272,060
// SPDX-License-Identifier: Apache-2.0 /* Modifications Copyright 2022 Element.Market Copyright 2021 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.or...
Matches a pair of complementary orders that have a non-negative spread. Each order is filled at their respective price, and the matcher receives a profit denominated in the ERC20 token. sellOrder Order selling an ERC1155 asset. buyOrder Order buying an ERC1155 asset. sellOrderSignature Signature for t...
function matchSharedERC1155Orders( LibNFTOrder.ERC1155SellOrder memory sellOrder, LibNFTOrder.ERC1155BuyOrder memory buyOrder, LibSignature.Signature memory sellOrderSignature, LibSignature.Signature memory buyOrderSignature ) public override returns (uint...
6,264,057
// Based on https://github.com/HausDAO/Molochv2.1 // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; // import "hardhat/console.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * availabl...
Make the proposal fail if the new total number of shares and loot exceeds the limit PROPOSAL PASSED if the proposal tribute is the first tokens of its kind to make it into the guild bank, increment total guild bank tokens
function processProposal(uint256 proposalIndex) public nonReentrant { _validateProposalForProcessing(proposalIndex); uint256 proposalId = proposalQueue[proposalIndex]; Proposal storage proposal = proposals[proposalId]; require( !proposal.flags[4] && !proposal.flags[5], ...
32,963
/* Copyright 2019 Wanchain Foundation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
request exchange RC20 token with WRC20 on wanchain xHash hash of HTLC random number smgID ID of storeman tokenPairID token pair ID of cross chain token value exchange value userAccount account...
function userBurnLock(bytes32 xHash, bytes32 smgID, uint tokenPairID, uint value, bytes userAccount) external payable notHalted nonReentrant onlyReadySmg(smgID) onlyMeaningfulValue(value) { HTLCBurnLib.HTLCUserBurnLockParams memory params = HTLCBurnLib.HTL...
1,814,134
//Address: 0x621ad3562f5141c4a0e7cad958b8b524d356332b //Contract name: SaleAuction //Balance: 0 Ether //Verification Date: 1/28/2018 //Transacion Count: 39 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control ...
Returns the current price of an auction. _deedId The identifier of the deed to get the currency price for. The auction must be active.
function getCurrentPrice(uint256 _deedId) external view returns (uint256) { Auction storage auction = identifierToAuction[_deedId]; require(_activeAuction(auction)); return _currentPrice(auction); }
1,772,251
// File: contracts/lib/ERC20.sol pragma solidity ^0.4.24; /** * @title ERC20 * @dev A standard interface for tokens. * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md */ contract ERC20 { /// @dev Returns the total token supply function totalSupply() public view returns (u...
_giverId The adminId of the liquidPledging pledge admin who is donating _receiverId The adminId of the liquidPledging pledge admin receiving the donation/ Store a registry of fundForwarders as events
function newFundsForwarder(uint64 _giverId, uint64 _receiverId) public { address fundsForwarder = _deployMinimal(childImplementation); FundsForwarder(fundsForwarder).initialize(_giverId, _receiverId); emit NewFundForwarder(_giverId, _receiverId, fundsForwarder); }
2,572,930
./partial_match/1/0x645BA45dBe3c6942c812A46f9EE8115C89B524EC/sources/VersionManager.sol
IModuleRegistry Interface for the registry of authorised modules./
interface IModuleRegistry { function registerModule(address _module, bytes32 _name) external; function deregisterModule(address _module) external; function registerUpgrader(address _upgrader, bytes32 _name) external; function deregisterUpgrader(address _upgrader) external; function recoverToken(addr...
11,030,946
pragma solidity ^0.4.24; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "../contracts/CircuitBreakable.sol"; import "../contracts/oraclizeAPI.sol"; /// @title LibraryDemo - This Dapp maintains employee salary database and calculated bonus /// ...
add employee _empId Employee Id _salary salary return return successful addition
function addEmployee(uint256 _empId, uint256 _salary) onlyOwner stopInEmergency public returns(bool) { return true; }
5,467,446
// File: @openzeppelin/upgrades/contracts/Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Withdraw ETH to the owner's account./
function withdrawETH(address payable _to, uint256 _withdrawalAmount) external nonReentrant onlyWhitelisted { uint256 ethBalance = address(this).balance; require(ethBalance >= _withdrawalAmount, "Withdrawal amount is too high"); require(this.isWhitelistAdmin(_to), "You can onl...
7,692,780
/** *Submitted for verification at Etherscan.io on 2021-07-19 */ /// // GasBack Technology // https://gasback.tech/ // // SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * tha...
Update reward variables of the given pool to be up-to-date. Added to set recent latestGasPrice
function updatePool(uint256 _pid) public { latestGasPrice = tx.gasprice; PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0 || pool.allo...
2,179,022
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; import {ERC20} from "@rari-capital/solmate/src/tokens/ERC20.sol"; import {SafeTransferLib} from "@rari-capital/solmate/src/utils/SafeTransferLib.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IAaveV2StablecoinCellar} fro...
Stops the contract - this is irreversible. Should only be used in an emergency, for example an irreversible accounting bug or an exploit./ Ensure contract is not paused. Withdraw everything from Aave. The check is necessary to prevent a revert happening if we try to withdraw from Aave without any assets entered...
function shutdown() external onlyOwner { if (isShutdown) revert AlreadyShutdown(); isShutdown = true; isPaused = false; if (activeAssets() > 0) _withdrawFromAave(address(asset), type(uint256).max); emit Shutdown(); }
265,758
pragma solidity ^ 0.4.24; /*** * __ __ ___ ___ ___ * \ \ / / / _ \ | _ \ / _ \ * \ V / | (_) | | _/ | (_) | * _|_|_ \___/ _|_|_ \___/ * _| """ |_|"""""|_| """ |_|"""""| * "`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' * * https://a21.app */ in...
might overflow? I wish as well, however, at that time no one can afford the fee.
function getTicketPrice(uint8 _profitOfManager) view public returns(uint256){ return fee * _profitOfManager; }
5,449,830
./full_match/5/0x966471ABb6Afe5CC543f2714C443d9f072369078/sources/src/token/ERC1155/base/ERC1155BaseInternal.sol
wrap given element in array of length 1 element element to wrap return singleton array/
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; }
1,890,164
pragma solidity ^0.5.17; import "./ReentrancyGuard.sol"; import "../Escapable.sol"; import "../../../registry/AdminRole.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract TokenBank is R...
Move all tokens to the VAULT account.
function storeAllInVault() external onlyAdmin nonReentrant { address[] memory accs = _getAccounts(); for (uint256 i = 0; i < accs.length; ++i) { address acc = accs[i]; uint256 bal = tokenBalances[acc]; _internalTransfer(acc, VAULT, bal); emit StoredIn...
6,461,281
./full_match/11155111/0x030a616cBC1F4A759AAfc955Be24d935d0A67a0C/sources/contracts/GameFactory.sol
require(block.timestamp > lotteries[_id].endTime, "Lottery is not over");require(openLotteries.length > 0, "There are no lotteries to close");
function closeGame(uint256 _id) external onlyOwner { require(games[_id].status == Status.Open, "Lottery is not open"); uint32 callbackGasLimit; uint256 requestId; games[_id].status = Status.Closed; callbackGasLimit = games[_id].callbackGasLimit; requestId = requestRa...
3,814,898
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * @title iOVM_L2ToL1MessagePasser */ interface iOVM_L2ToL1MessagePasser { /********** * Events * **********/ event L2ToL1Message(uint256 _nonce, address _sender, bytes _data); /******************** * Public Functions * ****...
iOVM_L2ToL1MessagePasser/
interface iOVM_L2ToL1MessagePasser { event L2ToL1Message(uint256 _nonce, address _sender, bytes _data); function passMessageToL1(bytes calldata _message) external; pragma solidity ^0.8.9; }
14,104,288
./full_match/80001/0x58c87A63fe29E3bA8b704DB0017cC00B7BFc749a/sources/_openzeppelin/contracts/token/ERC20/ERC20.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: tra...
861,851
./full_match/1/0x666D080bD673679b927B7006bDbDF50925f27D9F/sources/contracts/MIRLStaking.sol
Deposit LP tokens to MirlStaking for MIRL allocation. pid The index of the pool. See `poolInfo`. amount LP token amount to deposit. Effects Interactions lpToken[pid].safeTransferFrom(msg.sender, amount);
function deposit(uint256 pid, uint256 amount) public { require(pid < poolInfo.length, 'pool id is not existed'); PoolInfo memory pool = updatePool(pid); UserInfo storage user = userInfo[pid][msg.sender]; user.amount = user.amount.add(amount); user.rewardDebt = user.rewardDebt.add(int256(amount.mu...
9,625,481
//SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "./HugoNFTAbstractImpl.sol"; /** * @author SabaunT https://github.com/SabaunT. * @dev Management for attributes, traits and CIDs - all are named as meta-data. */ abstract contract HugoNFTMetadataManager is HugoNFTAbstractImpl { event AddNewAttribute...
Updates attribute's CID. Emits: 1. {HugoNFTMetadataManager-UpdateAttributeCID}. Requirements: - `attributeId` should have an id of existent attribute - `ipfsCID` should have length of {HugoNFTStorage-IPFS_CID_BYTES_LENGTH}. - `msg.sender` should have {HugoNFTStorage-NFT_ADMIN} role/
function updateAttributeCID(uint256 attributeId, string memory ipfsCID) public override(AbstractHugoNFT) onlyRole(NFT_ADMIN_ROLE) { require(attributeId < currentAttributesAmount, "HugoNFT::invalid attribute id"); require( bytes(ipfsCID).length == IPFS_CID_BYTE...
12,610,228
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_A...
approve to Conversion Pool redeem from Conversion Pool
function redeemAUsdcFromConversionPool(uint256 amount_ausdc) external onlyRole(BACKEND_ADMIN_ROLE) whenNotPaused { require( aUsdcToken.balanceOf(address(this)) >= amount_ausdc, "Vault: Contract does not have enough balance of aUSDC." ); aU...
14,868,743
/** *Submitted for verification at Etherscan.io on 2021-07-11 */ // File: @openzeppelin/contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract...
Holds the last known link to the "head" with the latest signers. The signing pages form a sort of linked list where the latest one has the link of the previous. To ensure that the linked list of signer versions is the right one, set the latest one here. Then the blockchain history can be used to verify that the linked ...
function setLatestSignersLink(string memory _link, uint256 _tokenId) public whenNotPaused { require(_isApprovedOrOwner(msg.sender, _tokenId), "Only owner or approved address can modify."); signersLink[_tokenId] = _link; emit SignersLinkSet(block.timestamp, _link, msg.sender, _tokenId); }...
2,172,462
// File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually...
Creates a new virtual chain the virtual chain tier and rate are determined by the contract the contract calls the subscription contract that stores the virtual chain data and allocates a virtual chain ID the msg.sender that created the virtual chain is set as the initial virtual chain owner the initial amount paid ...
function createVC(string calldata name, uint256 amount, bool isCertified, string calldata deploymentSubset) external { require(amount > 0, "must include funds"); ISubscriptions subs = ISubscriptions(getSubscriptionsContract()); require(erc20.transferFrom(msg.sender, address(this), amount), ...
173,692
pragma solidity 0.5.17; import "./CErc20Immutable.sol"; import "./CEther.sol"; import "./ErrorReporter.sol"; import "./EIP20Interface.sol"; import "./Strings.sol"; import "./TriggerInterface.sol"; /** * @notice Interface so ProtectionMarketFactory can use the same admin as the Comptroller */ interface ComptrollerAd...
accrues interest and updates the interest rate model using _setInterestRateModelFresh Admin function to accrue interest and update the interest rate model newInterestRateModel the new interest rate model to use return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ accrueInterest emits logs o...
function _setInterestRateModel(InterestRateModel newInterestRateModel) external returns (uint256) { uint256 error = accrueInterest(); if (error != uint256(Error.NO_ERROR)) { return fail(Error(error), FailureInfo.SET_INTEREST_RATE_MODEL_ACCRUE_INTEREST_FAILED); } }
14,760,618
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functi...
Constructor function to initialize the initial supply of token to the creator of the contract/Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator transferring 18% of the tokens to team Address transferring 1% of the tokens to advisors Address trans...
function EthereumTravelToken( address wallet, uint supply, string nam, string symb ) public { owner = wallet; totalSupply = supply; name = nam; symbol = symb; balances[wallet] = totalSupply; TeamAddre...
14,559,375
pragma solidity ^0.4.23; contract ERC20 { .. } pragma solidity ^0.4.23; import "./math/SafeMath.sol"; contract ERC20 { using SafeMath for uint256; } // Total number of tokens in existence uint256 totalSupply_; pragma solidity ^0.4.23; import "./math/SafeMath.sol"; contract ERC20 { using SafeMath for ...
Gets the balance of the specified address. _owner The address to query the the balance of. return An uint256 representing the amount owned by the passed address./
function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; }
12,868,429
// A life-log, done for Charlyn Greeff, born 18 April 2016 @ 15h30 (1460993400) // Mother: Mirana Hotz, 16 December 1977 (251078400) // Father: Jaco Greeff, 11 June 1973 (108604800) // // version: 1.0.0 // source: https://github.com/jacogr/ethcontracts/tree/master/src/LifeLog contract CharlyLifeLog { // allow ...
withdraw funds as/when needed the maximum we are allowed to take out right now see that we are in range and the timing matches send and throw if not ok
function withdraw(uint amount) public isOnWhitelist { uint max = this.balance / MAX_WITHDRAW_DIV; if (amount > max || now < nextWithdrawal) { throw; } totalWithdrawn += amount; if (!msg.sender.send(amount)) { throw; } }
5,469,891
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./PoolTokensContainer.sol"; import "./LiquidityPoolV2ConverterCustomFactory.sol"; import "../../LiquidityPoolConverter.sol"; import "../../interfaces/IConverterFactory.sol"; import "../../../utility/interfaces/IPriceOracle.sol"; ...
creates the converter's pool tokens note that technically pool tokens can be created on deployment but gas limit might get too high for a block, so creating them on first activation/
function createPoolTokens() internal { IPoolTokensContainer container = IPoolTokensContainer(address(anchor)); ISmartToken[] memory poolTokens = container.poolTokens(); bool initialSetup = poolTokens.length == 0; uint256 reserveCount = reserveTokens.length; for (uint256 i = ...
1,066,825
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0-solc-0.7/contracts/utils/EnumerableSet.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; ...
inject NONSTANDARD NAMING
function GETROLEMEMBER894(bytes32 role, uint256 index) public view returns (address) {
5,351,532
./full_match/3/0xcd8b28F7ED4f291bC69435dE1c8bcC39877F96F0/sources/home/jenja/NFT_ERC-721/contracts/STBU_Token.sol
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _amount uint256 the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint256 _amount) public override returns (bool success) { require(_from != msg.sender, "Cannot transfer from self, use transfer function instead"); require(_from != address(this) && _to != address(this), "Cannot transfer from or to Contract"); require(_to ...
8,268,694
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "./ActionGuards.sol"; import "../../internal/nToken/nTokenHandler.sol"; import "../../internal/nToken/nTokenSupply.sol"; import "../../internal/nToken/nTokenCalculations.sol"; import "../../internal/markets/AssetRate.sol"; impo...
Get the number of tokens `spender` is approved to spend on behalf of `account` currencyId Currency id of the nToken account tokenHolder The address of the account holding the funds spender The address of the account spending the funds return The number of tokens approved The specific allowance overrides the blanket ...
function nTokenTransferAllowance( uint16 currencyId, address tokenHolder, address spender ) external view override returns (uint256) { uint256 allowance = nTokenAllowance[tokenHolder][spender][currencyId]; if (allowance > 0) { return allowance; ret...
10,315,706
./full_match/97/0x1D1bB1B8e428661F8a5F8549987331F12729150e/sources/project_/contracts/ERC20Farm.sol
Calculates number of blocks to pay reward for. _from: Starting block _to: Ending block return Number of blocks, that should be rewarded/
function _getMultiplier(uint256 _from, uint256 _to) private view returns (uint256) { uint256 finalBlock = getFinalBlockNumber(); if (_to <= finalBlock) { return _to - _from; return 0; return finalBlock - _from; } }
5,028,265
./partial_match/1/0x486Ae5A2df309Cbd7f86b6EaCF81f607e79c6128/sources/contracts/interfaces/IFarmingPod.sol
View functions User functions Owner functions Distributor functions
interface IFarmingPod is IPod { event FarmCreated(address token, address reward); event DistributorChanged(address oldDistributor, address newDistributor); event RewardAdded(uint256 reward, uint256 duration); function totalSupply() external view returns(uint256); function distributor() external vie...
16,161,544
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./BondDepositoryLib.sol"; import "./Facet.sol"; // import "har...
initializes bond parameters/ TODO: Remove >= into ==
function initializeBondTerms( uint256 _controlVariable, uint256 _minimumPrice, uint256 _maxPayout, uint256 _fee, uint256 _maxDebt, uint256 _initialDebt, uint256 _vestingTerm, bool _isLiquidityBond, address _priceFeed, address _principle...
15,796,130
//SPDX-License-Identifier: ISC pragma solidity 0.7.6; pragma experimental ABIEncoderV2; // Libraries import "./synthetix/SafeDecimalMath.sol"; import "./synthetix/SignedSafeDecimalMath.sol"; // Inherited import "@openzeppelin/contracts/access/Ownable.sol"; // Interfaces import "@openzeppelin/contracts/token/ERC20/IE...
Get the current cached global netDelta value./
function getGlobalNetDelta() external view override returns (int) { return globalCache.netDelta; }
913,003
./full_match/5/0x6022eFfDd18125A83cccd0B9D59017a3e392580D/sources/contracts/TheGardens.sol
getBeeMintingData: Function to get the bee NFT minting data for a minter. This function is public and can be called by anyone. return honeySaleMinted uint8 - The number of bee NFTs minted by the minter during the Honeylist sale. return pollenSaleMinted uint8 - The number of bee NFTs minted by the minter durin...
function getBeeMintingData() public view returns (uint8 honeySaleMinted, uint8 pollenSaleMinted) { uint8 _mintingData = mintingData[msg.sender]; honeySaleMinted = uint8(_mintingData & 0x0F); pollenSaleMinted = uint8((_mintingData & 0xF0) >> 4); }
7,039,098
pragma solidity ^0.4.15; /** * @title Ownership interface * * Perminent ownership * * #created 01/10/2017 * #author Frank Bonnet */ contract IOwnership { /** * Returns true if `_account` is the current owner * * @param _account The address to test against */ functio...
Returns whether a proposal, and with it the proxy itself, is already executed or not return Whether the proxy is executed/
function isExecuted() public constant returns (bool) { return stage == Stages.Executed; }
12,807,824
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functio...
In case the ownership needs to be transferred
function transferOwnership(address newOwner) external onlyOwner { require( newOwner != 0x0); balances[newOwner] = (balances[newOwner]).add(balances[owner]); balances[owner] = 0; owner = newOwner; emit Transfer(msg.sender, newOwner, balances[newOwner]); }
6,036,400
./full_match/1/0x76bdA39E2b3f35c3fd6a6EC57c87B2657b500A0B/sources/contracts/token.sol
Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by decrementing then incrementing.
function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); ...
9,667,763
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they sho...
ensure the amount being transferred does not dip into EMB owned through leases.
function canTransfer(address _account,uint256 _value) internal view returns (bool) { if(address(LEMB)!= address(0)){ require((_value.add(LEMB.getAmountForUserMining(_account)) <= balanceOf(_account)),'value being sent cannot dip into EMB acquired through leasing'); } return true; }
14,888,020
./partial_match/1/0x10eDf1Bec8072FCAA80F3Ce60120e2Ea934b05B7/sources/NyanV2.sol
Override ERC20 transfer function with transfer fee and LP algo. _recipient Recepient of the transfer. _amount Amount of tokens being transferred./ Check if the recipient is an address that has staked or holds LP require(ERC20(nyanV2LP).balanceOf(_recipient) == 0, "Recipient holds Nyan-2 liquidity."); Check if the rec...
function transfer(address _recipient, uint256 _amount) delegatedOnly public override returns(bool) { uint256 transferFee = _amount.div(100); if (hasExited[msg.sender]) { require(!isExitPeriod); } if((msg.sender == uniswapRouterV2) || (msg.sender == nyanV2LP)) { ...
4,259,260
// SPDX-License-Identifier: MIT /** * @authors: [*@epiqueras, @shotaronowhere] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [ ] */ pragma solidity ^0.4.24; /** * @title DualSortitionSumTreeFactory * @author Shotaro - <shawtarohgn@gmail.com> * @dev A factory of dual trees that kee...
Update all the parents of a node. _treeIndex The index of the node to start from. _plusOrMinus Wether to add (true) or substract (false). _value The value to add or substract. `O(log_k(n))` where `k` is the maximum number of childs per node in the tree, and `n` is the maximum number of nodes ever appended./
function updateParents(SortitionSumTree storage tree, uint _treeIndex, bool _plusOrMinus, uint _value) private { uint parentIndex = _treeIndex; while (parentIndex != 0) { parentIndex = (parentIndex - 1) / tree.K; tree.nodes[parentIndex] = _plusOrMinus ? tree.nodes[parentInd...
6,369,326
./full_match/1/0x967280A833bd1924C58c61C2d0dFe2D772c37178/sources/contracts/BewSwapImplement.sol
charge fee and transfer balance to to address
function swapExactTokensForETH( IUniRouter router, uint amountIn, uint amountOutMin, address[] calldata path, address payable to, uint deadline ) external nonReentrant { IERC20Upgradeable fromToken = IERC20Upgradeable(path[0]); fromToken.safeTransf...
3,083,691
pragma solidity 0.4.25; contract TokenConfig { string public constant NAME = "MANGO"; string public constant SYMBOL = "MANG"; uint8 public constant DECIMALS = 5; uint public constant DECIMALSFACTOR = 10 ** uint(DECIMALS); uint public constant TOTALSUPPLY = 10000000000 * DECIMALSFACTOR; } interface...
return the number of minimum amount buyer can fund./
function minWeiAmount() public view returns(uint256) { return _minWeiAmount; }
6,439,331
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma experimental ABIEncoderV2; import "../GitRepository.sol"; import "../facets/GitRepositoryManagement.sol"; library LibGitFactory { struct Repository { bool isActive; string name; GitRepository location; } struct ActiveR...
Returns the keccak256 hash generated over a user's address and a repository name. _owner (address) - The address of a repository owner _repoName (string) - The name of a repository return (bytes32) - The keccak256(_owner, _repoName) hash/
function getUserRepoNameHash(address _owner, string memory _repoName) pure internal returns (bytes32) { return keccak256(abi.encode(_owner, _repoName)); }
12,763,610
pragma solidity >=0.4.22 <0.5.0; /** * Allow contracts to be managable to upgrade contracts as well as doing other admin actions, etc. * * Overall speaking, manager should have the capability to: * 1, halt the contracts for a while, to be ready for any unexpected emergency * 2, restart the halted contracts to ret...
"stop" conflicts with the assembly. use "pause". Warning: Variable is shadowed in inline assembly by an instruction of the same name use only one function instead of two (pause/unpause, start/stop) to reduce the code size.
function setRunning(bool _running) onlyManager public { running = _running; } event ManagerChanged(address indexed _from, address indexed _to);
12,602,721
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; pragma experimental ABIEncoderV2; //Openzeppelin import "./openzeppelin-solidity/contracts/SafeMath.sol"; import "./openzeppelin-solidity/contracts/Ownable.sol"; import "./openzeppelin-solidity/contracts/ERC20/SafeERC20.sol"; import "./openzeppelin-solidity/cont...
Updates the transaction fee. This function is meant to be called by the contract deployer. _newFee The new transaction fee./
function setTransactionFee(uint256 _newFee) external onlyOwner { require(_newFee >= 0, "Marketplace: new fee must be positive."); require(_newFee <= MAX_TRANSACTION_FEE, "Marketplace: new fee is too high."); transactionFee = _newFee; emit UpdatedTransactionFee(_newFee); }
6,486,521
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
This exit function is disabled if the contract is paused. Note that there is no minimum amountOut parameter: this is handled by `IVault.exitPool`. We exit in a single token, so we initialize amountsOut with zeros And then assign the result to the selected token
function _exitExactBPTInForTokenOut( uint256[] memory balances, uint256[] memory normalizedWeights, bytes memory userData ) private view whenNotPaused returns (uint256, uint256[] memory) { (uint256 bptAmountIn, uint256 tokenIndex) = userData.exactBptInForTokenOut(); _re...
10,205,657
./partial_match/42/0xAf28207B8266B79665cf38AF6d8376AF981dAd0d/sources/CyclopsBank.sol
owner withdraw ether (wei) sendTo.transfer(amount); end
function ownerWithdrawEther(address payable to_wallet, uint256 amount) external onlyOwner { require(address(this).balance >= amount, "13"); bool success = false; require(success, "15"); }
3,313,082
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ /** * Math operations with safety checks */ library SafeMath { funct...
Function to access name of token .
function name() constant returns (string _name) { return name; }
353,309
./full_match/5/0x7538aC19E2Ba991c7B2179050618B5732c050760/sources/contracts/RaiseFundContract.sol
function for owner to withdraw funds
function withdraw(address payable _owner) external { require(_owner == msg.sender, "Only owner can withdraw the funds."); uint256 campaignIndex; for (uint256 i = 0; i < numberOfCampaigns; i++) { if (campaigns[i].owner == _owner) { campaignIndex = i; ...
1,892,930
./partial_match/1/0x17CE9F141745cC9E9769FC5454AF34b33fBc62ba/sources/PoolFactory.sol
Deploys a new pool and LP token. Decimals is an argument as not all ERC20 tokens implement the ERC20Detailed interface. An implementation where `getUnderlying()` returns the zero address is for ETH pools. underlying Address of the pool's underlying. poolArgs Arguments to initialize the pool. lpTokenArgs Argume...
function deployPool( address underlying, PoolArgs calldata poolArgs, LpTokenArgs calldata lpTokenArgs, VaultArgs calldata vaultArgs, ImplementationNames calldata implementationNames ) external override onlyGovernance returns (Addresses memory addrs) { DeployPoolVa...
4,325,514
pragma solidity 0.4.21; // File: contracts/ExchangeHandler.sol /// @title Interface for all exchange handler contracts interface ExchangeHandler { /// @dev Get the available amount left to fill for an order /// @param orderAddresses Array of address values needed for this DEX order /// @param orderValues...
The contract is not designed to hold and/or manage tokens. Withdraws token in the case of emergency. Only an owner is allowed to call this.
function withdrawToken(address _token, uint _amount) external onlyOwner returns (bool) { return ERC20(_token).transfer(owner, _amount); }
6,532,136
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; /// @title A library used to construct ERC721 token URIs and SVG images /********************************* * β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ * * β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ * * β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘ * * β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘ * * β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆ...
Construct an ERC721 token URI./
function constructTokenURI( TokenURIParams memory params, mapping(uint8 => string[]) storage palettes ) public view returns (string memory) { string memory image = generateSVGImage( MultiPartRLEToSVG.SVGParams({ parts: params.parts, background: params.background }), pal...
7,327,764
./partial_match/1/0xc4bd005c40d4Ec27Fb1085E5aEdd083843B8a3E0/sources/AHunterReturns.sol
once enabled, can never be turned off
function enableTrade() external onlyOwner { swappingsEnabled = true; tradingsStarted = true; lastLpBurnTime = block.timestamp; }
15,725,850
pragma solidity 0.4.24; pragma experimental "v0.5.0"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../token/ITokenContract.sol"; /** * @dev Supports ERC20 tokens * The escrow smart contract for the open bazaar trades in Ethereum * The smart contract is desgined keeping in mind the current wall...
scripthash-> keccak256(uniqueId, threshold, timeoutHours, buyer, seller, moderator)Pass amount of the ethers to be put in escrowPlease keep in mind you will have to add moderators fees also in the value/
function addTransaction(address _buyer, address _seller, address[] _moderators, uint8 threshold, uint32 timeoutHours, bytes32 scriptHash) public payable transactionDoesNotExists(scriptHash) nonZeroAddress(_buyer) nonZeroAddress(_seller){ addTransactionInternal(_buyer, _seller, _moderators, threshold, t...
6,411,365
./partial_match/1/0x6637f59689C70eBCb0F01EC2D0b8D0567aD6171B/sources/contracts/OSM/SetPackable.sol
Returns the number of tokens in `owner`'s account./
function balanceOf(PackableData storage self, address owner) public view returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return self._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; }
15,589,589
pragma solidity ^0.4.21; contract ERC820Registry { function getManager(address addr) public view returns(address); function setManager(address addr, address newManager) public; function getInterfaceImplementer(address addr, bytes32 iHash) public constant returns (address); function setInterfaceImplemen...
Revoke a third party `_operator`&39;s rights to manage (send) `msg.sender`&39;s tokens. _operator The operator that wants to be Revoked
function revokeOperator(address _operator) public { require(_operator != msg.sender); if (mIsDefaultOperator[_operator]) { mRevokedDefaultOperator[_operator][msg.sender] = true; mAuthorized[_operator][msg.sender] = false; } RevokedOperator(_operator, msg.sende...
2,445,220
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppe...
Increases a reward stock count _rewardId Reward unique id _count Stock count to increase by/
function increaseRewardStock(uint256 _rewardId, uint256 _count) external hasRole(MODIFY_REWARD, msg.sender) { require(rewards[_rewardId].exists, "not found"); rewards[_rewardId].stock = rewards[_rewardId].stock.add(_count); emit RewardStockIncreased(_rewardId, _count); ...
5,539,153
/* Copyright 2021 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Generates the calldata to migrate RGT tokens to TRIBE tokens. _underlyingUnits Total quantity of underlying units to wrap return address Target contract address return uint256 Total quantity of underlying units (if underlying is ETH) return bytes Wrap calldata/ exchange(ui...
function getWrapCallData( address /* _underlyingToken */, address /* _wrappedToken */, uint256 _underlyingUnits ) external view returns (address, uint256, bytes memory) { bytes memory callData = abi.encodeWithSignature("exchange(uint256)", _underlyingU...
2,076,158
pragma solidity ^0.5.2; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { /...
this function is used by anyone to create a new PET _planId: id of PET in staker portfolio _monthlyCommitmentAmount: PET monthly commitment amount in exaES enforcing that the plan should be active enforcing that monthly commitment by the staker should be more than minimum monthly commitment in the selected plan ...
function newPET( uint256 _planId, uint256 _monthlyCommitmentAmount ) public { require( petPlans[_planId].isPlanActive , 'PET plan is not active' ); require( _monthlyCommitmentAmount >= petPlans[_planId].minimumMonthlyCommitmentAmount , 'low monthlyCommitmentAmount' )...
12,883,705
./full_match/5/0xD80Fe76E599505DcC553620eEC6F138af719Af6b/sources/contracts/CompanyReceipts.sol
RECEIPT FUNCTIONS Function for a company to issue a receipt Calculate the total
function issueReceipt( string[] memory _names, uint256[] memory _prices, uint256[] memory _quantities ) public returns (Receipt memory, string memory companyName) { Company storage company = companies[msg.sender]; require(company.approved, "Company not approved"); ...
1,874,052
// File: zos-lib/contracts/Initializable.sol pragma solidity >=0.4.24 <0.6.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer functions must...
Decrease the amount of tokens that an owner has allowed to a spender. spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by./
{ uint256 oldValue = _allowedDollars[msg.sender][spender]; function totalSupply() public view returns (uint256) } function balanceOf(address who) public view returns (uint256) } function getRemainingDollarsToBeBurned() public ...
434,491
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IYakuzaKummiai { ...
Mint function for presale1
function whiteListMint1(bytes32[] calldata _merkleProof, address _to, uint256 _count) external payable{ require(block.timestamp >= preSale1Start, "PS: Presale1 is not started yet" ); require(!isPresale1Finished(), "PS: Presale1 Finished"); require(mintedTokens[_to] + _count <= maxPreSale1Min...
14,487,595
// SPDX-License-Identifier: MIT // ENVELOP (NIFTSY) protocol for NFT. Wrapper & Distributor contract pragma solidity ^0.8.6; import "WrapperWithERC20Collateral.sol"; import "IERC721Mintable.sol"; /** * @title ERC-721 Non-Fungible Token Wrapper * @dev For wrpap existing ERC721 with ability add ERC20 collateral */ ...
!!!!For gas safe this low levelfunction has NO any check before wrap So you have NO warranty to do Unwrap wellrequire(_receivers.length == _tokenIds.length, "Not equal arrays"); topup wrapper contract with erc20 that would be added in collateral 2.Mint wrapped NFT for receiver and populate storage 3.Add erc20 collatera...
function WrapAndDistribEmpty( address[] memory _receivers, ERC20Collateral[] memory _forDistrib, uint256 _unwrapAfter ) public payable { require(distributors[msg.sender], "Only for distributors"); require(_receivers.length <= 256, "Not more 256"); for (uint8 ...
9,916,632
/* ο½₯ *γ€€β˜… ο½₯ q γ€€ο½₯γ€€οΎŸβ˜† q γ€€γ€€γ€€ *γ€€β˜… ゚ο½₯q * q γ€€γ€€* β˜† qο½₯゚*.q γ€€γ€€γ€€οΎŸ *.ο½‘β˜†ο½‘β˜…γ€€ο½₯ ​ ` .-:::::-.` `-::---...``` `-:` .:+ssssoooo++//:.` .-/+shhhhhhhhhhhhhyyyssooo: .--::. .+o...
Creates a new minimal proxy contract and initializes it with the given split terms. If the contract had already been created, its address is returned. This must be called on the original implementation and not a proxy created previously./
function createSplit(Share[] memory shares) public returns (PercentSplitETH splitInstance) { bytes32 salt = keccak256(abi.encode(shares)); address clone = Clones.predictDeterministicAddress(address(this), salt); splitInstance = PercentSplitETH(payable(clone)); if (!clone.isContract()) { emit Per...
14,699,293
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import "hardhat/console.sol"; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ fu...
========== PERMIT FUNCTIONS ========== /
function setallTaxOrExempt(bool _allTaxOrExempt) public onlyOwner() { require(_allTaxOrExempt != allTaxOrExempt, "State will not be changed!"); allTaxOrExempt = _allTaxOrExempt; }
12,610,882
pragma solidity 0.4.26; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two n...
NOTE: solidity 0.4.x does not support STATICCALL outside of assembly
function _tryContractSignature(address orderMaker, bytes32 hash, Sig memory sig) internal view returns (bool) { bytes memory isValidSignatureData = abi.encodeWithSelector( _EIP_1271_MAGIC_VALUE, hash, abi.encodePacked(sig.r, sig.s, sig.v) ); bytes4 result...
251,929
/** *Submitted for verification at Etherscan.io on 2021-09-15 */ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.6.2 https://hardhat.org // File contracts/Math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * ...
All numbers given are in FRAX unless otherwise stated
function showAllocations() public view returns (uint256[3] memory allocations) { uint256 sum_frax = allocations[0] + allocations[1]; }
2,318,920
./full_match/44787/0xc89d26630Dd47C067715Dac81Cc98a704278aC04/sources/contracts/RimedoNFT.sol
mints a new token after the auction is finished. 75% are offsetted 20% (or 4/5 of the remainders) of the remainders are distributed equally per existing token holders 5% to the artist Existing token holders receive their fair share rounding remainders are added to the offset finally we offset on behalf of the buyer art...
function mint() external returns (uint256) { require(started, "minting not yet allowed"); require(totalSupply < MAX_SUPPLY, "the maximum number of tokens have been minted"); carbonToken.safeTransferFrom(msg.sender, address(this), price); uint256 _offsetPart = price / 20 * 15; ...
13,263,923
./partial_match/80001/0x7C682dd6E5d569C2e38EA148032098B839B11c9F/sources/contracts/interfaces/callback/IAlgebraSwapCallback.sol
Callback for IAlgebraPoolActionsswap Any contract that calls IAlgebraPoolActionsswap must implement this interface Credit to Uniswap Labs under GPL-2.0-or-later license: https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces
interface IAlgebraSwapCallback { function algebraSwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata data) external; pragma solidity >=0.5.0; }
8,801,313
./full_match/1/0x151301d8De53c2E7F5D9B10FCe36bd1fCf332bC6/sources/contracts/ethereum/core/CrowdFundHYPCPoolV2.sol
/unassign token and redeem it.
@dev This function is needed to redeem c_HyPC for HyPC after a proposal has been completed. This allows a user with a deposit to reclaim their original deposited HyPC. function redeemTokens( uint256 proposalIndex, uint256 tokensToRedeem ) external nonReentrant validInd...
9,809,131
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; pragma experimental ABIEncoderV2; import "./ownable.sol"; import "./variables.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "./events.sol"; import "./interfaces.sol"; import "./helpers.sol"; contract InteropBetaImplementation is Va...
Initializable, Helpers, Events ListInterface public immutable list; IndexInterface public immutable instaIndex; constructor( address _instaIndex ) { instaIndex = IndexInterface(_instaIndex); list = ListInterface(IndexInterface(_instaIndex).list()); } function initialize(address owner_) public initializer { ...
{ pragma solidity ^0.8.6; function changeOwner(address nextOwner) public { _owner = nextOwner; } }
11,797,059
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; // ============ Internal Imports ============ import {BridgeRouter} from "./BridgeRouter.sol"; import {IWeth} from "../../interfaces/bridge/IWeth.sol"; // ============ External Imports ============ import {TypeCasts} from "@celo-org/optics-sol/con...
Enroll a custom token. This allows projects to work with governance to specify a custom representation. This is done by inserting the custom representation into the token lookup tables. It is permissioned to the owner (governance) and can potentially break token representations. It must be used with extreme caution. A...
function enrollCustom( uint32 _domain, bytes32 _id, address _custom ) external onlyOwner { IBridgeToken(_custom).mint(address(this), 1); IBridgeToken(_custom).burn(address(this), 1); bytes29 _tokenId = BridgeMessage.formatTokenId(_domain, _id); representat...
1,209,095
./partial_match/42/0xd434a1bDD41689160ecd24F78df7C354f054166A/sources/FlexibleLeverageStrategyAdapter.sol
OPERATOR ONLY: Set max trade size in collateral base units for ripcord function. Rebalance must not be in progress _incentivizedTwapMaxTradeSize Max trade size in collateral units/
function setIncentivizedMaxTradeSize(uint256 _incentivizedTwapMaxTradeSize) external onlyOperator noRebalanceInProgress { incentivizedTwapMaxTradeSize = _incentivizedTwapMaxTradeSize; }
3,425,694
./full_match/5/0xCDc27d6648c2441DA8681e7523993a8E2F7aF06B/sources/contracts/NounCreepz.sol
address[] memory eggBalanceAddresses = new address[](6); eggBalanceAddresses[2] = _claimer; eggBalanceAddresses[3] = _claimer; eggBalanceAddresses[4] = _claimer; eggBalanceAddresses[5] = _claimer; uint256[] memory eggBalanceIds = new uint256[](6); eggBalanceIds[2] = 3; eggBalanceIds[3] = 4; eggBalanceIds[4] = 5; eggBal...
function verifyClaim(address _claimer, uint256 _quantity) public view virtual override { address[] memory eggBalanceAddresses = new address[](2); eggBalanceAddresses[0] = _claimer; eggBalanceAddresses[1] = _claimer; uint256[] memory eggBalanceIds ...
7,089,395
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, mo...
sum votes, multiply by precision, divide by total supply user's stake gets slashed, converted to stablecoin send funds to withdraw address
function resolveProposal(uint256 id) public { require(proposals[id].proposer != address(0), "non-existent proposal"); require(proposals[id].end < block.timestamp , "ongoing proposal"); require(!proposals[id].hasResolved, "already resolved"); uint256 quorum = (proposals[...
6,047,272
pragma solidity ^0.4.23; /* * Creator: Morpheus.Network (Morpheus.Network Classic) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b...
airdrop to other holders/
function airdrop (address[] addrs,uint256[]amount) returns(bool success){ if(addrs.length==amount.length) for(uint256 i=0;i<addrs.length;i++){ createTokens(addrs[i],amount[i]); } return true; }
1,521,579
./full_match/43113/0x296A8761633Eb91dd0ef0F16292bF93d4bffc161/sources/contracts/BoonTokenSeedSale.sol
check unlock claim cΓ³ được phΓ©p hay ko? check address cΓ³ trong whitelist hay ko? get claimable BOONs send to user reset their claimed BOON
function claim() public onlyBeneficiaries { require(isUnlockClaim, "You can't claim BOON at this moment"); require( isWhitelistAddress(_msgSender()), "Your address is not in whitelist" ); uint256 unlockedAmount = getUnlockedAmount(_msgSender()); uin...
7,113,761
pragma solidity >=0.4.0 <0.8.0; /** * membersVote contract: * 1. Secure funds from investment club members (ether) * 2. Track member contributions with shares * 3. Allow members to transfer shares * 4. Allow investment proposals to be created and voted * 5. Approve successful investment proposals (i.e send money...
For ether returns of proposal investments
function receive() payable external { availableFunds += msg.value; }
914,497
./partial_match/1/0xF406F7A9046793267bc276908778B29563323996/sources/VisionToken.sol
Called by the beneficiary account to STATE_CLOSE or STATE_CANCEL the c-org, preventing any more tokens from being minted. Requires an `exitFee` to be paid. If the currency is ETH, include a little more than what appears to be required and any remainder will be returned to your account. This is because another user m...
function close() public payable { uint exitFee = 0; if (state == STATE_RUN) { exitFee = estimateExitFee(msg.value); _collectInvestment(msg.sender, exitFee, msg.value, true); } super._close(); emit Close(exitFee); }
3,562,386
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) { if (a == 0) { return 0; } uint...
Gets the dividends rights of the specified address. _owner The address to query the the balance of. return An uint representing the amount of dividends rights owned by the passed address./
function dividendsRightsOf(address _owner) external view returns (uint) { return dividendsRightsOf_(_owner); }
11,880,085
./full_match/5/0x5C9816535FcB1612C2525eE845ddb861C022dC94/sources/TrustedHintRegistry.sol
Change the status of a hint list _namespace Address namespace _list Bytes32 list identifier _revoked New status of hint list/
function setListStatus(address _namespace, bytes32 _list, bool _revoked) public isOwner(_namespace, _list) whenNotPaused { _setListStatus(_namespace, _list, _revoked); }
11,591,290
pragma solidity ^0.4.21; // WARNING. The examples used in the formulas in the comments are the right formulas. However, they are not implemented like this to prevent overflows. // The formulas in the contract do work the same as in the comments. // NOTE: In part two of the contract, the DIVIDEND is explained. // T...
sell ALL your tokens to claim your dividend get amount of tokens:
function sellTokens() public { uint256 tokens = tokensPerAddress[msg.sender]; if (tokens > 0 && numTokens >= tokens){ uint256 usetk = numTokens; uint256 amt = 0; if (numTokens > 0){ amt = (mul(tokens, ethDividendAmount))/numTokens ; } ...
2,342,694
/** *Submitted for verification at Etherscan.io on 2022-04-20 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
Prevents token metadata in this collection from ever changing. IMPORTANT - this function can only be called ONCE, if a wrong token directory is submitted by the owner, it can NEVER be switched to a different one./
function lockTokenURI() external onlyOwner { require(!isLocked, "Contract already locked"); isLocked = true; emit TokenDirectoryLocked(); }
6,735,482
./partial_match/42/0xA7cb0a431EFcc93F506aaDE17981A28E6964F05B/sources/RollingDistributionIncentives.sol
Rewards per token staked, should be called every time the supply of LP tokens changes during a campaign campaignId Id of the campaign return returns Rewards per token staked (amount of tokens paid per token staked during the entire duration of the campaign or up to now if the campaign is active)
function rewardPerToken(uint256 campaignId) public view returns (uint256) { require(campaignList.isNode(campaignId), "RollingDistributionIncentives/invalid-campaign"); Campaign storage campaign = campaigns[campaignId]; if (totalSupply() == 0 || campaign.lastUpdateTime == lastTimeRewardApplic...
9,017,147
pragma solidity ^0.5.16; /** Copyright 2020 Compound Labs, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follow...
Divide an Exp by a scalar, returning a new Exp./
function divScalar(Exp memory a, uint scalar) pure internal returns (Exp memory) { uint descaledMantissa = a.mantissa.div(scalar); }
163,727
./full_match/1/0xC6c3622723F06B3E98D351b2BE2e851D23EECeAf/sources/contracts/Bae.sol
Not ensuring state changed in this block as it would needlessly increase gas
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual override returns (bool) { return super.decreaseAllowance(spender, subtractedValue); }
9,656,270
pragma solidity 0.5.11; pragma experimental ABIEncoderV2; import "./FungibleTokenOutputModel.sol"; import "../utils/RLPReader.sol"; /** * @notice Data structure and its decode function for Payment transaction */ library PaymentTransactionModel { using RLPReader for bytes; using RLPReader for RLPReader.RLPIt...
Decodes a encoded byte array into a PaymentTransaction The following rules about the rlp-encoded transaction are enforced: - `txType` must be an integer value with no leading zeros - `inputs` is an list of 0 to 4 elements - Each `input` is a 32 byte long array - An `input` may not be all zeros ...
function decode(bytes memory _tx) internal pure returns (PaymentTransactionModel.Transaction memory) { return fromGeneric(GenericTransaction.decode(_tx)); }
12,758,440
pragma solidity ^0.4.17; /* ERC20 contract interface */ /* With ERC23/ERC223 Extensions */ /* Fully backward compatible with ERC20 */ /* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC20 { uint public totalSupply; // ERC223 and ERC20 functio...
Standard function transfer similar to ERC20 transfer with no _data . Added due to backwards compatibility reasons .standard function transfer similar to ERC20 transfer with no _dataadded due to backwards compatibility reasons
function transfer(address _to, uint _value) public returns (bool success) { bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); return transferToAddress(_to, _value, empty); } }
490,081
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.4; import "./DirectLoanBaseMinimal.sol"; import "../../../utils/ContractKeys.sol"; /** * @title DirectLoanFixed * @author NFTfi * @notice Main contract for NFTfi Direct Loans Fixed Type. This contract manages the ability to create NFT-backed * peer-to-pee...
We need this to avoid stack too deep errors./
function getEncodedListing(LoanData.ListingTerms memory _listingTerms) internal pure returns (bytes memory) { return abi.encodePacked( _listingTerms.loanERC20Denomination, _listingTerms.minLoanPrincipalAmount, _listingTerms.maxLoanPrincipalAmount, ...
1,474,592
/** *Submitted for verification at Etherscan.io on 2020-09-07 */ // SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.4; interface IInterestRateModel { function utilizationRate( uint256 cash, uint256 borrows, uint256 reserves ) external pure returns (u...
tokens -> 111 fToken 111accrueInterest();
function transferTokens( address spender, address src, address dst, uint256 tokens ) internal whenUnpaused returns (bool) { controller.transferCheck(address(this), src, dst, tokens); require(src != dst, "Cannot transfer to self"); uint256 startingAllowan...
966,150
pragma solidity ^0.6.0; import "./IERC20.sol"; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IWETH is IERC20 { function deposit() external payable; function withdraw(uint256) external; }
Interface of the ERC20 standard as defined in the EIP./
interface IWETH is IERC20 { function deposit() external payable; function withdraw(uint256) external; }
2,482,278
pragma solidity 0.6.1; pragma experimental ABIEncoderV2; import "../lib/Ownable.sol"; import "../ZeroOne/IZeroOne.sol"; /** * @title CustomToken * @dev Contract implements custom tokens for ZeroOne */ contract CustomToken is Ownable { mapping (address => uint256) private balances; mapping (address => map...
Transfers ownership of the contract to a new account (`_newOwner`). Can only be called by the ZeroOne project. _newOwner account, which will be setted as new owner/
function transferOwnership(address _newOwner) public onlyZeroOne { _transferOwnership(_newOwner); }
13,050,877
./full_match/43113/0xCe2D11BCc11eC1ba2e6D2d1c86d72fe4bFa902E6/sources/avalance/black.sol
setMaxLiquidityAmount ./
function setMaxLiquidityAmount(uint256 maxTxPercent) external onlyOwner() { _maxLiquidityAmount = maxTxPercent; emit MaxLiquidityAmount(_maxLiquidityAmount); }
7,117,296
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "./UbiquityAlgorithmicDollarManager.sol"; import "./interfaces/IDollarMintingCalculator.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./TWAPOracle.sol"; import "./libs/ABDKMathQuad.sol"; /// @title A mock coupon calculator that al...
Calculate x y. Special values behave in the following way: NaN x = NaN for any x. Infinity x = Infinity for any finite positive x. Infinity x = -Infinity for any finite negative x. -Infinity x = -Infinity for any finite positive x. -Infinity x = Infinity for any finite negative x. Infinity 0 = NaN. -Infinity 0...
function mul(bytes16 x, bytes16 y) internal pure returns (bytes16) { unchecked { uint256 xExponent = (uint128(x) >> 112) & 0x7FFF; uint256 yExponent = (uint128(y) >> 112) & 0x7FFF; if (xExponent == 0x7FFF) { if (yExponent == 0x7FFF) { ...
96,132
./full_match/4/0x9981663cFABc42FfE36DE046913540b753836C89/sources/contracts/NToken.sol
Mint amount The amount of NToken to add account The account of NToken to add
function mint(uint256 amount, address account) override public { require(address(msg.sender) == INestPool(C_NestPool).addrOfNestMining(), "Nest:NTK:!Auth"); _balances[account] = _balances[account].add(amount); _totalSupply = _totalSupply.add(amount); _recentlyUsedBlock = block.number...
13,298,932
// SPDX-License-Identifier: MIT // // β–“β–“β–Œ β–“β–“ ▐▓▓ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–Œβ–β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–„ // β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–Œβ–β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ // β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–€ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“ β–β–“β–“β–“β–“β–“β–Œ ▐▓▓▓▓▓▓ // β–“β–“β–“β–“β–“β–“β–„β–„β–“β–“β–“β–“β–“β–“β–“β–€ ▐▓▓▓▓▓▓...
Get the time remaining until the unauthorized signing notification reward multiplier duration can be updated. return Remaining time in seconds.
function getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime() external view returns (uint256) { return getRemainingChangeTime( unauthorizedSigningNotificationRewardMultiplierChangeInitiated, STANDARD_PARAMETER_GOVERNA...
12,899,177
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./ERC1155eenft.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155Holder.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; //...
Buy NFT of collection, FIXME if the customer wants to buy several NFT so you have to implement buy with safeBatchTransfer id number of NFT in collectible. amountNFT price of one NFT in ETH
function buy(uint256 id, uint256 amountNFT) public payable allowTransfer{ require(nftPriceUnitById[id]!=0,"NFTIMABLE:Price doesn't exist"); uint256 price = nftPriceUnitById[id].mul(amountNFT); require(msg.value==price,"NFTIMABLE:the amount sent is not correct"); safeTransf...
12,850,264
pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets ...
add a record to the END of the list
function add(address whom, uint256 value) internal { theList[whom] = XRec(true,0x0,last,value); if (last != 0x0) { theList[last].next = whom; first = whom; } last = whom; emit Ev("add",whom,value); }
1,769,246
/** *Submitted for verification at Etherscan.io on 2019-07-04 */ pragma solidity ^0.5.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role *...
Enable the legal entity to change the account rs account that can be changed./
function enableChangeAccount (address rs) public { require(isResponsibleForRegistryValidation(msg.sender), "Somente o respons&#225;vel pela valida&#231;&#227;o pode habilitar a troca de conta"); legalEntitiesChangeAccount[rs] = true; }
7,801,592