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 pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; // BuryLeash is the coolest pit in town. You come in with some Leash, and leave with more! The l...
Enter the doghouse. Pay some LEASHs. Earn some shares. Locks Leash and mints xLeash Gets the amount of Leash locked in the contract Gets the amount of xLeash in existence If no xLeash exists, mint it 1:1 to the amount put in Calculate and mint the amount of xLeash the Leash is worth. The ratio will change overtime, as ...
function enter(uint256 _amount) public { uint256 totalLeash = LEASH.balanceOf(address(this)); uint256 totalShares = totalSupply(); if (totalShares == 0 || totalLeash == 0) { _mint(msg.sender, _amount); } else { uint256 what = _amount.mul(totalShares)....
12,134,749
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 interfaces, which can then be *...
See {IERC721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if ( to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data) ) {...
190,451
pragma solidity ^0.4.18; /** * @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 ...
increase the token's supply
function increaseSoldSaleSupply (uint256 _value) onlyOwner public { require (_value + soldSupply < totalSupply); soldSupply += _value; IncreaseSoldSaleSupply(_value); }
6,387,112
./full_match/42220/0xa444da1f6eF511ce00E7Adc7D3963Eeafa79a33a/sources/project_/contracts/interface/IController.sol
Controller interface contract Administrative and orchestrator contract for local currencies/
interface IController { event NewUser(bytes32 indexed _userId, address indexed _walletAddress); event UserDeposit(bytes32 indexed _userId, address indexed _operator, uint256 _value); event UserWithdrawal(bytes32 indexed _userId, address indexed _operator, uint256 _value); event TransferToEvent(bytes3...
16,356,671
./full_match/137/0x51d2b3c0473b2e79e3F06F52C9bc312e5bb1bF0c/sources/contracts/Counter.sol
/ Returns the current value of the counter./
function current() public view returns (uint256) { return counter.current(); }
4,696,008
pragma solidity >=0.4.21 <0.6.0; import "../node_modules/@openzeppelin/contracts/math/SafeMath.sol"; import "../node_modules/@openzeppelin/contracts/ownership/Ownable.sol"; contract PredictionMarket is Ownable { using SafeMath for uint256; // Group stages uint256 public BETTING = 1; uint256 public WAITING = ...
Distribute winnings back to agents who bet.
function claimWinnings() public payable { require(canClaim(msg.sender), "Agent cannot claim at this time"); mapping(address => Bet) storage group = stageToGroup(CLAIMING); GroupInfo storage groupInfo = stageToGroupInfo[CLAIMING]; Bet storage bet = group[msg.sender]; uint256 denominator = groupIn...
7,275,514
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/drafts/Counter.sol"; contract BountyApp { using SafeMath for uint256; using Counter for Counter.Counter; address public owner; bool public stopped = false; /** ...
Returns an array of uint256 that the ids of the work that have been submitted for this bounty _bountyId uint256/
function getWorkProposedIds(uint256 _bountyId) public view returns (uint256[] memory) { return bountyIdToWorkIds[_bountyId]; }
12,945,455
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.11; import 'openzeppelin-solidity/contracts/access/Ownable.sol'; /** * @title Voting * @dev Smart contract de vote */ contract Voting is Ownable { struct Voter { bool isRegistered; bool hasVoted; uint votedProposalId; } st...
passe à l'étape suivante du processus de propositions/vote/
function nextStep() external onlyOwner { votingStatus = WorkflowStatus(uint(votingStatus)+1); emit WorkflowStatusChange(WorkflowStatus(uint(votingStatus)-1), WorkflowStatus(uint(votingStatus))); }
1,046,236
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../access/Controllable.sol"; import "../interfaces/INFTGemFeeManager.sol"; contract NFTGemFeeManager is Controllable, INFTGemFeeManager { address private operator; uint256 public constan...
Get the fee divisor for the specified token/
function fee(uint256 feeHash) external view override returns (uint256 feeRet) { feeRet = fees[feeHash]; }
12,576,967
./partial_match/42/0xA32DB627eFed25360FBD6D91A48A2E0526A47DA1/sources/YFDToken.sol
A method for a stakeholder to remove a stake. _stake The size of the stake to be removed./
function removeStake(uint256 _stake) public { stakes[msg.sender] = stakes[msg.sender].sub(_stake); if(stakes[msg.sender] == 0) removeStakeholder(msg.sender); _mint(msg.sender, _stake); } mapping(address => uint256) internal rewards;
8,917,744
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "@openzepp...
Swap token 1 for token 0 in CLR using Uni V3 Pool amounts should be in 18 decimals amountIn - amount as maximum input for swap, in token 1 terms amountOut - amount as output for swap, in token 1 terms/
function swapToken1ForToken0(uint256 amountIn, uint256 amountOut) private { UniswapLibrary.swapToken1ForToken0( amountIn, amountOut, UniswapLibrary.PositionDetails({ poolFee: poolFee, twapPeriod: twapPeriod, priceLower: pric...
1,688,381
pragma solidity ^0.4.24; // Amis Dex OnChainOrderBook follows ERC20 Standards contract ERC20 { function totalSupply() constant returns (uint); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _f...
Public Book View Intended for public book depth enumeration from web3 (or similar). Not suitable for use from a smart contract transaction - gas usage could be very high if we have many orders at the same price. Start at the given inclusive price (and side) and walk down the book (getting less aggressive) until we find...
function walkBook(uint16 fromPrice) public constant returns ( uint16 price, uint depthBase, uint orderCount, uint blockNumber ) { uint priceStart = fromPrice; uint priceEnd = (isBuyPrice(fromPrice)) ? minBuyPrice : maxSellPrice; uint bmi = priceStart / 256; uint bti = priceStart % ...
914,738
./full_match/5/0xD8bb5fcf7bE3A360A7c875F27bEd5DE46617c899/sources/contracts/ERC721NESBasic.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = ""; return bytes(baseURI).length != 0 ? stri...
1,949,765
pragma solidity ^0.4.16; contract SafeMath { function safeAdd(uint256 x, uint256 y) view internal returns (uint256) { uint256 z = x + y; assert((z >= x) && (z >= y)); return z; } function safeSubtract(uint256 x, uint256 y) view internal returns (uint256) { asser...
функция перевода токенов с делегированного счета Check if the transfer initiator has permissions to move funds from the sender's account If yes - perform transfer Decrease the total amount that initiator has permissions to access
function transferFrom(address _from, address _to, uint256 _value) external isTransactionsOn returns ( bool success ) { if ( allowed[_from][msg.sender] >= _value ) { if ( _transfer( _from, _to, _value ) ) { allowed[_from][msg.sender] = safeSubtract(allowed[_from][msg.sender], _value); return true; ...
2,573,502
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; /** * @dev Optional enumeration extension for ERC-721 non-fungible token standard. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. */ interface ERC721Enumerable { /** * @dev Returns a count of valid NFTs tracked by this contract, where ...
Optional enumeration extension for ERC-721 non-fungible token standard./
interface ERC721Enumerable { function totalSupply() external view returns (uint256); function tokenByIndex(uint256 _index) external view returns (uint256); function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256); pragma solidity 0.8.0; }
13,096,019
./partial_match/1/0xD0C6e59B50C32530C627107F50Acc71958C4341F/sources/contracts/loans/direct/loanTypes/DirectLoanBaseMinimal.sol
This function can be called by admins to change the permitted status of a batch of ERC20 currency. This includes both adding an ERC20 currency to the permitted list and removing it. _erc20s - The addresses of the ERC20 currencies whose permit list status changed. _permits - The new statuses of whether the currency is...
function setERC20Permits(address[] memory _erc20s, bool[] memory _permits) external onlyOwner { if (_erc20s.length != _permits.length) { revert FunctionInformationArityMismatch(); } for (uint256 i = 0; i < _erc20s.length; ++i) { _setERC20Permit(_erc20s[i], _permits[i]...
2,861,921
./full_match/80001/0x6223daEbE1E15690B5443dEf4Ea36393A8B32960/sources/contracts/DID-NFT.sol
We only override because of conflict from ContextUpgradeable and ERC2771ContextUpgradeable, But in this case only want to use function from ERC2771ContextUpgradeable for meta tx compartible./
function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) { return ERC2771ContextUpgradeable._msgData(); }
837,696
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./SwapUtils.sol"; /** * @title AmplificationUtils library * @notice A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct. * This library assumes the struct is ...
Return A in its raw precision See the StableSwap paper for details self Swap struct to read from return A parameter in its raw precision form/
function getAPrecise(Swap storage self) external view returns (uint256) { return _getAPrecise(self); }
970,532
./partial_match/1/0xdc8e6B998320651dFb61eA55695Df23d10B1C472/sources/contracts/interfaces/internal/INFTLimitedEditionCollectionInitializer.sol
Declares the interface for initializing an NFTLimitedEditionCollection contract. gosseti/
interface INFTLimitedEditionCollectionInitializer { function initialize( address payable _creator, string calldata _name, string calldata _symbol, string calldata _tokenURI, uint32 _maxTokenId, address _approvedMinter, address payable _paymentAddress ) external; }
16,118,900
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../common/implementation/FixedPoint.sol"; // Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below). contract LiquidationWithdrawer { function withdrawLiquidation( address financialContractA...
Sets the request to refund the reward if the proposal is disputed. This can help to "hedge" the caller in the event of a dispute-caused delay. Note: in the event of a dispute, the winner still receives the other's bond, so there is still profit to be made even if the reward is refunded. identifier price identifier to ...
function setRefundOnDispute( bytes32 identifier, uint256 timestamp, bytes memory ancillaryData ) external override nonReentrant() { require( getState(msg.sender, identifier, timestamp, ancillaryData) == State.Requested, "setRefundOnDispute: Requested" ...
99,319
./full_match/4/0x2F5409E82c3369188eBa135a71ee7C6Bb489e54E/sources/contracts/ERC1155Tradable.sol
Change the creator address for given tokens _to Address of the new creator _ids Array of Token IDs to change creator/
function setCreator( address _to, uint256[] memory _ids ) public { require(_to != address(0), "ERC1155Tradable#setCreator: INVALID_ADDRESS."); for (uint256 i = 0; i < _ids.length; i++) { uint256 id = _ids[i]; _setCreator(_to, id); } } address _operator
12,509,949
/* solhint-disable func-order */ pragma solidity ^0.4.24; import "./BimodalLib.sol"; import "./MerkleVerifier.sol"; import "./SafeMath/SafeMathLib32.sol"; import "./SafeMath/SafeMathLib256.sol"; /** * This library contains the challenge-response implementations of NOCUST. */ library ChallengeLib { using SafeMath...
======================================================================== ======================================================================== ======================================================================== ==================================== ACTIVE DELIVERY Challenge =====================================...
function initTransferDeliveryChallenge( BimodalLib.Ledger storage ledger, ERC20 token, address sender, address recipient, uint256 amount, uint256 txNonce, uint64 trail ) private { BimodalLib.Challenge storage challenge = ledger.challengeBook[token][recipient][sender]; requi...
12,584,733
./full_match/84531/0xD920Cd72ea026c9ce7620d19245A773a972c555a/sources/contracts/prebuilts/account/managed/ManagedAccountFactory.sol
Returns whether all relevant permission and other checks are met before any upgrade.
function _isAuthorizedCallToUpgrade() internal view virtual override returns (bool) { return hasRole(keccak256("EXTENSION_ROLE"), msg.sender); }
14,307,482
./partial_match/1/0x8Fbc2bD0F023c282EB6913444f26Ec8EC73DE967/sources/src/erc/ERC20.sol
See {IERC20-approve}./
function approve( address spender, uint wad ) external virtual override returns (bool) { return _setAllowance(msg.sender, spender, wad); }
4,162,714
./partial_match/1/0x1BFDe68f5694678FB4C45E9aD40eBEdB835b6346/sources/BST.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./
function _createInitialSupply(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: create to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; ...
15,520,379
pragma solidity >=0.5.4 <0.6.0; interface tokenRecipient { function RECEIVEAPPROVAL172(address _from, uint256 _value, address _token, bytes calldata _extraData) external; } //inject NONSTANDARD NAMING library SafeMath { ...
inject NONSTANDARD NAMING
function NAMEISADVOCATE881(address _nameId, address _id) external view returns (bool);
13,026,326
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/LBPair.sol
Returns next non-empty bin swapForY Whether the swap is for Y id The id of the bin return The id of the next non-empty bin/
function _getNextNonEmptyBin(bool swapForY, uint24 id) internal view returns (uint24) { return swapForY ? _tree.findFirstRight(id) : _tree.findFirstLeft(id); }
7,117,361
./partial_match/1/0xb7735077f5FD88F511f9F7e1f448057FB7e80b03/sources/TokenSOX.sol
Transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./
function transfer(address _to, uint256 _value) public whenNotPaused notInLockedList returns (bool) { if (_lockedListFlag) { require(!Roles.has(lockedList, _to)); } require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value);...
2,584,898
//Address: 0x398acb6594866bc7ac3a23e925b2fc3727c19828 //Contract name: Presale //Balance: 0 Ether //Verification Date: 1/19/2018 //Transacion Count: 1317 // CODE STARTS HERE pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety ch...
Public purchase interface for authorized Dragon Holders Purchases tokens starting in authorized minimum tier/ issue new tokens if there are funds left, send refund
function purchaseTokens() onlyAuthorized whenNotPaused public payable { var limit = cap.getLimit(msg.sender); var (purchased, refund) = discounts.purchaseTokens( limit, msg.value, participants[msg.sender].minimumTier ); cap.recordPurchase(msg.sender, purchased); ...
1,785,707
./full_match/8453/0x639dC4bDcAA16dd626Eaa6A1480a852D5427252C/sources/src/auction/Auction.sol
The time duration of each auction
function duration() external view returns (uint256) { return settings.duration; }
11,547,797
./partial_match/1/0x4E457a371e1c109DBF6d5c38327117F0C8835E05/sources/contracts/mixins/collections/RevealableCollection.sol
Allows a collection admin to reveal the collection's final content. Once revealed, the collection's content is immutable. Use `updatePreRevealContent` to update content while unrevealed. baseURI_ The base URI of the final content for this collection./ All tokens in this collection have been updated.
function reveal(string calldata baseURI_) external onlyAdmin onlyWhileUnrevealed { $isRevealed = true; _setBaseURI(baseURI_); emit URIUpdated(baseURI_, true); emit BatchMetadataUpdate(0, type(uint256).max); }
4,390,717
./full_match/1/0x96a5Be7077793C213Ab2f06bA90d69976d0b7bfb/sources/contracts/ZooZooos.sol
Safely mints `quantity` tokens and transfers them to `to`. Requirements: - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. - `quantity` must be greater than 0. Emits a {Transfer} event./ Overflows are incredibly unrealistic. balance or nu...
function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); unchecked { _addressData[to]...
8,411,296
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "./TokenBase/Base.sol"; /** * @title dForce's Lending Protocol Contract. * @notice iTokens which wrap an EIP-20 underlying. * @author dForce Team. */ contract iToken i...
Gets balance of this contract in terms of the underlying/
function _getCurrentCash() internal view override returns (uint256) { return underlying.balanceOf(address(this)); }
133,155
./full_match/1/0x3a32BecC41115b4Aa8bD8614301AeBB9bB11258b/sources/@lyrafinance/protocol/contracts/synthetix/DecimalMath.sol
Convert a high precision decimal to a standard decimal representation./
function preciseDecimalToDecimal(uint i) internal pure returns (uint) { uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10); if (quotientTimesTen % 10 >= 5) { quotientTimesTen += 10; } return quotientTimesTen / 10; }
9,672,022
pragma solidity ^0.5.0; /** EthPM */ //import Ownable contract from openzeppelin-solidity for basic authorization control import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; //import SafeMath library from openzeppelin-solidity for integer overflows and underflow import "openzeppelin-solidity/contracts/math...
market owner allowed to chainge marketplace state _state new market state/
function changeMarketState(bool _state) public onlyOwner { require(marktState != _state, "Sorry, it the the current state!!"); marktState = _state; emit marketStateChanged(_state); }
1,008,294
./full_match/1/0x96a7c18650DEDf9E76355f3f0458B027B789e201/sources/localhost/presale.sol
Returns claimable amount for address/
function claimable() external view returns (uint256 amount) { if (!cancelled) { amount = balances[msg.sender]; } }
9,776,495
./full_match/44787/0x1C5b3CdE2102d6182796a571F042a2E3aB6b62b2/sources/contracts/NftStaking.sol
READ-ONLY function that will calculate pending reward/
function calculateReward(uint staked, uint lastUpdate) private view returns (uint256) { return (staked == 0 || _totalStaked == 0) ? 0 : staked * _blockReward * (block.number - lastUpdate); }
13,254,917
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; ...
inject NONSTANDARD NAMING
function TOKEN190() external returns (address);
12,568,958
./partial_match/4/0x0A0bd842878EC7d53faF0e5c3C44870c3A90307d/sources/YFOSIphone12Components.sol
Override isApprovedForAll to whitelist user's proxy accounts./ Whitelist proxy contract for easy trading.
function isApprovedForAll(address owner, address operator) public override view returns (bool) { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(owner)) == operator) { return true; } ...
8,506,233
./full_match/1/0x27c283475Ed9524A43b795CDCAF9e3D177a35e00/sources/project_/contracts/CryptoPirates.sol
See {Ownable-owner}./
function owner() public view override(Ownable, UpdatableOperatorFilterer) returns (address) { return Ownable.owner(); }
16,406,988
./full_match/5/0x18AF3db49e20eE86207C62645c882d4696d0b66C/sources/contracts/lib/math/LogExpMath.sol
Natural exponentiation (e^x) with signed 18 decimal fixed point exponent. Reverts if `x` is smaller than MIN_NATURAL_EXPONENT, or larger than `MAX_NATURAL_EXPONENT`./ We only handle positive exponents: e^(-x) is computed as 1 / e^x. We can safely make x positive since it fits in the signed 256 bit range (as it is large...
function exp(int256 x) internal pure returns (int256) { _require( x >= MIN_NATURAL_EXPONENT && x <= MAX_NATURAL_EXPONENT, Errors.INVALID_EXPONENT ); if (x < 0) { return ((ONE_18 * ONE_18) / exp(-x)); } int256 firstAN; if (x >= x0)...
7,087,935
pragma solidity ^0.5.10; /** @title A contract for generating unique identifiers * * @notice A contract that provides an identifier generation scheme, * guaranteeing uniqueness across all contracts that inherit from it, * as well as the unpredictability of future identifiers. * * @dev This contract is i...
Confirms a pending increase in the token supply. When called by the custodian with a lock id associated with a pending ceiling increase, the amount requested is added to the current supply ceiling. NOTE: this function will not execute any raise that would overflow the supply ceiling, but it will not revert either. ...
function confirmCeilingRaise(bytes32 _lockId) public onlyCustodian { PendingCeilingRaise storage pendingRaise = pendingRaiseMap[_lockId]; uint256 raiseBy = pendingRaise.raiseBy; require(raiseBy != 0, "no gibberish _lockId"); delete pendingRaiseMap[_lockId]; uint256 newCeil...
12,961,592
...
inject NONSTANDARD NAMING
function WITHDRAW177() external {
5,441,360
./full_match/5/0x8339b06c37d488d51aB838f6C758D61ddb1F1C6c/sources/contracts/facets/DiamondLoupeFacet.sol
Get all the facet addresses used by a diamond. return facetAddresses_ loop through function selectors Set the number of facet addresses in the array
function facetAddresses() external view override returns (address[] memory facetAddresses_) { LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage(); facetAddresses_ = new address[](ds.selectorCount); uint256 numFacets; uint256 selector...
1,954,757
./partial_match/1/0x9cDDB488D39821F06057DFB0f7885964Da3D801B/sources/UpcToken.sol
Public variables of the token The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information./ Function to check the amount of token...
function UpcToken() { totalSupply = 2000000000 * (10**(uint256(decimals))); Transfer(address(0),0xB846E79AfE9Ee6690246C8Fd9A6edBF381e6f957, totalSupply); }
3,979,586
./full_match/1/0x8b2185bB3750cD6eD1Ced62a8E415bf05C40644e/sources/localhost/protocol/extensions/adapters/AUniswapV2.sol
REMOVE LIQUIDITY callerIsDragoOwner();
function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public returns (uint amountA, uint amountB) { IUniswapV2Pair( address( ...
4,890,504
./partial_match/4/0xd5aFFa6A82387D7Cc31E2DbBcC8Ca1f004eaFF4a/sources/KAKAMasterFarmer.sol
Perform LP token migration from legacy UniswapV2 to KAKASwap. Take the current LP token address and return the new LP token address. Migrator should have full access to the caller's LP token. Return the new LP token address. XXX Migrator must have allowance access to UniswapV2 LP tokens. KAKASwap must mint EXACTLY the ...
interface IMigratorToKAKASwap { function migrate(IERC20 token) external returns (IERC20); }
8,551,114
pragma solidity ^0.4.18; import './Genbby-Token.sol'; /** * @title Crowdsale Phase 1 * @dev Crowdsale phase 1 smart contract used by https://ico.genbby.com/ */ contract CrowdsalePhase1 is Pausable { using SafeMath for uint256; GenbbyToken public token; uint256 public start; uint256 public finish...
Function to give tokens to others users who have bought Genbby tokens _to The address that will receive the tokens _amount The amount of tokens to give return A boolean that indicates if the operation was successful/
function giveTokens(address _to, uint256 _amount) onlyOwner whenNotPaused whenRunning public returns (bool) { require (tokens_sold.add(_amount) <= total_tokens); token.mint(_to, _amount); tokens_sold = tokens_sold.add(_amount); TokensGiven(_to, _amount); return true; }
1,076,478
./full_match/137/0xfdd89f844ba410046aCAc9d198Ee515016059078/sources/Masterchef.sol
Pay referral commission to the referrer who referred this user.
function payReferralCommission(address _user, uint256 _pending) internal { if (address(pantherReferral) != address(0) && referralCommissionRate > 0) { address referrer = pantherReferral.getReferrer(_user); uint256 commissionAmount = _pending.mul(referralCommissionRate).div(10000); ...
3,740,906
./full_match/1/0xb02c4f774cf24fc9F580E5C8Af9C96399D232FF7/sources/project_/contracts/SpaceRanger.sol
If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); if (_revealed == false) { return notRevealedUri; } string memory _tokenURI = _getTokenUri(tokenId); ...
3,178,566
./partial_match/1/0x0De15a4D36060a0c022D066357A15b2e4545C203/sources/contracts/erc721/instances/MultipleEditionsDFS.sol
Initialize MultipleEditions instance with first edition, and potentially auction implementation_ ERC721Editions implementation initializeData Data to initialize instance @ param creator Creator/owner of contract @ param _contractURI Contract metadata @ param _name Name of token edition @ param _symbol Symbol of the t...
) { assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = implementation_; Address.functionDelegateCall(implementation_, abi.encodeWithSignature("initialize(bytes)", initializeData)); ...
15,943,030
pragma solidity ^0.4.11; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { // assert(b &gt; 0); // Solidity auto...
Function to allocate tokens to an user. `_to` the address of an user `_tokens` number of tokens to be allocated. Can be called only when funding is not active and only by the owner
function allocateTokens(address _to,uint _tokens) isNotFundable onlyOwner external { uint numOfTokens = _tokens.mul(1e18); totalPresale = totalPresale.add(numOfTokens); if(totalPresale &gt; maxPresaleTokens) throw; balances[_to] = balances[_to].add(numOfTokens); }
5,367,079
./full_match/5/0x2c815E7D0579670a0c538d6578dB937E410BFFe4/sources/contracts/Crowdfunding.sol
payable keyword - deals with the recieving of cryptocurrency
function donateToCampaign(uint256 _id) public payable { Campaign storage campaign = campaigns[_id]; campaign.donations.push(amount); if(sent) { campaign.amountCollected = campaign.amountCollected + amount; } }
7,040,775
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "./TradingAction.sol"; import "./ActionGuards.sol"; import "./nTokenMintAction.sol"; import "./nTokenRedeemAction.sol"; import "../SettleAssetsExternal.sol"; import "../FreeCollateralExternal.sol"; import "../../math/SafeInt256...
If an account has a negative cash balance we allow anyone to lend to to that account at a penalty rate to the 3 month market. account the account initiating the trade, used to check that self settlement is not possible cashGroup parameters for the trade blockTime the current block time trade bytes32 encoding of the...
function _settleCashDebt( address account, CashGroupParameters memory cashGroup, uint256 blockTime, bytes32 trade ) internal returns ( uint256, int256, int256 ) { address counterparty = address(uint256(trade)...
11,960
./full_match/43113/0x2148a45E33050A799b3fEb906da7644466F2F2aC/sources/contracts/Lottery.sol
changes the price to buy a ticket
function setTicketPrice(uint256 newPrice) external onlyOwner { ticketPrice = newPrice; }
13,181,867
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than a...
get address of first buyer by index _index Index of first buyer return Address of first buyer/
function getFirstBuyerAddress(uint256 _index) constant public returns(address) { return firstBuyerIndex[_index]; }
13,884,791
./partial_match/1/0xE0d0D052d5B1082E52C6b8422Acd23415c3DF1c4/sources/Masset.sol
Gets the supply and cache details for the mAsset, taking into account the surplus return Cache containing (tracked) sum of vault balances, ideal cache size and surplus/
function _getCacheDetails() internal view returns (Cache memory) { uint256 _surplus = surplus; uint256 sum = totalSupply().add(_surplus); return Cache(sum, sum.mulTruncate(cacheSize), _surplus); }
4,434,436
/** * Created on 2018-06-05 16:37 * @summary: Our NFT Minting Contract which inherits ERC721 capability from LSNFT * @author: Fazri Zubair & Farhan Khwaja */ pragma solidity ^0.4.23; pragma solidity ^0.4.23; /* NFT Metadata Schema { "title": "Asset Metadata", "type": "object", "properties": { ...
Batch function to detach multiple assets _tokenIds The token identifiers/
function setBatchDetachCollectibles(uint256[] _tokenIds) public anyOperator { uint256 _id; for(uint i = 0; i < _tokenIds.length; i++) { _id = _tokenIds[i]; setNFTDetached(_id); } }
7,722,540
pragma solidity ^0.4.21; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author CryptoCollector contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) public view returns (uint256 balance); function imp...
check for the same category
function GetWildCardOwner(uint256 _tokenId) public view returns (address _cardowner){ uint256 index= cardTokenToPosition[_tokenId]; string storage cardCategory=cards[index].category; uint256 totalCards = totalSupply(); uint256 i=0; for (i = 0; i <= totalCards-1; i++) { if ((ke...
1,177,790
./full_match/11155111/0x239A92b91e5b88d2671ed531209E5E88B80Ad983/sources/project_/contracts/interfaces/IAccessControl.sol
AccessControl Interface - don't change any signatures to maintain interface ID hash/
interface IAccessControl { event RoleAdminChanged( bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole ); event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); event RoleRevoked(bytes32 indexed role, address ...
3,835,578
pragma solidity ^0.4.18; import './FuturesContract.sol'; import './oraclizeAPI.sol'; contract MarketPlace is usingOraclize { // Enum definitions enum UserLoginStatus { Online, Offline, Archieved } // Unscoped variables string public binanceBaseAPI = "https://api.binance.com/api/v3/ticker/price?symbol="; str...
User Account Management Function Params Validation Register new user to Contract
function registerUser(string _name, string _password) public notUserExist { require(bytes(_name).length > 3); require(bytes(_password).length > 3); users[msg.sender] = User({ exist: true, name: _name, status: UserLoginStatus.Offline, futuresContractID: new uint256[](0), pass...
12,661,599
// SPDX-License-Identifier: MIT pragma solidity ^0.5.3; /// @title Proxy - GSVE proxy contract allows to execute all transactions applying the code of a master contract and then burning a gas token. /// @author Stefan George - <[email protected]> /// @author Richard Meissner - <[email protected]> /// @author Gas Save...
Fallback function forwards all transactions and returns all received return data. solium-disable-next-line security/no-inline-assembly 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0sif the gas amount is low, then don't burn anything and finish the proxy operationif the operation has ...
function () external payable { uint256 gasStart = gasleft(); uint256 returnDataLength; bool success; bytes memory returndata; assembly { let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff) if eq(calldataloa...
13,830,511
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 amount o...
Aave flash is used only for withdrawal due to high fee compare to DyDx _flashAmount Amount for flash loan _shouldRepay Flag indicating we want to leverage or deleverage return Total amount we leverage or deleverage using flash loan/ Due to less fee DyDx is our primary flash loan provider
function _doFlashLoan(uint256 _flashAmount, bool _shouldRepay) internal returns (uint256) { uint256 _totalFlashAmount; if (isDyDxActive && _flashAmount > 0) { bytes memory _data = abi.encode(_flashAmount, _shouldRepay); _totalFlashAmount = _doDyDxFlashLoan(address(collateralT...
1,539,126
//Address: 0xb8bf73550f251562d308882e032225a700a7b9bc //Contract name: DWorldCore //Balance: 0 Ether //Verification Date: 2/3/2018 //Transacion Count: 7 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { functi...
Buy the current owner out of the plot.
function buyout(uint256 _deedId) external payable whenNotPaused { buyoutWithData(_deedId, "", "", "", ""); }
15,801,561
./full_match/5/0xaF58A878F9D9E4580476936EEB1Cb7D5Dd18cA7d/sources/contracts/DropSinglePhase.sol
Mint the relevant NFTs to claimer.
function claimBatch( address _receiver, ClaimData[] calldata _claimData, address _currency, uint256 _pricePerToken, AllowlistProof calldata _allowlistProof for (uint256 i; i < _quantity;) { uint256 id; id = uint256(nextTo...
11,591,905
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarv...
Override this to add all tokens/tokenized positions this contract manages on a persistent basis (e.g. not just for swapping back to want ephemerally) NOTE: Do not include `want`, already included in `sweep` below Example: function protectedTokens() internal override view returns (address[] memory) { address[] m...
function protectedTokens() internal view override returns (address[] memory) { address[] memory protected = new address[](2); protected[0] = asset; protected[1] = underlyingVault.token(); return protected; }
15,189,535
// Sources flattened with hardhat v2.9.3 https://hardhat.org // File @openzeppelin/contracts/utils/EnumerableSet.sol@v3.4.1 // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[set...
Role responsible for managing target addresses Emmited when a new pool is deployed deployer address of the deployer swapAddress address of the deployed pool pooledTokens, array of addresses of the tokens in the pool/ Emmited when the pool registry cache is updated poolRegistry address of the current Saddle Pool R...
function addRegistry(bytes32 registryName, address registryAddress) external payable; function resolveNameToLatestAddress(bytes32 name) external view returns (address); function resolveNameAndVersionToAddress(bytes32 name, uint256 version) external v...
13,694,364
./partial_match/1/0x1DfF114dfBBcaedcA5f0d46DC8e9615dfC2645bd/sources/IWETH9.sol
IERC20Metadata Alchemix Finance
interface IERC20Metadata { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); }
4,021,622
./full_match/1/0x23bE14b17f481a04D7A42AA18fFc4D9D502E70e3/sources/browser/ValueIOU/ValueIOU.sol
sets the rebaser _rebaser The address of the rebaser contract to use for authentication./
function setRebaser(address _rebaser) external override onlyGov { address oldRebaser = rebaser; rebaser = _rebaser; emit NewRebaser(oldRebaser, _rebaser); }
3,007,753
pragma solidity ^0.4.19; /* developed by cryptonomica.net, 2018 last version: 2018-02-18 github: https://github.com/Cryptonomica/ */ contract CryptonomicaVerification { /* ---------------------- Verification Data */ // Ethereum address is connected to OpenPGP public key data from Cryptonomica.net // Eth...
(!) Gas requirement: infinite
function stringToBytes32(string memory source) public pure returns (bytes32 result) {
6,947,153
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; /* Interface Imports */ import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol"; /** * @title OVM_State...
Retrieves an account from the state. _address Address of the account to retrieve. return Account for the given address./
function getAccount( address _address ) override public view returns ( Lib_OVMCodec.Account memory ) { return accounts[_address]; }
6,068,966
./full_match/43114/0x8BeF31c1e0aC12D73842a49436458Fd586C22A58/sources/MasterChefL2.sol
Update startTime by the owner (added this to ensure that dev can delay startTime due to the congestion network). Only used if required.
function setStartTime(uint256 _newStartTime) external onlyOwner { require(startTime > block.timestamp, 'setStartTime: farm already started'); require(_newStartTime > block.timestamp, 'setStartTime: new start time must be future time'); uint256 _previousStartTime = startTime; startT...
4,548,455
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "../Utilities/Ownable.sol"; /******************************************************* * Interfaces *******************************************************/ interface IV2Vault { function token() external view returns (address); ...
Fetch asset positions for an account for all assets/
function assetsPositionsOf(address accountAddress) public view returns (Position[] memory) { address[] memory _assetsAddresses = assetsAddresses(); return assetsPositionsOf(accountAddress, _assetsAddresses); } address _oracleAddress, address _helperAd...
12,583,909
./full_match/4/0x2A391abb0E042566A7C24249ECDb2533EaB5D76F/sources/https_/raw.githubusercontent.com/0xcert/ethereum-erc721/master/src/contracts/tokens/nf-token-enumerable.sol
This is an internal function which should be called from user-implemented external burn function. Its purpose is to show and properly initialize data structures when using this implementation. Also, note that this burn implementation allows the minter to re-mint a burned NFT. Burns a NFT. _tokenId ID of the NFT to be...
function _burn( uint256 _tokenId ) internal override virtual { super._burn(_tokenId); uint256 tokenIndex = idToIndex[_tokenId]; uint256 lastTokenIndex = tokens.length - 1; uint256 lastToken = tokens[lastTokenIndex]; tokens[tokenIndex] = lastToken; tokens.pop(); idToI...
726,825
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./lib/Whitelist.sol"; import "./lib/Withdrawable.sol"; import "./TraceToSPListInterface.sol"; /** * @title TraceToSPList * @dev This contract is the whitelist contract for service providers. */ contract TraceToSPList i...
check whether a wallet is a sp _sp the wallet going to be checked return _isSP true if the user is a sp/
function isSP(address _sp) public view returns (bool _isSP){ return isWhitelisted(_sp); }
1,772,685
pragma solidity 0.4.26; // optimization enabled, runs: 500 /************** TPL Extended Jurisdiction - YES token integration ************* * This digital jurisdiction supports assigning YES token, or other contracts * * with a similar validation mechanism, as additional attribute validators. * * https://gi...
Determine if a validator at account `validator` is able to issue attributes of the type with ID `attributeTypeID`. validator address The account of the validator. attributeTypeID uint256 The ID of the attribute type to check. return True if the validator can issue attributes of the given type, false otherwise./
function canIssueAttributeType( address validator, uint256 attributeTypeID ) external view returns (bool) { return canValidate(validator, attributeTypeID); }
1,829,734
./full_match/3/0x57763B44f9fD2B5Dc5a7e131721b8569630F3A95/sources/browser/TokenERC721.sol
Find the owner of an NFT _tokenId The identifier for an NFT NFTs assigned to zero address are considered invalid, and queries about them do throw. return The address of the owner of the NFT
function ownerOf(uint256 _tokenId) public view returns(address){ require(isValidToken(_tokenId)); if(owners[_tokenId] != address(0x0)){ return owners[_tokenId]; return creator; } }
8,266,086
// Dependency file: @uniswap/lib/contracts/libraries/TransferHelper.sol // pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { ...
SWAP requires the initial amount to have already been sent to the first pair
function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = TaalLibrary.sortTokens(input, output); uint amountOut = amou...
13,767,037
./full_match/80001/0xF60bF646EF62B19859e00a3fC4d4d488b84ff74F/sources/DigitalaxIndex.sol
Function for adding designer token group _address Address of designer to be added _uri ipfs uri for designer to be added _tokenIds Array of token ids to be added/ require(designerGroupSet[_address].uri, "DigitalaxIndex.addDesignerGroup: designer already exists.");
function addDesignerGroup(address _address, string calldata _uri, uint256[] calldata _tokenIds) external { require(accessControls.hasAdminRole(_msgSender()), "DigitalaxIndex.addDesignerGroup: Sender must be admin"); require(_address == address(0), "DigitalaxIndex.addDesignerGroup: address must not b...
852,827
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existenc...
OVERRIDE Allows the current owner to relinquish control of the contract. Renouncing to ownership will leave the contract without an owner. It will not be possible to call the functions with the `onlyOwner` modifier anymore./
function renounceOwnership() public onlyOwner { revert("Cannot renounce ownership"); }
1,016,707
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.7.0; import "./lib/ReEncryptionValidator.sol"; import "./lib/SignatureVerifier.sol"; import "./StakingEscrow.sol"; import "./proxy/Upgradeable.sol"; import "../zeppelin/math/SafeMath.sol"; import "../zeppelin/math/Math.sol"; /** * @title Adjudicator *...
Withdraw available amount of tokens to staker _value Amount of tokens to withdraw/ the max locked tokens in most cases will be in the current period but when the staker locks more then we should use the next period unbond worker if staker withdraws last portion of NU
function withdraw(uint256 _value) external onlyStaker { uint16 currentPeriod = getCurrentPeriod(); uint16 nextPeriod = currentPeriod + 1; StakerInfo storage info = stakerInfo[msg.sender]; uint256 lockedTokens = Math.max(getLockedTokens(info, currentPeriod, nextPeriod), ge...
1,393,139
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract VoltronToken { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; event Transfer(address indexed owner, address indexed recipient, uint256 value); event Approval...
msg.sender = (third-party) spender
function transferFrom(address owner, address recipient, uint256 amount) public returns (bool) { uint256 currentAllowance = _allowances[owner][msg.sender]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _transfer(owner, recipient, amount); _ap...
5,978,765
./full_match/137/0x15255A1287e366ce8DE96e9f571B93824ef354A7/sources/contracts/Merkletree.sol
CountersInventoryPricesUtilitymapping
{ using Counters for Counters.Counter; using Strings for uint256; Counters.Counter internal _airdrops; string public baseURI; string public notRevealedUri; bytes32 private whitelistRoot; uint16 public maxMintAmountPerTransaction = 10; uint16 public maxMintAmountPerWallet = 10; uint...
4,785,799
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (finance/VestingWallet.sol) pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; interface IMultiSigGoverna...
Cancel an ongoing vesting with the vested amount sent to beneficiary and the rest to `remainderRecipient`/
function cancel(uint256 id, address remainderRecipient) external { require(msg.sender == coreTeam || msg.sender == committee, "DAOKIT: FORBIDDEN"); Vesting storage v = vesting[id]; require(msg.sender != coreTeam || IMultiSigGovernance(committee).isMember(v.beneficiary), "DAOKIT: ABUSIVE"); ...
13,062,837
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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...
withdrawRefund performs fund transfer to the client's account. _orderId Identifier of the order/ changing withdraw state before transfer transfer fund to clients account log withdrawn
function withdrawRefund(uint _orderId) external whenNotPaused { Withdraw storage withdraw = withdrawals[_orderId]; require(WithdrawState.Pending == withdraw.state); require(withdraw.tokenAddress == address(0)); address clientAddress = withdraw.clientAddress; uint amo...
12,864,072
// SPDX-License-Identifier: GPL-3.0 // File: @openzeppelin/contracts/utils/Strings.sol pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. ...
Hook that is called before any token transfer. This includes minting and burning. Calling conditions: - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be transferred to `to`. - When `from` is zero, `tokenId` will be minted for `to`. - When `to` is zero, ``from``'s `tokenId` will be burned. - `from` c...
function _beforeTokenTransfer(address from,address to, uint256 tokenId) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOw...
275,196
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import './CyanWrappedNFTV1.sol'; import './CyanVaultV1.sol'; contract CyanPa...
Liquidate defaulted payment plan wNFTContract Wrapped NFT contract address wNFTTokenId Wrapped NFT token ID estimatedTokenValue Estimated value of defaulted NFT/ Until the last payment
function liquidate( address wNFTContract, uint256 wNFTTokenId, uint256 estimatedTokenValue ) external nonReentrant onlyRole(CYAN_ROLE) { require( _paymentPlan[wNFTContract][wNFTTokenId].totalNumberOfPayments != 0, 'No payment plan found' ); ...
202,903
pragma solidity ^0.4.18; /* * This contract represents the game logic itself. */ library Rules { /* * Structs. */ /* * This struct represents connections, * that one field has to it's neighbours. */ struct Field { uint8[4] connections; } /* * This struc...
Return total number of moves made, i.e. how many lines was placed. self - Reference to current state object. returns numberOfOccupiedLines - Number of placed lines./
function getNumberOfMovesMade(State storage self) internal view returns (uint8 numberOfOccupiedLines) { return self.occupiedLines; }
1,028,605
pragma solidity ^0.5.8; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; import "./Bytes.sol"; import "./Operations.sol"; import "./UpgradeableMaster.sol"; //...
Register full exit request - pack pubdata, add priority request _accountId Numerical id of the account _token Token address, 0 address for ether Priority Queue request
function fullExit(uint32 _accountId, address _token) external nonReentrant { requireActive(); require(_accountId <= MAX_ACCOUNT_ID, "fee11"); uint16 tokenId; if (_token == address(0)) { tokenId = 0; tokenId = governance.validateTokenAddress(_token); }...
5,479,363
./full_match/1/0x7e3C7C1869E515D2637Ea48eDaf198b186F2c79b/sources/contracts/TimelockController.sol
Schedule an operation containing a batch of transactions. Emits one {CallScheduled} event per transaction in the batch. Requirements: - the caller must have the 'proposer' role./
function scheduleBatch(address[] calldata targets, uint256[] calldata values, bytes[] calldata datas, bytes32 predecessor, bytes32 salt, uint256 delay) public onlyRole(PROPOSER_ROLE) returns (bytes32 id) { require(targets.length == values.length, "TimelockController: length mismatch"); require(targe...
3,199,105
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.1; contract MultiPersonWallet { //Making the set of people address[] public Participants; //the contract deployer and Mainman who is in charge address payable public bossman; //deployer constructor(){ boss...
adding a person to the wallet Works
function addparticipant(address _participant) public { require(msg.sender == bossman, "Not BOSSMAN"); Participants.push(_participant); owners[_participant] = true; }
15,864,771
pragma solidity ^0.4.24; // import 'openzeppelin-solidity/contracts/math/SafeMath.sol'; // 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, ...
If tokens are already locked, the functions extendLock or increaseLockAmount should be used to make any changesrequire(tokensLocked(_of, _reason, block.timestamp) == 0);
function lock(address _of, bytes32 _reason, uint256 _amount, uint256 _time) onlyOwner public returns (bool) { uint256 validUntil = block.timestamp.add(_time); require(_amount <= transferableBalanceOf(_of)); if (locked[_of][_reason].amount == 0) ...
12,760,742
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "./IlluviumPoolBase.sol"; /** * @title Illuvium Core Pool * * @notice Core pools represent permanent pools like ILV or ILV/ETH Pair pool, * core pools allow staking for arbitrary periods of time up to 1 year * * @dev See IlluviumPoolBase for m...
Reads an entire voting power history array for the delegate specified _of delegate to query voting power history for return voting power history array for the delegate of interest/ return an entire array as memory
function getVotingPowerHistory(address _of) public view returns(VotingPowerRecord[] memory) { return votingPowerHistory[_of]; }
898,552
./full_match/42161/0x0188002Cc2166a65F6876d5bf39B9182e129ec35/sources/contracts/strategies/MatrixSwapHelper.sol
debugging: uncomment this block console.log("_fromToken:", IERC20Metadata(_fromToken).symbol()); console.log("_toToken", IERC20Metadata(_toToken).symbol()); console.log("_path:"); for (uint i; i < _swapPath.path.length; i++) { console.log(_swapPath.path[i]); console.log(IERC20Metadata(_swapPath.path[i]).symbol(...
function _swap( address _fromToken, address _toToken, uint256 _amount ) internal virtual returns (uint256 _toTokenAmount) { if (_fromToken == _toToken) return _amount; SwapPath memory _swapPath = getSwapPath(_fromToken, _toToken); IERC20(_fromToken).safeApprove(_...
16,300,580
./full_match/4/0x64989dc83c39B02b7117b76D74a853195Ea614Ba/sources/browser/nft_marketplace.sol
burn as admin, without CYTR move
function adminBurn(uint256 _tokenId) external onlyOwnerOrPriceManager returns(uint256){
648,125
pragma solidity ^0.5.0; import "../lib/BN256.sol"; import "../Ownable.sol"; contract UserContractInterface { // Query callback. function __callback__(uint, bytes calldata) external; // Random number callback. function __callback__(uint, uint) external; } contract DOSProxyMock is Ownable { using B...
Caller ensures no index overflow.
function getGroupPubKey(uint idx) public view returns (uint[4] memory) { BN256.G2Point storage pubKey = workingGroups[workingGroupIds[idx]].groupPubKey; return [pubKey.x[0], pubKey.x[1], pubKey.y[0], pubKey.y[1]]; }
886,841
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ // File: @openzeppelin/contracts/utils/ReentrancyGuard.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {no...
Deposit ERC20 collateral. vaultNum Vault number. amount ERC20 amount to deposit./ Receives Gem amount, approve and joins it into the vat. Also convert amount to 18 decimal Locks Gem amount into the CDP
function depositCollateral(uint256 vaultNum, uint256 amount) external override nonReentrant onlyVaultOwner(vaultNum) { amount = joinGem(mcdGemJoin[vaultType[vaultNum]], amount); ManagerLike manager = ManagerLike(mcdManager); VatLike(manager.vat()).frob( ...
2,352,491
// File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * m...
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
6,521,388
./partial_match/1/0x7516Ce30a4abadEf77F7Dd878BB849f0291c3771/sources/AEBBEGINS.sol
try catch vaersion ownerOf. support burned tokenid.
function tryOwnerOf(uint256 tokenId) external view virtual returns (address) { try this.ownerOf(tokenId) returns (address _address) { return(_address); } } catch { }
3,961,516
./full_match/1/0xa0334AD349c1D805BF6c9e42125845B7D4F63aDe/sources/contracts/lib/CoreTypes.sol
support EIP-2718: Currently all transaction types have the same receipt RLP format, so we can just skip the receipt type byte skip the earlier logs
function extractLog(bytes calldata receiptValue, uint256 logIdx) internal pure returns (LogData memory) { if (receiptValue[0] < 0x80) { receiptValue = receiptValue[1:]; } (, uint256 offset) = RLP.parseList(receiptValue); receiptValue = receipt...
17,179,415