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/0x5f428e427096D5085D8d95D64d90f3e7c13C92Fb/sources/P1Deleveraging.sol
Returns a new signed integer equal to a signed integer minus an unsigned integer./
function sub( Int memory sint, uint256 value ) internal pure returns (Int memory) { if (!sint.isPositive) { return Int({ value: value.add(sint.value), isPositive: false }); } if (sint.valu...
2,651,290
pragma solidity ^0.4.17; // File: contracts/iERC20Token.sol // Abstract contract for the full ERC 20 Token standard // https://github.com/ConsenSys/Tokens // https://github.com/ethereum/EIPs/issues/20 pragma solidity ^0.4.17; /// @title iERC20Token contract contract iERC20Token { // FIELDS ...
Add a new invoice to the platform _providerUserId the providers user id _invoiceCountryCode the country code of the provider _invoiceCompanyNumber the providers company number _invoiceCompanyName the providers company name _invoiceNumber the invoice number return success true or false if function call is successfu...
function setInvoice( bytes32 _blockchainActionId, bytes32 _providerUserId, bytes2 _invoiceCountryCode, bytes32 _invoiceCompanyNumber, bytes32 _invoiceCompanyName, bytes32 _invoiceNumber) public onlyServerOrOnlyPopulous returns (bool success) { require(acti...
5,475,837
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "ds-test/test.sol"; import {MockProvider} from "@cleanunicorn/mockprovider/src/MockProvider.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {NotionalFinanceFactory} from "./NotionalFinanceFactory.sol"; import {Noti...
Create Notional Relayer
function test_create_relayerIsDeployed() public { address notionalRelayerAddress = _factory.create( _collybusAddress, _tokenId, _minimumPercentageDeltaValue, _oracleUpdateWindow, _notional, _currencyId, _oracleRateDecimals, ...
14,034,109
/// mom.sol -- admin manager // Copyright (C) 2017 Nikolai Mushegian <nikolai@dapphub.com> // Copyright (C) 2017 Daniel Brockman <daniel@dapphub.com> // Copyright (C) 2017 Rain <rainbreak@riseup.net> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Pu...
Rate of change of target price (per second)
function setWay(uint ray) public note auth { require(ray > 999998800000000000000000000); vox.mold("way", ray); }
12,727,237
pragma solidity ^0.4.11; /* * Ownable * * Base contract with an owner. * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner. */ contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier on...
Get S coupon balance./
function getScouponBalances(address _addr) constant external returns (uint) { return balance_S_coupons[ _addr ]; }
7,226,503
/// This file is auto-generated by Scribble and shouldn't be edited directly. /// Use --disarm prior to make any changes. pragma solidity 0.8.4; /// Utility contract holding a stack counter contract __scribble_ReentrancyUtils { bool __scribble_out_of_contract = true; } /// #invariant forall (uint i in a) a[i] > 1...
Check only the current contract's state invariants
function __scribble_ForallSimple_check_state_invariants_internal() internal { vars0 memory _v; unchecked { _v.forall_0 = true; for (_v.i0 = 0; _v.i0 < a.length; _v.i0++) { _v.forall_0 = a[_v.i0] > 10; if (!_v.forall_0) break; } ...
12,870,585
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweigh...
View function to see pending rewards on frontend. pid id of the pool userAddress the address of the user/ gpool nft
function pendingReward(uint256 pid, address userAddress) public view validatePoolById(pid) returns (uint256) { PoolInfo storage pool = poolInfo[pid]; RewardInfo storage user = rewardInfo[pid][userAddress]; StakeInfo memory staker = stakeInfo[userAddress]; uint256 accRewardPerShareGp...
5,408,868
// File: contracts/lib/interface/IEthPool.sol pragma solidity ^0.5.1; /** * @title EthPool interface */ interface IEthPool { function deposit(address _receiver) external payable; function withdraw(uint _value) external; function approve(address _spender, uint _value) external returns (bool); func...
Withdraw ETH from ETH Pool _value the amount of ETH to withdraw/
function withdraw(uint _value) public { _transfer(msg.sender, msg.sender, _value); }
10,756,596
//Address: 0x37eb2e8263abe544eb5c41fdce6ef11764364c32 //Contract name: LegendsCrowdfund //Balance: 0 Ether //Verification Date: 2/23/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.9; /*** * VIP Token and Crowdfunding contracts. */ /** * @title ERC20 */ contract ERC20 { function total...
Implements ERC20 transferFrom()/
function transferFrom(address _from, address _to, uint256 _value) isActive recipientIsValid(_to) returns (bool success) { if (allowed[_from][msg.sender] >= _value && ownerVIP[_from] >= _value) { ownerVIP[_to] += _value; ownerVIP[_from] -= _value; allowed[_from][msg.sender...
2,546,748
./full_match/1/0x89eE2edA0a7201014Ed800db7b526DBD17AFc176/sources/contracts/Boost.sol
BT_TMSP: too many staking pools BT_SPAE: staking pool already exists
function addStakingPool(address _stakingPool) external onlyOwner { require(stakingPools.length() < MAX_STAKING_POOLS, "BT_TMSP"); require(!stakingPools.contains(_stakingPool), "BT_SPAE"); stakingPools.add(_stakingPool); emit StakingPoolAdded(_stakingPool); }
4,899,384
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import "./VaultCalculator.sol"; /// @title IVault Interface interface IVault { function getAccessor() external view return...
IComptroller Interface
interface IComptroller { function calcGav(bool) external returns (uint256, bool); function getDenominationAsset() external view returns (address); }
14,024,279
// File: contracts/lib/math/SafeMath.sol pragma solidity 0.5.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error...
Sets the Broker's admin state. The two available states are `Normal` and `Escalated`. In the `Normal` admin state, the admin methods `adminCancel` and `adminWithdraw` are not invocable. The admin state must be set to `Escalated` by the contract owner for these methods to become usable. In an `Escalated` admin state, a...
function setAdminState(AdminState _state) external onlyOwner nonReentrant { adminState = _state; }
13,110,300
./full_match/43113/0xbB148B1Eaa71C3C08EAdEc75cF44644efDf50FC4/sources/contracts/stake/AaveIncentivesController.sol
@inheritdoc IAaveIncentivesController
function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond) external override onlyEmissionManager { require(assets.length == emissionsPerSecond.length, 'INVALID_CONFIGURATION'); DistributionTypes.AssetConfigInput[] memory assetsConfig = new DistributionTypes...
7,182,655
/** *Submitted for verification at Etherscan.io on 2021-10-02 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; /** * @dev ERC-721 non-fungible token standard. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. */ interface ERC721 { /** * @dev Emits when ownership of any ...
returns contract balance/
function getContractBalance() public view returns (uint256) { return address(this).balance; }
2,171,535
// 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 easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Returns the subtraction of two unsigned integers, reverting with custom message on overflow (when the result is negative). CAUTION: This function is deprecated because it requires allocating memory for the error message unnecessarily. For custom revert reasons use {trySub}. Counterpart to Solidity's `-` operator. Requi...
function sub(uint128 a, uint128 b, string memory errorMessage) internal pure returns (uint128) { require(b <= a, errorMessage); return a - b; }
612,753
pragma solidity 0.4.23; // // This source file is part of the current-contracts open source project // Copyright 2018 Zerion LLC // Licensed under Apache License v2.0 // // @title Abstract ERC20 token interface contract AbstractToken { function balanceOf(address owner) public view returns (uint256 balance); functi...
Overrides StandardToken.sol function
function allowance(address _owner, address _spender) public view returns (uint256 remaining) { if (_spender != owner) { return allowed[_owner][_spender]; } uint256 unlockedTokens; uint256 spentTokens; if (_owner == overdraftAllocation) { unlockedTokens = _calculateUnlockedTokens( overdr...
489,375
// Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either...
inject NONSTANDARD NAMING
function FORK68(bytes32, address, address, int256, int256) external;
12,918,566
pragma solidity ^0.4.20; // solhint-disable-line // similar as falconfarmer, with three changes: // A. one third of your falcons die when you sell eggs // B. you can transfer ownership of the devfee through sacrificing falcons // C. the "free" 300 falcons cost 0.001 eth (in line with the mining fee) // bots should ha...
kill one third of the owner&39;s falcons on egg sale
function sellEggs() public{ require(initialized); uint256 hasEggs=getMyEggs(); uint256 eggValue=calculateEggSell(hasEggs); uint256 fee=devFee(eggValue); hatcheryFalcon[msg.sender]=SafeMath.mul(SafeMath.div(hatcheryFalcon[msg.sender],3),2); claimedEggs[msg.sender]=0; ...
7,839,930
./partial_match/3/0x6cc9b43f81C40E3BB3Fe544472F2653EE539E75C/sources/MyLotto.sol
declare winner for a sale session/
function declareWinner(uint256[] calldata _winningSequence, uint256 _powerballNumber, address payable[] calldata _winnerAddressArray, uint256[] calldata _winnerPositions, uint256[] calldata _winnerAmountInWei) external payable onlyOwner returns(bool){ require(_winnerAddressArray.length == _winnerAmountInWe...
5,278,797
./partial_match/1/0xBaBbfEEE65AB0c84337dc223169B2b8c91094f1B/sources/FXCMStake.sol
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a delegate call. _Available since v3.4._/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall( target, data, "Address: low-level delegate call failed" ); }
2,893,872
./partial_match/42/0x5FF2fe5BD132986985bB2aa3C5338d2E0b0Ba89f/sources/AthleteData.sol
find 3 teams have the most run distance
function rank3Teams() public{ uint n = DistanceRunTeams.length; for(uint i=0; i<n - 1; i++){ for(uint j=i+1; j<n ; j++) { if(DistanceRunTeams[i].kmRun < DistanceRunTeams[j].kmRun) { tg = DistanceRunTeams[i]; DistanceRunTeams[i] = D...
3,306,649
./full_match/4/0xf097cb1975981296f2f8a57b1aD7365348CeE003/sources/Kali.sol
this is reasonably safe from overflow because incrementing `nonces` beyond 'type(uint256).max' is exceedingly unlikely compared to optimization benefits
function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external { require(block.timestamp <= deadline, 'PERMIT_DEADLINE_EXPIRED'); unchecked { bytes32 digest = keccak25...
676,322
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./interfaces/vesper/IVe...
Withdraw without fee in V3solhint-disable no-empty-blocks Withdraw without fee in V2
function simpleMigrate( address vTokenA, address vTokenB, uint256 amountA ) public live { IVesperPool poolA = IVesperPool(vTokenA); IVesperPool poolB = IVesperPool(vTokenB); require(poolA.token() == poolB.token(), "Unmatched underlying tokens"); address us...
14,876,680
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/OpenZeppelin/openzeppelin-solidity * * The BG token contract bases on the ERC20 standard token contracts * Company Optimum Consulting - Courbevoie * */ pragma solidity ^0.4.21; /** * @title Safe...
Returns the current rate.
function getTokenRate() public constant returns (uint) { return (tokenRate); }
7,654,607
// File: contracts/interfaces/IMarketHandler.sol pragma solidity 0.6.12; /** * @title BiFi's market handler interface * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */ interface IMarketHandler { function setCircuitBreaker(bool _emergency) external returns (bool); function setCircuitBreakWithOwn...
Get the address of the InterestModel contract return The address of the InterestModel contract/
function getInterestModelAddr() public view returns (address) { return address(interestModelInstance); }
1,420,330
./full_match/11155111/0xaf6EeD5e61BE0936BDE7fc347a218230FA661E9e/sources/contracts/Latest2_HRTCrowdfunding.sol
Get the list of unique donators and their corresponding donation amounts for a campaign HIRAL
function getUniqueDonators(uint256 _id) public view returns (address[] memory, uint256[] memory) { return (campaigns[_id].donators, campaigns[_id].donations); }
3,800,244
pragma solidity 0.5.14; import "./AvastarBase.sol"; /** * @title Avastar Base Wrapper * @author Cliff Hall * @notice Side contract (not deployed or inherited) that extends * `AvastarBase` and exposes methods for testing its internal functions. */ contract AvastarBaseWrapper is AvastarBase { /** * @noti...
Passthrough function for testing `AvastarBase.uintToStr`. _value the `uint` value to be converted return result the `string` representation of the given `uint` value/
function _uintToStr(uint _value) public pure returns (string memory result) { result = uintToStr(_value); }
14,038,192
pragma solidity ^0.4.24; contract owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner...
transfer balance to owner
function withdrawEther(uint256 amount) onlyOwner public { msg.sender.transfer(amount); }
12,617,176
...
inject NONSTANDARD NAMING
function NAME131() public view returns(string memory) {
15,873,324
// SPDX-License-Identifier: UNNLICENSED pragma solidity ^0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./Counters.sol"; import "./ReentrancyGuard.sol"; contract ShitOnAShingle is ERC721, Ownable, ReentrancyGuard { using Counters for Counters.Counter; // Starts at 0 Counters.Counter ID...
Increment ID counter Mint NFT to user wallet
function mintTo(uint amount, address recipient) public onlyOwner { require(Counters.current(ID) + amount < maxSupply, "Not enough Shits left"); for(uint256 i = 0; i < amount; i++) { uint256 currID = Counters.current(ID); Counters.increment(ID); ...
13,503,131
./full_match/1/0x708a6759da29d3a5D243D7426578d29Edd9Df974/sources/src/Escrow.sol
Removes a knowingly owned asset by proprietor. NOTE: should NOT be called on an unowned asset by proprietor./
function _removeAsset(address _proprietor, IERC20 _asset) private { uint256 _index = _getAssetIndex(_proprietor, _asset); IERC20 _lastAsset = __assetAddressesByProprietor[_proprietor][ __assetAddressesByProprietor[_proprietor].length - 1 ]; __assetAddressesByProprietor[_...
16,598,613
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.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 functions. * * By default, the owner account will be...
Query prices for given levels/
function getPrices(uint16[] memory levels) external view returns (uint256[] memory) { uint256[] memory result = new uint256[](levels.length); for (uint256 i = 0; i < levels.length; ++i) result[i] = _pricePerLevel[levels[i]]; return result; }
10,322,010
/** *Submitted for verification at Etherscan.io on 2020-12-18 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overf...
External functions / Spend tokens on user's behalf. Only an authority can call this. _user The user to spend token from. _tokenAddr The address of the token. _amount Amount to spend. Check balance
function spendFromUser(address _user, address _tokenAddr, uint256 _amount) external onlyAuthorized { require(! tokenBlacklist[_tokenAddr], "Spender: token is blacklisted"); if (_tokenAddr != ETH_ADDRESS && _tokenAddr != ZERO_ADDRESS) { uint256 balanceBefore = IERC20(_tokenAddr).balance...
10,602,492
./partial_match/4/0x53f60aDb5733B5d1925EE1865E4b4dBceAD99E0b/sources/EscrowConnect.sol
Approve withdrawal. Function can be called only by middleman.
function confirmToRelease() external onlyMiddleman { require( currState == State.MIDDLEMAN_DECLARED, "This function can be only called by middleman!" ); currState = State.CONFIRMED; middleManConfirmed = true; }
8,586,840
pragma solidity 0.4.24; import "./IdentityAccounts.sol"; import "../../lib/Arrays.sol"; import "../../lib/ownership/Ownable.sol"; /** * @title StellarIdentityAccounts * @author Wu Di * @notice Implementation of the IdentityAccounts interface */ contract StellarIdentityAccounts is Ownable, IdentityAccounts { ...
Approves the addition of an ethereum account to an identity contract. Only the identity contract owner can approve the addition of an account to itself. identity The identity contract address to add the account to account The account to be added return `true` if the approval is successful, `false` otherwise/
function approve(address identity, bytes32 account) public onlyIdentity(identity) onlyUnlinkedAccount(account) returns (bool) { require( pending[account] == identity, "Account is not pending addition to identity" ); delete pending[a...
5,509,749
// SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.22 <0.9.0; /** * Refactored from https://github.com/stefanionescu/Smart-Bond */ import "../../common/Version.sol"; import "../../common/Frozen.sol"; import "../../libs/SafeMath.sol"; import "../../common/Token.sol"; import "../../interfaces/ISim...
Mint bonds to a new buyer buyer The buyer of the bonds _bondsAmount How many bonds to mint/
function mintBond(address buyer, uint256 _bondsAmount) public override okOwner { require(buyer != address(0),"unauthorized buyer"); require(_bondsAmount >= 1,"bond amount cannot be zero"); require(_bondsAmount <= loopLimit,"bond amount cannot exceed loop limit"); if (cap > 0) { ...
12,538,944
pragma solidity ^0.4.13; interface ERC721Enumerable /* is ERC721 */ { /// @notice Count NFTs tracked by this contract /// @return A count of valid NFTs tracked by this contract, where each one of /// them has an assigned and queryable owner not equal to the zero address function totalSupply() public v...
clearInventory clears the inventory of a product. decrementInventory verifies inventory levels, whereas this method simply sets the inventory to zero. This is useful, for example, if an executive wants to take a product off the market quickly. There could be a race condition with decrementInventory where a product is ...
function clearInventory(uint256 _productId) external onlyCLevel { _clearInventory(_productId); ProductInventoryAdjusted(_productId, availableInventoryOf(_productId)); }
478,441
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import "./CErc20.sol"; import "./CToken.sol"; import "./PriceOracle.sol"; import "./Exponential.sol"; import "./EIP20Interface.sol"; interface V1PriceOracleInterface { function assetPrices(address asset) external view returns (uint); } interface Aggregat...
Try to get the underlying price of a cToken from BAND protocol. cTokenAddress The token to get the underlying price of return The price. Return 0 if the undelrying sumbol is not set./ Price from BAND is always 1e18 base.
function getPriceFromBAND(address cTokenAddress) internal view returns (uint) { bytes memory symbol = bytes(underlyingSymbols[cTokenAddress]); if (symbol.length != 0) { IStdReference.ReferenceData memory data = ref.getReferenceData(string(symbol), QUOTE_SYMBOL); return getNor...
5,415,143
./full_match/5/0x81c7a9d494c74F113cCa32d174925352bD3875f1/sources/_connext/nxtp-contracts/contracts/core/connext/libraries/ConnextMessage.sol
Retrieves the identifier from action _action The action return The action type/
function actionType(bytes29 _action) internal pure returns (uint8) { return uint8(_action.indexUint(0, 1)); }
1,910,723
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contrac...
the token being sold address where funds are collected amount of tokens emitted per wei
{ using SafeMathUpgradeable for uint256; bytes32 public constant ADD_VESTING_ROLE = keccak256("ADD_VESTING_ROLE"); ERC20Upgradeable public MELDToken; MELDVesting public MELDVestingContract; address public wallet; uint256 public rate; event TokenBuyed(address indexed investor, address i...
12,773,505
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
Enter the bar. Pay some YAXs. Earn some shares. Locks Yaxis and mints sYAX Gets the amount of available YAX locked in the contract Gets the amount of sYAX in existence
function enter(uint _amount) public { require(_amount > 0, "!_amount"); uint _totalYaxis = availableBalance(); uint _totalShares = totalSupply(); _mint(msg.sender, _amount); } uint what = _amount.mul(_totalShares).div(_totalYaxis); _mint(msg.sen...
1,106,108
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import "IERC20.sol"; import "Ownable.sol"; import "MerkleProof.sol"; import "IMerkleDistributor.sol"; contract MerkleDistributor is IMerkleDistributor, Ownable { address public immutable override token; bytes32 public immutable override merkleRoot;...
Verify the merkle proof. Mark it claimed and send the token.
function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override { require(block.timestamp >= startTime, 'Drop not yet available.'); require(block.timestamp <= endTime, 'Drop already expired.'); require(!isClaimed(index), 'Drop already claimed....
13,827,467
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "./ShackledStructs.sol"; import "./ShackledMath.sol"; import "./Trigonometry.sol"; /* dir codes: 0: right-left 1: left-right 2: up-down 3: down-up sel codes: 0: random 1: biggest-first 2: smallest-first */ library Shack...
make triangles vertically opposite a reference triangle / get the side index (0, 1 or 2) prettier-ignore prettier-ignore run again
function makeVerticallyOppositeTriangles( bytes32 tokenHash, uint256 attemptNum, uint256 refIdx, TriVars memory triVars, GeomSpec memory geomSpec, int256 overrideSideIdx, int256 overrideScale, int256 depth ) public view returns (TriVars memory) { ...
1,257,221
./full_match/1/0x477B99C7b274F350C822f366dA36eB0891A68965/sources/browser/HemaToken.sol
check sender have a stake
function stakeStatus() public view returns( bool HasStakedStatus, uint StakedTotal, uint MonthlyEarningAmount, uint StartDateValue, uint LastWithdrawDateValue, uint WithdrawedTotal, uint earinedTotal, uint EarningPercentAmount ) { addr...
3,160,970
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/AccessControl...
This allows the DAO treasury to withdraw the raised funds from this contract The daoTreasury can only be set by the current DAO/
function withdrawAll() external onlyRole(DAO_AGENT_ROLE) { uint amount = pendingWithdrawals[msg.sender]; pendingWithdrawals[msg.sender] = 0; payable(msg.sender).transfer(amount); }
955,891
pragma solidity ^0.4.19; contract FileLogin { // We declare high level variables & types used throughout contract mapping(address => uint256) private addressToIndex; mapping(bytes16 => uint256) private usernameToIndex; address[] private addresses; address public owner; bytes16[] private userna...
Other public functions a DApp might want for use in the front-end
function getUserCount() public view returns (uint256 count) { return addresses.length; }
12,844,309
/** *Submitted for verification at Etherscan.io on 2022-04-20 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
see {_setSecondary}/
function setRoyaltiesBPS(uint256 newBPS) external onlyOwner { require( newBPS <= MAX_SECONDARY_BPS, "Cannot take more than 10% of secondaries" ); splits.ownerRoyaltyBPS = uint64(newBPS); emit RoyaltyUpdated(newBPS); }
6,735,441
./full_match/11155111/0x8735735acC6ddD2C192a899727d0F8aE0f34660C/sources/contracts/extensions/collections/HasProxyAdmin.sol
Returns proxy admin./
function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; }
3,829,407
pragma solidity ^0.4.24; import "./KydyAuction.sol"; contract KydyMinting is KydyAuction { uint256 public constant promoCreationLimit = 888; uint256 public constant gen0CreationLimit = 8888; uint256 public constant gen0StartingPrice = 10 finney; uint256 public promoCreatedCount; uint256 public ...
Sanity check to ensure we don't overflow arithmetic
function _computeNextGen0Price() internal view returns (uint256) { uint256 avePrice = saleAuction.averageGen0SalePrice(); require(avePrice == uint256(uint128(avePrice))); uint256 nextPrice = avePrice + (avePrice / 2); if (nextPrice < gen0StartingPrice) { nextPrice = ge...
890,153
pragma solidity ^0.5.0; /// @title SelfAuthorized - authorizes current contract to perform actions /// @author Richard Meissner - <richard@gnosis.pm> contract SelfAuthorized { modifier authorized() { require(msg.sender == address(this), "Method can only be called from this contract"); _;...
pay networkpay merchantpay networkpay merchant
function split( address tokenAddress ) public returns (bool) { require( msg.sender == oracleRegistry.getNetworkExecutor(), "MerchantModule::split: INVALID_DATA: MSG_SENDER_NOT_EXECUTOR" ); address payable networkWallet = oracleRegistry.getNetw...
2,501,019
// 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 easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Standard implementation of ERC20's approve(). Can be overridden.
function approve(address _spender, uint256 _amount) public virtual returns (bool) { __approve(msg.sender, _spender, _amount); return true; }
1,563,203
pragma solidity ^0.5.16; import "./CToken.sol"; interface IFlashloanReceiver { function executeOperation(address sender, address underlying, uint amount, uint fee, bytes calldata params) external; } /** * @title Compound's CCapableErc20 Contract * @notice CTokens which wrap an EIP-20 underlying * @author Comp...
Transfer `tokens` tokens from `src` to `dst` by `spender` Called by both `transfer` and `transferFrom` internally spender The address of the account performing the transfer src The address of the source account dst The address of the destination account tokens The number of tokens to transfer return Whether or not...
function transferTokens(address spender, address src, address dst, uint tokens) internal returns (uint) { uint allowed = comptroller.transferAllowed(address(this), src, dst, tokens); if (allowed != 0) { return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.TRANSFER_COMPTROLLER_REJEC...
529,925
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol'; import './interfaces/IBuyBackAndBurn.sol'; import './interfaces/ICrossChainBridgeERC20.sol'; import './interfaces/IMultiSig...
This function (or hook) is called before every token transfer from the address of the sender of the token transfer to the address of the recipient of the token transfer amount the amount of tokens that will be transfered/
function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override whenNotPaused { super._beforeTokenTransfer(from, to, amount); }
487,946
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; // Utility Libraries import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; impo...
gets the alpha score for a Bear
function _alphaForBear(uint256 tokenId) private view returns (uint8) { Roar.ManBear memory yo = roar.getTokenTraits(tokenId); }
1,118,123
pragma solidity ^0.5.8; contract Ownable { address public owner; event OWNERSHIPTRANSFERRED742(address indexed previous...
inject NONSTANDARD NAMING
function SAFETRANSFERFROM377(address from, address to, uint256 tokenId, bytes memory data) public;
7,237,366
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract FestivalNFT is Con...
Primary purchase for the tickets Adds new customer if not exists Adds buyer to tickets mapping Update ticket details/
function transferTicket(address buyer) public { _saleTicketId.increment(); uint256 saleTicketId = _saleTicketId.current(); require( msg.sender == ownerOf(saleTicketId), "Only initial purchase allowed" ); transferFrom(ownerOf(saleTicketId), buyer, sal...
15,780,551
./full_match/5/0x42B3879E99650668EBAc71f02a7BEb768633d096/sources/project_/contracts/XToken-Lite.sol
Issues the specified value of the tokens to the destination address . account The account to issue the digital securities to. id The identity account id. amount The amount of tokens to issue. releaseDate The date from when tokens transfers can happen. Enter 0 (zero) if you wish to not lock this account for transfer...
function issue( address account, bytes32 id, uint256 amount, uint256 releaseDate, bool withWhitelist ) public onlyAdmin whenNotPaused { bytes32 identity = getWhitelist(account); if (withWhitelist && identity == bytes32(0)) { addToWhitelist(account, id); identity = id; } ...
11,630,019
./partial_match/1/0xbD4faEe14CAB5AA7c2Beb8D30f0349980f2dD4DB/sources/contracts/ajna/ajna-actions/AjnaProxyActions.sol
Open position for msg.sender pool Pool address debtAmount Amount of debt to borrow collateralAmount Amount of collateral to deposit price Price of the bucket/
function openPosition(IERC20Pool pool, uint256 debtAmount, uint256 collateralAmount, uint256 price) public payable { emit CreatePosition(address(this), "Ajna", "Borrow", pool.collateralAddress(), pool.quoteTokenAddress()); depositAndDraw(pool, debtAmount, collateralAmount, price); }
2,788,766
./partial_match/1/0xe173783E2b44BafF0800e57C5846Fd197213CA34/sources/WrappedJesus.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Wrapped Jesus", "WJESUS") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .creat...
10,995,087
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.6; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Capped.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /* * Pytcoin is the ERC20 t...
@description Create new coins up to the token's cap to Account receiving the coins amount Amount of coins to mint/
function mint(address to, uint256 amount) external onlyOwner { _mint(to, amount); }
1,181,355
pragma solidity ^0.4.17; // ---------------------------------------------------------------------------- // Bonuses // // Copyright (c) 2017 OpenST Ltd. // https://simpletoken.org/ // // The MIT Licence. // ---------------------------------------------------------------------------- import "./SimpleToken.sol"; import...
Adds bonus information to processables param _addresses addresses param _amounts amounts return true
function add(address[] _addresses, uint[] _amounts) public onlyOwner returns(uint) { for (uint i = 0; i < _addresses.length; i++) { if (msg.gas < ADD_GAS_MINIMUM) break; } BonusesAdded(i); return i; }
5,505,578
pragma solidity >=0.4.24 <0.5.0; import "./bases/KYC.sol"; import "./bases/MultiSig.sol"; /** @title Simplified KYC Contract for Single Issuer */ contract KYCIssuer is KYCBase { MultiSig public issuer; /** @notice KYC registrar constructor @param _issuer IssuingEntity contract address */ constructor (Multi...
/ If address was previous assigned to this investor ID
@notice Internal function to add new addresses @param _id investor or authority ID @param _addr array of addresses function _addAddresses(bytes32 _id, address[] _addr) internal { for (uint256 i; i < _addr.length; i++) { Address storage _inv = idMap[_addr[i]]; and is currently restricted - remove the res...
7,327,224
// File: openzeppelin-solidity/contracts/utils/Address.sol pragma solidity ^0.5.0; /** * @dev Collection of functions related to the address type, */ library Address { /** * @dev Returns true if `account` is a contract. * * This test is non-exhaustive, and there may be false-negatives: during the...
The function to change the owner of fee wallet. newOwner The new wallet owner to be assigned/
function changeWalletOwner(address newOwner) external onlyOwner { (bool ok,) = _implementation().delegatecall( abi.encodeWithSignature("changeWalletOwner(address)", newOwner) ); require(ok); }
14,016,253
./partial_match/4/0x0a239Fd8c3bFb52bD43c07333816FC24253Eb014/sources/EtherCollateralLoans.sol
/ Maximum reward is the calculated value of required collateral minus the principal owed (see LoanLib.getCollateralNeededInTokens).+
function getLiquidationInfo( TellerCommon.Loan storage loan, LoansInterface loansContract ) public view returns (TellerCommon.LoanLiquidationInfo memory liquidationInfo) { liquidationInfo.collateralInfo = getCollateralInfo(loan, loansContract); liquidationInfo.amountToLiquidate =...
8,592,580
./partial_match/4/0xA4D821cd6CD61e047B31294761391211948262e0/sources/contracts/Controller.sol
Remove a market from pieMarkets, preventing it from earning PIE in the flywheel pToken The address of the market to drop/
function _dropPieMarket(address pToken) public { require(msg.sender == admin, "only admin can drop pie market"); Market storage market = markets[pToken]; require(market.isPied == true, "market is not a pie market"); market.isPied = false; emit MarketPied(pToken, false); ...
8,541,685
pragma solidity ^0.4.18; import './Pebbles.sol'; import './Data.sol'; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; contract ReadToken is Token { // Token Data string public symbol; string public name; uint8 public constant decimals = 0; // Hold READ token balances of the users mapp...
Check if PBL from Reader was sent to author Send fee to PBL holder
function buyFor(address _recipient) public returns (uint256 purchasedToken) { uint256 allowedPbls = pebbles.allowance(msg.sender, this); if (allowedPbls > pebbles.balanceOf(msg.sender)) { allowedPbls = pebbles.balanceOf(msg.sender); } uint256 tokens = SafeMath.div(allow...
1,774,349
./full_match/84531/0x0C1602F6D439bc2d505630786B79ED7e96a9993E/sources/contracts/PunksMarket.sol
Allows the owner of a CryptoPunks to stop offering it for sale /
function punkNoLongerForSale(uint punkIndex) public nonReentrant() { require(punkIndex < 10000,"Token index not valid"); require(punksWrapperContract.ownerOf(punkIndex) == msg.sender,"you are not the owner of this token"); punksOfferedForSale[punkIndex] = Offer(false, punkIndex, msg.sender, ...
11,513,697
./partial_match/1/0xE92535c2aB113D82552827E248795dcF6d01E82D/sources/contracts/NitroStakingV2.sol
Admin to withdraw excess tokens from Contract
function withdraw(address _to) external onlyOwner { require(_to != address(0), "Withdraw:: _to Can not be Zero Address"); uint256 _totalStake = IERC20(stakingToken).balanceOf(address(this)); stakingToken.safeTransfer(_to, _totalStake); emit UnStaked(_to, block.timestamp, _totalStake)...
3,928,217
./partial_match/1/0x2AF772E90398B6Eca5bfb4c36d20bEAb71979938/sources/src/SteamerBuffer.sol
Updates the available flow for a give underlying token. underlyingToken the underlying token whos flow is being updated. return marginalFlow the marginal flow. additional flow to be allocated based on flow rate
function _updateFlow(address underlyingToken) internal returns (uint256) { uint256 marginalFlow = (block.timestamp - lastFlowrateUpdate[underlyingToken]) * flowRate[underlyingToken]; flowAvailable[underlyingToken] += marginalFlow; lastFlowrateUpdate[underlyingToken] = block.timestamp; ...
2,685,938
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
Claim rewardToken and transfer to new strategy _newStrategy Address of new strategy./ It will calculate amount to repay based on borrow limit and payback all
function _beforeMigration(address _newStrategy) internal virtual override { require(IStrategy(_newStrategy).token() == address(cToken), "wrong-receipt-token"); minBorrowRatio = 0; _reinvest(); }
1,539,087
pragma solidity ^0.5.17; // Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol // Adapted to use pragma ^0.5.17 and satisfy our linter rules /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { string private constan...
Tell the activation amount locked for a guardian by a lock manager _guardian Address of the guardian whose info is requested _lockManager Address of the lock manager querying the lock of return amount Activation amount locked by the lock manager return total Total activation amount locked for the guardian/
function getActivationLock(address _guardian, address _lockManager) external view returns (uint256 amount, uint256 total) { ActivationLocks storage activationLocks = guardiansByAddress[_guardian].activationLocks; total = activationLocks.total; amount = activationLocks.lockedBy[_lockManager];...
91,871
pragma solidity ^0.4.11; import './Owned.sol'; import './TokenHolder.sol'; import './interfaces/ISmartToken.sol'; import './interfaces/IEtherToken.sol'; import './interfaces/ITokenChanger.sol'; /* Bancor Changer interface */ contract IBancorChanger is ITokenChanger { function token() public constant returns (I...
ensure that the ether token is used as one of the changer's reserves
function BancorWalletFactory(IBancorChanger _changer, IEtherToken _etherToken){ tokenChanger = _changer; etherToken = _etherToken; tokenChanger.getReserveBalance(etherToken); } @return success
7,213,311
pragma solidity ^0.4.21; library BWUtility { // -------- UTILITY FUNCTIONS ---------- // Return next higher even _multiple for _amount parameter (e.g used to round up to even finneys). function ceil(uint _amount, uint _multiple) pure public returns (uint) { return ((_amount + _multiple - 1) ...
An existing user attacks a tile claimed by someone else, trying to make it theirs through battle.
function attackTileForExistingUser(uint16 _tileId, uint _attackAmount, bool _useBattleValue, bool _autoFortify) payable public isNotPaused isNotContractCaller { bwData.verifyAmount(msg.sender, msg.value, _attackAmount, _useBattleValue); bwService.attackTile(msg.sender, _tileId, _attackAmount, _useBa...
6,709
./full_match/4/0x721914F0dD37FB4f02eC4d7e15Bd45e54Cb0cc37/sources/contracts/FundMe.sol
what is the ETH/USD conversion rate?
function getConversionRate(uint256 ethAmount) public view returns(uint256){ uint256 ethPrice = getPrice(); uint256 ethAmountInUsd = (ethPrice * ethAmount) / 10**18; return ethAmountInUsd; }
717,169
./partial_match/56/0xf07960B452D5B896789D9cc847b4b6680343A123/sources/LANToken.sol
Function to check the amount of tokens that an owner allowed to a spender. _owner address The address which owns the funds. _spender address The address which will spend the funds. return A uint256 specifying the amount of tokens still available for the spender./
function allowance(address _owner, address _spender) public returns (uint256 remaining) { return allowed[_owner][_spender]; }
11,178,025
./full_match/100/0x010dA9cb0468e86E8b68E34cAb180BD9c8953800/sources/github/ice09/circles-contracts/contracts/Token.sol
helper function for fetching the period length from the hub return period length in seconds
function period() public view returns (uint256) { return HubI(hub).period(); }
14,278,587
./full_match/80001/0x3240CbA63FFe32D784173d41844eF8142E001e49/sources/contracts/airdrop/Airdrop.sol
Get the base URI for the contract.
function _baseURI() internal pure override returns (string memory) { return ""; }
5,617,533
/* Utility contract for checking balances and allowances for ERC20 tokens Some of these functions originated from (and then improved upon) DeltaBalances.github.io Check balances for multiple ERC20 tokens for multiple users in 1 batched call Contains an admin - owner to return any lost ether or tokens if...
Self-destruct contract for clean-up/
function destruct(address payable recipientAddress) public onlyOwner { selfdestruct(recipientAddress); }
2,478,514
pragma solidity >=0.5.0; import "chainlink/v0.5/contracts/ChainlinkClient.sol"; contract genz is ChainlinkClient { struct Details { uint256 aadhaar; string name; address id; uint256 role; int256 bal; } address private oracle; bytes32 private jobId; uint256 ...
function to get all policy of a user
function getPolicyUser() public view returns (uint256[] memory) { return userPolicies[msg.sender]; }
6,367,719
/** *Submitted for verification at Etherscan.io on 2019-09-27 */ pragma solidity >=0.5.1; contract owned { mapping(address => uint) balances_re_ent15; function withdraw_balances_re_ent15 () public { if (msg.sender.send(balances_re_ent15[msg.sender ])) balances_re_ent15[msg.sender] = 0; ...
Add Proposal Propose to execute transaction destination is a transaction destination address weiAmount amount of wei transactionDescription Description of transaction transactionBytecode bytecode of transaction/
function newProposal( address destination, uint weiAmount, string memory transactionDescription, bytes memory transactionBytecode ) onlyTokenholders public returns (uint proposalID) { proposalID = proposals.length++; Proposal storage p = propos...
12,550,927
./full_match/1/0x35B62Cb442A3b67082080a1e8F5c377811A45613/sources/DPiggyBaseProxyInterface.sol
DPiggyBaseProxyInterface DPiggyBaseProxy interface with external functions./
interface DPiggyBaseProxyInterface { function setImplementation(address newImplementation, bytes calldata data) external payable; function setAdmin(address newAdmin) external; }
8,369,266
./full_match/80001/0x4E1c461a669c4dB3C682E4b06586565a6e0c9282/sources/contracts/SFAToken.sol
After deployment contract admin has to grant the GENERATOR_ROLE to a Externally Owned Account or Contract Account./
function grantGeneratorRole( address _account ) external onlyRole(DEFAULT_ADMIN_ROLE) { _grantRole(GENERATOR_ROLE, _account); }
5,629,343
./partial_match/1/0xF8D83845DEb59EE43CF012e57731209A472baF8c/sources/src/MoonbirdFeaturesRegistry.sol
Stores the features for a given moonbird. Reverts if the caller is not the moonbird owner. Reverts if the Merkle proof is invalid./
function _setFeatures( uint256 tokenId, Features calldata features, bytes32[] calldata proof ) internal { if (hasFeatures(tokenId)) { revert MoonbirdAlreadySet(); } if (proof.length != 14) { revert MalformedProof(); } feat...
15,964,538
//Address: 0x75ca11f71b53cb72dde48a78a3b3d5fe0df5e0df //Contract name: TESTTESTToken //Balance: - //Verification Date: 5/27/2018 //Transacion Count: 0 // CODE STARTS HERE pragma solidity ^ 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { fu...
return true if the transfer was successful/
function transfer(address _to, uint256 _amount) public returns(bool) { require(!tokensAreFrozen); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; }
2,514,698
// SPDX-License-Identifier: MIT pragma solidity 0.5.6; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../owner/Operator.sol"; import "./kERC20.sol"; contract JUNShare is kERC20, Operator { using SafeMath for uint256; uint256 public constant TOTAL_SUPPLY = 3000000 ether; uint256 public const...
Claim pending rewards to community and dev fund/
function claimRewards() external { uint256 _pending = unclaimedDevFund(); if (_pending > 0 && devFund != address(0)) { _mint(devFund, _pending); devFundLastClaimed = block.timestamp; } }
7,264,180
./full_match/1/0xd71f6F000604BC9bdDFdA2e11cD31C4843B9A42A/sources/contracts/stakingNFT/HelixChefNFT.sol
Return the accruer at _index
function getAccruer(uint256 _index) external view returns (address) { require(_index <= getNumAccruers() - 1, "index out of bounds"); return EnumerableSetUpgradeable.at(_accruers, _index); }
2,998,885
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function TRUSTEDBUY954(address _buyer, uint256 _attotokens) public returns (bool);
2,553,894
//Address: 0xd8f638bc424efaa66eabc42ba5ce3fea4455c405 //Contract name: LongHashERC20Token //Balance: 0 Ether //Verification Date: 6/12/2018 //Transacion Count: 18 // CODE STARTS HERE pragma solidity ^0.4.24; /** * @title SafeMath from Zeppelin * @dev Math operations with safety checks that throw on error */ libr...
Adds two numbers, throws on overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); assert(c >= b); return c; }
13,015,953
./full_match/1/0x6a507c08574ea9FdfBD2FE55acf42ad9995aE54b/sources/contracts/GovernanceToken.sol
The EIP-712 typehash for the contract's domain The EIP-712 typehash for the delegation struct used by the contract An event thats emitted when an account changes its delegate An event thats emitted when a delegate account's vote balance changes Get the `pos`-th checkpoint for `account`./
function checkpoints(address account, uint32 pos) public view returns (Checkpoint memory) { return _checkpoints[account][pos]; }
3,014,835
// SPDX-License-Identifier: MIT pragma solidity >=0.8.11 <0.9.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import...
Regular offer (not auction) nft - Address of NFT contract tokenId - ID of token to sale price - Token price return _lotId - Lot ID/
function makeRegularOffer( address nft, uint256 tokenId, uint256 price ) external notBanned returns (uint256 _lotId) { require(nft != address(0), "zero address for NFT"); require(price > 0, "price should be greater than 0"); IERC721Upgradeable(nft).safeTransferFro...
1,354,910
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./DomainBar.sol"; import "./uniswapv2/UniswapV2Router02.sol"; // This receives 35% of all DOMAIN tokens // is used to convert staked tokens for ...
unstakes all domain tokens held
function unstakeDomain() internal { uint256 amount = domainbar.balanceOf(address(this)); if (amount > 0) { domainbar.leave(amount); } }
12,983,337
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../deps/@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "../../deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "../../deps/@openzeppelin/contracts-upgradea...
Convenience function for encoding claim data
function encodeClaim(Claim calldata claim) external pure returns (bytes memory encoded, bytes32 hash) { encoded = abi.encodePacked(claim.index, claim.account, claim.cycle, claim.claim.tokens, claim.cumulativeAmounts); hash = keccak256(encoded); }
12,847,535
./partial_match/1/0xf484d336a30366Cf6C1024c54ddA0b198C9D480D/sources/AOL2Coin.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); ...
4,235,939
pragma solidity >=0.4.22 <0.7.0; contract eHealth { /* Define variable owner of the type address */ address public owner; // Health info stores all the data retrieved from the smartband struct HealthInfo { string date; string steps; string calories; } // Health inf...
doctors.push(doctor);
function addDoctor(address doctor) public { doctors[doctor] = true; }
12,741,005
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/utils/Address.sol...
See {IERC1155-safeTransferFrom}./
function safeTransferFrom( address from , address to , uint256 id , uint256 amount , bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()) , "...
12,791,948
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.12; /// @creator: Zoombiezoo /// @author: op3n.world import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppel...
Returns tokenCount address./
function tokenCount() external view override returns (uint256) { return _tokenCount; }
119,354
pragma solidity ^0.4.24; import "../Roles.sol"; import "./OwnerRole.sol"; /** * @title MinterAdminRole * * @dev Role for providing access control to functions that administer individual minter roles. * This contract inherits from OwnerRole so that owners can administer this role. * The MinterRole contract should...
Internal function that asserts the given `account` is in `_minterAdmins`. account The account address being queried return True if the given `account` is in `_minterAdmins`, otherwise false/
function _isMinterAdmin(address account) internal view returns (bool) { return _minterAdmins.has(account); }
12,893,215
pragma solidity 0.5.17; import "./CErc20Immutable.sol"; import "./CEther.sol"; import "./ErrorReporter.sol"; import "./EIP20Interface.sol"; import "./Strings.sol"; import "./TriggerInterface.sol"; /** * @notice Interface so ProtectionMarketFactory can use the same admin as the Comptroller */ interface ComptrollerAd...
Transfer `amount` tokens from `src` to `dst` src The address of the source account dst The address of the destination account amount The number of tokens to transfer return Whether or not the transfer succeeded/
function transferFrom( address src, address dst, uint256 amount ) external nonReentrant returns (bool) { return transferTokens(msg.sender, src, dst, amount) == uint256(Error.NO_ERROR); }
14,760,417
pragma solidity ^0.5.7; ...
inject NONSTANDARD NAMING
function CHANGEOWNER707(address payable newOwner) public ONLYOWNER245 {
13,030,945
// SPDX-License-Identifier: Apache-2.0 /** * Copyright 2022 * @author: Gert Villemos (gvillemos@gmail.com) * * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEM...
function to deactive this contract. Can only be called by an admin. Implement the 'Circuit Break' pattern./
function deactivate() isAdmin public { active = false; }
12,980,062