file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0x67391801E7564994bdAa80544Ff916A7bCBFCB60/sources/MacroverseUniversalRegistry.sol
Compute the square root of a number./
function sqrt(int128 real_arg) public pure returns (int128) { return pow(real_arg, REAL_HALF); }
9,236,741
pragma solidity 0.5.7; import "./ERC20.sol"; import "./ITransferCounter.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; import "openzeppelin-solidity/contracts/drafts/Counters.sol"; /** * @title Frictionless yield farming t...
An override of the classical implementation. Transfers `amount` in a way depending on whether `sender` and `receiver` are excluded or not. If participant is excluded, then his outer balance is changes as well. Sending to excluded account increases excluded amount. An opposite logic is when excluded account sends to the...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "FYFToken::transfer from the zero address"); require(recipient != address(0), "FYFToken::transfer to the zero address"); require(amount > 0, "FYFToken::transfer amount must be great...
5,346,173
./full_match/43113/0x8A493188A5E8F885c7b4Cab0f8F8B6c686A443A9/sources/JoeHatBondingCurve.sol
Gets total supply of $HAT. return Returns the amount of $HAT in existence./
function totalSupply() public view returns (uint256) { return hatToken.totalSupply(); }
7,157,669
./partial_match/1/0xd745A68c705F5aa75DFf528540678288ed2aD9eE/sources/contracts/src/Administrable.sol
Internal utility to set the pending admin address _pendingAdmin Address to set as pending admin
function _setPendingAdmin(address _pendingAdmin) internal { LibAdministrable._setPendingAdmin(_pendingAdmin); emit SetPendingAdmin(_pendingAdmin); }
9,396,056
pragma solidity ^0.4.18; /** * @title WeBetCrypto * @author AL_X * @dev The WBC ERC-223 Token Contract */ contract WeBetCrypto { string public name = "We Bet Crypto"; string public symbol = "WBA"; address public selfAddress; address public admin; address[] private users; ...
Transfer the specified amount to the target address ~ ERC-20 Standard _to The address you wish to send the tokens to _value The amount of tokens you wish to send return {/
function transfer(address _to, uint256 _value) external isRunning noFreeze returns (bool success) { bytes memory empty; A boolean is returned so that callers of the function will know if their transaction went through. "success": "Transaction success" } if (_to == selfAdd...
2,506,583
pragma solidity ^0.4.18; import "./Controlled.sol"; import "./TokenController.sol"; import "./DeveloperToken.sol"; import "./ExpositoProjectFactory.sol"; import "./EIP20Interface.sol"; contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public; ...
Burns `_amount` tokens from `_owner` _owner The address that will lose the tokens _amount The quantity of tokens to burn return True if the tokens are burned correctly/
function destroyTokens(address _owner, uint _amount ) onlyController public returns (bool) { uint curTotalSupply = totalStandardTokenSupply(); require(curTotalSupply >= _amount); uint previousBalanceFrom = standardTokenBalanceOf(_owner); require(previousBalanceFrom >= _amount); ...
5,392,960
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.6; /** * @title AcuityTrustedAccounts * @author Jonathan Brown <jbrown@acuity.social> * @dev Enables each account to maintain a public list of trusted accounts. */ contract AcuityTrustedAccounts { /** * @dev Mapping of account to array of trust...
Check if an account trusts multiple accounts. account Account to be checked if it trusts multiple accounts. accountsToCheck Accounts to be checked if they are trusted. return results Array of results./
function getIsTrustedByAccountMultiple(address account, address[] memory accountsToCheck) public view returns (bool[] memory results) { results = new bool[](accountsToCheck.length); for (uint i = 0; i < accountsToCheck.length; i++) { results[i] = accountTrustedAccountIndex[account][accou...
12,833,789
./partial_match/56/0xFEd1559D7d360873E4F9e6555084927C17e67680/sources/AyreCryptoVaultBnb.sol
No rebalance implementation for lower fees and faster swaps Check balance
function withdrawETH(uint256 _shares) public { uint256 r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); uint256 b = token.balanceOf(address(this)); if (b < r) { uint256 _withdraw = r.sub(b); IController(controller).withdraw(address...
11,272,957
./partial_match/1/0x1ED45Fa28DA61f860efdd9331Df7eC17AFA3Abb2/sources/sMartSwap.sol
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(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
15,544,601
./full_match/4/0x5e30D983392358DB09f02Cd10d13984dD97DCe2a/sources/project_/contracts/libraries/MainLibrary.sol
calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal view returns (address pair) { pair = IFactory(factory).getPair(tokenA, tokenB); }
817,040
./full_match/1/0x24fdB87Bf008E859c06f362E448494662d43Bd9f/sources/BARBIE.sol
Destroys `amount` tokens from `account`.`amount` is then deducted from the caller's allowance. See {_burn} and {_approve}./
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BARBIE: burn amount exceeds allowance")); }
8,478,399
./partial_match/1/0xA2BC379974a2e6b35e2610F921c5474C1FB32567/sources/StakeFdcRewardDnsPool.sol
rewardToken.mint(msg.sender, reward);
function getReward() public { require(started, "Not start yet"); uint256 reward = rewards[msg.sender]; if (reward > 0) { rewards[msg.sender] = 0; uint256 beforeT = rewardToken.balanceOf(address(this)); rewardToken.safeTransfer(msg.sender, reward);...
2,603,512
pragma experimental ABIEncoderV2; pragma solidity ^0.8.4; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppeli...
0 laVieImage uint64 vestingID = vesting.getVestID(player, depositID); console.log("vesting ID: %s",vestingID); addressToMph[player].vestID = vestingID; addressToMph[player].vestID,
function supplyDAITo88MPH( address player, uint256 amount, uint256 timeInDays, uint8 stakeType ) private { require(!(addressToMph[player].isStaking), "La Vie: Already staking!"); uint64 maturationTimestamp = uint64( block.timestamp + (timeInDays * 1 d...
921,499
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(addres...
Mints reserved tokens/ Get stage based on current datetime Get amount available for minting
function mintReserve() public onlyOwner { require(mintStart < _currentTime(), "Minting has not been allowed yet."); require(totalMinted < mintSize, "No tokens are available for minting."); MintStage memory currentStage = _getCurrentStage(); uint256 mintAmount = currentStage....
303,321
./full_match/1/0x96a5Be7077793C213Ab2f06bA90d69976d0b7bfb/sources/contracts/ZooZooos.sol
Required interface of an ERC721 compliant contract./
interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(addr...
8,411,236
./partial_match/56/0x0d8Ad2624EaA3A0789dc0611d091b085344EFC94/sources/EToken2.sol
Sets asset spending allowance for a specified spender. Note: to revoke allowance, one needs to set allowance to 0. _spenderId holder id to set allowance for. _value amount to allow. _symbol asset symbol. _senderId approve initiator holder id. return success./ Asset should exist. Should allow to another holder. Inte...
function _approve(uint _spenderId, uint _value, bytes32 _symbol, uint _senderId) internal checkEnabledSwitch(sha3(_symbol, Features.Allowances)) checkSigned(_senderId, 1) returns(bool) { if (!isCreated(_symbol)) { _error('Asset is not issued'); return false; } if (_se...
11,327,747
./full_match/4/0x8d65B8b02Ac534655ac8DeB626860745cc84d8fe/sources/contracts/Aliens.sol
Withdraw funds from contract for the team 21% Split evenly among the team 16% to the community wallet Half of that will go to charity The other half to invest back into community projects
function withdrawTeam(uint256 amount) public payable onlyOwner { uint256 percent = amount / 100; require(payable(a1).send(percent * 21)); require(payable(a2).send(percent * 21)); require(payable(a3).send(percent * 21)); require(payable(a4).send(percent * 21)); require...
722,375
pragma solidity ^0.5.16; import "./SToken.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./PriceOracle.sol"; import "./ComptrollerInterface.sol"; import "./ComptrollerStorage.sol"; import "./Unitroller.sol"; import "./STRK.sol"; /** * @title Strike's Comptroller Contract * @author Strike *...
Calculate STRK accrued by a borrower and possibly transfer it to them Borrowers will not begin to accrue until after the first interaction with the protocol. sToken The market in which the borrower is interacting borrower The address of the borrower to distribute STRK to/
function distributeBorrowerStrike(address sToken, address borrower, Exp memory marketBorrowIndex, bool distributeAll) internal { StrikeMarketState storage borrowState = strikeBorrowState[sToken]; strikeBorrowerIndex[sToken][borrower] = borrowIndex.mantissa; Double memory borrowIndex = Doubl...
14,598,270
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can...
Executed when a purchase has been validated and is ready to be executed This function adds liquidity and stakes the liquidity in our initial farm. beneficiary Address receiving the tokens ethAmount Amount of ETH provided tokenAmount Number of tokens to be purchased/ Step 1: add liquidity Step 2: we now own the liqui...
function _processLiquidity( address payable beneficiary, uint256 ethAmount, uint256 tokenAmount ) internal { require(token.mint(address(this), tokenAmount), 'minting failed'); uint256 lpToken = _addLiquidity(address(this), beneficiary, ethAmount, tokenAmount); uniV2Pair.approve(addre...
10,372,005
./full_match/97/0x001079B961fE0873E47c20d704E13Fb2c3Ea7cc7/sources/project_/contracts/UGRTokenFactory.sol
retirar todos los BNB del contrato
function withdrawBNB(address payable account) external onlyOwner {
5,045,337
./full_match/84531/0x954fa38132886cc6DFbe6a61979C6E1778A83e34/sources/contracts/BIOPTokenV4.sol
enables DAO to burn tokens amount the amount of tokens to burn/
function burn(uint256 amount) public { require(balanceOf(msg.sender) >= amount, "insufficent balance"); _burn(msg.sender, amount); }
11,499,448
pragma solidity ^0.5.15; pragma experimental ABIEncoderV2; import { Types } from "./Types.sol"; library RollupUtils { // ---------- Account Related Utils ------------------- function PDALeafToHash(Types.PDALeaf memory _PDA_Leaf) public pure returns (bytes32) { return keccak...
BytesFromTx and BytesFromTxDeconstructed do the same thing i.e encode transaction to bytes
function BytesFromTx(Types.Transaction memory _tx) public pure returns (bytes memory) { return abi.encodePacked( _tx.fromIndex, _tx.toIndex, _tx.tokenType, _tx.nonce, _tx.txType, ...
12,681,324
./full_match/1/0xD7E757Daf1ad562b01C35CC28B65876641CCAd39/sources/contracts/recipes/Deed.sol
ROYALTY FUNCTIONS/
{ function updateRoyalties( address payable recipient, uint256 bps } function getRoyalties( uint256 ) external view returns (address payable[] memory recipients, uint256[] memory bps) if (_royaltyRecipient != address(0x0)) { recipi...
17,177,514
./partial_match/97/0x0C1F57d52a09BDA459317c224A840139A29C3BF1/sources/StakingRewards.sol
Pull the tokens from the staker Staking token supply and boosted supply Staking token balance and boosted balance
function stake(uint256 amount) external override nonReentrant notLocked updateReward(msg.sender) { require(amount > 0, "Cannot stake 0"); require(greylist[msg.sender] == false, "address has been greylisted"); IERC20(stakingToken).safeTransferFrom(msg.sender, address(this), amount); ...
11,378,801
./full_match/5/0xaa7CBAFBD821507B5688218Ca72c44E69AE7E254/sources/contracts/AllowListMetadata.sol
TODO only owner can run this function require that the tokens have been lazy minted and from there get the currebt id
function _batchMintRootData( uint256 _amountToMint, string memory _rootForTokens, uint256 _startId ) internal returns (uint256 nextTokenIdToMint, uint256 rootId) { rootId = _startId + _amountToMint; nextTokenIdToMint = rootId; rootIds.push(rootId); Root[ro...
1,945,193
//Address: 0xd139103f7338f6508b2cbc1d010b45df4346d90d //Contract name: ImmlaDistribution //Balance: 0 Ether //Verification Date: 1/16/2018 //Transacion Count: 31 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
called to mint bonus tokens to founders/
function mintBonusToFounders(uint256 _value) internal { uint256 valueWithCoefficient = (_value * 1000) / 813; uint256 valueWithMultiplier1 = valueWithCoefficient / 10; uint256 valueWithMultiplier2 = (valueWithCoefficient * 7) / 100; token.mint(t_Andrey, (valueWithMultiplier1 * 4) /...
13,038,414
./full_match/100/0x62f5cAA239A97b21AA61502963Cf8C33F8182e79/sources/home/didi/src/artis2/artis2-launch-contracts/contracts/XATSToken.sol
calls onTokenTransfer fallback on the token receiver contract solhint-disable-next-line avoid-low-level-calls
function _callERC677Hook(address sender, address to, uint256 amount, bytes memory data) private returns (bool) { (bool success, ) = to.call(abi.encodeWithSelector(_ON_TOKEN_TRANSFER_SELECTOR, sender, amount, data)); if (ERC165Checker.supportsERC165(to) && ERC165Checker.supportsInterface(to, _ON_TOKE...
14,266,833
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; // must import this in order for it to connect to the system and network. import "@unification-com/xfund-router/contracts/lib/ConsumerBase.sol"; /** * @title Data Consumer Demo * * @dev Note the "is Consu...
setRouter allows updating the Router contract address NOTE: Calls the internal setRouter function in ConsumerBase.sol. Can be used if network upgrades require new Router deployments. Uses OpenZeppelin's onlyOwner modifier to secure the function. _router address new Router address/
function setRouter(address _router) external onlyOwner { require(_setRouter(_router)); }
5,364,772
// Sources flattened with hardhat v2.1.1 https://hardhat.org // File @openzeppelin/contracts/utils/EnumerableSet.sol@v3.4.1 // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Se...
Mints tokens to a recipient. This function reverts if the caller does not have the minter role. _recipient the account to mint tokens to. _amount the amount of tokens to mint.
function mint(address _recipient, uint256 _amount) external onlyWhitelisted { require(!blacklist[msg.sender], "WaBTC: Yum Vault is blacklisted."); uint256 _total = _amount.add(hasMinted[msg.sender]); require(_total <= ceiling[msg.sender],"WaBTC: Yum Vault's ceiling was breached."); require(!paused[msg...
1,661,124
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { TokenProxy } from "./TokenProxy.sol"; import { StaticAccessControlled } from "./lib/Stati...
Verifies that this contract is in control of at least as many tokens as accounted for token Address of ERC20 token/ The actual balance could be greater than totalBalances[token] because anyone can send tokens to the contract's address which cannot be accounted for
function validateBalance( address token ) private view { assert(TokenInteract.balanceOf(token, address(this)) >= totalBalances[token]); }
1,799,712
./full_match/8453/0x6538fCbBdDa7cbE8E89E6c502F9A599dE411d32a/sources/contracts/ExternalBribe.sol
This is an external function that can only be called by teams to handle unclaimed rewards due to zero vote require that supply of that epoch to be ZERO check bribe amount get timestamp of current epoch get notified reward of current epoch add previous unclaimed rewards to current epoch remove token rewards from previou...
function handleLeftOverRewards(uint epochTimestamp, address[] memory tokens) external { require(msg.sender == IVotingEscrow(_ve).team(), "only team"); uint epochStart = getEpochStart(epochTimestamp); SupplyCheckpoint memory sp0 = supplyCheckpoints[getPriorSupplyIndex(epochStart + DURATION)]...
11,545,321
pragma solidity ^0.5.0; contract MerkleProof { function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf, uint index ) public pure returns (bool) { bytes32 hash = leaf; for (uint i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; ...
Adds new authority. On successfull addition of authority RegisteredNewAuthority event is emitted.
function AddNewIssuerAuthority(address addressOfAuthority,string memory details) public{ require((isIssuingAuthority[msg.sender] == true), "You are not part of authority to register a new Issuer Authority."); issuerAuthorityDetails[details] = addressOfAuthority; isIssuingAuthority[addressOfA...
5,508,704
./partial_match/56/0x9f9F18aea36A44e56F141A98b68f700A4073A2E8/sources/MasterChef.sol
Safe brisket transfer function, just in case if rounding error causes pool to not have enough BSKs.
function safeBrisketTransfer(address _to, uint256 _amount) public onlyOwner { uint256 bskBal = brisket.balanceOf(address(this)); if (_amount > bskBal) { brisket.transfer(_to, bskBal); brisket.transfer(_to, _amount); } }
11,060,148
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // const RINKEBY_VRF_COORDINATOR = '0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B' // const RINKEBY_LINKTOKEN = '0x01BE23585060835E02B77ef475b0Cc51aA1e0709' // const RINKEBY_KEYHASH = '0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311' import "@ope...
define the NFT_safeMint(requestToSender[requestId], newId);
function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { uint256 newId = trophies.length; uint256 rarity = (randomNumber % 100); uint256 worth = ((randomNumber % 1000) / 100); trophies.push( Trophy( newId...
5,451,973
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.so...
Set wallet of creator Only `owner` can call/
function setCreatorWallet(address _new_creator) public onlyOwner { creatorAddress = _new_creator; }
537,893
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./IERC721Receiver.sol"; import "./Pausable.sol"; import "./Squuid.sol"; import "./SQUID.sol"; import "./ReentrancyGuard.sol"; contract Arena is Ownable, IERC721Receiver, Pausable { // maximum alpha score for a Guard uint8 public constant...
checks if a token is a Player tokenId the ID of the token to check return player - whether or not a token is a Player/
function isPlayer(uint256 tokenId) public view returns (bool player) { (player, , , , , , , , , ) = squuid.tokenTraits(tokenId); }
11,715,990
./partial_match/3/0x366eA2138BB9a1cF9d80cEF5688162107aB54889/sources/test.sol
dynamic arraybytes is same as byte[]access array variabletest array variablestatic array
function testArray() public pure{ uint len = 7; uint[] memory a = new uint[](7); bytes memory b = new bytes(len); assert(a.length == 7); assert(b.length == len); a[6] = 8; assert(a[6] == 8); uint[3] memory c = [uint(1) , 2, 3]...
5,065,945
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.s...
Copy word-length chunks while possible
function copyToMemory(uint _destination, uint _source, uint _length) private pure { for(_length ; _length >= 32; _length -= 32) { assembly { mstore(_destination, mload(_source)) } _destination += 32; _source += 32; } assembly {...
6,004,022
./full_match/1/0x272dfD47b3A4bc77DD8a667A327f1aCA15305FcC/sources/contracts/crosschain/layerzero/interfaces/ILayerZeroEndpoint.sol
ILayerZeroEndpoint LayerZero endpoint interface/
interface ILayerZeroEndpoint { function send( uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParam ) external payable; function estimateFees( ...
4,852,558
./full_match/4/0x3b85837Ed9C20ee81265D3180486405309c3943D/sources/contracts/CryptoPoly.sol
withdrawLink allows the owner to withdraw any extra LINK on the contractLinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());require(link.transfer(msg.sender, link.balanceOf(address(this))), "Unable to transfer");
function withdrawLink() public onlyAdmin { require(LINK.transfer(msg.sender, LINK.balanceOf(address(this))), "Unable to transfer"); }
691,711
pragma solidity 0.4.15; import '../EtherToken.sol'; import '../EuroToken.sol'; import '../LockedAccount.sol'; import '../Math.sol'; import '../Neumark.sol'; import './TimedStateMachine.sol'; import "../AccessControl/AccessControlled.sol"; import "../Agreement.sol"; import "../Reclaimable.sol"; // Consumes MCommitmen...
converts `amount` in wei into EUR with 18 decimals required by Curve Neufund public commitment uses fixed EUR rate during commitment to level playing field and prevent strategic behavior around ETH/EUR volatility. equity TOs will use oracles as they need spot prices
function convertToEur(uint256 amount) public constant returns (uint256) { return fraction(amount, ETH_EUR_FRACTION); }
12,915,262
./full_match/80001/0x95BbA0c44B3D8464aF386D1412131F7Cc5b79839/sources/_openzeppelin/contracts/utils/escrow/RefundEscrow.sol
Allows for refunds to take place, rejecting further deposits./
function enableRefunds() public virtual onlyOwner { require(state() == State.Active, "RefundEscrow: can only enable refunds while active"); _state = State.Refunding; emit RefundsEnabled(); }
9,436,081
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.8; import {Rlp} from "./Rlp.sol"; library MerklePatriciaVerifier { /* * @dev Extracts the value from a merkle proof * @param expectedRoot The expected hash of the root node of the trie. * @param path The path in the trie leading to value. ...
encodedPartialPath has elements that are each two hex characters (1 byte), but partialPath and slicedPath have elements that are each one hex character (1 nibble) pathPtr counts nibbles in path partialPath.length is a number of nibbles
function _nibblesToTraverse( bytes memory encodedPartialPath, bytes memory path, uint256 pathPtr ) private pure returns (uint256) { uint256 len; bytes memory partialPath = _getNibbleArray(encodedPartialPath); bytes memory slicedPath = new bytes(partialPath.length)...
1,800,200
/** * */ /** * */ pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; // // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers...
Delegate votes from `msg.sender` to `delegatee` delegatee The address to delegate votes to/
function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); }
1,340,938
// SPDX-License-Identifier: AGPL-3.0-or-later // hevm: flattened sources of contracts/Pool.sol pragma solidity =0.6.11 >=0.6.0 <0.8.0 >=0.6.2 <0.8.0; ////// contracts/interfaces/IBPool.sol /* pragma solidity 0.6.11; */ interface IBPool { function transfer(address, uint256) external returns (bool); function...
/ Subtract outstanding principal by the principal claimed plus excess returned. Considers possible `principalClaim` overflow if Liquidity Asset is transferred directly into the Loan.
@dev Claims available funds for the Loan through a specified DebtLockerFactory. Only the Pool Delegate or a Pool Admin can call this function. @dev It emits two `BalanceUpdated` events. @dev It emits a `Claim` event. @param loan Address of the loan to claim from. @...
1,709,452
./partial_match/100/0x5BAf71fdAB2d244A3F177E9C204156be644F7f45/sources/ValidatorSetAuRa.sol
Sets a new validator set as a pending (which is not yet passed to the `InitiateChange` event). Called by the `newValidatorSet` function. _stakingAddresses The array of the new validators' staking addresses. If there are no `poolsToBeElected`, we remove the validators which want to exit from the validator set The valid...
function _setPendingValidators( address[] memory _stakingAddresses ) internal { address unremovableMiningAddress = miningByStakingAddress[unremovableValidator]; if (_stakingAddresses.length == 0) { for (uint256 i = 0; i < _pendingValidators.length; i++) { add...
16,655,968
./full_match/1/0xD02A7208809821bC465BfBA4865D544cC48a93E8/sources/contracts/NFTStandard.sol
rest token tracker key The sale/minting-condition Id/ assert key must exist
function _tokenTrackerReset(Sales storage sales, uint256 key) internal { assert(_contains(sales, key)); sales._values[key]._tokenIdTracker.reset(); }
3,037,539
pragma solidity ^0.5.4; // ---------------------------------------------------------------------------- // DreamFrames Crowdsale Contract - Purchase FrameRush Tokens with ETH // // Deployed to : {TBA} // // Enjoy. // // (c) BokkyPooBah / Bok Consulting Pty Ltd for GazeCoin 2018. The MIT Licence. // (c) Adrian Guerrera...
Contract owner allocates frames to tokenOwner Also get the amount contributed Mint token lock = true, until they are certified as investors
function claimRoyaltyFrames(address tokenOwner, uint256 frames, uint256 ethToTransfer) external { require(!finalised); require(msg.sender == royaltyCrowdsaleAddress); require(framesSold.add(frames) <= maxFrames); contributedEth = contributedEth.add(ethToTransfer); require(royaltyToken....
894,490
/* Copyright 2018 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Parses the header from order byte array Can only be called by authorized contracts. _ordersData Byte array of order data _offset Offset to start scanning for order header return OrderHeader Struct containing wrapper order header data/
function parseOrderHeader( bytes _ordersData, uint256 _offset ) internal pure returns (OrderHeader) { OrderHeader memory header; uint256 orderDataStart = _ordersData.contentAddress().add(_offset); assembly { } return header; ...
5,526,214
./full_match/1/0xFBB1d40a7B3E553c510008c9bef1889015aC4965/sources/contracts/lending/tokens/cErc20ModifiedDelegator.sol
IKYCRegistry Ondo Finance The interface for Ondo's KYC Registry contract/
interface IKYCRegistry { function getKYCStatus( uint256 kycRequirementGroup, address account ) external view returns (bool); }
17,168,757
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; // Openzeppelin. import "./openzeppelin-solidity/contracts/SafeMath.sol"; // Interfaces. import './interfaces/external/ICandlestickDataFeedRegistry.sol'; import './interfaces/external/IBotPerformanceDataFeed.sol'; import './interfaces/IComponentsRegistry.sol'; ...
Updates the bot's profit target. This function can only be called by the operator. _newProfitTarget The new profit target %, denominated in 10000. Ex) 1% = 100./
function updateProfitTarget(uint256 _newProfitTarget) external override onlyOperator { require(_newProfitTarget >= 10 && _newProfitTarget <= 100000, "TradingBot: Profit target out of bounds."); params.profitTarget = _newProfitTarget; emit UpdatedProfitTarget(_newProfitTarget); }
5,454,648
./full_match/4/0x07e9BF60268551d2D5Cc9fAbCbAeE1b7385D45e0/sources/browser/Untitled.sol
use level 1 to 6 not 0 to 5 / this need correct differently because of mega - pool structurebooster for level 0
function withdrawMegaPoolGain(uint32 _userId) public returns(bool) { uint16 refCount; uint8 lastLevel; uint256 totalAmount; ( ,,,,lastLevel,refCount,,) = mscInterface(mscContractAddress).userInfos(networkId,0,false, _userId); if(lastLevel >= 2 && refCount >= 3 ) ...
12,373,308
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; import "../libraries/Address.sol"; import "../libraries/SafeMath.sol"; import "../libraries/SafeERC20.sol"; import "../interfaces/IERC20.sol"; import "../interfaces/ITreasury.sol"; import "../types/OlympusAccessControlled.sol"; interface ICurve3Po...
withdraws asset from treasury, deposits asset into lending pool, then deposits crvToken into convex/ retrieve amount of asset from treasury account for deposit approve and deposit into curve approve and deposit into convex
function deposit( address token, uint256 amount, uint256[4] calldata amounts, uint256 minAmount ) public onlyGuardian { require(!exceedsLimit(token, amount), "Exceeds deployment limit"); address curveToken = tokenInfo[token].curveToken; treasury.manage(to...
13,139,148
pragma solidity ^0.4.24; import "./ERC721/ERC721.sol"; import "./ERC721/ERC721Enumerable.sol"; contract Klaystagram is ERC721, ERC721Enumerable { event PhotoUploaded (uint256 indexed tokenId, bytes photo, string title, string location, string description, uint256 timestamp); mapping (uint256 => PhotoData) p...
Recommand using transferOwnership, which uses safeTransferFrom function Overided transferFrom function to make sure that every time ownership transfers new owner address gets pushed into ownerHistory array/
function transferFrom(address from, address to, uint256 tokenId) public { super.transferFrom(from, to, tokenId); _photoList[tokenId].ownerHistory.push(to); }
12,814,231
pragma solidity ^0.5.0; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint25...
Get platform of crowdsale. _crowdsale the crowdsale to get platfrom from. return address of owning platform.
function getPlatformOfCrowdsale(address _crowdsale) public view returns (address) { return controllerData.crowdsaleToPlatform[_crowdsale]; }
2,537,482
./partial_match/1/0xc3ee1dbBCDdd0b57F5277009F6c96596096f5543/sources/contracts/LLCMinter.sol
Mint LLC Mint LLC NFT Set participant Update sale round status
function mint( bytes32[] memory _proof, bytes32 leaf, uint256 _roundId ) external payable nonReentrant whenNotPaused onlyOngoingRound(_roundId) { require(!participants[_roundId][_msgSender()], "Already participated"); LLCMintingRound memory round = rounds[_roundId]; ...
2,835,359
./full_match/5/0xb93278af83Ab7FC2A9d08EF096f49EE8616C95A2/sources/contracts/Miratashi.sol
Current price for auction phase./ Seconds since we started How many decrements should've happened since that time How much ETH to remove If how much we want to reduce is greater or equal to the range, return the lowest value
function auctionCurrentPrice() public view returns (uint256) { if (auctionFinalPrice > 0) return auctionFinalPrice; uint256 timeSinceStart = block.timestamp - auctionStartingTime; uint256 decrementsSinceStart = timeSinceStart / auctionDecrementFrequency; uint256 totalD...
11,588,465
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /** * @title The Tracks contract enables the storage of collections of * text information with voting enabled on each memeber of the collection ...
Check a specific track is in the 'Blocked' state. Fails if track doesnt exist _trackId The id of the track/
function isTrackBlocked(uint _trackId) public view checkTrackExists(_trackId) returns (bool){ return (tracks[_trackId].state == State.Blocked); }
955,155
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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. ...
156.2,212.1 & 291.9,212.1
function _eyeSubstitutions(uint replacementY) private pure returns (IBearRenderTechProvider.Substitution[] memory substitutions) { substitutions = new IBearRenderTechProvider.Substitution[](2); substitutions[0].matchingX = 1562; substitutions[0].matchingY = 2121; substitutions[0].rep...
11,688,031
/** * Tokensale.sol * Mt Pelerin Share (MPS) token sale : public phase. * More info about MPS : https://github.com/MtPelerin/MtPelerin-share-MPS * The unflattened code is available through this github tag: * https://github.com/MtPelerin/MtPelerin-protocol/tree/etherscan-verify-batch-2 * @notice Copyri...
get base price in CHF cents/
function basePriceCHFCent() public view returns (uint256) { return BASE_PRICE_CHF_CENT; }
12,912,506
./full_match/1/0x0a642E8F78FEf7b1063915cC2d8302851dE71dd6/sources/contracts/AccessControl/RaffleAdminAccessControl.sol
Removes the sender from the list the prizeManager role/
function renouncePrizeManager() public { renounceRole(PRIZE_MANAGER_ROLE, msg.sender); emit PrizeManagerRemoved(msg.sender, managerOf); }
3,122,063
./partial_match/1/0xc8024fB5C7beD98CcE0e498E54B7D89816B3521B/sources/GenesisLiquidityPool.sol
Modifies the amount to mint / burn to keep collateral weight between pools. Uses 6 decimals.
function _poolWeightRatio() private view returns(uint256) { uint256 totalValue = oracleGeminon.getTotalCollatValue(); uint256 poolValue = getCollateralValue(); if (totalValue == 0 || poolValue == 0) return 1e6; uint256 actualWeight = (poolValue * 1e3) /...
3,668,774
./full_match/1/0x07B0226465A50300F91c8A7930f90aEcae3D6Ed4/sources/contracts/staking/Series.sol
Set the address for the FeeVault. other contracts reference this value as well vault_ - address for the contract/
function setVault(address vault_) external onlyGovernor { require(vault_ != address(0), 'Series: Zero address: FeeVault'); vault = vault_; }
16,523,422
./partial_match/5/0x21a44231D24813F881c873C141aE6e157d7Ec14F/sources/VybeStake.sol
noReentrancy shouldn't be needed due to the lack of external calls better safe than sorry update the last claim time mint out their staking rewards and the dev funds
function claimRewards() external noReentrancy { require(!_dated); uint256 mintage = _calculateMintage(msg.sender); uint256 mintagePiece = mintage.div(20); require(mintagePiece > 0); _lastClaim[msg.sender] = block.timestamp; _VYBE.mint(msg.sender, mintage.sub(mintagePiece)); _VYBE.mint(_d...
16,860,105
./full_match/5/0x853528bD616110F9fa96854159458f25669a8Eb9/sources/contracts/TalentirTokenV1.sol
Update the talent address for a given token. This can only be called by the current talent address. tokenId The token ID to update the talent for. talent The address to receive the trading royalty for the token.
function updateTalent(uint256 tokenId, address talent) external { address currentTalent = talents[tokenId]; require(currentTalent == msg.sender, "Talent must update"); _setTalent(tokenId, talent); }
11,608,726
./full_match/5/0xCAc2Bfbaa9b6C0017BB957F8c5f3e2b41b01D0E5/sources/contracts/ecosystem/SafetyModuleERC20.sol
Enables staking for non-vesting investors amount is the uint256 amount to stake
function stake(uint256 amount) public whenNotPaused nonReentrant { require(amount != 0, "SM: Stake amount cannot be zero"); uint256 rewards = _updateUserAssetState( _msgSender(), address(this), balanceOf(_msgSender()), totalSupply() ); ...
7,068,656
./partial_match/1/0xca63f155EaD7b40e2E67Dc5f7E8cA50BFB283FD0/sources/contracts/libraries/Hashflow.sol
slither-disable-next-line unused-return it's safe to ignore
function tradeSingleHop(RFQTQuote calldata quote) external payable; } ) internal returns (uint256 amountOut) { IHashflowRouter.RFQTQuote memory quote = abi.decode(swapData.data, (IHashflowRouter.RFQTQuote)); IERC20(from).approve(swapData.addr, amountIn); if (amountIn < quote.maxBaseToke...
16,172,221
./partial_match/1/0x107342f1434b7C14E1870EB5A526fb621bea3547/sources/WeLoveBanksy.sol
Update the min amount to liquify. Can only be called by the current operator./
function updateMinAmountToLiquify(uint256 _minAmount) private onlyOperator { emit MinAmountToLiquifyUpdated(msg.sender, minAmountToLiquify, _minAmount); minAmountToLiquify = _minAmount; }
4,252,198
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "./DelayedMinterHelper.sol"; import "./IATokenV1.sol"; import "./ICToken.sol"; import "./IComptroller.sol"; import "./ISushiBar.sol"; import "./ILendingPoolV1.sol"; import "./ICompoundLens.sol"; import "./IUniswapV2.sol"; import "./IBasket.sol"; import "...
Approves derivative to the basket address and gets the mint amount. Mainly here to avoid stack too deep errors derivative Address of the derivative (e.g. cUNI, aYFI) basketTotalSupply Total supply of the basket token tokenAmountInBasket Amount of derivative currently in the basket curMintAmount Accu...
function _approveDerivativeAndGetMintAmount( address derivative, uint256 basketTotalSupply, uint256 tokenAmountInBasket, uint256 curMintAmount ) internal returns (uint256) { uint256 derivativeBal = IERC20(derivative).balanceOf(address(this)); IERC20(derivative).s...
7,011,917
./partial_match/3/0x9eA18AA1E3494EE3b6A0FD2D1a1FbF6a570a8D01/sources/BnEXDistributor.sol
Minter can claim any tokens that transfered to this contract address token The token address/
function recoverERC20(ERC20 token) public onlyOwner { require(address(token) != address(0)); uint256 balance = token.balanceOf(address(this)); require(token.transfer(msg.sender, balance), 'DevTools::recoverERC20::TRANSFER_FAILED'); }
5,328,524
pragma solidity ^0.4.23; /* * Creator:MTY (MONETY) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uin...
Get total number of tokens in circulation. return total number of tokens in circulation/
function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "MONETY"; string constant public symbol = "MTY"; uint8 constant public decimals = 18;
7,825,213
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import { MerkleTreeLib as Merkle } from "./merkle/MerkleTreeLib.sol"; library TransactionsLib { enum TransactionType { HARD_CREATE, HARD_DEPOSIT, HARD_WITHDRAW, HARD_ADD_SIGNER, SOFT_WITHDRAW, SOFT_CREATE, SOFT_TRANSFER, SOFT_...
nonce: [no offset] [24 bits] (load(0) >> 232) fromIndex: [offset 3 bytes] [32 bits] (load(3) >> 224) toIndex: [offset 7 bytes] [32 bits] (load(7) >> 224) value: [offset 11 bytes] [56 bits] (load(11) >> 200) sigV: [offset 18 bytes] [8 bits] (load(18) >> 248) sigR: [offset 19 bytes] [256 bits] (load(19)) sigS: [off...
function decodeSoftTransfer( bytes memory transaction ) internal pure returns (SoftTransfer memory softTransfer) { assembly { let bodyPtr := add(transaction, 0x21) mstore(softTransfer, shr(232, mload(bodyPtr))) mstore(add(softTransfer, 0x20), shr(224, mload(add(bodyPtr, 3)))) mstore(...
2,535,315
./full_match/1/0xC7af765703454b024d4fE03d8013B70fDd1d5C6c/sources/Flappyinu.sol
SPDX-License-Identifier: Unlicensed
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint...
3,038,953
// Upgraded Date: 01-04-2022 // Commit: https://github.com/Sperax/USDs/commit/3423ae0177c292a47f0939ee5a6b24a18c145643 // Changes: Added missing parameters update in updateCollateralInfo() // Implementation Contract Address: 0xE0A1f2Ed69A739B52a493B244d8ac27F555E0b55 // SPDX-License-Identifier: MIT pragma solidity >=...
the value of collaterals in this contract and strategies/
function totalValueLocked() public view returns (uint value) { value = totalValueInVault().add(totalValueInStrategies()); }
14,017,355
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title RewardsPool Contract * @author alexponce.eth * @notice A contract that allows user to farm SimpleToken rewards based on contributions to t...
RewardsPool method to add SimpleToken rewards to the pool _rewards to be added to RewardsPool Contract/
function addRewards(uint256 _rewards) external payable onlyOwner{ address from = msg.sender; (bool poolRewards) = _token.transferFrom(from, address(this), _rewards); require(poolRewards, "Failed to add rewards to pool"); totalRewards += _rewards; uint numofParticipants = part...
6,377,178
pragma solidity 0.7.4; interface IArbitrable { /** * @dev To be raised when a ruling is given. * @param _arbitrator The arbitrator giving the ruling. * @param _disputeID ID of the dispute in the Arbitrator contract. * @param _ruling The ruling which was given. */ event Ruling(IA...
Adds two unsigned integers, returns 2^256 - 1 on overflow./
function addCap(uint _a, uint _b) internal pure returns (uint) { uint c = _a + _b; return c >= _a ? c : UINT_MAX; }
7,358,362
// 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...
Deposit LP tokens to MasterChef for onePool allocation.
function deposit( uint256 _amount) public { rewardPool.updatePool(poolId); (IERC20 lpToken, , , uint256 acconePoolPerShare,) = rewardPool.poolInfo(poolId); UserInfo storage user = userInfo[msg.sender]; if (user.amount > 0) { uint256 pending = user.amount.mul(acconePoolPe...
12,135,160
pragma solidity ^0.4.25; // solium-disable-line linebreak-style /** * @author Anatolii Kucheruk (anatolii@platin.io) * @author Platin Limited, platin.io (platin@platin.io) */ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev M...
Finalization, transfer unsold tokens to the reserve address with lockup/
function finalization() internal { uint256 _unsold = token.balanceOf(this); if (_unsold > 0) { PlatinToken(token).transfer( tge.UNSOLD_RESERVE(), _unsold); } }
12,901,234
./full_match/1/0x071f637a1C3F2195082007255810B86aE7ddFC21/sources/contracts/DogeDrinksETH.sol
if (isSniperOrBlacklisted(from) || isSniperOrBlacklisted(to)) { revert("Rejected.");}
function _finalizeTransfer(address from, address to, uint256 tAmount, bool takeFee) internal returns (bool) { if (isSniperOrBlacklisted(from) || isSniperOrBlacklisted(to)) { revert("Rejected."); } if (sniperProtection){ if (!_hasLiqBeenAdded) { ...
16,537,453
./full_match/44787/0xfA1929D54801512C8cFdbef3c56fCC7011151B70/sources/contracts/StarFarm.sol
Stake Star NFT to MasterChefrequire(userNFTs[_msgSender()].length > 0, "star token user");
function enterStakingNFT(uint256 _tokenId) public { PoolInfo storage pool = poolInfo[0]; UserInfo storage user = userInfo[0][_msgSender()]; require(starNFT.ownerOf(_tokenId) == _msgSender(), "error NFT user"); updatePool(0); (uint256 _selfGain, uint256 _parentGain) = starNode.node...
13,256,516
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.8.4 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.5.0 // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as de...
Sets the data for the buffer without encoding CBOR on-chain CBOR can be closed with curly-brackets {} or they can be left off self The initialized request data The CBOR data/
function setBuffer(Request memory self, bytes memory data) internal pure { BufferChainlink.init(self.buf, data.length); BufferChainlink.append(self.buf, data); }
1,301,066
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
Returns the timestamp at which the prize period ends return The timestamp at which the prize period ends. current prize started at is non-inclusive, so add one
function prizePeriodEndAt() external view returns (uint256) { return _prizePeriodEndAt(); }
562,196
./partial_match/1/0xd3B5AD4979788Cf23cBE0704C2Cd2F0629e521b6/sources/LiquidityMining.sol
mints a new PositionToken inside the collection for the given wallet. uniqueOwner liquidityMiningPosition token extension. amount amount of to mint for a farm token. setupIndex index of the setup. return objectId new liquidityMiningPosition token object id./
function _mintLiquidity(address uniqueOwner, uint256 amount, uint256 setupIndex) private returns(uint256 objectId) { if (_setups[setupIndex].objectId == 0) { (objectId,) = INativeV1(_liquidityFarmTokenCollection).mint(amount, string(abi.encodePacked("Farming LP ", _toString(_setups[setupIndex].l...
4,218,400
./full_match/80001/0xeb70EaC1371Ef898AC2781D7168c0d5A11da10cf/sources/contracts/trove-factory.sol
set the ratio of the arbitrage gains which should go to the sender of the message _arbitrageShareRatio the ratio by which the arbitrage gains will be multiplied
function setArbitrageShareRatio(uint256 _arbitrageShareRatio) public onlyOwner { require(_arbitrageShareRatio <= 100, "d7dc8 the share can not be over 100%"); arbitrageShareRatio = (_arbitrageShareRatio * DECIMAL_PRECISION) / 100; }
9,539,825
/** *Submitted for verification at Etherscan.io on 2021-05-03 */ // Sources flattened with hardhat v2.1.2 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/[email protected] // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in th...
return "https:gift.kernel.community/raw/";
function _baseURI() internal view virtual override returns (string memory) { return tokenUri; }
15,001,899
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./NfpToken.sol"; import "./PriceFeed.sol"; /// @title NFP Limit Sale /// @autho...
Get the current balance of NFP tokens in the contract
function getBalance() public view returns (uint256) { return _nfpToken.balanceOf(address(this)); }
5,988,360
/** *Submitted for verification at Etherscan.io on 2020-09-18 */ pragma solidity 0.5.15; // YAM v3 Token Proxy /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers u...
Currently unused. For future compatability owner The address of the account to query return The number of underlying tokens owned by `owner`/
function balanceOfUnderlying(address owner) view returns (uint256) { delegateToViewAndReturn(); }
5,539,299
./full_match/3/0x8c4F674e29fbf22c070E2b0cEBb38b4Ad6D22511/sources/contracts/nftfactory.sol
require(Projects[_id].creator == msg.sender, "you are not the owner");Projects[_id].startDate = _newDate;
function changeDate(uint _id, uint256 _newDate) public { nft(Projects[_id]).changeDate(_newDate); }
8,142,213
./partial_match/3/0x0A236d465c71CF37EA40a2cc052bdc5c78F6Fb6c/sources/Valhalla_finance.sol
Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero./ ================================================ @Dev This will create a txn Cap for all hodlers regardless of wallet type ================================================ =================================...
function transferFrom(address from, address to, uint256 value) external override returns (bool) { require(value <= _balances[from]); require(value <= _allowed[from][msg.sender]); require(to != address(0)); if (_checkWhitelist(from)) { _balances[from] ...
5,265,878
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; //import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/.../Context.sol"; import "https://github.com/vigilance91/solidarity/contracts/accessControl/AccessControl.sol"; import "http...
mixinEIP1753.STORAGE_SLOT
function _readOnlyLicenseStorage( )private view returns( mixinEIP1753.LicenseStorage storage ){ return mixinEIP1753.dataStore( ); }
12,953,636
./full_match/1/0x011ab72Bd679B12F5316F70E770Aea738e745a4F/sources/contracts/ZombieFriends.sol
In order to mint your free mint go to Ownerfy.com
function websiteMint(uint16 _count, uint256 _nonce, bytes memory _sig) public payable { uint256 total = _totalMinted(); uint256 totalAfter = total + _count; require(totalAfter <= maxZombies, "Max total limit"); if(saleOn != true) { require(totalAfter <= 4000, "Max limit d...
4,946,494
./partial_match/1/0x126d852A3150C53B851eB340ea54Dc379d62f27c/sources/_primitivefi/contracts/contracts/option/libraries/TraderLib.sol
Burns redeemTokens to withdraw available strikeTokens. inputRedeems = outputStrikes. optionToken The address of the option contract. redeemQuantity redeemQuantity of redeemTokens to burn. receiver The strikeTokens are sent to the receiver address./ There can be the case there is no available strikes to redeem, caus...
function safeRedeem( IOption optionToken, uint256 redeemQuantity, address receiver ) internal returns (uint256) { require(redeemQuantity > 0, "ERR_ZERO"); require( IERC20(optionToken.redeemToken()).balanceOf(msg.sender) >= redeemQuantity, ...
4,396,037
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./LogHelper.sol"; contract FlightSuretyData is LogHelper { using SafeMath for uint256; /********************************************************************************************/ /* ...
Get operating status of contract return A bool that is the current operating status/
function isOperational() public view returns (bool) { return operational; }
895,681
// Verified using https://dapp.tools // hevm: flattened sources of src/GebProxySaviourActions.sol pragma solidity =0.6.7 >=0.6.7; ////// lib/geb-proxy-registry/lib/ds-proxy/lib/ds-auth/src/auth.sol // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public ...
Withdraw cover from a saviour and uncover a SAFE collateralSpecific Whether the collateral type of the SAFE needs to be passed to the saviour contract saviour The saviour contract being detached manager The SAFE manager contract token The token being used as cover liquidationEngine The LiquidationEngine contract ...
function withdrawUncoverSAFE( bool collateralSpecific, address saviour, address manager, address token, address liquidationEngine, uint256 safe, uint256 tokenAmount, address dst ) public { withdraw(collateralSpecific, saviour, manager, safe...
13,562,940
./partial_match/1/0x0B604c14796CD16016479a8f8C3FF407d2fC94A4/sources/Nutties.sol
mint the hot potato 1/1 last person holding it gets to keep it
function mintHotPotato1of1() external onlyOwner { require(totalSupply() == 0, "1 of 1 has been minted"); lastFlyingSquirrelOwner = msg.sender; _mint(msg.sender, 1); }
15,558,711
pragma solidity 0.6.0; import "./Storage.sol"; import "../Safe/SafeMath.sol"; contract Alef is Storage { using SafeMath for uint256; constructor (address _daiContractAddress, address _cDaiContractAddress, address _cEthContractAddress) public { // must set the 3 erc addresses daiContractAddress = _dai...
anyone can fund a sponsor
function fundSponsor (address _sponsor) public payable whenNotPaused { require (sponsors[_sponsor].status == true,"sponsor does not exist"); sponsors[_sponsor].balance = sponsors[_sponsor].balance.add(msg.value); }
1,766,927
./partial_match/1/0xBCF85224fc0756B9Fa45aA7892530B47e10b6433/sources/src/v0.8/PermissionedForwardProxy.sol
Verifies if msg.sender has permission to forward to target address and then forwards the handler target address of the contract to forward the handler to handler bytes to be passed to target in call data/
function forward(address target, bytes calldata handler) external { if (s_forwardPermissionList[msg.sender] != target) { revert PermissionNotSet(); }
4,175,590
./full_match/288/0x9284863F131f0145C8F22905C62504E9fD06AB2E/sources/contracts/Ola/Peripheral/ComptrollerPeripherals/RainMaker/SingleAssetDynamicRainMaker.sol
Calculate COMP accrued by a borrower and possibly transfer it to them Borrowers will not begin to accrue until after the first interaction with the protocol. cToken The market in which the borrower is interacting borrower The address of the borrower to distribute COMP to/ Update borrowers's index to the current inde...
function distributeBorrowerCompInternal(address cToken, address borrower, Exp memory marketBorrowIndex) internal { CompMarketState storage borrowState = compBorrowState[cToken]; uint borrowIndex = borrowState.index; uint borrowerIndex = compBorrowerIndex[cToken][borrower]; compBorr...
7,104,157
./full_match/137/0x8785A084FEee5Da46bfa70b3abD94EA157875037/sources/contracts/MasterChef.sol
Update reward variables for all pools. Be careful of gas spending!
function _massUpdatePools() internal { uint length = poolInfo.length; for (uint pid = 0; pid < length; ++pid) { _updatePool(pid); } }
4,712,330
./partial_match/1/0xCD16E7D62dfFD3Bdc5d0C8A0a0Ca2C70991Ad4E1/sources/ETH2.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Ethereum 2.0", "ETH2.0") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factor...
15,635,167