file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// Verified using https://dapp.tools // hevm: flattened sources of src/DexC2CGateway.sol pragma solidity ^0.4.24; ////// lib/ds-auth/src/auth.sol // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundat...
require(withdrawAddresses[keccak256(abi.encodePacked(_token, _receiver))], "Address not in white list");
function withdraw(DSToken _token, uint _amnt, address _receiver) external auth returns(bool){ require(feesAvailableForWithdraw[_token] > 0, "Fees is 0 or token not exists"); require(_amnt <= feesAvailableForWithdraw[_token], "Amount is higher than amount available"); if(_token == ETH_TOKEN_A...
1,004,804
./full_match/77/0x37A3f02721939C7357779A7E1Bd91f1be61203b5/sources/contracts/LP.sol
Core: Change amount of reserved by conditions funds. initReserve reinforcement of the condition. profitReserve amount of reserves that was not demand according to the condition results/ pool win calc oracle rewards calc DAO rewards add profit to segmentTree remove loss from segmentTree excluding canceled conditions...
function addReserve( uint128 initReserve, uint128 profitReserve, uint48 leaf ) external override onlyCore { if (profitReserve >= initReserve) { uint128 profit = profitReserve - initReserve; uint128 oracleRewards = (profit * oracleFee) / multiplier; ...
5,046,588
pragma solidity ^0.4.24; /* SLUGROAD Simple Fomo Game with fair scaling. Slugroad has 3 different tracks: different networks, with different settings. This is the Ethereum track. A car drives to hyperspeed. Speed starts at a min of 100mph and rises to a max 1000mph over 7 days. Buy Slugs with ETH. Slugs...
give miles to drivercalculate rewardremove reward from potput timer back to 1 hours (+1 hour of hyperspeed)give player his rewardset driver as the starterset lastHijack to reset miles count to 0 (easier on frontend)
function JumpOut() public { require(gameStarted == true, "game hasn't started yet"); require(msg.sender == driver, "can't jump out if you're not in the car!"); require(msg.sender != starter, "starter isn't allowed to be driver"); uint256 _mile = ComputeMileDriven(); ...
6,346,524
pragma solidity ^0.4.23; import "./interface/ITRC20.sol"; import "../common/PausableDSAuth.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /// @title TRC223ReceivingContract - Standard contract implementation for compatibility with TRC223 tokens. contract TRC223ReceivingContract { /// @dev Fun...
TRC 223 Added support for the ERC 223 "tokenFallback" method in a "transfer" function with a payload./
function transferFromAndFallback(address _from, address _to, uint256 _amount, bytes _data) public transfersAllowed returns (bool success) { require(transferFrom(_from, _to, _amount)); if (isContract(_to)) { TRC223ReceivingContract receiver = TRC223ReceivingContract(_...
1,763,999
// 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_193(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,453,906
./partial_match/1/0x70f648c442eFa7007E7e4323e14e7Bdc800Bd0cf/sources/MainnetUsdpToUsdpAssimilator.sol
Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number and y is unsigned 256-bit integer number. Revert on overflow. x signed 64.64-bit fixed point number y uint256 value return signed 64.64-bit fixed point number/ We rely on overflow behavior here
function pow (int128 x, uint256 y) internal pure returns (int128) { uint256 absoluteResult; bool negativeResult = false; if (x >= 0) { absoluteResult = powu (uint256 (x) << 63, y); absoluteResult = powu (uint256 (uint128 (-x)) << 63, y); negativeResult = y...
9,381,652
/** *Submitted for verification at Etherscan.io on 2020-10-04 */ // SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.6.12; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { uint c = a * b; require(a == 0 || c / a == b); return c; } function div(u...
inject PUBLIC FUNC TO EXTERNAL
function shareValue() public view returns (uint) {
2,519,502
./full_match/1/0x8b8bf083fD1837486c141681E10Ea61D0f3cD692/sources/src/StaticATokenLM.sol
@inheritdoc IStaticATokenLM
function aToken() external view returns (IERC20) { return _aToken; }
5,016,533
// @Author: Yuexin Xiang // @Email: yuexin.xiang@cug.edu.cn //Remix Compiler 0.4.25 pragma solidity >=0.4.22 <0.7.0; contract Verification{ //Start to verify the signed string function Verify_String(bytes memory signed_string) public returns (address){ //This is a signed string data //e.g. by...
Bob sends the number of blokcs he wants to buy to the smart contract
function Set_Number (uint BlockNumber) public { address_B = msg.sender; if (step_SetTime == true) { if (address_B != address_A) { step_SetNumber = true; block_num = BlockNumber; block_value = block_price * block_num; } else { step...
6,361,566
./full_match/80001/0x21289999e7EAf1ED197e42aE1E4c3b09c9ccfE8a/sources/lib/plugin-pattern/src/presets/utils/StringSet.sol
Removes a value from a set. O(1). Returns true if the value was removed from the set, that is if it was present./
function remove(Set storage set, string memory value) internal returns (bool) { return _remove(set, value); }
852,343
./full_match/1/0xfB2Bfc368a7edfD51aa2cbEC513ad50edEa74E84/sources/contracts/cctp/SynapseCCTP.sol
Predicts the address of the destination caller that will be used to call the Circle Message Transmitter. On the destination chain, Synapse CCTP will deploy a MinimalForwarder for each request, using requestID as salt for the create2 deployment.
function _destinationCaller(address synapseCCTP, bytes32 requestID) internal pure returns (bytes32) { return synapseCCTP.predictAddress(requestID).addressToBytes32(); }
5,006,485
./partial_match/4/0x6480e156865Bbb84Ba94d53dC09f667bdC2B371a/sources/Contract.sol
Получение количества голосваний./
function getBallotsLengh() public view returns(uint) { return ballots.length; }
8,508,810
./full_match/43113/0xE745F526aD4244B4432D8F5Da402f5778668693C/sources/contracts/router.sol
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = PangolinLibrary.sortTokens(input, output); IPair pair ...
7,205,208
./full_match/1/0xE7C2016f5344858f6A1874424d077aDD3ea81fa5/sources/contracts/test/GovernQueueFactoryMock.sol
TODO: emit events and catch it in the govern-base-factory-unit.test.ts
function configure(ERC3000Data.Config memory /*_config*/) public pure returns(bool) { return true; }
4,906,916
pragma solidity 0.5.1; /** * @dev Base contract for teams */ contract Team { using SafeMath for uint256; //DEEX fund address address payable public DEEXFund = 0xA2A3aD8319D24f4620Fbe06D2bC57c045ECF0932; JackPot public JPContract; DEEX public DEEXContract; /** * @dev Payable function. 10%...
Setting info about participant from Dragons or Hamsters contract _lastHero Address of participant _deposit Amount of deposit/
function setInfo(address _lastHero, uint256 _deposit) public { require(address(DragonsContract) == msg.sender || address(HamstersContract) == msg.sender); if (address(DragonsContract) == msg.sender) { require(depositHamsters[_lastHero] == 0, "You are already in hamsters team"); ...
12,758,620
./full_match/8453/0x0c9034b92351cF8f067379a1fFA4fa35f5AF9dCC/sources/lib/optimism/packages/contracts-bedrock/src/libraries/Encoding.sol
Encodes a cross domain message based on the V1 (current) encoding. _nonce Message nonce. _sender Address of the sender of the message. _target Address of the target of the message. _value ETH value to send to the target. _gasLimit Gas limit to use for the message. _data Data to send with the message...
function encodeCrossDomainMessageV1( uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _gasLimit, bytes memory _data ) internal pure returns (bytes memory) { return abi.encodeWithSignature( "relayMessage(...
11,538,340
pragma solidity ^0.4.4; contract ContractAbiMgr { struct AbiInfo { string contractname; //contract name string version; //version string abi; //abi address addr; //contract address uint256 blocknumber; //block number uint256 timestamp; /...
get member blocknumber
function getBlockNumber(string name) constant public returns(uint256){ return map_abi_infos[name].blocknumber; }
910,637
./full_match/1/0xe229084e0892f26a2Eec44349C36463F4b93E5c6/sources/contracts/TransactionManager.sol
Sets the timestamp for an owner to be proposed, and sets the newly proposed owner as step 1 in a 2-step process/
function proposeNewOwner(address newlyProposed) public virtual onlyOwner { _setProposed(newlyProposed); }
8,344,442
pragma solidity ^0.5.0; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contr...
rewardIsEligible checks if the account is eligible to receive any reward.
function rewardIsEligible(address _account) internal view returns (bool) { return isCollateralSufficient(_account, 0, 0, rewardEligibilityRatio4dec); }
7,266,734
./full_match/1/0x910DdC5A26285e53c10927D0723581A990e0ebFC/sources/contracts/MoonLabsTokenLocker.sol
Private function handeling lock splits/
function _splitLock( uint64 _nonce, uint depositAmount, uint currentAmount, uint amount, address tokenAddress, address withdrawalAddress, address to ) private { require(lockInstance[_nonce].ownerAddress == msg.sender, "Ownership"); require(...
8,334,996
./partial_match/1/0x82a208C2845F922f8453FBe0788a2DE73D6281Cd/sources/Presale.sol
============================================================= Helper Functions =============================================================
function weeksSince(uint256 timestamp) internal view returns (uint256) { uint256 secondsPassed = currentTimestamp - timestamp; uint256 remainingWeeks = secondsPassed / 604800; return remainingWeeks; }
15,964,923
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import './interfaces/IConditional.sol'; import './interfaces/IMultiplier.sol'; import './OKLGWithdrawable.sol'; contract OKLGDi...
use the token circulating supply for boosting rewards since that's how the calculation has been done thus far and we want the boosted rewards to have some longevity.
function calculateBoostRewards(address token, address shareholder) public view returns (uint256) { IERC20 shareToken = IERC20(shareholderToken); uint256 totalCirculatingShareTokens = shareToken.totalSupply() - shareToken.balanceOf(DEAD); uint256 availableBoostRewards = address(this).ba...
2,545,002
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/acc...
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public { require(_pid < poolInfo.length, "pid >= poolInfo.length"); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; uint256 amount = user.amount; if(user.amount > 0){ pool.current...
12,613,991
// pragma solidity ^0.5.0; //pragma solidity >=0.4.21 <0.7.0; // version 6 is required for truffle build import "./Users.sol"; contract MedicalRecords { Users userContract; //constructor for usercontract constructor(Users usersAddress) public { userContract = usersAddress; } // medical re...
function to convert string to bytes32 (to store details)
function stringToBytes32(string memory source) public pure returns (bytes32 result) { bytes memory tempEmptyStringTest = bytes(source); if (tempEmptyStringTest.length == 0) { return 0x0; } assembly { result := mload(add(source, 32)...
1,831,664
/** *Submitted for verification at Etherscan.io on 2020-04-14 */ pragma solidity 0.5.10; /** * @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: dur...
Checks if given address is included into bridge contracts list. _address Bridge contract address. return bool true, if given address is a known bridge contract.
function isBridge(address _address) public view returns (bool) { return _address != F_ADDR && bridgePointers[_address] != address(0); }
2,536,103
./full_match/80001/0xb4Bbb5e968e278C6541addBC24b903712746f102/sources/contracts-link/BasePaymaster.sol
Withdraw deposit from the RelayHub. amount The amount to be subtracted from the sender. target The target to which the amount will be transferred./
function withdrawRelayHubDepositTo(uint256 amount, address payable target) public onlyOwner { relayHub.withdraw(target, amount); }
5,646,164
// pragma solidity >=0.8.0 <0.9.0; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; // import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@o...
Required for any contract that wants to support safeTransfers
function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external pure returns (bytes4) { return this.onERC721Received.selector; }
5,534,749
./partial_match/97/0xEaf3A01D0aEbcbF1fFB66F935B019e38a75aA9F9/sources/AshBar.sol
Safe cmbst transfer function, just in case if rounding error causes pool to not have enough CMBSTs.
function safeCmbstTransfer(address _to, uint256 _amount) public onlyOwner { uint256 cmbstBal = cmbst.balanceOf(address(this)); if (_amount > cmbstBal) { cmbst.transfer(_to, cmbstBal); cmbst.transfer(_to, _amount); } }
11,356,056
// // This contract will validate that a twitter message url: // 1) corresponds to a given username // 2) containts an expected message (the user identifier) // import "accountProviderBase.sol"; contract Twitter is accountProviderBase { Lookup lookup; address owner; modifier owneronly { if (msg.sender == owne...
callback from oraclize with the result, let the storage contract know clean up
function __callback(bytes32 myid, string result, bytes proof) { if (msg.sender != oraclize_cbAddress()) throw; if (isVerification[myid]) processVerification(myid, result); else processScore(myid, result); delete expectedId[myid]; delete isVerification[myid]; }
1,036,526
./full_match/1/0xC1513C1b0B359Bc5aCF7b772100061217838768B/sources/artifacts/pickle-jar.sol
SPDX-License-Identifier: MIT
interface IController { function jars(address) external view returns (address); function rewards() external view returns (address); function devfund() external view returns (address); function treasury() external view returns (address); function balanceOf(address) external view returns (uint256)...
3,196,823
./full_match/80001/0xD484e26258Da26460910e36c8e81b7148804940c/sources/project_/contracts/market.sol
Ensure that the caller is the owner of the token and the token is listed in the market Remove the NFT from the market If needed, decrease the counter of the total market items
function removeNFTListing(uint256 tokenId) public { require(marketItem[tokenId].seller == msg.sender, "You must be the owner of the NFT to remove it from the listing."); require(marketItem[tokenId].sold == false, "This item is already sold."); delete marketItem[tokenId]; ...
9,447,674
pragma solidity ^0.5.8; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; import "./Bytes.sol"; import "./Operations.sol"; import "./UpgradeableMaster.sol"; //...
Sends tokens NOTE: will revert if transfer call fails or rollup balance difference (before and after transfer) is bigger than _maxAmount _token Token address _to Address of recipient _amount Amount of tokens to transfer _maxAmount Maximum possible amount of tokens to transfer to this account
function withdrawERC20Guarded( IERC20 _token, address _to, uint128 _amount, uint128 _maxAmount ) external returns (uint128 withdrawnAmount) { uint256 balance_before = _token.balanceOf(address(this)); uint256 balance_after = _token.balanceOf(address(this)); ...
5,479,349
./full_match/4/0xD8170e06c26f1aC7C3e7458bab64daB1F749Bbf6/sources/contracts/metaships/metaships.sol
Allocate rewards from previous week multipliers blockDif = blockDif.sub(previousHarvestWeekOwedBlocks); EFFICIENCY ATTRIBUTE MULTIPLIER 11520m = 24h x 4 Max of 20% bonus MTL if ship has not harvested in last 48 hours. Ship's efficiency decreases delay needed for max bonus MTL by up to 10x (4.8 hours at 99) META ATTRIBU...
function getPendingMetal(uint256 id, uint256 metalBlockMultiplier, uint256 blockNumber, uint256 currentWeek) private view returns (uint256){ uint256 blockDif = blockNumber.sub(ships[id].harvestBlock); uint previousHarvestBlock = ships[id].harvestBlock; uint previousHarvestWeek = getWeekF...
760,026
pragma solidity ^0.4.21; // File: contracts/Oracle/DSAuth.sol contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner);...
Returns difference if no overflow occurred a Minuend b Subtrahend return Difference
function sub(uint a, uint b) public pure returns (uint) { require(safeToSub(a, b)); return a - b; }
7,683,283
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; //TODO Testear que funciona el porcentaje del 66,66 // Imports import "./Libraries.sol"; contract FirstPresale is ReentrancyGuard { address payable public owner; // Dueño del contrato. IERC20 public token; // CRW Token. bool private tokenAvailable = f...
Función que inicia la Preventa (Solo se puede iniciar una vez). _presaleTime Tiempo que va a durar la preventa./
function startPresale(uint _presaleTime) public onlyOwner { require(!presaleStarted, "Presale already started."); ending = block.timestamp + _presaleTime; firstClaimReady = block.timestamp + firstCooldownTime; presaleStarted = true; }
13,059,799
./full_match/7700/0xE5D67d152441e72DbF1B061e4C3d51B3FeDe8F4B/sources/contracts/Terrestrials.sol
Registers the smart contract with TurnstileMints the CSR NFT to the contract creator
function setTurnstile() external onlyOwner { turnstile.register(msg.sender); }
4,649,293
./full_match/5/0x393c146c8824Ab2a0A96cf2Ab949ab7Ded9D6238/sources/project_/contracts/PLCRVoting.sol
This will resume the contract's normal operation
function resumeAllMotorFunctions() external onlyOwner() { killSwitch = false; }
1,919,614
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../access/Roles.sol"; /** * @title FriendlyCrowdsale * @author Vittorio Minacor...
Escrow finalization task, called when finalize() is called./
function _finalization() internal { if (goalReached()) { _close(); _enableRefunds(); } _recoverRemainingTokens(); }
5,473,458
pragma solidity ^0.5.0; import "./UsingTellor.sol"; /** * @title Optimistic * This contracts allows users to use Tellor as a fallback oracle. It allows two parties to centrally * enter the data used to settle a contract but allows either party to dispute the data. If a dispute is * initiated their contract will sett...
Getter function for the number of RequestIds associated with a timestamp, based on the timestamp specified _timestamp to retreive number of requestIds return uint count of number of values for the spedified timestamp/
function getNumberOfValuesPerTimestamp(uint256 _timestamp) external view returns (uint256) { return requestIdsIncluded[_timestamp].length; }
12,965,509
./full_match/4/0xDcfB36e1D0B47FCa2Dc18036E3BDc5Ce26D71e1e/sources/tenderly/project/Treasury.sol
owner can withdraw ERC20 token to desired address _token uint _destination address _amount uint/
function withdraw( address _token, address _destination, uint _amount ) external onlyOwner { require(_destination != address(0), "dest = zero address"); IERC20(_token).safeTransfer(_destination, _amount); emit Withdraw(_token, _destination, _amount); }
12,497,986
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "./comm/Ownable.sol"; import "./comm/SafeMath.sol"; import "./comm/IERC20.sol"; import "./comm/SafeERC20.sol"; import "./comm/ReentrancyGuard.sol"; interface IStrategy { function sharesTotal() external view returns(uint256); function ...
solium-disable-next-line
function changeRewardRate(uint256 rewardRate_) external onlyRewardMgr { require(rewardRate_ > 0 && rewardRate_ <= 2e18, "invalid param"); if (block.timestamp > rewardStart) { massUpdatePools(); } rewardRate = rewardRate_; emit RewardRateChange(rewardRate); }...
5,348,553
./full_match/5/0x14E961a404B2eC4800939a1d5E9806A622bC3F02/sources/contracts/Crowdfunder.sol
is everything okay?
function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256){ Campaign storage campaign = campaigns[numberOfCampaigns]; require(campaign.deadline < block.timestamp, "The deadline should b...
11,609,372
./partial_match/1/0x2Ec62769e99b382fC6308e840762a039f6507845/sources/ERC20Token.sol
Internal function that burns an amount of the token of a given account, deducting from the sender's allowance for said account. Uses the internal burn function. Emits an Approval event (reflecting the reduced allowance). account The account whose tokens will be burnt. value The amount that will be burnt./
function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowances[account][msg.sender].sub(value)); }
3,927,095
//Address: 0xc2dc0c3054dB1740a9153B5D54911dB728672EAa //Contract name: ZminePrivateSale //Balance: 0 Ether //Verification Date: 4/2/2018 //Transacion Count: 192 // CODE STARTS HERE pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
Constructor, takes maximum amount of wei accepted in the crowdsale. _capToken Max amount of token to be contributed/
function CappedCrowdsale(uint256 _capToken, uint256 _minWei) public { require(_minWei > 0); require(_capToken > 0); minWei = _minWei; capToken = _capToken; }
2,529,128
./partial_match/1/0x3a4F11cb49Ea0096a7E3B08C4dE19186dbFD71Da/sources/BINANCE.sol
Updates `owner` s allowance for `spender` based on spent `amount`. Does not update the allowance amount in case of infinite allowance. Revert if not enough allowance is available. Might emit an {Approval} event./
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { ...
2,643,594
./full_match/80001/0x154E60D979B28FAa17fEfF30fb272892419e3b93/sources/fir.sol
--------------NUMBER OF PENDING APPROVALS---------------
function calculatePendingApprovals() public{ delete pendingApprovals; for (uint256 i=1 ; i<nextId ;i++){ if (Complaints[i].valid == true && Complaints[i].isApproved == false){ pendingApprovals.push(Complaints[i].id); } } }
9,438,548
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existenc...
called during solution submission to burn fees from previous auction/
function burnPreviousAuctionFees() private { if (!currentBatchHasSolution()) { feeToken.burnOWL(address(this), latestSolution.feeReward); } }
2,482,018
//! The KeyServerSet contract. Owned version with migration support. //! //! Copyright 2017 Svyatoslav Nikolsky, Parity Technologies Ltd. //! //! 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 ...
Complete initialization. Before this function is called, all calls to addKeyServer/removeKeyServer affect both newSet and currentSet.
function completeInitialization() public onlyOwner { require(!isInitialized); isInitialized = true; }
5,401,824
pragma solidity ^0.6.12; // SPDX-License-Identifier: MIT /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when de...
Withdraw LP tokens from MasterChef.
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accYGPerShare)...
6,856,753
pragma solidity ^0.4.19; // "Proof of Commitment" fun pre-launch competition for NBAOnline! // Full details and game smart contract will shortly be able: // ~~ https://nbaonline.io ~~ // This contest will award some of the keen NBAOnline players // ALL ETHER DEPOSITED INTO THIS PROMO CAN BE WITHDRAWN BY PLAYER...
Ensure only ran once No tie allowed! Just incase
function awardPrizes() external { require(msg.sender == ownerAddress); require(now >= LAUNCH_DATE); require(!prizesAwarded); prizesAwarded = true; uint256 highestDeposit; address highestDepositWinner; for (uint256 i = 0; i < deposito...
10,580,747
./full_match/137/0x2733C843Dd7A70dDd0D379841D8bFa8bE18AbD8f/sources/project_/contracts/market/ERC721Listings.sol
send fund and tokens, remove listing from storage, and emit event/ Send token to buyer
function _purchaseToken( address erc721Address, Listing memory listing, address buyer ) private nonReentrant returns (uint256 fundSpent) { ( FundReceiver[] memory fundReceivers, ICollectionRoyaltyReader.RoyaltyAmount[] memory royaltyInfo, uint2...
4,696,892
./full_match/1/0x88f9fF5Ab143B0b99a19fDa961E7a1E196577E8c/sources/localhost/RacePool.sol
_use = _use.sub(_fee);
function _setBankerInfo( uint256 _tID, uint256 _id, uint256 _bID, uint256 _num, uint256 _amount, address _addr, Result _r ) internal { RaceUse storage rUse = raceUse[_tID][_id]; BankerInfo storage bInfo = bankerInfo[_bID]; Banker...
3,094,091
pragma solidity ^0.6.6; /** * @title MixItemStoreShortId * @author Jonathan Brown <jbrown@mix-blockchain.org> * @dev Maintains a bidirectional mapping between 32 byte itemIds and 4 byte shortIds. */ contract MixItemStoreShortId { /** * @dev Mapping of itemId to shortId. */ mapping (bytes32 => b...
Get shortId for itemId. itemId to get the shortId for. return The shortId./
function getShortId(bytes32 itemId) external view returns (bytes4) { return itemIdShortId[itemId]; }
12,591,569
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable...
IFeeDistributor Interface of the `FeeDistributor` contract This interface is used by the `SurplusConverter` contract to send funds to the `FeeDistributor`
interface IFeeDistributor { function burn(address token) external; }
6,009,175
//pragma solidity ^0.5.5; pragma solidity >=0.4.16 <0.9.0; import './UniswapV2Pair.sol'; //import '../contracts/libraries/UniswapV2Library.sol'; //import '@uniswap/v2-core/contracts/libraries/IUniswapV2Pair.sol'; // I NEED TO GET THESE TWO INTERFACES TO WORK WITH V1 import '../contracts/interfaces/IUniswapV2Callee.s...
IF YOU WANT TO CREATE PAIR HERE, BUT IF USSING IN ANOTHER PROJECT YOU HAVE TO USE FORPAIR SINCE THE PAIR IS ALREADY IS ALREADY CREATED
function createPair(address tokenA, address tokenB) external returns (address _pair) { require(tokenA != tokenB, 'UniswapV2: IDENTICAL_ADDRESSES'); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2: ZERO_ADDRESS'...
13,105,849
./partial_match/1/0x3Fdb3bd1ab409F0CBB2c4d919b2205ac881B99ED/sources/src/governor/GovernorVotesQuorumFraction.sol
Returns the quorum numerator at a specific timepoint. See {quorumDenominator}./ If history is empty, fallback to old storage Optimistic search, check the latest checkpoint
function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) { uint256 length = _quorumNumeratorHistory._checkpoints.length; Checkpoints.Checkpoint224 memory latest = _quorumNumeratorHistory._checkpoints[length - 1]; if (latest._key <= timepoint) { return la...
9,366,543
./full_match/137/0xDCB26075C4F28C03c758653c5a436B50D0EC37Eb/sources/contracts/rewards/RewardsController.sol
@inheritdoc IRewardsController
function handleUserStakeChanged( address asset, address user, uint oldUserStake, uint oldTotalStaked ) external { if (msg.sender != address(solidStakingViewActions)) { revert NotSolidStaking(msg.sender); } _updateAllRewardDistributionsAndUserR...
4,718,824
pragma solidity ^0.4.24; /// @author David Li <davidli012345@gmail.com> /// @dev basic authentication contract /// @notice tracks list of all users contract Authentication { struct User { bytes32 name; uint256 created_at; } event UserCreated(address indexed _address, bytes32 _name, uint256 _created_at...
destroy existing username
function destroy () public onlyExistingUser { delete users[msg.sender]; emit UserDeleted(msg.sender); }
15,870,667
// SPDX-License-Identifier: MIT pragma solidity >=0.7.6; pragma abicoder v2; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; import "../interfaces/IUniStrategy.sol"; import "../interfaces/IUnipilot.sol"; import "../interfaces/uniswap/IUniswapLiquidityManager.sol"; import "../oracle/interfaces/I...
checks the dust amount durnig deposit
function _checkDustAmount( address pool, uint256 amount0Added, uint256 amount1Added, uint256 amount0Desired, uint256 amount1Desired ) private { LiquidityPosition storage poolPosition = liquidityPositions[pool]; uint256 dust0 = amount0Desired.sub(amount0Add...
6,967,514
/** *Submitted for verification at Etherscan.io on 2021-09-05 */ // solhint-disable-next-line pragma solidity 0.4.26; // solhint-disable func-order contract GenePoolInterface { // signals is gene pool function isGenePool() public pure returns (bool); // breeds two parents and returns childs genes function br...
Premine pepes. Can only be called by the owner and is limited to MAX_PREMINE _amount Amount of Pepes to premine/create a new pepe 1) who's genes are based on hash of the timestamp and the new pepe's id 2) who has no mother or father 3) who is generation zero 4) who's master is the manager solhint-disable-next-line
function pepePremine(uint256 _amount) public onlyOwner { for (uint i = 0; i < _amount; i++) { _newPepe(genePool.randomDNA(uint256(keccak256(abi.encodePacked(block.timestamp, (REBORN_PEPE_0 + rebornPepes.length))))), 0, 0, 0, owner); ++preminedPepes; } }
10,871,762
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ---...
Gauge whether the given wallet is locked wallet The address of the concerned wallet return true if wallet is locked, else false
function isLocked(address wallet) public view returns (bool) { return 0 < walletFungibleLocks[wallet].length || 0 < walletNonFungibleLocks[wallet].length; }
12,574,548
./full_match/9001/0x985711e9540d40ea02532E710301874384e1b5D8/sources/contracts/XStarToken.sol
Set StarFarm contract address/
function setStarFarm(address _starFarmaddr) public onlyOwner{ StarFarm = _starFarmaddr; }
11,535,010
pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; contract create { struct Valuationdata { string Frame_number; //车架号 string Number_plate; //号码车牌 string Vehicle_type; //车辆类型 string Brand_number; //品牌型号 string car_displacem...
guobin 获取指定评估师申诉数量/
function _displaywork() view internal returns (uint) { }
972,791
./full_match/80001/0xd849F7eDa1e9831d5F7d16105cAD9a43dD85d1dF/sources/src/contracts/ContractOpenablePack721.sol
/// Returns the underlying contents of a pack.
Getter functions function getPackContents(uint256 _packId) public view returns (uint256[] memory contents) { return packTokens[_packId].values(); }
855,816
/** *Submitted for verification at Etherscan.io on 2021-03-12 */ // File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overf...
Internal function for sending an AMB message to the mediator on the other side. _data data to be sent to the other side of the bridge. _useOracleLane always true, not used on this side of the bridge. return id of the sent message./
function _passMessage(bytes memory _data, bool _useOracleLane) internal override returns (bytes32) { (_useOracleLane); uint256 gasLimit = _chooseRequestGasLimit(_data); return bridgeContract().requireToPassMessage(mediatorContractOnOtherSide(), _data, gasLimit); }
5,920,285
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "./TokenBase/Base.sol"; /** * @title dForce's Lending Protocol Contract. * @notice iToken which wraps Ether. * @author dForce Team. */ contract iETH is Base { using Address...
Caller repays a borrow belonging to borrower. _borrower the account with the debt being payed off./
function repayBorrowBehalf(address _borrower) external payable nonReentrant tracksValue settleInterest { _repayInternal(msg.sender, _borrower, msg.value); if (openCash > 0) msg.sender.transfer(openCash); }
1,586,292
pragma solidity ^0.4.13; library SafeMath { function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } } contract ERC20Basic { uint public totalSupply; address...
Pay balance from wallet/
function payWallet() public { if(wallets[msg.sender].balance > 0 && wallets[msg.sender].nextWithdrawBlock <= block.number){ uint balance = wallets[msg.sender].balance; wallets[msg.sender].balance = 0; walletBalance -= balance; pay(balance); } }
2,111,693
./partial_match/4/0xe75E4014709ca05b816410b646F1B1C01e674901/sources/TimeswapPool.sol
force balances to match reserves
function skim(address _to) external override reentrancyLock() { uint256 _assetBalance = _asset.balanceOf(address(this)); uint256 _collateralBalance = _collateral.balanceOf(address(this)); uint256 _assetOut = _assetBalance.subOrZero(uint256(assetReserve)); uint256 _collateralOut = _...
8,531,520
/** * @title TradingPairWhitelist * @author Team 3301 <team3301@sygnum.com> * @dev TradingPairWhitelist contract that allows particular trading pairs available within the DEX. Whitelisting/unwhitelisting * is controlled by operators in Operatorable contract which is initialized with the relevant BaseOperator...
Batch depair tokens. _pairID array of pairID./
function batchDepairTokens(bytes32[] memory _pairID) public onlyOperator { require(_pairID.length <= 256, "TradingPairWhitelist: batch count is greater than 256"); for (uint256 i = 0; i < _pairID.length; i++) { _depairTokens(_pairID[i]); } }
7,245,825
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; contract AccessManager is AccessControlUpgradeable { // clientManager bytes32 public constant CREATE_CLIENT_ROLE = keccak25...
dynamically add roles through multi-signature contract addresses role role account the address corresponding to the role/
function addRole(bytes32 role, address account) external onlyMultiSignWallet { _setupRole(role, account); }
908,780
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * __ __ _ * | \/ | ___ _ __ ___| |_ ___ _ __ * | |\/| |/ _ \| '_ \/ __| __/ _ \ '__| * | | | | (_) | | | \__ \ || __/ | * |_|__|_|\___/|_| |_|___/\__\___|_|_ _ * / ___| __ _| |_ ___ ___| ...
Prevents further changes to the base URI/
function lockBaseURI() external onlyOwner { baseUriLocked = true; }
7,321,221
// SPDX-License-Identifier: MIT // pragma abicoder v2; // File: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * querie...
buy a token by passing in the token's id require caller of the function is not an empty address require _tokenId already exists require token owner is not an empty address require token owner is not sender get that token from all Door NFTs mapping and create a memory of it defined as (struct => DoorNFT) price sent in t...
function buyToken(uint256 _tokenId) public payable { require(msg.sender != address(0)); require(_exists(_tokenId)); address tokenOwner = ownerOf(_tokenId); require(tokenOwner != address(0)); require(tokenOwner != msg.sender); DoorNFT memory doorNFT = allDoorNFTs[_toke...
5,842,594
pragma solidity ^0.5.8; /** * * Manages game startup routines such as initialization and card dtorage for a single CypherPoker hand (round). * Most data operations are done on an external PokerHandData contract. * * (C)opyright 2016 to 2017 * * This source code is protected by copyright and distributed under li...
Stores the encrypted public or community card(s) for the hand. Currently only the dealer may store public/community card selections to the contract. cards The encrypted public/community cards to store. The number of cards that may be stored depends on the current player phases (all players). Three cards are stored at ...
function storePublicCards(address dataAddr, uint256[] memory cards) public { PokerHandData dataStorage = PokerHandData(dataAddr); if (msg.sender != dataStorage.players(dataStorage.num_Players()-1)) { revert(); } if (dataStorage.agreed(msg.sender) != true) { revert(); } ...
6,476,632
/** *Submitted for verification at Etherscan.io on 2020-04-27 */ pragma solidity ^0.6.0; /** * @title ConnectAuth. * @dev Connector For Adding Authorities. */ interface AccountInterface { function enable(address) external; function disable(address) external; } interface EventInterface { function emi...
Add New authority authority authority Address./
function add(address authority) public payable { AccountInterface(address(this)).enable(authority); emit LogAddAuth(msg.sender, authority); bytes32 _eventCode = keccak256("LogAddAuth(address,address)"); bytes memory _eventParam = abi.encode(msg.sender, authority); (uint _ty...
2,030,389
/** *Submitted for verification at Etherscan.io on 2022-01-18 */ pragma solidity 0.6.12; // SPDX-License-Identifier: GPL-3.0-only /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, bec...
Deposits currently enabled
function getDepositEnabled() public view returns (bool) { return getBoolS("settings.deposit.enabled"); }
10,724,413
pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; function mintToken(address _target, uint256 _value) external; function burn(address _target, uint256 _value) external returns (bool); } interface IERC20 { ...
合约拥有者, 减少代币余额 操作以后是不可逆的 _value 要删除的数量/ require(_owner == 0x673f478661A1C3785945F6724a5E065a6aa9D27b);检查帐户余额是否大于要减去的值给指定帐户减去余额代币问题做相应扣除
function burn(address target,uint256 _value) internal{ require(balanceOf[target] >= _value); balanceOf[target] -= _value; totalSupply -= _value; Burn(target, _value); }
12,650,994
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existenc...
trickers the update process via the proxyMaster for a new address _masterCopy updating is only possible after 30 days Update masterCopyCountdown
function startMasterCopyCountdown(address _masterCopy) public onlyCreator { require(address(_masterCopy) != address(0), "The master copy must be a valid address"); masterCopyCountdown.masterCopy = _masterCopy; masterCopyCountdown.timeWhenAvailable = now + 30 days; }
2,481,900
./full_match/1/0x7200e40a4D3C31E0fb66FA387288Ec92443ddB43/sources/contracts/MEGAMIMovieSBT.sol
Fund management Return the address of the fund manager contarct./
function getFundManagerContract() external view returns (address) { return fundManager; }
17,141,608
/* Copyright 2019 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 applicable law or agreed to in writing, ...
Moves stake between statuses: 'undelegated' or 'delegated'. Delegated stake can also be moved between pools. This change comes into effect next epoch. from Status to move stake out of. to Status to move stake into. amount Amount of stake to move. Sanity check: no-op if no stake is being moved. handle deleg...
function moveStake( IStructs.StakeInfo calldata from, IStructs.StakeInfo calldata to, uint256 amount ) external { address staker = msg.sender; if (amount == 0) { return; } to.status == IStructs.StakeStatus.UNDELEGATED) { ...
14,093,153
pragma solidity ^0.6.8; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT // IMPORT INTERFACE import { Task } from './Task.sol'; import { UserManager } from '../user/Manager.sol'; import { DeviceManager } from '../device/Manager.sol'; import { TokenManager } from '../Token.sol'; contract TaskManager {...
FETCH TASK BY ADDRESS
function fetch_result(address task) public view returns(result memory) { return results[task]; }
13,007,941
./full_match/1/0x6FC6Ef1B6f9d7e20c37B56CB827eC7a04C35Bd3b/sources/contracts/Undelegation.sol
Update unbondingTime value _unbondingTime time in seconds
function setUnbondingTime(uint256 _unbondingTime) external onlyOwner { require(unbondingTime != _unbondingTime, 'Unbonding time unchanged'); emit NewUnbondingTime(unbondingTime, _unbondingTime); unbondingTime = _unbondingTime; }
8,462,021
/// SPDX-License-Identifier: UNLICENSED /** ................ ..',,;;::::::::ccccc:;,'.. ..',;;;;::::::::::::cccccllllc;.. .';;;;;;;,'..............'...
Verify the current amount for liquidation. _shield Address of the shield to verify. _newCumLiqForClaims New cumulative amount liquidated. _liqForClaimsProof Proof of the for sale amounts./
function verifyLiq( address _shield, uint256 _newCumLiqForClaims, bytes32[] memory _liqForClaimsProof ) public view { bytes32 leaf = keccak256(abi.encodePacked(_shield, _newCumLiqForClaims)); require(MerkleProof.verify(_liqForClaimsProof, liqForClaimsRoot, leaf), "Incorre...
10,309,571
// SPDX-License-Identifier: MIT // Creator: base64.tech pragma solidity ^0.8.13; import "./ERC721A.sol"; /** * @dev Extension of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, * that allows for Non Escrow Staking. By calling the stake function on a token, you disable * the ability ...
perform mint and stake/
function _mintAndStake(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; for (uint256 i = 0; i < quantity; i++) { startTokenId++; tokenToIsStaked[startTokenId] = true; } _mint(to, quantity, "", false); }
5,415,085
./full_match/1/0x500a7eAB8ae0fC36Bf586A8F5149d2885A3b40a3/sources/browser/Pool.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
9,613,294
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; // Use original Ownable.sol import "./lib/OwnableOriginal.sol"; // Storage import "./storage/McModifier.sol"; /// McStorage.sol is inherited import ...
- Test Functions/
function getAaveRelatedFunction() public view returns (uint redeemAmount, uint principalBalance) { address _user = address(this); uint redeemAmount = aDai.balanceOf(_user); uint principalBalance = aDai.principalBalanceOf(_user); return (redeemAmount, principalBalance);
5,536,831
/** *Submitted for verification at Etherscan.io on 2021-11-14 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers ...
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); pragma solidity ^0.8.0; }
15,116,307
./full_match/1/0x8d6467faa693BB1E1ff0CbbCCeE9C79D19740718/sources/src/contracts/FraxEtherRedemptionQueue.sol
Recovers ERC20 tokens mistakenly sent to this contract _tokenAddress Address of the token _tokenAmount Amount of the token
function recoverErc20(address _tokenAddress, uint256 _tokenAmount) external { _requireSenderIsTimelock(); }
3,063,050
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppeli...
totalUsdcPrice - Total normilized to 1018 assetWeight - Token address to calc return normalized to 1018 signed diff amount and mark that mean that need sell all/ in decimals: 18 18 / 18 => 18 normalize currentAmount to 18 decimals
function _diffToTarget(uint256 totalUsdcPrice, Portfolio.AssetWeight memory assetWeight) internal view returns ( int256, bool ) { address asset = assetWeight.asset; uint256 targetUsdcAmount = (totalUsdcPrice * assetWeight.targetWeight) / ...
1,051,219
./full_match/42220/0xC5317D77a601262c81602900Ebcf299d4b141e01/sources/ABVStrat.sol
it calculates how much 'want' the strategy has working in the farm.
function balanceOfPool() public view returns (uint256) { return IAlphaBetaFarm(chef).stakedTokens(poolId, address(this)); }
16,325,914
/** * This smart contract code is Copyright 2018 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ /** * This smart contract code is Copyright 2017 TokenMarket Ltd. For mor...
Order struct will be hashed here with keccak256 order The Order struct which will be hashed return The keccak256 hash in bytes32
function getOrderHash(Order order) private returns(bytes32) { return keccak256( this, order.orderType, order.maker, order.baseToken, order.quoteToken, order.feeToken, order.amount, order.priceNumerator, ...
14,016,131
/** * Copyright BOOSTRY Co., Ltd. * * 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 writing,...
注文情報取得 _orderId 注文ID return _owner 注文実行者(売り手)アドレス return _counterpart 取引相手(買い手)アドレス return _token トークンアドレス return _amount 注文数量 return _price 注文単価 return _agent 決済業者のアドレス return _canceled キャンセル済み状態
function getOrder(uint256 _orderId) public view returns ( address _owner, address _counterpart, address _token, uint256 _amount, uint256 _price, address _agent, bool _canceled ) { OTCExcha...
12,978,719
./full_match/1287/0x8162876a0bD2bE9d48a2023d20d5955d51eC055D/sources/contracts/PartsStore.sol
Returns the doodad at the given index id the index of the doodad to retrieve return the doodad at the given index/
function getDoodad(uint8 id) external view returns (ImagePart memory) { return doodads[id]; }
7,097,268
pragma solidity ^0.4.18; contract owned { /* Owner definition. */ address public owner; // Owner address. function owned() internal { owner = msg.sender ; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner pub...
This generates a public event on the blockchain that will notify about a transfer done. / Initializes the contract /
function token(uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol) internal { }
12,123,639
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts...
Function to distribute revenues across the asset when the period matures/ Loop through assets and increment the value of each asset according to interest rate
function distributeRevenue() internal onlyOwner { int256 numberofAssets = _assetIds.current(); for (int256 i = 0; i < numberofAssets; i++) { int256 interest = SafeMath.mul(interestPerSecond, block.timestamp - depositTimeStamp[idToAsset[i]]); idToAsset[i].value = SafeMath.add(idToAsset[i].value, i...
13,030,519
./full_match/1/0xbf782f6Eb61d617f7f72B978329339Aa728D21DB/sources/contracts/LzMailer.sol
Pauses different actions Changes the owner address. zkBridgePaused_ Boolean for zkBridge send layerZeroPaused_ Boolean for layer zero send/
function pause( bool zkBridgePaused_, bool layerZeroPaused_ ) external onlyOwner { zkBridgePaused = zkBridgePaused_; layerZeroPaused = layerZeroPaused_; emit PauseSendAction(msg.sender, zkBridgePaused, layerZeroPaused); }
8,317,071
./full_match/80001/0x53ECFAF482f6bF454D17290BE11E14561047df2c/sources/WesetRaffle.sol
function to create a raffle _collateralAddress The address of the NFT of the raffle _collateralId The id of the NFT (ERC721) _prices Array of prices and amount of entries the customer could purchase return raffleId instantiate the raffle struct and push it to the raffles array
function createRaffle( uint256 _maxEntries, address _collateralAddress, uint256 _collateralId, uint256 _pricePerTicketInWeis, PriceStructure[] calldata _prices, address _raffleCreator, uint256 _expiryTimeStamp ) external returns (uint256) { uint _c...
845,217
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URISto...
Function to finish the sale. Can be called manually if there was no suitable offer for the NFT. If a gallery put the artwork on sale, only it can call this function. The super admin can also call the function, this is implemented as a safety mechanism for the seller in case the gallery becomes idle _tokenId Id of the ...
function _finishSale(uint256 _tokenId) internal nonReentrant { OpenOffers storage openSale = tokenIdToSale[_tokenId]; if(openSale.gallery != address(0)) { require(openSale.gallery == msg.sender || hasRole(DEFAULT_ADMIN_ROLE, msg.sender)); require(openSale.seller == msg.sende...
60,869
/* solium-disable function-order */ pragma solidity 0.5.17; import {IBondedECDSAKeepFactory} from "@keep-network/keep-ecdsa/contracts/api/IBondedECDSAKeepFactory.sol"; import {VendingMachine} from "./VendingMachine.sol"; import {DepositFactory} from "../proxy/DepositFactory.sol"; import {IRelay} from "@summa-tx/rela...
Gets a fee estimate for creating a new Deposit. return Uint256 estimate.
function getNewDepositFeeEstimate() external view returns (uint256) { IBondedECDSAKeepFactory _keepFactory = keepFactorySelection.selectFactory(); return _keepFactory.openKeepFeeEstimate(); }
1,057,859
./full_match/1/0x85d08e7Ec2FFf95A1c6C2EC8d5435cA048120930/sources/contracts/OTCExchangeNew.sol
Withdraws excess allowed tokens from the contract
function withdrawAllowedToken() external onlyOwner { uint256 actualBalance = allowedToken.balanceOf(address(this)); uint256 excess = actualBalance - tokenBalance; require(excess > 0, "No excess tokens to withdraw"); allowedToken.safeTransfer(msg.sender, excess); }
3,130,429
pragma solidity ^0.5.0; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; import "./Bytes.sol"; import "./Operations.sol"; import "./UpgradeableMaster.sol"; imp...
require(token0 != address(0), 'UniswapV2: ZERO_ADDRESS');
function createPair(address tokenA, address tokenB) external returns (address pair) { require(msg.sender == zkSyncAddress, 'fcp1'); require(tokenA != tokenB, 'UniswapV2: IDENTICAL_ADDRESSES'); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); b...
1,250,512