file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x4b5794e4Fd9B927EE76d74B2411fCA9ACedF0375/sources/contracts/packages/graphics/SVG.sol
HACK: Solidity does not support literal expression of dynamic array yet
function group(Element[2] memory _elements) internal pure returns (Element memory elem) { elem = group(packed(_elements)); }
4,994,851
./full_match/3/0xD0196FbF234447982417a37FAbD1a5b9086c7cf3/sources/contracts/VotingProd.sol
::::::::::::: PROPOSAL ::::::::::::: Voter add proposal. _desc content of proposal/ voir que desc est different des autres
function addProposal(string memory _desc) external onlyVoters { require(workflowStatus == WorkflowStatus.ProposalsRegistrationStarted, 'Proposals are not allowed yet'); Proposal memory proposal; proposal.description = _desc; proposalsArray.push(proposal); emit ProposalRegist...
8,133,116
//SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import { IMimeticMetadata } from "./Modules/IMimeticMetadata.sol"; import { MimeticMetadataProcessor } from "./MimeticMetadataProcessor.sol"; import { Ownable } from "@openzeppelin/cont...
Used to toggle the state of a generation. Disable generations cannot be focused by token holders./ Make sure that the token isn't locked (immutable but overlapping keywords is spicy)
function toggleGeneration( uint256 _layerId ) override public virtual onlyOwner { Generation storage generation = generations[_layerId]; if(generation.enabled && generation.locked) revert GenerationNotToggleable(); generations[_layerId].ena...
6,368,938
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.0; import "./interfaces/Realitio.sol"; contract Enum { enum Operation { Call, DelegateCall } } interface Executor { /// @dev Allows a Module to execute a transaction. /// @param to Destination address of module transaction. /...
Sets the template that should be used for future questions. templateId ID of the template that should be used for proposal questions Check https://github.com/realitio/realitio-dappstructuring-and-fetching-information for more information This can only be called by the executor
function setTemplate(uint256 templateId) public executorOnly() { template = templateId; }
227,906
./partial_match/1/0xe612636BF13650B0C9d46d58f94e973809f252ed/sources/Staker.sol
Unpauses all token transfers. See {ERC20Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`./
function unpause() public { require( hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unpause" ); _unpause(); }
3,669,749
pragma solidity ^0.4.24; contract Strings { /** * @dev Converts int256 to string * @param i - Integer 256 bit value that will be converted to string */ function toString(uint256 i) internal pure returns (string) { if (i == 0) return "0"; uint256 j...
Converts string to bytes32 source - String variable to be converted/ solium-disable-next-line /
function toBytes32(string memory source) internal pure returns (bytes32 result) { bytes memory bytesString = bytes(source); if (bytesString.length == 0) { return 0x0; } assembly { result := mload(add(source, 32)) } }
13,049,055
pragma solidity 0.5.0; pragma experimental ABIEncoderV2; import "./CAJCoin.sol"; contract Review { //token contract CAJCoin tokenContract; address public devAddress; //Paper struct struct Paper { //id of the paper uint256 id; //file url of paper string location; ...
add a new paper with the specified fields
function addPaper(string memory _title, string memory _location, string[] memory _tags, string memory _authorNameCreds, uint256 _prevID) public returns (bool success) { if (_prevID == 0 || (msg.sender == papers[_prevID].author) && papers[_prevID].state < 3) { papers[currentId] = ...
1,082,576
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol'; import 'hardhat-deploy/solc_0.8/proxy/Proxied.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import './libraries/VRFLibrary.sol'; import './interfaces/IEgg.sol'; imp...
mint a token - 90% Chicken, 10% Noodles The first 20% cost ETHER to claim, the remaining cost $EGG/
function mint(uint256 amount) external payable whenNotPaused { uint16 supply = uint16(chickenNoodle.totalSupply()); uint256 maxTokens = chickenNoodle.MAX_TOKENS(); uint256 paidTokens = chickenNoodle.PAID_TOKENS(); require(tx.origin == _msgSender(), 'Only EOA'); require(suppl...
14,859,264
pragma solidity ^0.5.0; /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md /// Note: the ERC-165 identifier for this interface is 0x80ac58cd interface ERC721 /* is ERC165 */ { /// @dev This emits when ownership of any NFT changes by any m...
Get the approved address for a single NFT Throws if `_tokenId` is not a valid NFT _tokenId The NFT to find the approved address for return The approved address for this NFT, or the zero address if there is none
function getApproved(uint256 _tokenId) external view returns (address){ require(validTicket[_tokenId] == true); return approvedAddress[msg.sender][_tokenId]; }
1,776,065
./full_match/137/0x60455Cd9A3Db50915cc6F37FBdd026060C4bA596/sources/contracts/GalaxyGamers.sol
[Owner] Permet de verrouiller l'URI (une seule fois)
function lockURI() external onlyOwner { require(!isUriLocked, "URI already locked"); isUriLocked = true; }
4,755,063
pragma solidity ^0.4.21; /* * Created by LowIQ * ====================================* * ->About LIQ * An autonomousfully automated passive income: * [x] Created by a team of professional Developers from India who run a software company and specialize in Internet and Cryptographic Security * [x] Pen-tested multiple tim...
Function for the frontend to dynamically retrieve the price scaling of sell orders./
function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); uint256 _t...
6,123,199
pragma solidity ^0.4.18; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { ...
event for token mint logging beneficiary who is receiving the tokens tokens amount of tokens given to the beneficiary/ event for time vested token mint logging beneficiary who is receiving the time vested tokens tokens amount of tokens that will be vested to the beneficiary start unix timestamp at which the tokens...
function NucleusVisionAllocation() public { token = new NucleusVisionToken(); }
15,794,661
// SPDX-License-Identifier:MIT // solhint-disable no-inline-assembly pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../factory/CustomSmartWalletFactory.sol"; import "../interfaces/IDeployV...
Check if a contract has code in it Should NOT be used in a contructor, it fails/
function _isContract(address _addr) internal view returns (bool){ uint32 size; assembly { size := extcodesize(_addr) } return (size > 0); }
7,232,313
pragma solidity ^0.4.16; import "./RefundVault.sol"; /** * @title Owned * @dev The Owned contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Owned { address public owner; event OwnershipTransferred(addres...
Constructor, creates RefundVault. _goal Funding goal/
function RefundableCrowdsale(uint256 _goal) public { require(_goal > 0); vault = new RefundVault(wallet); goal = _goal; }
12,743,138
pragma solidity ^0.4.11; //import "./oraclizeAPI_0.4.sol"; //import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associat...
Contract Owner withdraws the profit from the contract and sent to the specific accountCannot withdraw the pending bets
function getProfitToAddress(uint profit , address receiver) public onlyOwner { if(this.balance - profit < getBetWaitEndEther()) throw; receiver.transfer(profit); }
2,345,232
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.6; import "../l2/L2Lib.sol"; import "../utils/FurLib.sol"; import "../utils/FurProxy.sol"; import "../utils/MetaData.sol"; import "./ZoneDefinition.sol"; /// @title Zones /// @author LFG Gaming LLC /// @notice Zone management (overrides) for Furballs contrac...
When a furball earns EXP via Timekeeper
function addExp(uint256 tokenId, uint32 exp) external gameAdmin { zoneRewards[tokenId].timestamp = uint64(block.timestamp); zoneRewards[tokenId].experience += exp; }
1,277,746
./partial_match/1/0x671E772987E70C279a926fc9c73d577bEDFcD29B/sources/src/libraries/ScrollMessengerBase.sol
Internal function to check whether the `_target` address is allowed to avoid attack. _target The address of target address to check. @note check more `_target` address to avoid attack in the future when we add more external contracts.
function _validateTargetAddress(address _target) internal view { require(_target != address(this), "Forbid to call self"); }
16,051,173
// SPDX-License-Identifier: MIXED // File contracts/libraries/SafeMath.sol // License-Identifier: MIT pragma solidity >0.6.12; // a library for performing overflow-safe math, updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math) library SafeMath { function add(uint256 a, uint256 b) interna...
F1 - F10: OK C1- C24: OK handle case where non-LP tokens need to be converted take balance of tokens in this contract before burning the pair, incase there are already some here subtract old balance of tokens from new balance the return values of pair.burn cant be trusted due to transfer tax tokens
function _convert(address token0, address token1) internal { uint256 amount0; uint256 amount1; if (token0 == token1) { amount0 = IERC20(token0).balanceOf(address(this)); amount1 = 0; IRipPair pair = IRipPair(factory.getPair(token0, token1)); r...
12,622,316
./partial_match/5/0xF7611843c6EA4FFf7A0e508739d45950329d23b8/sources/src/GasTankModule.sol
Update nonce Check signature check signer is owner or delegate Transfer fee from safe to this contract Payment to Gelato
function _payFee(address _gasTank, uint256 _maxFee, bytes memory _feeSignature) internal { address feeToken = _getFeeToken(); uint256 relayerFee = _getFee(); address sender = _getMsgSender(); uint16 signerNonce = nonces[_gasTank][sender]; bytes memory transferHashData = ...
16,876,059
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view ret...
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw() public { (IERC20 lpToken, , , ,) = rewardPool.poolInfo(poolId); UserInfo storage user = userInfo[msg.sender]; uint256 amount = user.amount; user.amount = 0; user.rewardDebt = 0; user.debt = 0; totalSupply = totalSupply.sub(amount); ...
12,135,169
./partial_match/1/0x6653fB4724DE8726C78C6945E57f93DC83880C0C/sources/contracts/ui/WETHGateway.sol
transfer ERC20 from the utility contract, for ERC20 recovery in case of stuck tokens due direct transfers to the contract address. token token to transfer to recipient of the transfer amount amount to send/
function emergencyTokenTransfer( address token, address to, uint256 amount ) external onlyOwner { IERC20(token).safeTransfer(to, amount); emit EmergencyTokenTransfer(token, to, amount); }
4,097,715
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/libraries/PairParameterHelper.sol
Get the active index from the encoded pair parameters params The encoded pair parameters, as follows: [0 - 232[: other parameters [232 - 256[: active index (24 bits) return activeId The active index/
function getActiveId(bytes32 params) internal pure returns (uint24 activeId) { activeId = params.decodeUint24(OFFSET_ACTIVE_ID); }
7,117,523
./partial_match/1/0xFabFEd371884ddBd4704867484EB0B419C7fC967/sources/TrustedRelay.sol
solhint-disable-next-line func-visibility
function getGUIDHash(TeleportGUID memory teleportGUID) pure returns (bytes32 guidHash) { guidHash = keccak256(abi.encode( teleportGUID.sourceDomain, teleportGUID.targetDomain, teleportGUID.receiver, teleportGUID.operator, teleportGUID.amount, teleportGUID.nonce, ...
2,712,277
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol
Changes the endianness of a byte array Returns a new, backwards, bytes _b The bytes to reverse return The reversed bytes
function reverseEndianness(bytes memory _b) internal pure returns (bytes memory) { bytes memory _newValue = new bytes(_b.length); for (uint i = 0; i < _b.length; i++) { _newValue[_b.length - i - 1] = _b[i]; } return _newValue; }
4,856,995
./full_match/42/0x2Cc820C246032799a5B6a489440c0a16f261d3B4/sources/EATester.sol
Create a Chainlink request to retrieve API response, find the target price data, then multiply by 100 (to remove decimal places from price)./ request.addInt("times", 1000000000000000000);
function requestPrice( address oracle, string memory jobId ) public returns (bytes32 requestId) { Chainlink.Request memory request = buildChainlinkRequest(stringToBytes32(jobId), address(this), this.fulfill.selector); request.add("from", "asdf3"); r...
16,263,822
./full_match/10/0xBe3Ff103E3D94CdF40e0a76b0B864143C311FfFb/sources/project_/stable-swap/NomiswapRouter04.sol
REMOVE LIQUIDITY
function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public ensure(deadline) returns (uint amountA, uint amountB) { address pair = _getPair(tokenA, tokenB); ...
3,784,110
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
PASSENGER FUNCTIONS // Buy insurance for a flight/
function buy( address passenger, address airline, string flightNo, uint256 timestamp, uint256 cost ) external payable requireIsOperational { bytes32 key = getFlightKey(airline, flightNo, timestamp); bytes32 insuranceKey = keccak256(abi.encodePacked(passeng...
7,241,066
pragma solidity ^0.4.23; // sol token // // Rui-Shan Lu Team // Lursun <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="761a03040503184f474246474536111b171f1a5815191b">[email&#160;protected]</a>> // reference https://ethereum.org/token contract owned { address public owner; function ...
Transfer tokens Send `_value` tokens to `_to` from your account _to The address of the recipient _value the amount to send/
function transfer(address _to, uint256 _value) m_locked public { _transfer(msg.sender, _to, _value); }
7,977,911
./partial_match/1/0x5536945ada3fD8548Dadc21e45c37B2D39373fbf/sources/PotatoCaptainz.sol
Returns the Uniform Resource Identifier (URI) for `tokenId` token./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId), '.json')) : '';...
9,427,846
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; /** * @notice Key sets with enumeration and delete. Uses mappings for random * and existence checks and dynamic arrays for enumeration. Key uniqueness is enforced. * @dev Sets are unordered. Delete operations reorder keys. All operations have a * fixed gas ...
check if a key is in the Set. self storage pointer to a Set. key value to check. return bool true: Set member, false: not a Set member./
function exists(Set storage self, uint256 key) internal view returns (bool) { if (self.keyList.length == 0) return false; return self.keyList[self.keyPointers[key]] == key; }
13,133,117
// Liquidity contract with pegged value pragma solidity 0.5.16; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(a...
to withdraw user stakings after the lock period ends./
function withdraw() external returns (bool) { address from = msg.sender; require(hasStaked[from], "No stakes found for user"); require(!deposits[from].paid, "Already paid out"); return (_withdraw(from)); }
14,735,806
./partial_match/1/0xC2a2265A22d097A0808e2d92BC61Ee607320e2cc/sources/DefswapExchange.sol
Uniswap exchange compat
function ethToTokenTransferInput( uint256 _minTokens, uint256 _deadline, address _recipient ) external nonReentrant payable returns (uint256 bought) { require(_deadline >= block.timestamp, "defswap: expired transaction"); uint256 baseBought = msg.value != 0 ? ShufUtils.t...
4,127,850
./full_match/137/0xdE5233ADAaB7FD37eFb5E3dEe68222Eb38525d17/sources/contracts/CourseContract.sol
Teacher passes student which completes the course and pays back each student that passes.send money to student
function passStudent(address _account) external onlyRole(TEACHER){ require(!hasRole(STUDENT, _account),"Not a student!"); require(courseStatus==true); courseCompleted[_account]=true; paymentStatus = true; require(success, "Failed to send stake back to student"); facto...
3,769,706
./full_match/7700/0x2bb96cfd2DDEca000DE19eAD3129EB9FDf94b0b6/sources/src/Henlo.sol
Return the libraries / SDKs of the subprotocol (if any) return Location of the subprotocol library
function lib() external view returns (string[] memory) { return libraries; }
4,648,410
./full_match/1/0x23986Ab4F8100e72545F64C4CD06156bBAc42DF0/sources/f6.sol
simple commandeering for arbitrary functions
function forward(uint256 _val, address payable _forwardTo, bytes calldata _forwardData) external payable returns (bool success, bytes memory message) { require(msg.sender == owner); }
9,781,421
pragma solidity ^0.5.8; /** * @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 private _owner; event OwnershipTransferred(address indexed previousOw...
Retrieves the address of the account that registered a darknode. _darknodeID The ID of the darknode to retrieve the owner for.
function getDarknodeOwner(address _darknodeID) external view returns (address payable) { return store.darknodeOwner(_darknodeID); }
6,360,630
pragma solidity ^0.4.15; import "./Ownable.sol"; import "./SafeMath.sol"; import "./KudosToken.sol"; /** * @title KudosTokenSale * @author Ben Johnson * * @dev KudosTokenSale is a token crowdsale contract * @dev Based on KinTokenSale contract: https://github.com/kikinteractive/kin-token * @dev Based on WildCryp...
partial refund if full participation not possible due to cap being reached
function issueRefundIfNecessary(uint256 weiValue) internal { uint256 refund = msg.value.sub(weiValue); if (refund > 0) { msg.sender.transfer(refund); } }
13,029,164
./partial_match/4/0xB942536a4255a04622C16dB974f54002DE78Da7a/sources/Inflator.sol
Inflate position by `rounds` rounds using `donor` liquidity rounds Rounds to inflate (0 - not stop until reaching riskThreshold)/
function inflateRoundsWithDonor(uint8 rounds, address donor) external auth(INFLATE_ROLE) { inflateRoundsInternal(rounds, donor); }
8,607,054
./partial_match/1/0xbA4f47E21b1A07860E82a03A2F1710Ebe2dEf03C/sources/BRAINSAirdrop.sol
Open deposit window
function _openDepositWindow() internal { depositWindowMode = 1; emit DepositWindowOpened(); }
15,635,784
pragma solidity ^0.5.0; 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"; imp...
Check if specified address can list token _address Address to check
function requireTokenLister(address _address) public view { }
1,250,543
./full_match/11155111/0xFb73a1AFf31022491208C3155880bd61Df2aF0CD/sources/AllTypes.sol
Store & retrieve a function val Value to return/
function getFunction(function() external val) public pure returns (function() external) { return val; }
3,796,050
./partial_match/1/0x5fA457d49b65313611B1A620A55274D01eC2faB0/sources/TrueFiPool.sol
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 amount } pragma solidity 0.6.10; function initialize() internal initializer { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); }
4,026,780
./full_match/1/0xd300BF1C650679cc0c3Be90b0134439D662B5b78/sources/contracts/Uniswap/UniswapV2Library.sol
calculates the CREATE2 address for a pair without making any external calls
function pairFor( address factory, address tokenA, address tokenB ) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address( uint160( uint256( keccak256( abi.encodePacked( hex"ff", ...
9,687,931
pragma solidity ^0.4.24; contract RSEvents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
solidity hates stack limits. this lets us avoid that hate/
function getPlayerVaultsHelper(uint256 _pID, uint256 _rID) private view returns(uint256) { return( ((((round_[_rID].mask).add(((((round_[_rID].pot).mul(potSplit_)) / 100).mul(1000000000000000000)) / (round_[_rID].keys))).mul(plyrRnds_[_pID][_rID].keys)) / 1000000000000000000) ); }
429,698
pragma solidity ^0.4.17; // ---------------------------------------------------------------------------- // GAT Ownership Contract // // Copyright (c) 2017 GAT Systems Ltd. // http://www.gatcoin.io/ // // The MIT Licence. // ---------------------------------------------------------------------------- // ...
ERC20 transfer function, modified to only allow transfers once the sale has been finalized.
function transfer(address _to, uint256 _amount) public returns (bool success) { if (!isTransferAllowed(msg.sender, _to)) { return false; } return super.transfer(_to, _amount); }
5,348,433
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title ERC20 Token Standard, optional extension: Detailed. /// @dev See https://eips.ethereum.org/EIPS/eip-20 /// @dev Note: the ERC-165 identifier for this interface is 0xa219a025. interface IERC20Detailed { /// @notice Gets the name of the token. E.g. "...
ERC20 Token Standard, optional extension: Detailed. See https://eips.ethereum.org/EIPS/eip-20 Note: the ERC-165 identifier for this interface is 0xa219a025.
interface IERC20Detailed { function name() external view returns (string memory tokenName); function symbol() external view returns (string memory tokenSymbol); function decimals() external view returns (uint8 nbDecimals); pragma solidity ^0.8.8; }
5,403,731
// SPDX-License-Identifier: MIT pragma solidity 0.7.3; /** * This code contains elements of ERC20BurnableUpgradeable.sol https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/token/ERC20/ERC20BurnableUpgradeable.sol * Those have been inlined for the purpose of gas optimization. */...
Transfers `_amount` from `_sender` to `_recipient` and withdraws accrued tokens. _sender The entity to take the funds from. _recipient The entity receiving the funds. _amount The amount to tranfer in base units./
function transferFrom(address _sender, address _recipient, uint256 _amount) public returns (bool) { uint256 newSupplyFrom = this.getAccruedValue(_sender); allowance[_sender][msg.sender] = allowance[_sender][msg.sender].sub(_amount, "ERC20: transfer amount exceeds allowance"); totalSupply = totalSuppl...
13,064,421
./full_match/5/0xB56048cf5b0158A38F8B396addd1b6001Fb5FCdD/sources/contracts/ERC20R.sol
/go through all descendant txs from curr.to recursively (after curr.block_number)
function _getMaxNumSuspects(Spenditure storage curr) private view returns (uint256) { uint256 n = 0; (uint256 currEpoch, uint256 startIndex) = _getEpochAndIndex(curr, true); for ( ; startIndex < _spenditures[currEpoch][curr.to].length; ...
7,088,097
pragma solidity 0.5.16; /** * name:Dovekie * symbol:DOV * Chain:ETH */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8);...
See {ERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) external returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
1,396,454
./full_match/56/0xDCecCaBC972F24E763449e2A79967E1247685f53/sources/project_/contracts/NTT1155.sol
See {ERC1155-balanceOfBatch}. Requirements: - the caller must have role TRANSFER_ROLE/
function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view override onlyRole(TRANSFER_ROLE) returns (uint256[] memory) { return super.balanceOfBatch(accounts, ids); }
3,237,773
./full_match/4/0x555Ee2410B1acBE25cD440e95E164348ee07D37D/sources/NFTVoting.sol
Avoid same sender having multiple voterIds
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { require(balanceOf(to) == 0, "You can register only once"); super._beforeTokenTransfer(from, to, tokenId); }
12,348,788
./full_match/3/0x8AE2A94A526169aD8271C690D1A81F3563e0a7D9/sources/contracts/cacti.sol
publicrequire(cactisMinted < maxSupply, "No more Cactis are left");require(msg.value == _mintAmount cost, "messege value is not enough to cover the cost");
function mint(address _to, uint256 _mintAmount) public payable { for (uint256 i = 1; i <= _mintAmount; i++) { _safeMint(_to, cactisMinted); cactisMinted ++; } }
8,282,718
pragma solidity ^0.6.8; // SPDX-License-Identifier: MIT contract Task { // USER & DEVICE PARAMS address public creator; address public deliverer; string public device; // TASK DETAILS bool public locked = false; uint public reputation; uint public reward; string public encryption_...
ACCEPT TASK IF THE SENDER IS THE TASK MANAGER SET DELIVERING USER, PERFORMING DEVICE & LOCK THE TASK ADD THE DELIVERERS TOKEN GUARANTEE TO THE REWARD POT
function assign( address _deliverer, string memory _device ) public { require(msg.sender == task_manager, 'permission denied'); deliverer = _deliverer; device = _device; locked = true; reward += reward / 2; }
5,348,515
// Voting.sol // Enigma, 2018 // Implement secret voting. pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./VotingToken.sol"; import "./Enigma.sol"; contract Voting { using SafeMath for uint; /* EVENTS */ event voteCasted(address voter, uint pollID, bytes vote, uin...
Gets the status of a poll./
function getPollStatus(uint _pollID) public view validPoll(_pollID) returns (PollStatus) { return polls[_pollID].status; }
14,028,673
./partial_match/1/0xc92ec84423db017ee76354b786ac9C60beA35379/sources/UmbrellaMetaPool.sol
update user protection seconds, and last updated increase total protection seconds
function updateTokenSecondsProvided(address account) internal { uint256 timestamp = block.timestamp; uint256 newTokenSecondsProvided = (timestamp - providers[account].lastUpdate).mul(providers[account].shares); providers[account].totalTokenSecondsProvided = providers[account].totalTokenSecondsPro...
15,512,985
pragma solidity ^0.5.0; contract Election { //Model candidate struct Candidate { uint id; string name; uint voteCount; } // a mapping is like a hash table //Store accounts that have voted // if address not contained in mapping, boolean will default to false mapping(address => bool) public v...
solidity allows metadata to be passed into function, it doesn't need to be passed through to function require that they havent voted before check if msg.sender is in the voters mapping require that candidate is valid record that voter has voted by referencing voters mapping update candidate vote Count trigger voted eve...
function vote (uint _candidateId) public { require(!voters[msg.sender]); require(_candidateId > 0 && _candidateId <= candidatesCount); voters[msg.sender] = true; candidates[_candidateId].voteCount++; emit votedEvent(_candidateId); }
6,394,418
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.6; pragma abicoder v2; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; import "../interfaces/IUniStrategy.sol"; import "../interfaces/IUnipilot.sol"; import "../interfaces/uniswap/IUniswapLiquidityManager.sol"; import "../oracle...
Returns the status of runnng readjust function, the limit is set to 2 readjusts per day pool Address of the pool return status Pool rebase status
function readjustFrequencyStatus(address pool) public returns (bool status) { LiquidityPosition storage lp = liquidityPositions[pool]; if ( block.timestamp - lp.timestamp > unipilotProtocolDetails.readjustFrequencyTime ) { lp.counter = 0; lp.status = false...
12,215,881
./full_match/11155111/0xA7a7a82597063CF4e3AC51bF601Ce75D12126C45/sources/contracts/base/ModuleManager.sol
Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token) and return data to Destination address of module transaction. value Ether value of module transaction. data Data payload of module transaction. operation Operation type of module transaction. return success Boolean flag indicating if...
function execTransactionFromModuleReturnData( address to, uint256 value, bytes memory data, Enum.Operation operation ) public returns (bool success, bytes memory returnData) { success = execTransactionFromModule(to, value, data, operation); assembly { ...
3,832,855
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; contract ContentFi { uint public videoCount = 0; uint public personCount = 0; string public name = "ContentFi"; mapping(uint => Video) public videos; mapping(address => Profile) public profiles; mapping(address => address[]) public followers; mappi...
set nicname and avatar picture
function setProfile(string memory _avatarHash, string memory _nickname) public { require(bytes(_avatarHash).length > 0); require(bytes(_nickname).length > 0); require(msg.sender!=address(0)); profiles[msg.sender] = Profile(_avatarHash, _nickname, msg.sender); emit ProfileSetted(_avatarHash, _nickn...
12,844,399
./partial_match/56/0x916cfb044E6b0647eaF229A228bC9FEE2c333dBB/sources/DexMex.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 1000, "amount to small, maths wi...
11,059,648
pragma solidity >=0.4.15; import './Common.sol'; contract ERC20Interface { function getTotalSupply() public returns (uint totalSupply); function getTokenBalance(address _owner) public constant returns (uint balance); function mint(address _addr, uint _amount) public; function burn(uint _amount) public...
totalSupply = 100000000000000000000000; balanceOf[owner] = totalSupply;
function Token() public { owner = msg.sender; owner = msg.sender; name = "Custom Token"; decimals = uint(DECIMALS); symbol = "CT"; }
13,130,070
./full_match/1/0x146657fd93AA4869934383c9c899891078E6b94C/sources/src/FeeBonding.sol
Unstakes a bond, returns lp tokens and mints call option tokens. tokenId The tokenId of the bond to unstake./ check that the user owns the bond check that the bond has matured update the rewards for everyone burn the bond update staked total supply send lp tokens back to sender send fee rewards to sender
function feeUnstake(uint256 tokenId) public returns (uint256 rewardAmount) { require(msg.sender == feeBondingNft.ownerOf(tokenId), "Not owner"); FeeBond memory bond = _bonds[tokenId]; require(block.timestamp >= bond.depositTimestamp + terms[bond.termIndex], "Bond not matured"); ski...
2,983,298
./full_match/1/0xFbeC16EECD4558297FB3deA9934A162Ef76b14bd/sources/src/bases/EIP1967Upgradeable.sol
Upgrades the proxy to a new implementation address The new implementation should be a contract that implements a way to perform upgrades as well otherwise the proxy will freeze on that implementation forever, since the proxy doesn't contain logic to change it. It also must conform to the IModuleMetadata interface (thi...
function upgrade(IModuleMetadata _newImplementation) public onlySafe { assembly { sstore(EIP1967_IMPL_SLOT, _newImplementation) } emit Upgraded(_newImplementation, _newImplementation.moduleId(), _newImplementation.moduleVersion()); }
3,085,345
./full_match/1/0x41De0a913e8A10E0415B70810FEbCaF8a86Ea9BE/sources/contracts/Bueno1155Drop.sol
Retrieve the fallback payment splitter config (used if a token doesn't have it's own payment splitter settings)/
function getFallbackPaymentSplitterSettings() external view returns (PaymentSplitterSettings memory) { return _fallbackPaymentSplitterSettings; }
3,109,862
./full_match/11155111/0xF10657029a3b3672E81Dd6f8580B8167c34B2996/sources/contracts/AuctionCampaign.sol
Send transaction to Auctioneer return isSent the transaction status in boolean type. [1]: if the deadline has not been met, return a message to the client. status: completed. TODO: please check if this returned value still required./ get the last index of participant from the current auction Participant[] storage pa...
function sendTransactionToAuctioneer(uint256 _id) public payable returns (bool isSent) { Auction storage auction = auctions[_id]; uint256 lastBidAmount = auction.participant[auction.participant.length - 1].bidRecords; auction.winner = auction.participant[auction.participant.length - 1].bidde...
3,798,767
/* * Holdenomics * put details here */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * *...
Sets tax swap boolean. Only callable by owner. enabled If tax sell is enabled.
function swapAndLiquifyEnabled(bool enabled) external onlyOwner { inSwap = enabled; }
1,002,832
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.4; import "../../openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "../../openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import "../../openzeppelin/contracts-upgradeable/utils/SafeCastUpgradeable.sol"; import "./l...
Get the account info of the trader. Need to update the funding state and the oracle price of each perpetual before and update the funding rate of each perpetual after WARN: the result of this function is base on current storage of liquidityPool, not the latest. To get the latest status, call ...
function getMarginAccount(uint256 perpetualIndex, address trader) public view onlyExistedPerpetual(perpetualIndex) returns ( int256 cash, int256 position, int256 availableMargin, int256 margin, int256 settleableMargin, ...
12,856,656
./full_match/4/0x7ca3DFcE2FA28c3bF1D8AB5E1c8ca18d131373D4/sources/contracts/Ost.sol
Transfer `amount` tokens from `src` to `dst` src The address of the source account dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/
function transferFrom( address src, address dst, uint256 rawAmount ) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, 'Ost::approve: amount exceeds 96 bits'); if ...
12,389,298
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "./libraries/IHEX.sol"; import "./libraries/ERC165Checker.sol"; import "./libraries/FullMath.sol"; import "./MinterReceiver.sol"; /// @title HEX Share Minter /// @author Sam Presnal - Staker /// @dev Mint shares to any receiving contract that...
The minter earnings are claimable by any caller if the grace period has expired. If the grace period has not expired and the minter is not the caller, then record the minter earnings. If the minter is the caller, they will get the earnings sent immediately.
function _payMinterEarnings( uint256 lateDays, address minter, uint256 minterEarnings ) internal { if (msg.sender != minter && lateDays <= GRACE_PERIOD_DAYS) { minterHeartsOwed[minter] += minterEarnings; hexContract.transfer(msg.sender, minterEarnings); ...
10,239,081
./partial_match/3/0xC6409A6f7051C6AbcAAA335163Cd9FF62B429FE4/sources/CheckpointStore.sol
adds a new data point to the store can only be called by an owner _address the address we're collecting the data for/
function addCheckpoint(address _address) external override validAddress(_address) { require(hasRole(ROLE_OWNER, msg.sender), "ERR_ACCESS_DENIED"); addCheckpoint(_address, time()); }
5,080,957
pragma solidity ^0.4.24; /** * @title AdvertisingInterface */ interface AdvertisingInterface { function incrementBetCounter() external returns (bool); } // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations wi...
Allows developer to pause the contract _paused The new paused value to be set/
function devSetPaused(bool _paused) public onlyDeveloper { paused = _paused; }
12,874,096
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/SignedSafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20...
return total0 Quantity of token0 in both positions and unused in the Hypervisor return total1 Quantity of token1 in both positions and unused in the Hypervisor
function getTotalAmounts() public view returns (uint256 total0, uint256 total1) { (, uint256 base0, uint256 base1) = getBasePosition(); (, uint256 limit0, uint256 limit1) = getLimitPosition(); total0 = token0.balanceOf(address(this)).add(base0).add(limit0); total1 = token1.balanceOf(...
17,148
pragma solidity 0.6.6; import "https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.6/interfaces/AggregatorInterface.sol"; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol"; /// @title Manage the backend of the Tetri0n game i.e. leaderbo...
return Player ID split (g.boardOwner, msg.value); init a new player in the board
function addPlayerToBoard(uint256 boardId) public payable returns (bool) { require(msg.value >= playerFee, " The ETH sent is less than the amount required"); Board storage g = boards[boardId]; uint newPlayerID = g.numPlayers++; g.players[newPlayerID] = Player(msg.sender,0,0,...
6,435,470
./full_match/4/0x6e1862a5EC2830e62bDb208b84E77599fB811efb/sources/ERC721Burnable.sol
Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator./solhint-disable-next-line max-line-length
function burn(uint256 tokenId) public virtual { require(_msgSender() == owner() || _isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); }
831,830
pragma solidity ^0.4.23; import "../math/SafeMath.sol"; import "../ownership/Ownable.sol"; import "./ERC721.sol"; import "./ERC721Metadata.sol"; import "./ERC165implementation.sol"; import "./ERC721TokenReceiver.sol"; import "../utils/AddressUtils.sol"; /* * @title None-fungable token. * @dev Xcert is an implementa...
Assignes a new NFToken to owner. _To Address to wich we want to add the NFToken. _tokenId Which NFToken we want to add./
function addNFToken(address _to, uint256 _tokenId) private { require(idToOwner[_tokenId] == address(0)); idToOwner[_tokenId] = _to; ownerToNFTokenCount[_to] = ownerToNFTokenCount[_to].add(1); }
12,687,838
./partial_match/1/0x55d7EFC74a12c742E38Ae864957CD2288da22146/sources/London1764.sol
Change Price function
function changeUSDTPrice(uint256 usdtPrice) public onlyOwner { priceUSDT = usdtPrice; }
3,979,843
// contracts/Box.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.8.4; pragma solidity ^0.6.6; // Import Ownable from the OpenZeppelin Contracts library import "@openzeppelin/contracts/access/Ownable.sol"; // Import Auth from the access-control subdirectory import "./Auth.sol"; contract Box is Ownable { ...
Used to perform specific logic based on if user has rolled previoulsy or not. return (rollerHistory[_member].length > 0);
function hasRolledOnce(address _member) public view returns(bool) { return (getUserRollsCount(_member) > 0); }
13,088,698
./partial_match/97/0x6fC5a01FDb790415c89deFA0C18416212A3a51C0/sources/BEP20Token.sol
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "BEP20: approve from the zero address"); require(spender != address(0), "BEP20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); }
11,462,878
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // File @openzeppelin/contracts/utils/Context.sol@v4.1.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 sh...
Called by owner of the wrapper to change the destination of the wrapped ETH (bridgePool). newBridgePool address of the bridge pool to send Wrapped ETH to when ETH is sent to this contract./
function changeBridgePool(address newBridgePool) public onlyOwner { bridgePool = newBridgePool; emit ChangedBridgePool(bridgePool); }
14,487,554
./full_match/80001/0x6B902344B61be408Ec2cb16Bdf9Cd63908FAc413/sources/contracts/TokenERC721.sol
Mints an NFT according to the provided mint request.
function mintWithSignature(MintRequest calldata _req, bytes calldata _signature) external payable nonReentrant returns (uint256 tokenIdMinted) { address signer = verifyRequest(_req, _signature); address receiver = _req.to; tokenIdMinted = _mintTo(receiver...
5,670,352
./full_match/5/0x46911382D66A39B72CDC5418A092b5Cc62F21275/sources/contracts/CrowdFunding.sol
return some data to view it
function getDonators(uint256 _id) view public returns (address[] memory, uint256[] memory){ return(campaigns[_id].donators, campaigns[_id].donations); }
7,060,714
./full_match/5/0x47b6BC8C74009B5EC15BA7F2f461Af6dB2cD413D/sources/contracts/ERC20Staking.sol
Makes unstake./ transfer to stakedTokens vault
function unstake() external whenNotPaused { require(stakeOf[msg.sender].timeAt > 0, "no stake"); require(stakeOf[msg.sender].lockPeriodUntil < block.timestamp, "too early"); if (calculateAvailableReward() > 0) { withdrawAvailableReward(); } delete stakeOf[msg.sender]; uint256 av...
1,864,200
./partial_match/1/0x199b877df5be8CD3486C66B5DFe5457EC11AEF94/sources/ExenoCollectionHub.sol
IERC1363Receiver Interface Interface for any contract that wants to support transferAndCall or transferFromAndCall from ERC1363 token contracts as defined in/
interface IERC1363Receiver { function onTransferReceived( address spender, address sender, uint256 amount, bytes calldata data ) external returns (bytes4); }
4,289,370
./full_match/1/0x8430Be7B8fd28Cc58EA70A25C9c7A624F26f5D09/sources/src/core/Decoder.sol
Decodes a send-type tx _inPtr location in calldata of the encoded transaction _outPtr location in memory to write the decoded transaction to return - location in calldata of the next encoded transaction The send tx has 0-values for `publicValue`, `publicOwner` and `assetId` No need to copy anything into memory ...
function sendTx(uint256 _inPtr, uint256 _outPtr) internal pure returns (uint256) { assembly { } unchecked { return (_inPtr + 0x81); } }
4,874,619
/** *Submitted for verification at Etherscan.io on 2022-03-30 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // File: Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is...
Returns the largest of two numbers./
function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); } function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; }
6,670,192
//SPDX-License-Identifier: MIT pragma solidity 0.7.5; import "./extensions/ERC20Internal.sol"; import "../../Interfaces/IERC20Extended.sol"; import "../WithSuperOperators.sol"; abstract contract ERC20BaseToken is WithSuperOperators, IERC20, IERC20Extended, ERC20Internal { bytes32 internal immutable _name; // work...
Get the name of the token collection. return The name of the token collection.
function name() external view returns (string memory) { return string(abi.encodePacked(_name)); }
1,808,140
//Address: 0xa1f58f081c67dfd9ef93955c06877cbf357b5c56 //Contract name: DogRace //Balance: 0 Ether //Verification Date: 4/17/2018 //Transacion Count: 10 // CODE STARTS HERE pragma solidity ^0.4.19; // File: contracts/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error ...
end race and transfer house fee (called internally by callback) calculate winning pool(s) and their total amount
function end_race() internal { chronus.race_end = true; for (uint dog = 0; dog < dogs_count; dog++) { if (pools[dog].delta == max_delta) { pools[dog].winner = true; winning_bets_total = winning_bets_total.add(pools[dog].bets_total); } ...
15,811,095
/** * @title The contract that incorporates the logic of the wallet (for internal usage) * @notice This contract is used when proposals are stored as structs but not created as individual contract by the factory. */ pragma solidity ^0.4.21; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";...
Getter for current balance/
function getTotalBalance() public view returns (uint256, uint256) { return (totalBalance, address(this).balance); }
1,778,678
./full_match/56/0x0d7f57f14d301fE75BBf9f8Aee7e29920d5e714c/sources/project_/contracts/diamond/libraries/LibAlpManager.sol
Dynamic rates are not supported in Phase I Soon it will be supported
function getBurnFeePoint(LibVault.AvailableToken storage at) internal view returns (uint16) { require(!at.dynamicFee, "LibAlpManager: Dynamic fee rates are not supported at this time"); return at.taxBasisPoints; }
3,232,513
./full_match/8453/0x8c7d3063579BdB0b90997e18A770eaE32E1eBb08/sources/contracts/libraries/UserEarn.sol
update UserEarn info for an unlegacy (uncleared during swap) limit order. and then add some amount of selling token update strategy is 'first claim first earn', etc, earned token will be transformed for limit orders which is update first self UserEarn storage object of target limit order currAccEarn 'accEarn...
function addUnlegacyOrder( UserEarn.Data storage self, uint128 delta, uint256 currAccEarn, uint160 sqrtPrice_96, uint128 totalEarn, bool isEarnY ) internal returns(uint128 totalEarnRemain, uint128 claimSold, uint128 claimEarn) { (totalEarnRemain, claimSold...
11,562,763
./partial_match/11155111/0x9B36F148D92494F144d8F70F60cCadC4b726194e/sources/nft/chainTransferAble/Tripster721ACreateFeeTransferChainSender.sol
Public mint function if (!IpfsCollections[collectionIndex].public_released) revert TokensNotReleased(); if (currentTokenMinted.add(amount) > IpfsCollections[collectionIndex].maxSupply) revert MaxSupplyReached();
function bulkPublicMint(uint256 amount) public payable { uint256 collectionIndex = currentCollectionIndex.current(); require( IpfsCollections[collectionIndex].public_released, "TokensNotReleased" ); uint256 totalTotalMinted = IpfsCollections[collectionIndex]...
3,534,156
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "./IBox.sol"; i...
Throw if box is destroyed boxId id of the box/
function onlyNotBrokenBox(uint256 boxId) internal view { require(!destroyedBoxes[boxId], "e3"); }
6,475,081
./partial_match/1/0x23c9e48F7E9fCa487bd0c4f41EE1445812d871fd/sources/Hat.sol
Buy a token and mint it in the process. (Only 1 - softCap). _tokenId id of the token to be minted/
function buy(uint256 _tokenId) external payable { uint256 payed = msg.value; uint256 price = getInitialPrice(_tokenId); require(!locked, 'Buying hats is not unlocked yet. Soon™'); require(_tokenId >= 1 && _tokenId <= hardCap, '_tokenId is invalid'); require(_tokenId <= soft...
2,848,828
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./Interfaces/ILosslessER...
This function sets a new recovery admin Only can be called by the previous Recovery admin _newRecoveryAdmin Address corresponding to the new Lossless Recovery Admin
function setRecoveryAdmin(address _newRecoveryAdmin) override public onlyLosslessRecoveryAdmin { require(_newRecoveryAdmin != recoveryAdmin, "LERC20: Cannot set same address"); emit RecoveryAdminChange(_newRecoveryAdmin); recoveryAdmin = _newRecoveryAdmin; }
14,553,382
./full_match/5/0x10f5F1d06d682b4d765DAe4B99d356FB9e327d7B/sources/contracts/RugWrapperdb.sol
//Returns whether the user is stored in the array//
function isHolderInArray(address _wallet) public view returns (bool, uint) { for (uint256 s = 0; s < holderaddresses.length; s += 1) { if (_wallet == holderaddresses[s]) return (true, s); } return (false, 0); }
1,874,470
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "openzeppelin-solidity/contracts/access/Ownable.sol"; import "openzeppelin-solidity/contracts/token/ERC20/utils/SafeERC20.sol"; contract RecoverERC20 is Ownable { using SafeERC20 for IERC20; /// @notice Emitted when tokens that were stuck in the...
Added to support recovering tokens stuck in the contract This is to ensure that tokens can't get lost
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner { IERC20(tokenAddress).safeTransfer(msg.sender, tokenAmount); emit Recovered(tokenAddress, tokenAmount); }
15,868,581
// 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...
Returns the number of tokens in circulation. In other pools, this would be the same as `totalSupply`, but since this pool pre-mints all BPT, `totalSupply` remains constant, whereas `getVirtualSupply` increases as users join the pool and decreases as they exit it./ Note that unlike all other balances, the Vault's BPT ba...
function getVirtualSupply() external view returns (uint256) { (, uint256[] memory balances, ) = getVault().getPoolTokens(getPoolId()); return _getVirtualSupply(balances[_bptIndex]); }
277,465
pragma solidity ^0.5.5; import "../interface/IERC20.sol"; import "../library/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../interface/IGegoToken.sol"; import "../interface/IGegoFactory.sol"; import "../library/Governance.sol"...
set dandy contract address/
function setDandyContract(address dandy) public onlyGovernance{ _dandy = IERC20(dandy); }
7,289,247
./full_match/5/0x267834298Ba174B9B3d85566b02C6Dae4F2fBfe6/sources/contracts/crowdfunding.sol
to increment the campaigns
function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) { campaign.owner = _owner; campaign.title = _title; campaign.description = _description; campaign.target = _ta...
1,942,242
// 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 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uin...
sell from want to USDC via sushi, USDC -> WETH via Uni, WETH -> want via Sushi sell our emission token for USDC on sushi sell our usdc for weth on uni sell our weth for want on sushi
function _sellMostlyOnSushi(uint256 _amount) internal { address[] memory emissionTokenPath = new address[](2); emissionTokenPath[0] = address(emissionToken); emissionTokenPath[1] = address(usdc); IUniswapV2Router02(sushiswapRouter).swapExactTokensForTokens( _amount, ...
1,407,077