file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/5/0x2E3dD5F1E9E3180a64E367B2aCD56B4004039590/sources/ParagonsDAOPlayerID.sol
Returns the Player data by id.
function getPlayerData(uint256 _tokenId) public view returns (PlayerData memory) { if (!_exists(_tokenId)) revert NoPDP(); return _playerData[_tokenId]; }
1,876,920
./full_match/5/0xB23F0796e592A91467E5D42F3368Cd722E7f0251/sources/contracts/medrecords.sol
Retrieve patient count
function getPatientCount() public view returns(uint256) { return patientCount; }
11,630,163
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2021 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by a...
Sells an ERC1155 asset to fill the given order. buyOrder The ERC1155 buy order. signature The order signature from the maker. erc1155TokenId The ID of the ERC1155 asset being sold. If the given order specifies properties, the asset must satisfy those properties. Otherwise, it must equal the toke...
function sellERC1155( LibNFTOrder.ERC1155Order memory buyOrder, LibSignature.Signature memory signature, uint256 erc1155TokenId, uint128 erc1155SellAmount, bool unwrapNativeToken, bytes memory callbackData ) public override { _sellERC11...
13,001,148
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/math/Math.sol'; import './interfaces/IOracle.sol'; import './interfaces/IBoardroom.sol'; import './interfaces/IBa...
迁移国库合约到新合约 target 目标地址/ cash更换GOC合约的Admin,Owner为target,并把原合约的GOC发送至target bond更换GOB合约的Admin,Owner为target,并把原合约的GOB发送至target share更换GOT合约的Admin,Owner为target,并把原合约的GOT发送至target Boardroom更换boardroom合约的Admin params触发所有权转移事件
function migrate(address target) public onlyAdmin checkAdmin { require(!migrated, 'Treasury: migrated'); AdminRole(cash).addAdmin(target); AdminRole(cash).renounceAdmin(); IERC20(cash).transfer(target, IERC20(cash).balanceOf(address(this))); AdminRole(bond).addAdmin(target)...
6,464,094
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.4; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "../interface/IKeeperWhi...
List all local keepers. begin The begin index of keeper to retrieve. end The end index of keeper, exclusive. return result An array of keeper addresses./
function listKeepers(uint256 begin, uint256 end) public view virtual returns (address[] memory) { return _keepers.toArray(begin, end); }
6,439,537
pragma solidity ^0.5.16; contract FlightCompensation{ /* * Compensation amounts */ uint256 small3 = 125; uint256 small6 = 250; uint256 small9 = 500; uint256 large3 = 400; uint256 large6 = 700; uint256 large9 = 1000; uint256 private availableFunds; //variable storing the contract...
going through only the ongoing claims
function addNewClaim( uint256 ID, bytes32 flightID, uint8 airlineType, uint256 maxArrivalTime0, uint256 maxArrivalTime1, uint256 maxArrivalTime2, address payable compensationAddress ) } function updateFlightStatus( bytes32 flightID, ...
15,825,085
./full_match/4/0x134C164ba6c5ba1A380317c2A9BE4BA33f080161/sources/testtest.sol
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWit...
648,474
pragma solidity >=0.5.0; import "6_DBClientInterface.sol"; // This contract demonstrates how to send different amounts of information to another contract. contract DataBase { // Modifier that allows public function to accept all external calls. modifier alwaysAccept { // Runtime function that allows contract to ...
Function sends an array of structures to the contract with address 'receiver'.
function sendStructArray(address receiver) public alwaysAccept { IDataBaseClient.MyStruct[] arr = createStructArray(); IDataBaseClient(receiver).receiveStructArray(arr); sendCounter++; }
5,408,049
// @author Unstoppable Domains, Inc. // @date August 12th, 2021 pragma solidity ^0.8.0; import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; import './IForwarder.sol'; import './BaseForwarder.sol'; /** * @title BaseRoutingForwarder * @dev BaseRoutingForwarder simplifies operation with legac...
solium-disable-next-line security/no-inline-assembly /
function _getRoute(bytes memory data) internal view returns (bytes4) { bytes4 selector; assembly { selector := mload(add(data, add(0x20, 0))) } return _routes[selector]; }
6,474,704
// File: contracts/vaults/IStrategy.sol ...
inject NONSTANDARD NAMING
function SWAPEXACTAMOUNTOUT77(address, uint, address, uint, uint) external returns (uint, uint);
1,825,117
./partial_match/1/0x1E7407b5f0c3ec55cFEEb0B19Dfb006e32F8EBB0/sources/TOW3.sol
0 is always defined as the O from HOST 9 image will just be 6 upside down
function getNumberDefinitions( uint n ) private pure returns (string memory) { bytes memory b = bytes(n.toString()); string memory definitions = getNumberSVG(0); uint isDefined = 0; for(uint i; i < b.length; i++){ uint digit = uint(uint8(b[i])) - 48; if( digit != 0 ){ uint positi...
2,838,338
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./lib/RLPReader.sol"; import "./lib/RLPEncode.sol"; import "....
UUPS /
function _authorizeUpgrade(address) internal view override { require(msg.sender == _getAdmin(), "LightNode: only Admin can upgrade"); }
12,668,546
./full_match/1/0x5C65b21FeD9e97369d0e04b03B3180dB3249759d/sources/contracts/growth/growth.sol
getters and setters for Presale access
function canAccessPresale(address addr) public view returns (bool) { return _presaleAccess[addr]; }
3,849,117
pragma solidity >=0.7.0 <0.8.0; /** * SPDX-License-Identifier: MIT * Copyright (c) 2020 Kim Il Yong */ // Connect Remix to: http://localhost:49796 import "./safemath.sol"; import "./signedsafemath.sol"; import "./math.sol"; /** * @title OwnedContract * @dev Set & change contract owner */ contract OwnedContrac...
Request bootstrap gas from the faucet _to address to send the gas to _amount of gas to send/
function giveBootstrapGas(address payable _to, uint _amount) public isOwner { require(_amount <= 0.1 ether, "Max 0.1 NRG is more than enough gas!"); _to.transfer(_amount); }
7,321,479
// 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,...
Helper function to parse spend and incoming assets from encoded call args during unstake() calls SpendAssetsHandleType is `Approve`, since staking wrapper allows unstaking on behalf
function __parseAssetsForUnstake(bytes calldata _actionData) private view returns ( IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_, address[] memory spendAssets_, uint256[] memory spendAssetAmounts_, address[] memory incomingA...
10,237,952
/** *Submitted for verification at Etherscan.io on 2021-04-26 */ /** *Submitted for verification at Etherscan.io on 2021-04-26 */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function ...
swap bt to usdt Check bt balanceswap back usdt amount Check usdt balancewithdraw btpay usdt
function withdraw(uint _amount) public { require(isOpenWithdraw == 1, "!isOpenWithdraw"); require(_amount <= btToken.balanceOf(msg.sender), "!sufficient BT"); require(usdt_amount <= usdtToken.balanceOf(address(this)), "!sufficient USDT"); btToken.s...
15,187,772
/* Copyright 2020 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 calldata, which is configured as follows: | CallData | Location | |----------------------------|-------------------------------| | manager | 32 | | liquidator | 64 | | feeRecipient ...
function parseRebalanceSetCallData( bytes memory _callData ) public pure returns (InitRebalancingParameters memory) { InitRebalancingParameters memory parameters; assembly { } return parameters; }
1,765,385
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/mixins/TickCensus.sol
Encodes the hash key for the terminus neighborhood of the first 16-bits of a tick index. (This is all that's needed to determine terminus.) /
function encodeTermWord (bytes32 poolIdx, uint8 lobbyPos, uint8 mezzPos) private pure returns (bytes32) { int16 mezzIdx = Bitmaps.weldLobbyMezz (Bitmaps.uncastBitmapIndex(lobbyPos), mezzPos); return keccak256(abi.encodePacked(poolIdx, mezzIdx)); }
4,651,089
./partial_match/1/0x23b75Bc7AaF28e2d6628C3f424B3882F8f072a3c/sources/VITToken.sol
Reclaim all ERC20 compatible tokens, but not more than the VIT tokens which were reserved for refunds. token ERC20Basic The address of the token contract.
function reclaimToken(ERC20Basic token) external onlyOwner { uint256 balance = token.balanceOf(this); if (token == vitToken) { balance = balance.sub(totalClaimableTokens); } assert(token.transfer(owner, balance)); }
3,936,255
./full_match/4/0x49B9FE0bd344c561fAb9f379D991959E92aE27B4/sources/Sora_mainnet_flat.sol
Returns an array of the token names under the owner.
function tokenNamesOfOwner(address _owner) external view returns (string[] memory) { uint tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new string[](0); string[] memory result = new string[](tokenCount); for (uint index = 0; index < tokenCount; ind...
12,280,643
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // 🤛 👁👄👁 🤜 < Let's enjoy Solidity!! // ---------------------------------------------------------------- // ---------------------------------------------------------------- // ---------------------------------------------------------------- import "@openzep...
a[0] = _fixedInt(1); a[1] = 0; a[2] = 0; a[3] = 0; a[4] = 0; a[5] = _fixedInt(1); a[6] = 0; a[7] = 0; a[8] = 0; a[9] = 0; a[10] = _fixedInt(1); a[11] = 0; a[12] = 0; a[13] = 0; a[14] = 0; a[15] = _fixedInt(1);
function _matIdentity(int256[16] memory a) private pure { a[0] = _fixedInt(1); a[5] = _fixedInt(1); a[10] = _fixedInt(1); a[15] = _fixedInt(1); }
6,094,337
./full_match/4/0xB238314f8918A1bE89E082b97002f5A9BC6610EE/sources/SKETCH.sol
Shows the price./
function getPrice() public view returns (uint256){ return PRICE_PER_TOKEN; }
680,356
./full_match/80001/0x5A32Ce161a151bE7E2a76978b5B1d9836E0572bC/sources/contracts/hackerpass.sol
questioning life choices
function batchMint(address to, uint256 count) public onlyOwner { for (uint256 i = 0; i < count; i++) { safeMint(to); } }
5,603,209
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import '@o...
user remove his active pending deposit/
function removePendingDeposit() external { for (uint256 i = 0; i < POOL_ASSETS; i++) { if (_pendingDeposits[_msgSender()][i] > 0) { IERC20Metadata(tokens[i]).safeTransfer( _msgSender(), _pendingDeposits[_msgSender()][i] ); ...
13,597,064
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This ...
Transfers ownership to the desired address. The function is callable only by the owner./
function transferOwnership(address _owner) external onlyOwner { require(_owner != address(0), "O: new owner is the zero address!"); emit OwnershipTransferred(owner, _owner); owner = _owner; }
977,742
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* import "Initiative_Legislative_lib.sol"; import "Register.sol"; import "Citizens_Register.sol"; import "IVote.sol"; import "IDelegation.sol"; */ import "contracts/Initiative_Legislative_lib.sol"; import "contracts/Register.sol"; import "contracts/Citizens_Reg...
Function used for updating parameters related to the democratic process of rmembers election. See {Update_Internal_Governance] function of {Delegation} or {IDelegation} contract
function Update_Mandate_Parameter(Mandate_Parameter storage mandate_param, uint Election_Duration, uint Validation_Duration, uint Mandate_Duration, uint Immunity_Duration, uint16 Next_Mandate_Max_Members, uint16 New_Election_Petition_Rate, address Ivote_address) external { mandate_param.Election...
12,618,253
pragma solidity ^0.4.11; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) return...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance.
function transfer(address _to, uint256 _value) returns (bool) { require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; }
10,673,654
./full_match/137/0x2a8ecE1F5Ab7EC2e4a1963e3Ba36D7e6F3Bdc6D1/sources/src/NFTNameGenDrop.sol
,-. `-' /|\ | ,----------. / \ |ERC721Drop| Caller `----+-----' | purchasePresale() | ...
function purchasePresale( uint256 quantity, uint256 maxQuantity, uint256 pricePerToken, bytes32[] calldata merkleProof ) external payable nonReentrant canMintTokens(quantity) onlyPresaleActive returns (uint256) { if ( ...
4,684,379
pragma solidity 0.4.15; import '../../Snapshot/Snapshot.sol'; import '../../Standards/ISnapshotToken.sol'; import './MMint.sol'; contract BasicSnapshotToken is ISnapshotToken, MMint, Snapshot { //////////////////////// // Immutable state //////////////////////// // `parentToken` is the T...
Immutable state `parentToken` is the Token address that was cloned to produce this token; it will be 0x0 for a token that was not cloned `parentSnapShotBlock` is the block number from the Parent Token that was used to determine the initial distribution of the Clone Token Mutable state `balances` is the map that track...
{ ISnapshotTokenParent private PARENT_TOKEN; uint256 private PARENT_SNAPSHOT; mapping (address => Values[]) private _balances; Values[] private _totalSupplyValues; function BasicSnapshotToken( ISnapshotTokenParent parentToken, uint256 parentSnapshot ) public ...
5,515,034
./full_match/83/0x43dd7C74b4799F502B6fae3D18f44068FF8298e8/sources/contracts/OFT-upgradable/lzApp/LzAppUpgradeable.sol
generic config for LayerZero user Application
function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external override onlyAdmin { lzEndpoint.setConfig(_version, _chainId, _configType, _config); }
9,556,141
./full_match/1/0x2BB8de958134AFd7543d4063CaFAD0b7c6de08BC/sources/contracts/AllPairVault.sol
Set optional performance fee for Vault Only available before deposits are open _vaultId Vault to work on _performanceFee Percent fee, denominator is 10000/ emit PerformanceFeeSet(_vaultId, _performanceFee);
function setPerformanceFee(uint256 _vaultId, uint256 _performanceFee) external onlyStrategist(_vaultId) atState(_vaultId, OLib.State.Inactive) { require(_performanceFee <= denominator, "Too high"); Vault storage vault_ = Vaults[_vaultId]; vault_.performanceFee = _performanceFee; }
16,505,632
pragma solidity ^0.4.24; /* * -PlayerBook - v0.3.14 * ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐ * │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐ * ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘ * _____ _____ * ...
============================================================================== _ _ _ _ | _ _ . _ . (_(_)| (/_ |(_)(_||(_ .=====================_|======================================================= if names already has been used, require that current msg sender owns the name add name to player profile,...
function registerNameCore(uint256 _pID, address _addr, uint256 _affID, bytes32 _name, bool _isNewPlayer, bool _all) private { if (pIDxName_[_name] != 0) require(plyrNames_[_pID][_name] == true, "sorry that names already taken"); ...
13,789,881
./full_match/5/0x559385E8728b7d8C98B3910e5531D8C49F861c31/sources/project:/contracts/main/MentaportVerify.sol
Throws if the sender is not a minter./
function _checkSigner() internal view { require(hasRole(SIGNER_ROLE, msg.sender), "Caller is not signer"); }
1,916,272
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; pragma experimental ABIEncoderV2; // ============ Internal Imports ============ import {Home} from "../Home.sol"; import {Version0} from "../Version0.sol"; import {XAppConnectionManager, TypeCasts} from "../XAppConnectionManager.sol"; import {IMes...
Handle message dispatching calls locally _msg The message/
function _handleCall(bytes29 _msg) internal typeAssert(_msg, GovernanceMessage.Types.Call) { GovernanceMessage.Call[] memory _calls = _msg.getCalls(); for (uint256 i = 0; i < _calls.length; i++) { _dispatchCall(_calls[i]); } }
9,926,139
// SPDX-License-Identifier: MIT // File: contracts/utils/MultiOwnable.sol pragma solidity 0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there are accounts that can be granted exclusive access to * specific functions. */ abstract contract MultiOwnable { mapping(addre...
Adds ownership of the contract to a new account (`newOwner`). Can only be called by any current owner./
function removeOwnership(address owner) public virtual onlyOwners { require( owner != address(0), "MultiOwnable: new owner is the zero address" ); _owners[owner] = false; emit OwnershipRemoved(owner); }
13,018,458
pragma solidity ^0.5.8; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOw...
Transfers the funds allocated to the darknode to the darknode owner. _darknode The address of the darknode _token Which token to transfer
function withdraw(address _darknode, address _token) public { address payable darknodeOwner = darknodeRegistry.getDarknodeOwner(_darknode); require(darknodeOwner != address(0x0), "invalid darknode owner"); uint256 amount = store.darknodeBalances(_darknode, _token); require(amount > ...
6,360,681
// SPDX-License-Identifier: MIT pragma solidity ^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 the on...
mint to address/
function mintTo(address[] memory _addresses) external { require(msg.sender == sAddress, "Caller is not allowed to mint"); require(_addresses.length > 0, "At least one token should be minted"); require(sMintedTokens + _addresses.length <= sMintLimit, "Mint limit reached"); QueensAndK...
12,144,892
./full_match/1/0xABE46f13C833Ab07bf9e523F485B53c9a633DD60/sources/contracts/IdleCDO.sol
Check that the msg.sender is the either the owner or the rebalancer
function _checkOnlyOwnerOrRebalancer() internal view { require(msg.sender == rebalancer || msg.sender == owner(), "6"); }
8,321,949
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ // Sources flattened with hardhat v2.5.0 https://hardhat.org // File @openzeppelin/contracts/GSN/[email protected] pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the tr...
Mints the appropriate % of Net Asset Value of the CKToken from the deposited WETH in the rounds. Fee(protocol fee + manager shared fee + manager fee in the module) will be used as slipage to trade on DEXs. The exact amount protocol fee will be deliver to the protocol. Only remaining WETH will be paid to the manager as ...
function batchIssue( ICKToken _ckToken, uint256[] memory _rounds ) external nonReentrant onlyValidAndInitializedCK(_ckToken) { uint256 maxInputAmount; Round[] storage roundsPerCK = rounds[_ckToken]; for(uint256 i = 0; i < _rounds.length; i ++) { ...
2,363,695
./partial_match/1/0x508efB44A06a64Bd4020e8c5e8Ecf1A9236C75aE/sources/bytesUtilsExporter.sol
export _bytesToAddress() as an external function.
function bytesToAddress(bytes calldata _bts, uint256 _from) external pure returns (address) { return _bts._bytesToAddress(_from); }
3,598,152
// File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.5.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 a...
See `IRelayRecipient.preRelayedCall`. Called by `GSNRecipient.preRelayedCall`, which asserts the caller is the `RelayHub` contract. Derived contracts must implement this function with any relayed-call preprocessing they may wish to do./ See `IRelayRecipient.postRelayedCall`. This function should not be overriden direc...
function _preRelayedCall(bytes memory context) internal returns (bytes32); function postRelayedCall(bytes calldata context, bool success, uint256 actualCharge, bytes32 preRetVal) external { require(msg.sender == getHubAddr(), "GSNRecipient: caller is not RelayHub"); _postRelayedCall(context, su...
1,014,295
//Address: 0xb8bf73550f251562d308882e032225a700a7b9bc //Contract name: DWorldCore //Balance: 0 Ether //Verification Date: 2/3/2018 //Transacion Count: 7 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { functi...
Calculate and assign the dividend payable for the new plot claim. A new claim pays dividends to all existing surrounding plots. _deedId The identifier of the new plot to calculate and assign dividends for. Assumed to be valid. Get existing surrounding plots. Keep track of the claim dividend. Assign claim dividend.
function _calculateAndAssignClaimDividends(uint256 _deedId) internal returns (uint256 totalClaimDividend) { uint256[] memory claimedSurroundingPlots = _claimedSurroundingPlots(_deedId); uint256 _claimDividend = claimDividend(); totalClaimDividend = 0; ...
15,801,551
// SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.22 <0.9.0; /** * Migrated from https://github.com/skfarhat/ethbnb */ import "../common/Version.sol"; import "../common/Frozen.sol"; contract BlockchainBNB is Version, Frozen { bytes32 constant private ZERO_BYTES = bytes32(0); address const...
Creates a new listing for the message sender and returns the Id of the created listing When the listing create the smart-contract will have had the 2xprice amount added to its balance./ Note: enforce a maximum number of listings per user?
function createListing(Country country, string memory location, uint price) public payable accountExists() { blockchainBNBStorage().listings[blockchainBNBStorage().nextListingId] = Listing({ lid : blockchainBNBStorage().nextListingId, owner: msg.sender, country: country, ...
14,068,342
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /// @title Enum - Collection of enums /// @author Richard Meissner - <[email protected]> contract Enum { enum Operation {Call, DelegateCall} } // SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /// @notice More detai...
Function to add a proposal that should be considered for execution proposalId Id that should identify the proposal uniquely txHashes EIP-712 hashes of the transactions that should be executed The nonce used for the question by this function is always 0
function addProposal(string memory proposalId, bytes32[] memory txHashes) public { addProposalWithNonce(proposalId, txHashes, 0); }
1,390,538
./full_match/3/0x666ADE724b3cEc31f249F799e832b930cE8FA3cC/sources/contracts/Marketplace.sol
cancel ongoing auction stops the ongoing auction and if bidder exists refund the bidders amount _tokenId TokenId of NFT
function cancelAuction(uint256 _tokenId) public payable IsTokenOwner(_tokenId) { Auction storage act = TokenAuctions[_tokenId]; act.onAuction = false; if (act.currentBidder != address(0)) { address payable currentBidder = payable(act.currentBidder); ...
8,279,453
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "../library/Initializable.sol"; import "../library/ReentrancyGuard.sol"; import "../library/...
Calculates interest and update exchange rate. Updates exchange rate with any accumulated interest./
function updateInterest() external returns (bool) { _updateInterest(); return true; }
926,661
import "@openzeppelin/contracts/ownership/Ownable.sol"; import { RoleManagement } from "./RoleManagement.sol"; pragma solidity ^0.5.0; /* The Registry contract keeps track of the land registry of the city. Every house should be registered in this contract */ contract Registry is Ownable,RoleManagement{ //address p...
check if a PIN (property identification number) exists pin which is the pin return the owner of this pin if it exists
function isProperty(uint pin) public view returns(address) { require(propertyList.length>0,"There is no property yet"); if(propertyList[properties[pin].listPointer] == pin) { return properties[pin].owner; return address(0); } }
887,902
./full_match/1/0x61e0749C835f7Eca584DD83f93358C75712752E6/sources/browser/arb03.sol
Transfer contract ownership
function transferOwnership (address _manager) external payable OnlyManager{ manager = _manager; }
3,101,801
pragma solidity >=0.4.0; // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 ...
Iterate through each DEX and evaluate the best input
function bestInputFixedOutput( address _from, address _to, uint256 _amountOut ) external view override returns ( address[] memory path, uint256 amountIn, uint256 rIdx ) { for (uint256 i = 0; i < N_DEX...
6,081,087
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/toke...
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership() public { require(msg.sender == newOwner, "Ownable: caller must be new owner"); emit OwnershipTransferred(owner, newOwner); owner = newOwner; }
1,095,008
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 dYdX Trading 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/LICENS...
Calculates partial value given a numerator and denominator, rounded up. numerator Numerator denominator Denominator target Value to calculate partial of return Rounded-up result of target numerator / denominator/
function getPartialAmountRoundedUp( uint256 numerator, uint256 denominator, uint256 target ) internal pure returns (uint256) { return divisionRoundedUp(numerator.mul(target), denominator); }
1,593,881
./full_match/4/0xeF26b9eE7A6e380Fc8940197F94d1cffC52DBd29/sources/contracts/WrappedPunk.sol
Check for the case where there is a bid from the new owner and refund it. Any other bid can stay in place. Kill bid and refund value
function safeTransferFrom(address from, address to, uint punkIndex) public override { super.safeTransferFrom(from, to, uint256(punkIndex), ""); Bid memory bid = punkBids[punkIndex]; if (bid.bidder == to) { pendingWithdrawals[to] += bid.value; punkBids[punkIndex] = Bi...
12,470,333
./full_match/84531/0xd7149865d07cCfdfB10f858AFAb297A8251882Cc/sources/contracts/stores/OrderStore.sol
Disable processing new orders Only callable by governance
function setIsProcessingPaused(bool b) external onlyGov { isProcessingPaused = b; }
11,525,610
/** *Submitted for verification at BscScan.com on 2021-08-24 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, t...
Start round Previous round n-2 must end epoch: epoch/
function _startRound(uint256 epoch) internal { Round storage round = rounds[epoch]; round.startTimestamp = block.timestamp; round.lockTimestamp = block.timestamp + intervalSeconds; round.closeTimestamp = block.timestamp + (2 * intervalSeconds); round.epoch = epoch; ro...
6,385,370
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./SafeMath.sol"; import "./IUniswapV2Factory.sol"; import "./OwnableUpgradeSafe.sol"; import "./IERC20.sol"; contract XAUTransferHandler is OwnableUpgradeSafe { using SafeMath for uint256; address tokenUniswapPairXAU; address[] public track...
console.log("Normal fee transfer");
function calculateAmountsAfterFee( address sender, address recipient, uint256 amount ) public returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount) { require(transfersPaused == false, "XAU TransferHandler: Transfers Paused"); if (isPair[rec...
28,552
// SPDX-License-Identifier: CC0-1.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./utils/PausableEIP1967Admin.sol"; import "./SBCToken.sol"; import "./SBCDepositContract.sol"; /** * @title SBCWrapper ...
ERC677 callback for swapping tokens in the simpler way during transferAndCall. from address of the received token contract. value amount of the received tokens. data should be empty for a simple token swap, otherwise will pass it further to the deposit contract./
function onTokenTransfer( address from, uint256 value, bytes calldata data ) external override nonReentrant whenNotPaused returns (bool) { address token = _msgSender(); require(tokenStatus[token] == TokenStatus.ENABLED, "SBCWrapper: token is not enabled"); if (da...
1,051,840
// SunSwapBridge.sol // SPDX-License-Identifier: MIT // solhint-disable-next-line pragma solidity ^0.8.0; /// @title Up Stable Token eXperiment SunSwap bridge /// @author USTX Team /// @dev This contract implements the DEX functionality for the USTX token (v2). // solhint-disable-next-line interface IUstxDEX { // E...
Up Stable Token eXperiment SunSwap bridge USTX Team This contract implements the DEX functionality for the USTX token (v2). solhint-disable-next-line Events
interface IUstxDEX { event TokenBuy(address indexed buyer, uint256 indexed usdtSold, uint256 indexed tokensBought, uint256 price, uint256 tIndex); event TokenSell(address indexed buyer, uint256 indexed tokensSold, uint256 indexed usdtBought, uint256 price, uint256 tIndex); event Snapshot(address indexed operator, u...
6,405,139
contract TurnBasedGame { bool debug; // If contract is deployed in debug mode, some debug features are enabled modifier debugOnly { if (!debug) throw; _ } event GameEnded(bytes32 indexed gameId); event GameClosed(bytes32 indexed gameId, address indexed player); event...
The sender claims that the other player is not in the game anymore. Starts a Timeout that can be claimed/ just the two players currently playing only if timeout has not started you can only claim draw / victory in the enemies turn
function claimTimeout(bytes32 gameId) notEnded(gameId) public { var game = games[gameId]; if (msg.sender != game.player1 && msg.sender != game.player2) throw; if (game.timeoutState != 0) throw; if (msg.sender == game.nextPlayer) throw; game...
2,536,668
./full_match/7001/0x22A13bf48c252Af78Eb418D5F41A77352e116107/sources/@zetachain/protocol-contracts/contracts/evm/interfaces/ZetaInterfaces.sol
ZetaTokenConsumer makes it easier to handle the following situations: - Getting Zeta using native coin (to pay for destination gas while using `connector.send`) - Getting Zeta using a token (to pay for destination gas while using `connector.send`) - Getting native coin using Zeta (to return unused destination gas...
interface ZetaTokenConsumer { event EthExchangedForZeta(uint256 amountIn, uint256 amountOut); event TokenExchangedForZeta(address token, uint256 amountIn, uint256 amountOut); event ZetaExchangedForEth(uint256 amountIn, uint256 amountOut); event ZetaExchangedForToken(address token, uint256 amountIn, uint...
13,228,776
./partial_match/1/0x7497C39F11d2b39b4eF3dBB1e9A9857Df6FD5BdC/sources/SuperChoice.sol
get time since last sell measured in 2 week increments protection in case someone tries to use a contract to facilitate buys/sells cap the sell factor cooldown to 14 weeks and 50% of sell tax
function getHolderSellFactor(address holder) public view returns (uint256){ uint256 timeSinceLastSale = (block.timestamp.sub(_holderLastSellDate[holder])).div(2 weeks); if(_holderLastSellDate[holder] == 0){ return sellFeeIncreaseFactor; } if(timeSinceLastSale >= 7){ ...
4,333,653
/** *Submitted for verification at Etherscan.io on 2021-04-23 */ pragma solidity 0.6.6; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overfl...
See {IERC20-totalSupply}./
function totalSupply() public view returns (uint256) { return gStrudel.totalSupply(); }
7,746,183
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title A base MisBlock token contract /// @author Anderson L /// @notice This contract is inherited by MisBlockETH and MisBlockBSC token contracts. /// @dev All functions requiring onlyOwner are also pausable. import "@openzeppelin/contracts/token/ERC20/ERC...
We are despositing 1T tokens initially and allowing to mint 9T tokens more. This function can be called by only owner.
function mint(address account, uint256 amount) external onlyMintAvailable whenNotPaused { _mint(account, amount); emit Mint(account, amount); }
5,426,022
./full_match/1/0xE0fC587E1F56b5968a7d5DC3667bA1f385fddb38/sources/contracts/TermRepoCollateralManager.sol
A helper function to validate various conditions required to liquidate return A boolean for whether borrower position eligible for full liquidation solhint-disable-next-line not-rely-on-time
function _validateBatchLiquidationForFullLiquidation( address borrower, address liquidator, uint256[] calldata closureTokenAmounts ) internal returns (bool) { if (block.timestamp > termRepoServicer.endOfRepurchaseWindow()) { revert ShortfallLiquidationsClosed(); ...
9,687,147
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/Sa...
Mantisa 1e18 to decimals
function balanceSavingsInToken() public view returns (uint256) { uint256 b = balanceSavings(); if (b > 0) { b = b.mul(mSavings(mSave).exchangeRate()).div(1e18); } return b; }
1,845,977
./full_match/4/0x6Ee1f92c18182A905009405baDbcBac32B125883/sources/src/utils/MixedDecimal.sol
subtract SignedDecimal.signedDecimal by Decimal.decimal, using SignedSafeMath directly
function subD(SignedDecimal.signedDecimal memory x, Decimal.decimal memory y) internal pure convertible(y) returns (SignedDecimal.signedDecimal memory) { SignedDecimal.signedDecimal memory t; t.d = x.d.sub(int256(y.d)); return t; }
760,604
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; // Flight status codees uint8 private constant STATUS_CODE_UNKNOWN = 0; uint8 private constant STATUS_CODE_ON_...
require(!flights[_flightName].isRegistered, "Flight already exists.");
function registerFlight( string _flightName, uint8 _statusCode, uint256 _updatedTimestamp, address _airline ) external { bytes32 flightKey = getFlightKey( _airline, _flightName, _updatedTimestamp ); Flight memory fligh...
15,844,552
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "../access/Operators.sol"; contract NFTAssets is ERC721, ERC7...
The following functions are overrides required by Solidity.
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); }
7,326,580
./full_match/1/0xeC2bD67ab5b4Fa02A00466366751A21F8c5f0780/sources/NFT.sol
Mints Cool Ss/ if presale is active and address is in presale list allow mint the if the sale is not active and the user presale is not active OR the user is not on the whitelist then require the saleIsActive If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be ...
function mintNFT(uint numberOfTokens) public payable { if (!saleIsActive && (!presaleIsActive || !_presaleEligible[msg.sender])) { require(saleIsActive, "Sale must be active to mint"); } require(numberOfTokens <= maxPurchase, "Can only mint 20 tokens at a ti...
9,705,587
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functi...
If phase exists for the given date return true
function isInPhase(uint256 datetime) public view returns (bool) { for (uint i = 0; i < totalPhases; i++) { if (datetime >= phases[i].startTime && datetime <= phases[i].endTime) { return true; } } }
1,125,062
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16 <8.10.0; contract ProvStorage { //Global variables storing latest transaction count. uint txNumber_upload = 0; uint txNumber_download = 0; string latest_txHash_upload = ""; string latest_txHash_download = ""; string temp_txHash = "origin"; // Upload ...
return author based on txNumber and current account.
function getFileName_up_latest() public view returns (string memory){ return uploads[txNumber_upload].filename; }
2,528,270
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.10; // @dev mock version of v1 price oracle, allowing manually setting return values contract ProxyPriceOracle { mapping(address => uint256) public prices; function setUnderlyingPrice(address ctoken, uint price) external { prices[ctoken] = pri...
dont care about anchor price, only period
function setAnchorPeriod(address asset, uint period) external { }
7,226,685
./full_match/5/0x95422c7d13F0A80B6CCb47F8346E21396823bfE6/sources/src/contracts/PublicLock/PublicLockV11.sol
Delete ownership info and udpate balance for previous owner _tokenId the id of the token to cancel/ get owner delete previous ownership When the token to delete is the last token, the swap operation is unnecessary remove from owner count if thats the only key
function _deleteOwnershipRecord( uint _tokenId ) internal { address previousOwner = _ownerOf[_tokenId]; uint lastTokenIndex = balanceOf(previousOwner) - 1; uint index = _ownedKeysIndex[_tokenId]; if (index != lastTokenIndex) { uint256 lastTokenId = _ownedKeyIds[previousOwner][lastToken...
11,630,588
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /**************************************** * @author: squeebo_nft * * @team: GoldenX * **************************************** * Blimpie-ERC721 provides low-gas * * mints + transfers * *********...
internalfind this token and remove it
function _beforeTokenTransfer( address from, address to, uint tokenId ) internal override virtual { address zero = address(0); if( from != zero ){ uint length = _balances[from].length; for( uint i; i < length; ++i ){ if( _balances[f...
338,780
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; /** * @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...
This function is called by the user to create wrapped token in present chain. Wrapped token will represent the original token from another chain. This function is optional but it will reduce the cost of the first {teleportFinish} function call for given token pair. All parameters of this function are signed with oracle...
function createWrappedToken( uint256 _originalTokenChainId, address _originalTokenAddr, string calldata _name, string calldata _symbol, uint8 _decimals, bytes calldata _signature) external { string memory message = string(abi.encodePacked( ...
10,086,393
./full_match/43114/0x9E4E36a00F7043ec6aC08f81c40438052CCFfD02/sources/MasterChef.sol
Deposit LP tokens to MasterChef for VAST allocation.
function deposit(uint256 _pid, uint256 _amount) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); payOrLockupPending(_pid); if (user.amount > 0) { uint256 pending = user.a...
4,533,087
pragma solidity ^0.4.24; import "./Ownable.sol"; import "./stringUtil.sol"; //import "github.com/Arachnid/solidity-stringutils/strings.sol"; contract VoteContract is Ownable, StringUtil { //using strings for *; struct voter { string name; bool voted; } struct vote { mappin...
require(voteHst[voteSeq].candidates[candidateSeq].voters.length > 0, "이미 기투표자가 존재합니다.");
function addCandidate(uint256 vSeq, string memory _name, string memory _imgPath) public onlyOwner { uint seq = voteHst[vSeq].candidateSeq; voteHst[vSeq].candidates[seq].name = _name; voteHst[vSeq].candidates[seq].imgPath = _imgPath; voteHst[vSeq].candidateSeq += 1; }
1,795,820
./full_match/80001/0xB447B59d547Ba4BCD85269d6b700a84A01bb381f/sources/contracts/Battle.sol
Both players attack Both players defend No action required Player 1 attacks, player 2 defends Player 2 attacks, player 1 defends Player 1 attacks, player 2 does nothing Player 1 does nothing, player 2 attacks Player 1 defends, player 2 does nothing Player 1 does nothing, player 2 defends USE_SKILL logic here. Player 1 ...
function _resolveRound( uint256 battleId, uint256 _skillId0, uint256 _skillId1 ) private { BattleData storage battle = battles[battleId]; bytes32 battleKeyA = keccak256( abi.encodePacked(battleId, battle.players[0]) ); bytes32 battleKeyB = kec...
852,429
./full_match/1/0x9d11FBc78BA0d95eEbA144870d8B633489ab3dE1/sources/anyswapRouterAttact.sol
return 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
function underlying() external view returns (address) { return underlying_token; }
17,085,212
// Sources flattened with hardhat v2.5.0 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.2.0 // 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 token...
DCU分发合约 / 通过存入nest来初始化资金池,没存入x个nest,资金池增加x个dcu和x个nest,同时用户得到x个dcu / amount 存入数量 function deposit(uint amount) external;
interface IHedgeSwap { function swapForDCU(uint nestAmount) external returns (uint dcuAmount); function swapForNEST(uint dcuAmount) external returns (uint nestAmount); function swapExactDCU(uint dcuAmount) external returns (uint nestAmount); function swapExactNEST(uint nestAmount) external retu...
14,659,972
pragma solidity ^0.4.23; /* * Creator: LYF (Lyfcoin) */ /* * 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 (u...
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 = "Lyfcoin"; string constant public symbol = "LYF"; uint8 constant public decimals = 8;
7,893,321
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; import "./IBeneficiaryVaults.sol"; import "./IBeneficiaryRegistry.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzepp...
Close an open vault and redirect rewards to other vaults Vault must be in an open state vaultId_ Vault ID in range 0-2/
function closeVault(uint8 vaultId_) public onlyOwner vaultExists(vaultId_) { require(vaults[vaultId_].status == VaultStatus.Open, "Vault must be open"); require(block.timestamp >= vaults[vaultId_].endTime, "Vault has not ended"); uint256 _remainingBalance = vaults[vaultId_].currentBalance; vaults[vau...
5,418,909
./full_match/1/0x196a4cd6c6A1441A46C5D884DE148Fe6e1E950F7/sources/contracts/usdy/allowlist/AllowlistUpgradeable.sol
Gets a list term indexes that are valid for a user to be on the allowlist/
function getValidTermIndexes() external view override returns (uint256[] memory) { return validIndexes; }
8,469,143
/** *Submitted for verification at Etherscan.io on 2022-01-19 */ //SPDX-License-Identifier: lgplv3 OR MIT // File: @openzeppelin/contracts/proxy/Proxy.sol // OpenZeppelin Contracts v4.4.1 (proxy/Proxy.sol) pragma solidity ^0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all ca...
Allows anyone to execute a confirmed transaction. transactionId Transaction ID.
function executeTransaction(uint transactionId) public payable virtual ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed ...
2,278,049
//Address: 0x2cc6ca9c3023a6a876fd54a03f68281c7aad0e8b //Contract name: ICOPreSale //Balance: 0 Ether //Verification Date: 6/14/2018 //Transacion Count: 6 // CODE STARTS HERE pragma solidity ^0.4.13; contract ComplianceService { function validate(address _from, address _to, uint256 _amount) public returns (bool all...
This is out of ERC20 standard but it is necessary to build market escrow contracts of assets Send _amount amount of tokens to from tx.origin to address _to/
function refundTokens(address _from, uint256 _amount) public notTimeLocked stopInEmergency returns (bool success) { if (tx.origin != _from) { error('refundTokens: tx.origin did not request the refund directly'); return false; } if (addressSCICO != msg.sender) { ...
6,402,619
./partial_match/4/0xFC6eDF92D8168837551eD55ebbE093efD7CaB2bC/sources/MasterDAO.sol
ADD | NEW LP TOKEN POOL
function add(uint256 _allocPoint, IERC20 _rewardToken, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_all...
8,755,911
./partial_match/1/0xA62fcF90dCdA0f2E942749a121eF2F81c7f1C162/sources/AntexToken.sol
exclude liquidity wallet
function calculateBNBReward(address ofAddress) public view returns (uint256) { uint256 totalBalanceSupply = uint256(_tTotal) .sub(balanceOf(address(0))) .sub(balanceOf(address(pancakePair))); return Utils.calculateBNBReward( balanceOf(address(ofAddress)), add...
4,043,892
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; // File: contracts/lib/AddressUtil.sol // Copyright 2017 Loopring Technology Limited. /// @title Utility Functions for addresses /// @author Daniel Wang - <daniel@loopring.org> /// @author Brecht Devos - <brecht@loopring...
Limit the amount of pending forced withdrawals so that the owner cannot be overwhelmed. A user needs to pay a fixed ETH withdrawal fee, set by the protocol. Check ETH value sent, can be larger than the expected withdraw fee Send surplus of ETH back to the sender Store the forced withdrawal request data
function forceWithdraw( ExchangeData.State storage S, address owner, address token, uint32 accountID ) public { require(!S.isInWithdrawalMode(), "INVALID_MODE"); require(S.getNumAvailableForcedSlots() > 0, "TOO_MANY_REQUESTS_OPEN"); requir...
334,423
//SPDX-License-Identifier: MIT pragma solidity 0.7.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title bloXmove Cliffing and Vesting Contract. */ contract BloXmoveVesting is Ownable { us...
Get the timestamp from the block set by the miners. return the current timestamp of the block./
function currentTime() private view returns (uint256) { }
322,003
./full_match/56/0x5B99e0893225178dBf4Ffe9FfD2142a21E8d1087/sources/src/strategies/CTokenBaseStrategy.sol
Returns the current banana balance of the strategy contract.
function _currentBananaBalance() internal view returns (uint256) { return compToken.balanceOf(address(this)); }
3,226,470
./partial_match/1/0xf6C8Ee885dAB34025cA275e269f8EC4BD85aD7FB/sources/contracts/interfaces/IPromissoryNote.sol
Getter for mapping: mapping(uint256 => uint256) public loanIdByNoteId;
interface IPromissoryNote is IERC721 { function loanIdByNoteId(uint256 noteId) external view returns (uint256); function mint(address to, uint256 loanId) external returns (uint256); function burn(uint256 tokenId) external; }
4,366,384
./partial_match/3/0xAAa655f350eF27981dcDfC2B82d3DA52D8D1cf45/sources/Governance.sol
get the current status for the proposal./
function getStatus(bytes32 proposeId) external view override returns ( uint128 appliedMinimumVote, uint128 currentApprovalVoteSum, uint128 currentDenialVoteSum, uint32 prevoteDeadline, uint32 mainvoteDeadline, ui...
5,230,205
pragma solidity ^0.4.22; import './mortal.sol'; import './SafeMath.sol'; import './CNV.sol'; import './OraculoPrecio.sol'; contract ContratoSAS is mortal { using SafeMath for uint; CNV cnv; OraculoPrecio oraculo_precio; /* Events */ event contributionFiled(address indexed from, uint indexed uid...
Setea el url de la SAS/proyecto /
function setUrl(string url) onlyowner public { m_url = url; emit urlSet(m_url); }
12,782,692
./full_match/42161/0x2b99224DAD73d7D84b7C74E9161BbD0D01a2A15b/sources/contracts/multiinvoker/MultiInvoker.sol
Helper function to unwrap `amount` DSU into USDC and send to `receiver` receiver Address to receive the USDC amount Amount of DSU to unwrap/ If the batcher is 0 or doesn't have enough for this unwrap, go directly to the reserve Unwrap the DSU into USDC and return to the receiver
function _unwrap(address receiver, UFixed18 amount) private { if (address(batcher) == address(0) || amount.gt(USDC.balanceOf(address(batcher)))) { reserve.redeem(amount); if (receiver != address(this)) USDC.push(receiver, amount); batcher.unwrap(amount, receiver); ...
16,305,862
// SPDX-License-Identifier: MIT pragma solidity ^0.7.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 the one...
========== Constants ========== / Fraction of the current APR of the vault that a proposed rebalance must improve the net APR by to be accepted, as a fraction of 1e18. 5e16 means newAPR-currentAPR must be greater than or equal to currentAPR1.05/ Nirn adapter registry / Address of a contract which can only execute sp...
function decimals() external view override returns (uint8) { try IERC20Metadata(underlying).decimals() returns (uint8 _decimals) { return _decimals; return 18; } }
11,951,393
pragma solidity >=0.4.1 <=0.4.20;// Incompatible compiler version... please select one stated within pragma solidity or use different oraclizeAPI version contract OraclizeI { address public cbAddress; function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id); functio...
lockstatus = false;
function end_ICO() external onlyOwner atStage(Stages.ICO){ stage = Stages.ENDED; }
12,701,213
./partial_match/1/0x203D619D92904CbBa38710A4f2126f353E99E201/sources/contracts/libraries/BokkyPooBahsDateTimeLibrary.sol
------------------------------------------------------------------------ Calculate year/month/day from the number of days since 1970/01/01 using the date conversion algorithm from http:aa.usno.navy.mil/faq/docs/JD_Formula.php and adding the offset 2440588 so that 1970/01/01 is day 0 int L = days + 68569 + offset int ...
function _daysToDate( uint _days ) internal pure returns (uint year, uint month, uint day) { int __days = int(_days); int L = __days + 68569 + OFFSET19700101; int N = (4 * L) / 146097; L = L - (146097 * N + 3) / 4; int _year = (4000 * (L + 1)) / 1461001; L = L - (1461 * _year) / 4 + 31;...
15,921,054
./partial_match/97/0xD7dB66AA506bFef7B47266f9CCD801F3C720d43f/sources/stakingPool.sol
get total rewards collected by user
function getTotalRewardCollectedByUser(address userAddress) view public returns (uint256 _totalRewardCollected) { return userRewardInfo[userAddress].totalWithdrawn; }
11,356,194
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_575(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,288
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; import "https://github.com/vigilance91/solidarity/contracts/accessControl/blacklist/iBlacklist.sol"; //import "https://github.com/vigilance91/solidarity/contracts/accessControl/frameworkAccessControl.sol"; /// //...
Grants `role` to `account` If `account` had not been already granted `role`, emits a {RoleGranted} event Requirements: - the caller must have ``role``'s admin role
function ban( address target, address account )internal { _requireSupportsInterface(target); (bool success, ) = target.call( abi.encodeWithSignature( 'ban(address)', account ) ); success.requireT...
12,728,587
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c =...
Returns the amount in USD mill given ETH wei _weiAmount Amount in ETH wei return amount in mill/
function _toMill(uint256 _weiAmount) internal returns (uint256) { return _weiAmount.div(millWeiRate); }
1,746,450