file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ // Sources flattened with hardhat v2.8.2 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/[email protected] // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev ...
Get the total reward share in this contract. Total reward is tracked with `_rewards[address(this)]` and `_userRewardPerTokenPaid[address(this)]`
function _shareTotal() public view returns (uint256) { uint256 rewardPerToken = convexBaseRewardPool.rewardPerToken(); return (_totalSupply * (rewardPerToken - _userRewardPerTokenPaid[address(this)]) / (1e18)) + _rewards[address(this)]; }
10,510,024
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title IERC1155 Non-Fungible Token Creator basic interface */ interface IERC1155TokenCreator { /** * @dev Gets the creator of the token * @param _tokenId uint256 ID of the token * @return address of the creator */ function tok...
/ _resetBid/ Internal function to reset bid by setting bidder and bid to 0. _tokenId uin256 id of the token. _owner address of the token owner/
function _resetBid(uint256 _tokenId, address _owner) internal { activeBid[_tokenId][_owner] = ActiveBid( address(0), 0, 0 ); }
1,455,528
./partial_match/1/0x6DbC5978711Cb22D7ba611BC18CEC308EA12EA95/sources/PublicResolver.sol
Sets the SECP256k1 public key associated with an ENS node. node The ENS node to query x the X coordinate of the curve point for the public key. y the Y coordinate of the curve point for the public key./
function setPubkey(bytes32 node, bytes32 x, bytes32 y) public onlyOwner(node) { records[node].pubkey = PublicKey(x, y); emit PubkeyChanged(node, x, y); }
2,748,352
./partial_match/42/0xa9f8807601a230495c674596468954Bc6d627B5F/sources/contracts/DecentralizedAutonomousTrust.sol
Purchase TAKE tokens with the given amount of currency. _to The account to receive the TAKE tokens from this purchase. _currencyValue How much currency to spend in order to buy TAKE. _minTokensBought Buy at least this many TAKE tokens or the transaction reverts. _minTokensBought is necessary as the price will chang...
function buy( address _to, uint _currencyValue, uint _minTokensBought ) public payable { require(_to != address(0), "INVALID_ADDRESS"); require(_minTokensBought > 0, "MUST_BUY_AT_LEAST_1"); require(bcGoal > totalSupply, "BC_GOAL_REACHED"); uint tokenValue = estimateBuyValue(_currencyV...
9,049,930
./full_match/1/0x990f58570b4C7b8b7ae3Bc28EFEB2724bE111545/sources/contracts/DullahanRewardsStaking.sol
Calculate the amount of rewards accrued by an user since last update for a reward token reward Address of the reward token user Address of the user return uint256 : Accrued rewards amount for the user/ Get the user scaled balance If the user has a previous deposit (scaled balance is not null), calcualte the earned re...
function _getUserEarnedRewards(address reward, address user, uint256 currentRewardPerToken) internal view returns(uint256) { UserRewardState storage userState = rewardStates[reward].userStates[user]; uint256 userScaledBalance = userScaledBalances[user]; if(userScaledBalance == 0) return 0;...
17,128,424
./full_match/4/0x0c9a5E965EFc546d88F722a073f97299152ff82E/sources/contracts/NFT.sol
require(!_colorExists[_color]); _colorExists[_color] = true;
function mint(uint256 _tokenId ,string calldata _uri, string memory _nftname, string memory _nftSymbol) external { nftName = _nftname; nftSymbol = _nftSymbol; uris.push(_uri); super._mint(msg.sender, _tokenId); super._setTokenUri(_tokenId, _uri); }
12,490,802
pragma solidity 0.5.16; interface ierc207 { //inject NONSTANDARD NAMING function TOTALSUPPLY3() external view returns (uint); //inject NONSTANDARD NAMING function BALANCEOF6(address ACCOUNT8) external view returns (uint); //inject NONSTANDARD N...
inject NONSTANDARD NAMING
function _TRANSFER10(address SENDER7, address RECIPIENT4, uint AMOUNT10) internal {
5,469,225
./full_match/1/0x1BCcd4573e2754A18FbAe60B79f5D2CE5e7a31e6/sources/StakingPrizeRandomiser.sol
Assumes the subscription is funded sufficiently. Will revert if subscription is not set and funded.
function requestRandomWords(uint32 _numWords) external returns (uint256 requestId) { requestId = COORDINATOR.requestRandomWords( keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, _numWords ); s_r...
4,926,860
pragma solidity ^0.5.16; import "../../contracts/AErc20Immutable.sol"; import "../../contracts/AErc20Delegator.sol"; import "../../contracts/AErc20Delegate.sol"; import "../../contracts/CDaiDelegate.sol"; import "./ComptrollerScenario.sol"; contract AErc20Harness is AErc20Immutable { uint blockNumber = 100000; ...
dai -> internal dai
function join(address, uint) external payable {}
6,345,157
./full_match/80001/0x72C87B8B8afD695513C45601983647931f4Caa28/sources/contracts/DAO/SharedAddress/SharedAddress.sol
@inheritdoc ISharedAddress
function revokeFullFunctionAccess( uint256 _hat, address _zone, bytes4 _function ) external auth(REVOKE_ACCESS_PERMISSION_ID) { fullFunctionAccess[_functionId(_zone, _function)][_hat] = false; emit FullFunctionAccessRevoked(_hat, _zone, _function); }
862,474
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SY...
uses MerkleRoot to verify if the hash is valid. (This function is used externally only) root can be rootOg or rootWl proof is the Merkle proof in the form of a bytes32 array Returns a boolean
function verify(bytes32 root, bytes32[] memory proof) internal view returns (bool) { return MerkleProof.verify( proof, root, keccak256(abi.encodePacked(msg.sender)) ); }
15,396,115
./partial_match/3/0xd2972589bbb649CD88de51db463003302724203d/sources/DMMPool.sol
update reserves
function _update(bool isAmpPool, ReserveData memory data) internal { uint32 blockTimestamp = uint32(block.timestamp % 2**32); reserve0 = safeUint112(data.reserve0); reserve1 = safeUint112(data.reserve1); blockTimestampLast = blockTimestamp; if (isAmpPool) { vReser...
5,284,282
./partial_match/1/0x8B4953DCCd3EE51DA1E146fd8FecA4C21458238C/sources/EnumerableMapping.sol
Returns the value associated with `key`. O(1). Requirements: - `key` must be in the map./
function get(AddressToAddressMap storage map, address key) internal view returns (address) { return address(uint160(uint256(_get(map._inner, bytes32(uint256(uint160(key))))))); }
4,339,050
pragma solidity ^0.5.17; // Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol // Adapted to use pragma ^0.5.17 and satisfy our linter rules /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { string private constan...
Returns the current timestamp, converted to uint64. Using a function rather than `block.timestamp` allows us to easily mock it in tests./
function getTimestamp64() internal view returns (uint64) { return getTimestamp().toUint64(); }
91,616
pragma solidity ^0.4.24; import "../../open-zeppelin/contracts/math/SafeMath.sol"; import "./OwnerStandardERC20.sol"; import "./ERC20Exchangable.sol"; import "./OperationHolder.sol"; /** * @title Basic treasury smart contract * @author Biglabs Pte. Ltd. * @dev : Treasury smart contract - use for Buy/Sell tokens */...
Check whether this is fixed fee/
function isFixedFee() public view returns(bool){ return fixedFee; }
13,089,330
pragma solidity 0.6.7; abstract contract StabilityFeeTreasuryLike { function getAllowance(address) virtual public view returns (uint256, uint256); function setPerBlockAllowance(address, uint256) virtual external; } abstract contract TreasuryFundableLike { function authorizedAccounts(address) virtual public...
--- Core Logic --- @notify Recompute the base and max rewards for a specific funding receiver with a specific function offering funding receiver The funding receiver address targetFunctionSignature The signature of the function whose callers get funding/ Update last time Read the gas and the ETH prices Calculate the ...
function recomputeRewards(address receiver, bytes4 targetFunctionSignature) external { FundingReceiver storage targetReceiver = fundingReceivers[receiver][targetFunctionSignature]; require(both(targetReceiver.lastUpdateTime > 0, addition(targetReceiver.lastUpdateTime, targetReceiver.updateDelay) <= ...
7,110
/** *Submitted for verification at Etherscan.io on 2020-05-27 */ /** *Submitted for verification at Etherscan.io on 2020-05-27 */ pragma solidity 0.5.10; /* ___________________________________________________________________ _ _ ______ |...
Transfer tokens Send `_value` tokens to `_to` from your account _to The address of the recipient _value the amount to send/
function transfer(address _to, uint256 _value) public returns (bool success) { _transfer(msg.sender, _to, _value); return true; }
15,835,594
./partial_match/1/0x0402342Dd3B083C8A928C8BfCe3795124C767BF6/sources/NameMarketplace.sol
Get NFT's owner nftAddress address of the NFT collection tokenId token id of the NFT/
function getOwner(address nftAddress, uint256 tokenId) internal view returns (address) { if (nftAddress == address(punksAddress)) { return IPunks(punksAddress).punkIndexToAddress(tokenId); return IERC721(nftAddress).ownerOf(tokenId); } }
2,754,855
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/ContractRegistryClient.sol"; import "../token/interfaces/IDSToken.sol"; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterFactory.sol"; import "./interfaces/IConverterRegistry.sol"; import "./interfaces/I...
checks whether or not a given configuration depicts a standard pool/
function _isStandardPool(uint32[] memory reserveWeights) internal pure virtual returns (bool) { return reserveWeights.length == 2 && reserveWeights[0] == PPM_RESOLUTION / 2 && reserveWeights[1] == PPM_RESOLUTION / 2; }
14,085,394
./full_match/80001/0xD2c21633a243169A6b6E2688d9A9fC1A10809cD5/sources/_7i7o/tokengate/src/ERC721TGNT.sol
Transfers the ownership of an NFT from one address to another address This works identically to the other function with an extra data parameter, except this function just sets data to ""./
function safeTransferFrom(address, address, uint256) public virtual override { revert TransferAndApprovalsDisabled(); }
9,513,518
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ 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; } /** * @dev Integer division o...
Burns a specific amount of tokens. _who The address that amount of token is burned. _value The amount of token to be burned./ Do not allow owner to burn manually no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure
function burnTrusted(address _who, uint256 _value) public onlyTrustedContracts { require(_value <= balances[_who]); require(msg.sender != owner); balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(_who, _value); Transfer(_who, address(0), _value); }
1,365,956
./partial_match/1/0x6FAEB511989E280D3A51ca45ED756C90e736b012/sources/@violetprotocol/mauve-periphery/contracts/base/PeripheryPayments.sol
@inheritdoc IPeripheryPayments IWETH -> Insufficient WETH9
function unwrapWETH9(uint256 amountMinimum, address recipient) public payable virtual override { uint256 balanceWETH9 = IWETH9(WETH9).balanceOf(address(this)); require(balanceWETH9 >= amountMinimum, 'IWETH'); if (balanceWETH9 > 0) { IWETH9(WETH9).withdraw(balanceWETH9); ...
15,680,892
pragma solidity 0.5.12; pragma experimental ABIEncoderV2; contract HelloWorld{ struct Person { uint id; string name; uint age; uint height; bool senior; } event PersonUpdated(string oldname, uint oldAge, uint oldheight, bool oldSenior, string updatedName, uint age, uint heig...
This creates a person
function createPerson(string memory name, uint age, uint height) public { Person memory newPerson; newPerson.name = name; newPerson.age = age; newPerson.height = height; if(age >= 65){ newPerson.senior = true; } else{ newPerson.senior = fa...
15,837,209
./full_match/5/0x66024D053884Ea452D16f5935141b00d186108C8/sources/project_/contracts/LBCMarketV1.sol
@description: Gets the subcategories of a category _category: the category return: the list of pertinent subcategories
function getSubCategoriesByCategory( string calldata _category ) external override view returns (string[] memory) { return categoriesToSubs[_category]; }
7,083,594
/************************************************* * * * AirDrop Dapp * * Developed by Phenom.Team "www.phenom.team" * * * *************************************************/ pragma...
Sends the tokens to a list of addresses./
function airdrop(address[] _addresses, uint256[] _values) public onlyOwner returns (bool) { require(_addresses.length == _values.length); for (uint256 i = 0; i < _addresses.length; i++) { require(transfer(_addresses[i], _values[i])); } return true; }
12,956,845
./partial_match/97/0x6Ce1D8d0a8f13D6e69EB283a83f179b4d77680eD/sources/Waifus.sol
- `tokenId` must not exist. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event./
function _safeMint(address to, uint256 tokenId) internal virtual { require(totalSupply() < 16384); _safeMint(to, tokenId, ""); }
11,345,321
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./ERC20.sol"; import "./Dubi.sol"; import "./IHodl.sol"; import "./MintMath.sol"; contract Purpose is ERC20 { // The DUBI contract, required for auto-minting DUBI on burn. Dubi private immutable _dubi; // Th...
Send `amount` tokens from `sender` to recipient`. The `sender` must be opted-in and the `msg.sender` must be a trusted booster. NOTE: Booster extension/ We verify the nonce separately, since it's stored next to the balance
function boostedSend(BoostedSend memory send, Signature memory signature) public { address from = send.sender; address to = send.recipient; UnpackedData memory unpackedFrom = _unpackPackedData(_packedData[from]); UnpackedData memory unpackedTo = _unpackPackedData(_packed...
491,263
// SPDX-License-Identifier: MIT pragma solidity ^0.6.7; import "../strategy-base.sol"; import "../../interfaces/masterchefv2.sol"; import "../../interfaces/alcx-rewarder.sol"; abstract contract StrategyAlcxFarmBase is StrategyBase { // Token addresses address public constant alcx = 0xdBdb4d16EdA451D0503b854CF...
Anyone can harvest it at any given time. I understand the possibility of being frontrun But ETH is a dark forest, and I wanna see how this plays out i.e. will be be heavily frontrunned? if so, a new strategy will be deployed. Collects Sushi and ALCX tokens Donates DUST
function harvest() public override onlyBenevolent { IMasterchefV2(masterChef).harvest(poolId, address(this)); uint256 _alcx = IERC20(alcx).balanceOf(address(this)); if (_alcx > 0) { uint256 _amount = _alcx.div(2); IERC20(alcx).safeApprove(sushiRouter, 0); ...
13,137,211
pragma solidity 0.4.25; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenDGT { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the ...
Set allowance for other address Allows `_spender` to spend no more than `_value` tokens on your behalf _spender The address authorized to spend _value the max amount they can spend/
function approve(address _spender, uint256 _value) public returns (bool success) { require(!blacklist[msg.sender]); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
10,441,409
./full_match/1/0x8606075928EF3Fe7B9a1cd6045CEe11bBC0738bE/sources/contracts/Ownerfy-Contract-4-Merch.sol
Adds new blockchain information regarding a token/
function update(string calldata _update, uint256 id) public virtual { require(hasRole(AUDITOR_ROLE, _msgSender()), "Ownerfy ERC1155: must have auditor role to update"); emit Update(_update, id); }
3,167,433
/* 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,...
Overridden to revert on unsuccessful fillOrder call. ABI encode calldata for `fillOrder` Revert and rethrow error if unsuccessful
function _fillOrderNoThrow( LibOrder.Order memory order, uint256 takerAssetFillAmount, bytes memory signature ) internal returns (LibFillResults.FillResults memory fillResults) { bytes memory fillOrderCalldata = abi.encodeWithSelector( IExchangeCor...
1,007,569
./full_match/62320/0x4B621443c1c749ef5252e8AEE158A52B5eCe304A/sources/lib/mento-core/contracts/StableToken.sol
Returns the storage, major, minor, and patch version of the contract. return Storage version of the contract. return Major version of the contract. return Minor version of the contract. return Patch version of the contract./
function getVersionNumber() external pure returns ( uint256, uint256, uint256, uint256 ) { return (1, 2, 1, 0); }
3,224,895
/** * @title SwissRealCoin Liquidatation Wallet * handles ERC20 tokens (Ex: W-ETH), not unwrapped ether * @version 1.0 * @author Validity Labs AG <info@validitylabs.org> */ pragma solidity ^0.4.19; import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; ...
allows onlyOwner to set new ERC20 token for payouts _token ERC20/
function setNewErc20Token(ERC20 _token) public onlyOwner onlyValidAddress(address(_token)) { token = _token; }
904,602
./partial_match/1/0x5fa60726E62c50Af45Ff2F6280C468DA438A7837/sources/contracts/exchangeV2/BlurExchangeV2.sol
Cancels all orders by incrementing caller nonce/
function incrementNonce() external { emit NonceIncremented(msg.sender, ++nonces[msg.sender]); } EXECUTION WRAPPERS
4,003,407
//Address: 0xee61d0f4d7da6953b4e3ca62cbe10c16045b6a67 //Contract name: BitindiaVestingContract //Balance: 0 Ether //Verification Date: 1/25/2018 //Transacion Count: 6 // CODE STARTS HERE /** * The MIT License (MIT) Copyright (c) 2018 Bitindia. Permission is hereby granted, free of charge, to any person obtaining a ...
Check the balance of the Vesting Contract/
function getBalance() public constant returns (uint256) { return token.balanceOf(this); }
6,477,136
./full_match/5/0x871d72C888B7d92686E01e48F6F06FFB11EEe9B5/sources/browser/contracts/Pool.sol
Withdraw TAMAG tokens from MasterChef.
function withdrawTamag(uint256 _pid, uint256 tamagId) public whenNotPausedWithdraw{ require(isTamagPool(_pid), "not tamag pool"); PoolInfo storage pool = poolInfo[_pid]; require (pool.tamagIds.contains(tamagId), "pool don't have tamag"); UserInfo storage user = userInfo[_pid][_msgSe...
1,897,224
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../core/IERC1155CreatorCore.sol"; import "../extensions/ERC1155/ERC1155CreatorExtensionApproveTransfer.sol"; import "../extensions/ICreatorExtensionTokenURI.sol"; contract MockERC1155CreatorExtensionOverride is ERC1155CreatorExtensionApproveTransfer, IC...
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155CreatorExtensionApproveTransfer, IERC165) returns (bool) { return interfaceId == type(ICreatorExtensionTokenURI).interfaceId || super.supportsInterface(interfaceId); }
2,569,382
pragma solidity ^0.4.15; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function ...
called by the owner on emergency, triggers stopped state
function halt() external onlyOwner inNormalState { halted = true; }
15,106,440
pragma solidity ^0.4.18; // // 🌀 EnishiCoin // /** * @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; ...
Burns a specific amount of tokens. _from The address that will burn the tokens. _unitAmount The amount of token to be burned./
function burn(address _from, uint256 _unitAmount) signed public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); }
14,881,034
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./ICnydToken.sol"; import "./Ownable.sol"; abstract contract Administrable is Ownable, IAdministrable { ...
Destroys `amount` tokens from contract account, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
function burn(uint256 amount) public virtual override onlyAdmin { _burn(address(this), amount); }
6,438,454
./full_match/77/0x4999eC8c8EfFa1Fd5f2D1923BCBd59e9e4E82cB4/sources/arrauy_bug.sol
Update vote powers when tokens are transfered./ Set the cleanup block number. Historic data for the blocks before `cleanupBlockNumber` can be erased, history before that block should never be used since it can be inconsistent. In particular, cleanup block number must be before current vote power block. _blockNumber Th...
interface IICleanable { function setCleanerContract(address _cleanerContract) external; function setCleanupBlockNumber(uint256 _blockNumber) external; function setCleanupBlockNumberManager(address _cleanupBlockNumberManager) external; function cleanupBlockNumber() external view returns (u...
5,048,907
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token...
Retrieves the offers for a given item. _collection The address of the collection that the item is from. _tokenId The token ID of the item. return The array of offers that match the query./
function retrieveOffersByItem( address _collection, uint _tokenId ) public view returns (Offer[] memory) { uint numOffers = _offers.current(); uint matches = 0; uint cursor = 0; for (uint i = 0; i < numOffers; i++) { if (offer[i + 1].collection == _co...
13,071,100
./partial_match/42/0x33E90Dea6a8Cd1e76Ea38604d1694c392582845D/sources/ImpermanentGain.sol
can only call once after closeTime get price from oracle and calculate ILcanBuy = false;
function close() external { require(now >= closeTime, "Not yet"); require(canBuy, "Closed"); closePrice = uint256(oracle.latestAnswer()); uint256 ratio = openPrice.mul(1e18).div(closePrice); bPrice = _bPrice > 1e18 ? 1e18 : _bPrice; }
3,447,055
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Context.sol 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, they should n...
Proxy registry address Contract name Contract symbol Mapping from token ID to account balances
{ using Address for address; address public proxyRegistryAddress; string public name; string public symbol; mapping(uint256 => mapping(address => uint256)) private balances; mapping(uint256 => uint256) private _supply; constructor( string memory _name, string memory _symb...
11,863,449
./partial_match/1/0xd6F2E30B99214B6eaffBE2B270d2e42c762a929B/sources/DisputeManager.sol
Sets the global configuration for the max number of jurors to be drafted per batch _maxJurorsPerDraftBatch Max number of jurors to be drafted per batch/
function _setMaxJurorsPerDraftBatch(uint64 _maxJurorsPerDraftBatch) internal { require(_maxJurorsPerDraftBatch > 0, ERROR_BAD_MAX_DRAFT_BATCH_SIZE); emit MaxJurorsPerDraftBatchChanged(maxJurorsPerDraftBatch, _maxJurorsPerDraftBatch); maxJurorsPerDraftBatch = _maxJurorsPerDraftBatch; }
4,343,494
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/introspection/IERC165.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/con...
Transfer NFT to buyer
function _buyItem(string memory _bundleID, address _payToken) private { bytes32 bundleID = _getBundleID(_bundleID); address owner = owners[bundleID]; Listing memory listing = listings[owner][bundleID]; require(listing.price > 0, "not listed"); for (uint256 i; i < listing.nft...
1,519,383
./full_match/1/0x151301d8De53c2E7F5D9B10FCe36bd1fCf332bC6/sources/contracts/ethereum/core/CrowdFundHYPCPoolV2.sol
Returns the number of tokens swapped for in the given proposal. return The length of the proposal's tokenIds array.
function getProposalTokensLength(uint256 proposalIndex) external view returns (uint256) { return proposals[proposalIndex].tokenIds.length; }
9,809,168
./full_match/1/0x85D69fdb2d0E010a1FAB3603b5F654D928dc093B/sources/browser/my-erc20.sol
Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {_s...
function decimals() public view returns (uint8) { return _decimals; }
3,004,179
./full_match/1/0xE8c1B97913cB46BB8741e6FA483717Ea89FfC56d/sources/contracts/TeaVaultV2.sol
Deposit ERC1155 tokens Only the investor can do this _token address of the token contract _tokenId the token to deposit _amount amount to deposit
function deposit1155(address _token, uint256 _tokenId, uint256 _amount) external nonReentrant onlyInvestor { IERC1155(_token).safeTransferFrom(msg.sender, address(this), _tokenId, _amount, ""); emit Token1155Deposited(msg.sender, _token, _tokenId, _amount); }
3,870,438
./full_match/1/0xCf3b485bd11BCa74103D7D3534503bAD3fbdaC6d/sources/contracts/JBFundingCycleStore.sol
/ Duration must fit in a uint32. Discount rate must be less than or equal to 100%. Weight must fit into a uint88. If the start date is in the past, set it to be the current timestamp. Make sure the min start date fits in a uint56, and that the start date of an upcoming cycle also starts within the max. Ballot should be...
function configureFor( uint256 _projectId, JBFundingCycleData calldata _data, uint256 _metadata, uint256 _mustStartAtOrAfter ) external override onlyController(_projectId) returns (JBFundingCycle memory) { if (_data.duration > type(uint32).max) revert INVALID_DURATION(); if (_data.discountR...
17,049,533
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {ECDSAUpgradeable} from "@openzeppelin/...
Create a new KYC store domain admin The address of domain admin publicKey The KYC domain publicKey kycMode The KYC mode return DomainId The new KYC domain id
function createNewKYCDomain( address admin, address publicKey, uint256 kycMode ) external returns (uint32) { require(admin != address(0), "cannot create a kyc domain with an empty user"); uint32 id = domainCount + 1; domainCount = id; _setDomainPermissions...
5,438,284
./full_match/97/0x5B7297D544f161134E0D77a8835a59AFF5abDF37/sources/project:/contracts/diamond/libraries/LibPriceFacade.sol
Excessive price difference. Reject this price The time interval is too long. receive the current price but not use it and wait for the next price to be fed.
function requestPriceCallback(bytes32 requestId, uint64 price) internal { PriceFacadeStorage storage pfs = priceFacadeStorage(); PendingPrice memory pendingPrice = pfs.pendingPrices[requestId]; IdInfo[] memory ids = pendingPrice.ids; require(pendingPrice.blockNumber > 0 && ids.length...
3,279,074
// File: @openzeppelin/contracts/utils/math/SafeMath.sol // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow c...
unstake function check the index of stake token that unstaked before require( amount > GetMaxUnstakeAmount(), "amount must be less than available max unstake amount" );
function unstake(uint256 amount) public { uint256 sendAmount = amount; for (uint256 index; index < Stakers[msg.sender].stakeCount; index++) { if (stakersRecord[msg.sender][index].unstaked || amount == 0) { continue; } if ( stakers...
1,730,419
pragma solidity ^0.4.24; // File: contracts/LandBasic.sol /** * @title Land interface */ contract LandBasic { function createAndTransfer(address _to, uint32 _world, int64 _x, int64 _y) public; event Create(uint32 indexed _world, int64 indexed _x, int64 indexed _y); } // File: contracts/BidLandBasic.sol /** *...
Bids on a plot by anyone./
function bid(uint8 _x, uint8 _y, uint8 _team, uint256 _newMaxBid) external payable whenNotPaused canBid { uint8 index = plotPositionToIndex(_x, _y); Plot storage plot = currentAuction.plots[index]; require(_newMaxBid <= msg.value.add(balances[msg.sender]), "Max bid must be less than sending plus available...
15,833,404
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; address private contractOwner; // Account used to deploy contract bool private operational = true; ...
Buy insurance for a flight/
function buy(address _address,uint _insuranceamt,string _flight) external payable requireIsOperational { string[] memory flights = new string[](3); bool[] memory paid = new bool[](3); uint[] memory insuranceamt = new uint[](3); uint index; if(passengers[_address].isInsur...
12,841,076
./full_match/1/0x467a2B91f231D930F5eeB6B982C7666E81DA8626/sources/contracts/nft/ZKSeaNFT.sol
withdrawBalanceUpdate set the key to withdraw is true
function withdrawBalanceUpdate(address addr, uint64 globalId) external onlyZksCore { bytes28 withdrawKey = bytes28((uint224(addr) | (uint224(globalId) << 160))); toWithdraw[withdrawKey] = true; }
3,857,715
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; pragma abicoder v2; // required to accept structs as function parameters import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URISto...
Transfers all pending withdrawal balance to the caller. Reverts if the caller is not an authorized minter. IMPORTANT: casting msg.sender to a payable address is only safe if ALL members of the minter role are payable addresses. zero account before transfer to prevent re-entrancy attack
function withdraw() public { require( hasRole(MINTER_ROLE, msg.sender), "Only authorized minters can withdraw" ); address payable receiver = payable(msg.sender); uint256 amount = pendingWithdrawals[receiver]; pendingWithdrawals[receiver] = 0; ...
5,376,444
pragma solidity ^0.4.23; import "../../node_modules/zeppelin-solidity/contracts/token/ERC20/MintableToken.sol"; contract ERC20Token is MintableToken { mapping(address => uint256) pending; function pendingBalanceOf(address _owner) public view returns (uint256) { return pending[_owner]; } /** * Overr...
Overrides BasicToken.transfer Checks that the specified address has a valid balance/
function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balanceOf(msg.sender)); return super.transfer(_to, _value); }
12,639,662
/** *Submitted for verification at Etherscan.io on 2021-12-15 */ pragma solidity ^0.5.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role...
Transfers contract to a new primary. recipient The address of new primary./
function transferPrimary(address recipient) public onlyPrimary { require(recipient != address(0), "Secondary: new primary is the zero address"); _primary = recipient; emit PrimaryTransferred(recipient); }
10,977,021
./partial_match/1/0x4bff131408C2018a992B01c9C2C59B41488EF3d6/sources/contracts/MergeRouter.sol
REMOVE LIQUIDITY (supporting fee-on-transfer tokens)
function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) public virtual ensure(deadline) returns (uint256 amountETH) { return IRoute...
15,994,632
pragma solidity ^0.8.0; // Copyright 2020 Keyko GmbH. // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import './DIDRegistryLibrary.sol'; import './ProvenanceRegistry.sol'; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; /** * @title DID...
getPermission gets access permission of a grantee _did refers to decentralized identifier (a bytes32 length ID) _grantee address return true if grantee has access permission to a DID/
function getPermission( bytes32 _did, address _grantee ) external view returns(bool) { return _getPermission(_did, _grantee); }
1,770,157
// File: interfaces/IHopBridge.sol pragma solidity ^0.8; interface IHopBridge { function sendToL2( uint256 chainId, address recipient, uint256 amount, uint256 amountOutMin, uint256 deadline, address relayer, uint256 relayerFee ) external payable; } // ...
Calling a function that does not exist triggers the fallback function.
function bridgeMatic(uint256 amount) public { address srcToken = 0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0; address targetBridgeAddress = 0x22B1Cbb8D98a01a3B71D034BB899775A76Eb1cc2; IERC20(srcToken).safeTransferFrom(msg.sender, address(this), amount ); if (IERC20(srcToken).allowan...
5,878,820
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** *...
Deposit LP tokens to FryCook for CHKN allocation. Deposit 0 to bump a pool update.
function deposit(uint256 _pid, uint256 _amount) public { _deposit(_pid, _amount, msg.sender, msg.sender); }
14,410,121
./full_match/1/0x0BbE1D2c0BB0a2b7F2E3c3D59358193C9d2b0301/sources/contracts/staking/ResourceFieldV2.sol
See {IResourceField-nonceUsed}./
function nonceUsed(bytes32 nonce) external view override returns (bool) { return _usedNonces[nonce]; }
4,829,592
./partial_match/1/0xE61fDAF474Fac07063f2234Fb9e60C1163Cfa850/sources/CoinToken.sol
Add signature prefix to hash for recovery à la ERC191. _hash The hashed transaction to add signature prefix to./
function getSignHash(bytes32 _hash) public pure returns (bytes32 signHash) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _hash)); }
9,313,083
pragma solidity ^0.4.21; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author CryptoCollector contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) public view returns (uint256 balance); function imp...
For checking approval of transfer for address _to
function _approved(address _to, uint256 _tokenId) private view returns (bool) { return cardTokenToApproved[_tokenId] == _to; }
1,177,798
pragma solidity ^0.6.6; import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; contract BetContractV2 { AggregatorV3Interface internal priceFeed; address public priceFeedAddress; string public priceFeedName; /** * Our Bettors */ address public player1; address pu...
Returns the latest price/
function getLatestPrice() public view returns (int) { ( int price, ) = priceFeed.latestRoundData(); return price;
2,527,574
pragma ton-solidity >= 0.43.0; pragma AbiHeader time; pragma AbiHeader expire; pragma AbiHeader pubkey; import "./interfaces/IOracleService.sol"; import "./interfaces/IOracleUpdatePrices.sol"; import "./interfaces/IOracleReturnPrices.sol"; import "./interfaces/IOracleManageTokens.sol"; import "./libraries/CostConstan...
/ code New contract code updateParams Extrenal parameters used during update codeVersion New code version/
function upgradeContractCode(TvmCell code, TvmCell updateParams, uint32 codeVersion) override external canUpgrade { tvm.accept(); tvm.setcode(code); tvm.setCurrentCode(code); onCodeUpgrade( nonce, prices, swapPairToTokenRoot, 0, ...
1,069,987
// Copyright 2019 - See NOTICE file for copyright holders. // // 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 ap...
Returns the dispute state for the given channelID. Reverts if the channel has not been registered yet./
function requireGetDispute(bytes32 chID) internal view returns (Dispute memory) { (Dispute memory dispute, bool registered) = getDispute(chID); require(registered, "not registered"); return dispute; }
12,786,621
//Address: 0xc56c90c42948cb1d43148877351495cab4d1cd0e //Contract name: LociBackend //Balance: 0 Ether //Verification Date: 4/3/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity >=0.4.19; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control *...
enable recovery of LOCIcoin sent to this contract
function ownerRecoverTokens(address _beneficiary) external onlyOwner { require(_beneficiary != 0x0); require(_beneficiary != address(token)); uint256 _tokensRemaining = token.balanceOf(address(this)); if (_tokensRemaining > 0) { token.transfer(_benefi...
1,057,192
pragma solidity 0.7.0; import "./Modules/Administration.sol"; import "./Math/SafeMath.sol"; import "./Interfaces/ERC20Interface.sol"; contract AirdropChannels is Administration { using SafeMath for uint256; string constant public VERSION = "0.0.5alpha"; bytes private prefix = "\x19Ethereum Signed Message:\n32"; ...
air drop proof: keccak256(prefix, keccak256(_channelId, _id, msg.sender)) verify channel id verify we are in the correct state verify channel balance this ensure only the intended recipient of a signed message can redeem validate the signer signer checks out, but does the data? mark them as having received a bonus so t...
function retrieveAirdrop( bytes32 _h, uint8 _v, bytes32 _r, bytes32 _s, bytes32 _channelId, uint256 _id) public returns (bool) { require(channelIds[_channelId]); require(channels[_channelId].state == ChannelStates.releasing); require(channels[_channelId].value >= channels[_channelId].dropAmoun...
2,548,121
pragma solidity ^0.4.24; import "AuthenticationManager.sol"; import "OmniDividendFundToken.sol"; import "SafeMath.sol"; contract IcoPhaseManagement { using SafeMath for uint256; bool public icoPhase = true; /* Defines whether or not we are in the ICO phase */ bool public...
Allows people to withdraw funds that failed to send during the abandonment of the ICO for any reason. / This functionality only exists if an ICO was abandoned Attempt to send them to funds
function abandonedFundWithdrawal() public { if (!icoAbandoned || abandonedIcoBalances[msg.sender] == 0) revert(); uint256 funds = abandonedIcoBalances[msg.sender]; abandonedIcoBalances[msg.sender] = 0; if (!msg.sender.send(funds)) revert(); }
2,546,466
./partial_match/1/0x2d255b756dD75a11D75cf701aBaD7c6D64b0AeDD/sources/ERC721.sol
Returns an URI for a given token ID. Throws if the token ID does not exist. May return an empty string. tokenId uint256 ID of the token to query/
function tokenURI(uint256 tokenId) public override view returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return super._tokenURI(tokenId); }
15,682,629
./full_match/80001/0xe09A49a4F8c1F13102Da970DF9472e0E33E6Fc49/sources/contracts/auction.sol
/require(auction.duration > block.timestamp, "Deadline already passed");
function bid(address _nft, uint256 _tokenId) external payable { tokenDetails storage auction = tokenToAuction[_nft][_tokenId]; require(msg.value >= auction.price, "bid price is less than current price"); require(auction.isActive, "auction not active"); if (bids[_nft][_tokenId][msg.se...
9,471,192
/** *Submitted for verification at Etherscan.io on 2019-09-27 */ pragma solidity >=0.4.21 <0.6.0; /* ___________________________________________________________________ _ _ ______ | | / / / ...
it only holds ether as fee
function availableTradingFeeOwner() public view returns(uint256){ return tokens[address(0)][feeAccount]; } bool claimed_TOD26 = false; address owner_TOD26; uint256 reward_TOD26;
12,782,235
./full_match/4/0x77d46DB778C619d678f599E1f0BCF0501CAa94B9/sources/Bank/interfaces/UniversalERC20.sol
token.transfer(to, amount);
function universalTransfer(IERC20 token, address to, uint256 amount) internal returns(bool) { if (amount == 0) { return true; } if (isETH(token)) { payable(address(uint160(to))).transfer(amount); return true; SafeERC20.safeTransfer(address(tok...
748,088
// SPDX-License-Identifier: MIT /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: YFIRewards.sol * * Docs: https://docs.synthetix.io/ * * * MIT License * ======...
returns the voting power of a given address against a given proposal _voter voter address _id proposal id return votes of given address against given proposal/
function votesAgainstOf(address _voter, uint256 _id) public view returns (uint256) { return proposals[_id].votesAgainst[_voter]; }
2,517,657
./full_match/1/0x5e4aE2Ffc7667E671804000aC1491cC5A43C06Df/sources/contracts/RewardClaimer.sol
Allows a user to claim rewards for specified NFTs. tokenIds An array of NFT token IDs owned by the caller./
function claimAllRewards(uint256[] calldata tokenIds) external { require(tokenIds.length > 0, "No token IDs provided"); for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; require(nftToken.ownerOf(tokenId) == msg.sender, "Not the token owner"); ...
3,174,096
./partial_match/5/0xdE4c870F36a614E44bd00f987B22F4c4D48718F3/sources/contracts/base/utils/Permutate.sol
Gets a digit from the lookup table. table Table to extract the digit from. index Index to extract./
function getDigit(bytes10 table, uint256 index) pure private returns (uint256){ return uint256(uint8(table[index])) - 48; }
16,867,023
pragma solidity ^0.5.9; import "./DelightBuildingManagerInterface.sol"; import "./DelightManager.sol"; import "./DelightArmyManager.sol"; import "./DelightItemManager.sol"; import "./Util/SafeMath.sol"; contract DelightBuildingManager is DelightBuildingManagerInterface, DelightManager { using SafeMath for uint; /...
Creates an army from the building. 건물에서 부대를 생산합니다. Only the owner of the building can create an army from it. 건물 소유주만 부대 생산이 가능합니다. A hq creates knights. 본부의 경우 기사를 생산합니다. A training center creates swordsmen. 훈련소의 경우 검병을 생산합니다. An achery range creates archers. 사격소의 경우 궁수를 생산합니다. A stable creates cavalry. 마굿간의 경우 기마병을 생...
function createArmy(address owner, uint buildingId, uint unitCount) onlyDelight external { Building memory building = buildings[buildingId]; require(building.owner == owner); uint unitKind; if (building.kind == BUILDING_HQ) { unitKind = UNIT_KNIGHT; } else if (building.kind == BUILDING_TR...
1,027,490
./full_match/10/0x7A2Cf54897345b5f6a9006e2dA19B3739c4f5DCE/sources/contracts/RubiconMarket.sol
If we still need more offers
function getBuyAmount( ERC20 buy_gem, ERC20 pay_gem, uint256 pay_amt ) external view returns (uint256 fill_amt) { while (pay_amt > offers[offerId].buy_amt) { if (pay_amt > 0) { } } fill_amt = add( fill_amt, rmul( ...
3,777,812
./full_match/11155111/0x6A64944e8F9D3610EA82e557346902F77b463f74/sources/contracts/CrowdFunding.sol
Increase 1 like +1 like to campaign
function addLike( uint256 _campaignId, address _account ) public returns (uint256) { Like storage like = likes[numberOfLikes]; numberOfLikes++; like.id = numberOfLikes; like.campaignId = _campaignId; like.account = _account; like.unLike = false; ...
3,788,284
pragma solidity ^0.5.7; library SafeMath256 { function ADD150(uint256 a, uint256 b) internal pure returns (uint256 c) { //inject NONSTANDARD NAMING c = a + b; assert(c >= a); return c; } function SUB227(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDAR...
inject NONSTANDARD NAMING
function TRANSFER337(address to, uint256 value) external returns (bool);
1,830,149
./partial_match/1/0xa3df9428dedA5120d04177488849f7507B2e5067/sources/StandardController.sol
Returns the allowance for a spender owner The address of the owner of the tokens. spender The address of the spender. return Number of tokens the spender is allowed to spend./
function allowance( address owner, address spender ) external view returns (uint) { return token.allowance(owner, spender); }
4,149,981
// File: openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol pragma solidity ^0.5.2; /** * @title Helps contracts guard against reentrancy attacks. * @author Remco Bloemen <remco@2π.com>, Eenae <alexey@mixbytes.io> * @dev If you mark a function `nonReentrant`, you should also * mark it `external`. ...
ITransferProxy Set Protocol The ITransferProxy interface provides a light-weight, structured way to interact with the TransferProxy contract from another contract./
interface ITransferProxy { function transfer( address _token, uint256 _quantity, address _from, address _to ) external; function batchTransfer( address[] calldata _tokens, uint256[] calldata _quantities, address _from, address _to ...
5,523,358
./full_match/97/0x0eb2eBa66E6a325e15C1E42548D49bA50896f88A/sources/contracts/ExampleTREX.sol
See {ITREX-version}./
function version() external view override returns (string memory) { return TOKEN_VERSION; }
5,018,945
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721Tradable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/IERC20.sol"; contract UniqGenerator is ERC721Tradable{ // ----- VARIABLES ----- // uint256 internal _verificationPrice; address internal _tokenForPay...
----- OWNERS METHODS -----
function setProvenanceHash(string memory _hash) external onlyOwner { METADATA_PROVENANCE_HASH = _hash; }
331,026
pragma solidity ^0.5.8; import "./Owned.sol"; import "./BirthDate.sol"; contract MarketPlace is Owned { //structure of farmer - buyer/seller struct Farmer { uint aadhaar; // aadhar id of the farmer address farmer_address; // blockchain identif...
- farmer should be the owner of the cattle, the ownership of the cow milk has to be transferred
function EndAuctionForCowMilk(address cattle) public { }
14,081,545
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/IERC20Ubiquity.sol"; import "./UbiquityAlgorithmicDollarManager.sol"; import "./interfaces/ITWAPOracle.sol"; import "./BondingShareV2.sol"; import "./interfaces/IUbiquityFormula...
update bond LP amount , LP rewards debt and end block. _bondId bonding share id _lpAmount amount of LP token deposited _lpRewardDebt amount of excess LP token inside the bonding contract _endBlock end locking period block number we are removing LP we are adding LP
function updateBond( uint256 _bondId, uint256 _lpAmount, uint256 _lpRewardDebt, uint256 _endBlock ) external onlyMinter whenNotPaused { Bond storage bond = _bonds[_bondId]; uint256 curLpAmount = bond.lpAmount; if (curLpAmount > _lpAmount) { _to...
595,072
// Sources flattened with hardhat v2.6.0 https://hardhat.org // File contracts/libraries/SafeMath.sol pragma solidity ^0.6.6; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error * * @dev Default OpenZeppelin */ library SafeMath { /** * @dev Multiplies two unsi...
Add to the cover amount for the user and contract overall. _user The user who submitted. _nftId ID of the NFT being staked (used for events on RewardManager). _coverAmount The amount of cover being added. _coverPrice Price paid by the user for the NFT per second. _protocol Address of the protocol that is having co...
function _addCovers(address _user, uint256 _nftId, uint256 _coverAmount, uint256 _coverPrice, address _protocol) internal { IRewardManagerV2(getModule("REWARDV2")).deposit(_user, _protocol, _coverPrice, _nftId); totalStakedAmount[_protocol] = totalStakedAmount[_protocol].add(_coverAmount);...
226,706
./full_match/1/0xCa6eb1818eAFB1EFb94b0DC2c84Ef2c2D1A6BC9C/sources/contracts/Zentanode.sol
Slash wallet. Emits a {Slash} event./
function slashUser(address wallet) external onlyOwner { _slashed[wallet] = true; _userInfos[wallet].nextClaim += node.slashDuration; emit Slash(wallet); }
4,970,730
pragma solidity ^0.4.24; contract SuperBank { using SafeMath for *; struct Investment { uint256 amount; uint256 safeAmount; uint256 atBlock; uint256 withdraw; uint256 canWithdraw; uint256 maxWithdraw; } uint256 public startBlockNo; ui...
invest radical investment/
function() public payable { if (msg.value == 0) { withdraw(); invest(2, address(0)); } }
6,345,391
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "./LotteryToken.sol"; import "./PriceConsumers.sol"; struct LotteryEvent { uint timestamp; string description; } struct Participant { //address participant; uint tokenId; } stru...
Releases the funds to the lottery wallet/ Release funds Fill winners
function triggerCompletion() public { require(getState() == State.WaitingForFundsRelease, "Not currently waiting for funds release"); _releaseFunds(); for(uint i = 0; i < remainingParticipantsRanges.length && winners.length < totalWinners; i++) { Range memory range = remainingP...
7,229,838
pragma solidity 0.5.12; import "./library/ReentrancyGuard.sol"; import "./library/Pausable.sol"; import "./library/ERC20SafeTransfer.sol"; import "./library/SafeMath.sol"; import "./interface/IDispatcher.sol"; import "./interface/IHandler.sol"; contract DToken is ReentrancyGuard, Pausable, ERC20SafeTransfer { usi...
Check balance and allowance
function transferFrom( address _src, address _dst, uint256 _wad ) public nonReentrant whenNotPaused returns (bool) { Balance storage _srcBalance = balances[_src]; require( _srcBalance.value >= _wad, "transferFrom: insufficient balance" ); ...
12,948,871
/** *Submitted for verification at Etherscan.io on 2022-02-01 */ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // File: AddressUpgradeable.sol /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. ...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 amount uint256[44] private __gap; } function __Ownable_init() internal initializer { __Context_init_unchained(); __Ownable_init_unchained(); }
6,657,173
pragma solidity ^0.4.25; /* * Creator: CCVT (CrytoCoinVillage) */ /* * 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 ...
Transfer given number of tokens from given owner to given recipient. _from address to transfer tokens from the owner of _to address to transfer tokens to the owner of _value number of tokens to transfer from given owner to given recipient return true if tokens were transferred successfully, false otherwise ac...
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] ...
520,167
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
Deposit LP tokens to MasterChef for BTF allocation.
function deposit(uint256 _pid, uint256 _amount, address referrer) public updateReward(_pid, msg.sender) reduceHalve checkStart { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; _getReward(_pid, msg.sender); pool.lpToken.safeTransferFrom(add...
1,417,380
./partial_match/1/0x635e4A8d23d9adD975E931113Ddd2ac3663A7325/sources/FaaSPoolLite.sol
bytes4(keccak256(bytes('transfer(address,uint256)')));
function _pushUnderlying(address erc20, address to, uint amount) internal { (bool success, bytes memory data) = erc20.call(abi.encodeWithSelector(0xa9059cbb, to, amount)); require(success && (data.length == 0 || abi.decode(data, (bool))), '!_pushU'); }
4,056,105
pragma solidity ^0.4.19; // solhint-disable-line /** * Interface for contracts conforming to ERC-721: Non-Fungible Tokens * @author Dieter Shirley <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f397968796b3928b9a9c9e89969ddd909c">[email&#160;protected]</a>> (https://github.com/dete) */...
For querying founder cut which is left in the contract by `purchase` _price The token actual price/
function calculateFounderCut (uint256 _price) public pure returns (uint256 _founderCut) { return _price.mul(1).div(100); }
2,420,962
./full_match/56/0x4d2FA1E81661ecaF1FABdB9FF08c582F1ACEf003/sources/contracts/Token.sol
Set transaction fee rate/
function setFees( uint256 _buyFee, uint256 _sellFee, uint256 _transferFee, uint256 _feeDenominator ) external onlyOwner { buyFee = _buyFee; sellFee = _sellFee; transferFee = _transferFee; feeDenominator = _feeDenominator; }
3,254,991