file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT // @unsupported: ovm pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Interface Imports */ import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol"; import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/b...
Converts a bytes32 value to an address. Takes the last 20 bytes. _in Input bytes32 value. return Bytes32 as an address./
function toAddress( bytes32 _in ) internal pure returns ( address ) { return address(uint160(uint256(_in))); }
83,281
pragma solidity 0.5.10; import './DecentralizedStore.sol'; import '../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol'; import '../node_modules/openzeppelin-solidity/contracts/lifecycle/Pausable.sol'; /* * @title Marketplace * * @dev @notice This contract allows the users to operate different funct...
return all the informations of a product knowing its id productId id of the product return productData/
function getProductData(bytes32 productId) public view returns (string memory, string memory, uint, uint, bytes32){ return (productMap[productId].productName, productMap[productId].description, productMap[productId].price, productMap[productId].stock, productMap[productId].idMarketplace); }
12,656,917
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../base/Multicall.sol"; import "../bancor/BancorFormula.sol"; import "../upgrades/GraphUpgradeable.sol"; import "../...
Mint the NFT for the subgraph. _owner Owner address _tokenID Subgraph ID/
function _mintNFT(address _owner, uint256 _tokenID) internal { subgraphNFT.mint(_owner, _tokenID); }
1,674,936
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract ERC20TimeLockedTrustfund is Ownable { address public admin; address public...
Transfers the funds to the Owner account and removes the smart-contract from the blockchain
function destroyContract() public onlyOwner() { address _owner = Ownable.owner(); if (_owner != msg.sender) revert OnlyOwners("TrustFund: Only the OWNER can execute selfdestruct!"); address addr = payable(address(_owner)); selfdestruct(payable(addr)); }
12,764,888
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; // ---------------------------------------------------------------------------- /// @author Gradi Kayamba /// @title Purchase items with ether /// @dev notice contract gas cost (1,718,837 gas) // ------------------------------------------------------------...
Returns the locked status for order _id of _seller and _buyer. return pending true/false/
function lockedOf(address _seller, address _buyer, uint256 _id) public view returns (bool pending) { return locked[_id][_seller][_buyer]; }
14,064,011
// SPDX-License-Identifier: MIT // Sources flattened with hardhat v2.0.5 https://hardhat.org // File contracts/interface/IFlashloanExecutor.sol pragma solidity 0.6.12; interface IFlashloanExecutor { function executeOperation( address reserve, uint256 amount, uint256 fee, bytes mem...
Calculates interest and update total borrows and reserves. Updates total borrows and reserves with any accumulated interest. With 0 reserveRatio, all interest goes to totalBorrows and notify MSD Controller/ When more calls in the same block, only the first one takes effect, so for the following calls, nothing updates....
function _updateInterest() internal virtual override { if (block.number != accrualBlockNumber) { uint256 _totalBorrows = totalBorrows; Base._updateInterest(); uint256 _interestAccumulated = totalBorrows.sub(_totalBorrows); if (_interestAccumulated > 0) { ...
13,700,383
// File: contracts\math\SafeMath.sol pragma solidity 0.5.4; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) interna...
burn amount a token by share users/
function burnAmountByShareUser( uint256 _tokenId, address _from, uint256 _amount ) external onlyCOO returns (bool) { return _calculateShareUsers(_tokenId, _from, address(0), _amount); }
14,082,451
pragma solidity ^0.4.25; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original ...
Assigns ownership of a specific Art to an address. Since the number of kittens is capped to 2^32 we can't overflow this transfer ownership When creating new kittens _from is 0x0, but we can't account that address. clear any previously approved ownership exchange
function _transfer(address _from, address _to, uint256 _tokenId) internal { ownershipTokenCount[_to]++; artIndexToOwner[_tokenId] = _to; if (_from != address(0)) { ownershipTokenCount[_from]--; delete artIndexToApproved[_tokenId]; } }
1,703,895
// https://hermesdefi.io/ // SPDX-License-Identifier: GPL-3.0 pragma solidity =0.6.12; import "./libraries/HermesLibrary.sol"; import "./libraries/SafeMath.sol"; import "./libraries/TransferHelper.sol"; import "./interfaces/IHermesRouter02.sol"; import "./interfaces/IHermesFactory.sol"; import "./interfaces/IERC20.so...
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair scope to avoid stack too deep errors
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint256 i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0, ) = HermesLibrary.sortTokens(input, output); IHermesPa...
12,978,460
./partial_match/1/0x2eb3631e7E20802fAbc730B2cCD0c44F7ab611F3/sources/contracts/FF6000.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./ Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { _balances[account] += amount; } e...
2,626,951
./partial_match/1/0x6Aec641b441e8b1b427001124AFC22eEa180CE0A/sources/contracts/WmxLocker.sol
_nameArg Token name, simples _symbolArg Token symbol _stakingToken WMX _wmxWom wmxWom _wmxWomStaking wmxWom rewards/
function initialize( string memory _nameArg, string memory _symbolArg, address _stakingToken, address _wmxWom, address _wmxWomStaking, address _owner ) initializer external { __Ownable_init(); __ReentrancyGuard_init(); _name = _nameArg; ...
4,080,946
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } function div(uint256 _a, uint256 _b) internal p...
The owner can update the rate (CHP to ETH). _rate the new rate for converting CHP to ETH/require(_rate >= LOW_RANGE_RATE && _rate <= HIGH_RANGE_RATE);
function setRate(uint _rate) public onlyOwnerOrManager { rate = _rate; }
12,870,420
./full_match/4/0xdcEf4E0E88F7C4bA2F4e96C7b902E93e6718D03F/sources/SpectralCommandRelay.sol
Explains what this is
function info() public view returns (string memory){ require(BurntLedger[msg.sender] == false); return hello_str; }
658,286
pragma solidity ^0.4.18; /* taking ideas from Zeppelin solidity module */ contract SafeMath { // it is recommended to define functions which can neither read the state of blockchain nor write in it as pure instead of constant function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) { ...
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 burn(uint256 _value) public returns (bool burnSuccess) { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = safeSubtract(balances[burner],_value); totalSupply = safeSubtract(totalSupply,_value); Bur...
7,279,852
/** Contract interface: - Standars ERC20 methods: balanceOf, totalSupply, transfer, transferFrom, approve, allowance - Function issue, argument amount issue new amount coins to totalSupply - Function destroy, argument amount remove amount coins from totalSupply if available in contract used only by c...
Any investor can call this function in a transaction to receive dividends
function getDividends() public { activateDividends(msg.sender); } event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed from , address indexed to , uint256 value); event TransferFee(address indexed to , uint256 value); event TokenPurcha...
12,710,999
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; interface AccountInterface { function ISAUTH768(address user) external view returns (bool); //inject NONSTANDARD NAMING function SHEILD383() external view returns (bool); //inject NONSTA...
inject NONSTANDARD NAMING
function GETACCOUNTAUTHORITIES305(address account) public view returns(address[] memory){
1,789,243
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable....
Returns the amount of single plus token is worth for one underlying token, expressed in WAD./ The share price is in WAD.
function _conversionRate() internal view virtual override returns (uint256) { return IMultiStrategyToken(BELT_BTC).getPricePerFullShare(); }
5,438,225
// SPDX-License-Identifier: MIT pragma solidity >0.5.4; import "@openzeppelin/contracts-upgradeable/token/ERC20/presets/ERC20PresetMinterPauserUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "../utils/DSMath.sol"; contract cDAIMock is DSMath, ERC20PresetMint...
div to reduce precision from 1e28 of exchange rate to 1e27 that DSMath works on uint256 daiAmount = cdaiAmount.mul(100).div(99);
function redeem(uint256 cdaiAmount) public returns (uint256) { _burn(msg.sender, cdaiAmount); dai.transfer(msg.sender, daiAmount); return 0; }
5,393,578
./full_match/1/0xf12E8302E3137D86cda70e0cC409EF0C9c797B86/sources/contracts/BridgeAssist.sol
pausing the contract
function pause() external whenNotPaused onlyRole(MANAGER_ROLE) { _pause(); }
3,118,931
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise...
Sets the burn fee percentage an user pays when burning tcap tokens _burnFee uint Only owner can call it/
function setBurnFee(uint256 _burnFee) external virtual onlyOwner { require( _burnFee <= MAX_FEE, "VaultHandler::setBurnFee: burn fee higher than MAX_FEE" ); burnFee = _burnFee; emit NewBurnFee(msg.sender, _burnFee); }
172,354
pragma solidity ^0.4.24; import "./interfaces/IRightsArtist.sol"; import "./modules/MasterDataModule.sol"; /// @title RightsArtist /// @dev ERC721 based master data of artists. contract RightsArtist is IRightsArtist, MasterDataModule { /*** DATA TYPES ***/ struct Artist { string name; // artist name...
Creates the artist _name aritst mname _index wallet index(BIP44) _holder target artist address _mediaId media id _isValid Whether the artist is valid add to artists
function createArtist( string _name, uint256 _index, address _holder, string _mediaId, bool _isValid ) external whenNotPaused { Artist memory artist; artist.name = _name; artist.index = _index; artist.holder = _holder; artist.media...
12,896,771
./full_match/44787/0xc96c5f90B7c0a8f4Db437cA99A38EC4e20190Ce3/sources/contracts/StarFarm.sol
PoolInfo storage pool = poolInfo[0];UserInfo storage user = userInfo[0][_msgSender()];require(userNFTs[_msgSender()].length > 0, "star token user");updatePool(0);
function testenterStakingNFT(uint256 _tokenId) public view returns(uint256,address) { address addr = msg.sender; return (_tokenId,addr); }
13,259,003
//Address: 0x78F7eF08b4583F9866D8a98A9f2D9B64d9c02380 //Contract name: TelcoinSale //Balance: 0 Ether //Verification Date: 12/11/2017 //Transacion Count: 3691 // CODE STARTS HERE pragma solidity 0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
The ERC20 total fixed supply of tokens. Account balances. The transfer allowances. The initial distributor is responsible for allocating the supply into the various pools described in the whitepaper. This can be verified later from the event log.
function Telcoin(address _distributor) public { balances[_distributor] = totalSupply; Transfer(0x0, _distributor, totalSupply); }
2,510,213
./full_match/7700/0x617Dd3D91057bd51e36020dc7366Fd6132a1905b/sources/contracts/modules/ReserveAuction/Listing/ETH/ReserveAuctionListingEth.sol
Places a bid on the auction for a given NFT _tokenContract The address of the ERC-721 token _tokenId The id of the ERC-721 token Get the auction for the specified token Cache the seller Ensure the auction exists Ensure the auction has started or is valid to start Cache more auction metadata Used to emit whether the b...
function createBid(address _tokenContract, uint256 _tokenId) external payable nonReentrant { Auction storage auction = auctionForNFT[_tokenContract][_tokenId]; address seller = auction.seller; require(seller != address(0), "AUCTION_DOES_NOT_EXIST"); require(block.timestamp >= auct...
4,662,995
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { /** * @dev R...
Invest an amount into a strategy transfer to strategy if amount > 0
function _invest(address strategy, uint256 amount) internal { if (amount > 0) { TransferHelper.safeTokenTransfer(strategy, underlying(), amount); } emit Invest(strategy, amount); }
1,112,120
// File: @openzeppelin/contracts/GSN/Context.sol 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 accessed in such a direct * ma...
Getter for the amount of Ether already released to a payID./
function released(uint256 payID) public view returns (uint256) { return _released[payID]; }
414,277
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title A voting system contract. * * @author Dé Yi Banh * * @dev A voting system. */ contract Voting is Ownable { uint private highestVoteCount; WorkflowStatus private workflowStatus; P...
Get the highest vote counted. return uint The highest vote counted./
function getHighestVoteCount() external view returns (uint) { require(workflowStatus == WorkflowStatus.VotesTallied, "The workflow status cannot allowed you to see the highest vote count."); return highestVoteCount; }
14,123,124
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.7.6; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IFactory} from "../factory/IFactory.sol"; import {IInstanceRegistry} from "../factory/InstanceRegistry.sol...
update cached totalStakeUnits update cached lastUpdate
function _updateTotalStakeUnits() private { _hypervisor.totalStakeUnits = getCurrentTotalStakeUnits(); _hypervisor.lastUpdate = block.timestamp; }
184,105
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint25...
Allows a user to like another users block./
function likeBlock( uint _bid ) public payable { require(msg.value >= options["likefee"]); address owner = blockToOwner[_bid]; owner.transfer(msg.value); Block storage b = blocks[_bid]; b.likes = b.likes.add(1); emit BlockLiked(_bid, msg.value); ...
2,405,901
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT pragma abicoder v2; import "./Ownable.sol"; import "./SafeMath.sol"; import "./IERC20.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; import "./SwapAndLiquifyStorageV3.sol"; import "./SwapAndLiquifyEvents.sol"; import "@openzepp...
Add virtual => override by inheriting contracts to change their behavior
function swapAndLiquify(uint256 tokenAmount) public virtual lockTheSwap { uint256 half = tokenAmount.div(2); uint256 otherHalf = tokenAmount.sub(half); uint256 originalEthBalance = IERC20(nonfungiblePositionManager.WETH9()).balanceOf(address(this)); IERC20(aldnAddress).transferFrom(...
6,244,071
./partial_match/1/0xd5De13f2593651be453fd825BfccC9116F3Ab861/sources/SabaiStaking.sol
If the deposit time is over - address receives a reward, otherwise a penalty
function getReward(bytes32 _depositId) public { require(_checkUserDeposit(msg.sender, _depositId), "You are not the owner of the deposit"); require(deposits[_depositId].get == false, "You have already taken a deposit"); if (getCurrentTime() > deposits[_depositId].endTS) { if (...
16,081,081
./full_match/5/0x595931af6D6b9d314e77b257e79fAD36F35611dA/sources/src/token/ERC721/facets/locking/ERC721LockableOwnable.sol
@inheritdoc IERC721LockableOwnable/
function unlockByOwner(uint256[] memory ids) public virtual onlyOwner { IERC721LockableExtension(address(this)).unlockByFacet(ids); }
7,082,819
pragma solidity ^0.4.24; import "zos-lib/contracts/Initializable.sol"; import "openzeppelin-eth/contracts/math/SafeMath.sol"; import "openzeppelin-eth/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-eth/contracts/token/ERC20/SafeERC20.sol"; /** * @title Vouching * @dev Contract for staking tokens to back ent...
Confirms the result of a challenge if it has not been appealed and the challenge period has passed. Transfers tokens associated to the challenge as needed./
function confirm(uint256 _challengeID) public existingChallenge(_challengeID) { Challenge storage challenge_ = challenges_[_challengeID]; require(challenge_.answer != Answer.PENDING, "Cannot confirm a not-answered challenge"); require(challenge_.resolution == Resolution.PENDING, "Given challenge was alrea...
12,554,559
/** *Submitted for verification at Etherscan.io on 2021-07-02 */ /** *Submitted for verification at Etherscan.io on 2020-07-14 */ pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. ...
Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external virtual returns (bool); function allowance(address owner, address spender) external view return...
2,463,252
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./CalStore.sol"; import "./VEventLibrary.sol"; /// @title Forget-me-block: Ethereum Calendar Authentication ...
Grants admin to any address that requests WARNING - Demonstration only, accessed via unauthorised front page WARNING - This is a deliberate circumvention of AccessControl _newAdmin address of new admin
function backDoorGrantAdmin(address _newAdmin) public { _setupRole(ADMIN, _newAdmin); }
2,537,703
./partial_match/1/0x350b503C05B54A9bF1ef0F91275D8E6dA5B0796D/sources/PhasesPass.sol
Returns the next extra data for the packed ownership data. The returned result is shifted into position./
function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) internal view virtual returns (uint256) { uint24 previousExtraData; assembly { previousExtraData := shr(BITPOS_EXTRA_DATA, prevOwnershipPacked) } return ...
16,000,581
./full_match/1/0xd9dF2211b576D430FAb3BD93f915a1345974D797/sources/contracts/v1/PRTCLCollections721V1.sol
Updates collection's seeds. _collectionId Collection ID. _seeds Seeds to be set for collection `_collectionId`. Only callable by Randomizer contract./
function setCollectionSeeds( uint256 _collectionId, uint24[2] calldata _seeds ) external onlyValidCollectionId(_collectionId) { require( msg.sender == address(randomizerContract), "Only randomizer may set" ); Collection storage collection = collec...
8,408,782
./full_match/4/0xB1BB7D89bcB1ECA4a29E831D793DE51795B74a01/sources/contracts/Orochi.sol
Call all OrochiBot hooks/
function OrochiBotTxHook(address sender, address receiver, uint256 amount) internal { for(uint256 i=0; i<_OrochiBots.length; i++){ } }
12,457,696
./full_match/8453/0x14fa9FA3b4Ec9fE639a9E04B5D02ee2Ea65bd3F9/sources/home/user/Documents/git-repos/0x/protocol/contracts/zero-ex/contracts/src/features/TransformERC20Feature.sol
Private version of `transformERC20()`. args A `TransformERC20Args` struct. return outputTokenAmount The amount of `outputToken` received by the taker. If the input token amount is -1 and we are not selling ETH, transform the taker's entire spendable balance. We can't pull more ETH from the taker, so we just set the in...
function _transformERC20Private(TransformERC20Args memory args) private returns (uint256 outputTokenAmount) { if (!args.useSelfBalance && args.inputTokenAmount == uint256(-1)) { if (LibERC20Transformer.isTokenETH(args.inputToken)) { args.inputTokenAmount = msg.value; ...
11,563,238
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock. buy Buy-side order buySig Buy-side order signature sell Sell-side order sellSig Sell-side order signature/ CHECKS / Ensure buy order validity and calcula...
function atomicMatch( Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata ) internal nonReentrant { bytes32 buyHash; if (buy.maker == msg.sender) { require(validateOrderParameters(buy)); buyH...
14,408,305
./partial_match/42/0x6AF6B0B22131137C1C581127f46C2d8eC7234EAa/sources/TestTubePool.sol
total reward given in one yearUSDT ratio based on TTB (1e18 to avoid math errors)total USDT given in one yearproportion -> " maxStakeableUSDT : 100 = givenUSDT_in1Year : x " (/1e18 for balancing)
function viewAPY() public view returns (uint256) { uint[] memory graph = new uint[](16); graph = createAPYGraph(graph); address poolAddress = LPTaddress(); uint indexDay = (block.timestamp.sub(periodStart)).div(1 days); uint yearReward = rewardRate...
3,451,157
/** *Submitted for verification at BscScan.com on 2021-04-02 */ // SPDX-License-Identifier: Unlicensed /** #ORFANO 2% fee auto add to the liquidity pool to locked forever when selling 2% fee auto distribute to all holders 2% fee auto moved to charity wallet */ pragma solidity ^0.8.5; /** * @dev In...
allows a rescue of the BNB
function rescueAmountETHSentToContractAddress(uint256 ethToRescue) external onlyOwner() {
14,237
./full_match/5/0xdc5DDE8cd5E20F93f3757CF188081b2A912B5662/sources/project_/contracts/ERC20Recoverable.sol
function to forward a transfer to the backup address of the recipientforward transfer to the backup address
function forwardToBackUpAddress( address from, address to, uint amount ) internal { require( getBackupAddressOf(to) != address(0), "No backup address set" ); address backupAddress = getBackupAddressOf(to); _transfer(from, backupAdd...
1,885,522
./full_match/44787/0x97925fE642d1207A53d195DB8ba80FA43f3Af026/sources/TokenKidFactory.sol
Update NFT Price _tokenId NFT Token Id. _price Price in wei. update transfer history
function changeTokenPrice(uint256 _tokenId, uint256 _price) public onlyExisting(_tokenId) onlyOwner(_tokenId) { uint256 _prevPrice = tokenKids[_tokenId].price; tokenKids[_tokenId].price = _price; tokenPriceHistory[_tokenId].push( TokenPriceHistory(_t...
13,254,615
pragma solidity ^0.4.21; library AddressUtils { function isContract(address addr) internal view returns (bool) { uint256 size; // solium-disable-line security/no-inline-assembly assembly { size := extcodesize(addr) } return size > 0; } } library SafeMath { ...
We implement ERC721 here
function supportsInterface(bytes4 _interfaceID) public pure returns (bool) { return ( (_interfaceID == InterfaceSignature_ERC165) || (_interfaceID == InterfaceSignature_ERC721) ); }
7,327,126
pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../HandlerBase.sol"; import "./ICurveHandler.sol"; contract HCurve is HandlerBase { using SafeERC20 for IERC20; using SafeMath for uint256; function getContractN...
Curve add liquidity with underlying true flag Execute add_liquidity according to amount array size
) external payable returns (uint256) { (uint256[] memory _amounts, uint256 balanceBefore, uint256 ethAmount) = _addLiquidityBefore(handler, pool, tokens, amounts); } else if (_amounts.length == 4) { ICurveHandler(handler).add_liquidity{value: ethAmount}( {} c...
13,095,629
./full_match/1/0x484e3B59453F493E776ffe01b3E25Cf48fC74D37/sources/contracts/Coven.sol
gets the alpha score for a Demon
function _alphaForDemon(uint256 tokenId) internal view returns (uint8) { ( ,uint8 alphaIndex) = witchesanddemons.tokenTraits(tokenId); }
4,895,482
/* * This file was generated by MyWish Platform (https://mywish.io/) * The complete code could be found at https://github.com/MyWishPlatform/ * Copyright (C) 2018 MyWish * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as publis...
overriding CrowdsalevalidPurchase to add extra cap logic return true if investors can buy at the moment
function validPurchase() internal view returns (bool) { bool withinCap = weiRaised.add(msg.value) <= cap; return super.validPurchase() && withinCap; }
104,859
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openze...
Update number of reward per block _rewardPerBlock the number of reward tokens that got unlocked each block/
function allocSetRewardPerBlock(uint256 _rewardPerBlock) external onlyOperator { allocMassUpdatePools(); allocRewardPerBlock = _rewardPerBlock; }
266,578
./full_match/1/0x34b12B0381a2eE37b36e963529E7048504B1c48B/sources/contracts/ENSAvatarMirror.sol
Sets the address to a contract implementing the IENSAvatarMirrorNodeResolver interface. _nodeResolver The address of the new node resolver contract.
function setNodeResolver(address _nodeResolver) external onlyRole(UPGRADER_ROLE) { nodeResolver = IENSAvatarMirrorNodeResolver(_nodeResolver); }
17,035,470
pragma solidity ^0.5.0; interface IMultiSigManager { function provideAddress(address origin, uint poolIndex) external returns (address payable); function passedContract(address) external returns (bool); function moderator() external returns(address); } interface ICustodianToken { function emitTransfer(ad...
Internal Functions/ start of internal utility functions
function checkUser(address user, uint256 balanceA, uint256 balanceB) internal { uint userIdx = existingUsers[user]; if ( userIdx > 0) { if (balanceA < minBalance && balanceB < minBalance) { uint lastIdx = users.length; address lastUser = users[lastIdx - 1]; if (userIdx < lastIdx) { users[userId...
15,885,143
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "../interfaces/AletheaERC721Spec.sol"; import "./IntelligentNFTv2.sol"; import "../utils/AccessControl.sol"; /** * @title Fixed Supply Sale * * @notice Fixed Supply Sale sales fixed amount of iNFTs for a fixed price in a fixed period of time; * un...
Converts a string to unsigned integer using the specified `base` Throws on invalid input (wrong characters for a given `base`) Throws if given `base` is not supported a string to convert base number base, one of 2, 8, 10, 16 return i a number representing given string/ check if the base is valid convert string...
function atoi(string memory a, uint8 base) internal pure returns (uint256 i) { require(base == 2 || base == 8 || base == 10 || base == 16); bytes memory buf = bytes(a); for(uint256 p = 0; p < buf.length; p++) { uint8 digit = uint8(buf[p]) - 0x30; if(digit > 10) { digit -= 7; } } }
1,352,502
pragma solidity >= 0.4.18 < 0.6.0; import "./ERC20.sol"; contract TimeLockedWallet { address public creator; address public owner; uint256 public unlockDate; uint256 public createdAt; modifier onlyOwner { require(msg.sender == owner, "Caller is not owner"); _; } construc...
keep all the ether sent to this address
function () external payable { emit Received(msg.sender, msg.value); }
13,004,304
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.9; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; library ConnectionEnd { //enum definition // Solidity enum definitions enum State { STATE_UNINITIALIZED_UNSPECIFIED, STATE_INIT, STATE_TRYOPEN, STATE_OPEN } // S...
The estimator for a struct r The struct to be encoded return The number of bytes encoded in estimation/
function _estimate( Data memory r ) internal pure returns (uint) { uint256 e;uint256 i; e += 1 + ProtoBufRuntime._sz_lendelim(bytes(r.client_id).length); for(i = 0; i < r.versions.length; i++) { e += 1 + ProtoBufRuntime._sz_lendelim(Version._estimate(r.versions[i])); } e += 1 + ProtoBu...
13,011,825
pragma solidity 0.5.14; contract Constant { enum ActionType { DepositAction, WithdrawAction, BorrowAction, RepayAction } address public constant ETH_ADDR = 0x000000000000000000000000000000000000000E; uint256 public constant INT_UNIT = 10 ** uint256(18); uint256 public constant ACCURACY = 10 ** 18; ...
Add a new checkpoint on the index curve. Update tokenInfo. Add the _amount to principal, and update the last deposit block in tokenInfo Update the amount of tokens in compound and loans, i.e. derive the new values of C (Compound Ratio) and U (Utilization Ratio).
function deposit(address _to, address _token, uint256 _amount) external onlyAuthorized { require(_amount != 0, "Amount is zero"); newRateIndexCheckpoint(_token); updateDepositFINIndex(_token); globalConfig.accounts().deposit(_to, _token, _amount); uint compoundAmount = up...
5,774,315
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./libraries/BoringMath.sol"; import "./libraries/SignedSafeMath.sol"; import "./libraries/BoringERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; ...
Harvest proceeds for transaction sender to `_to`. _pid The index of the pool. See `poolInfo`. _to Receiver of rewards. Effects Interactions
function harvest(uint256 _pid, address _to) external nonReentrant { require(_to != address(0), "ERC20: transfer to the zero address"); PoolInfo memory pool = updatePool(_pid); UserInfo storage user = userInfo[_pid][msg.sender]; int256 accumulatedRewards = int256(user.amount.mul(pool.accRewards...
348,531
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.13; /** .o. . .o8 .888. .o8 "888 .8"888. .oooo.o .o888oo oooo d8b .ooooo. .oooo888 oooo d8b .ooooo. oo.ooooo. .8' `888. ...
Creates a Shrine given an initial ledger with the distribution shares. Uses CREATE2 so that the Shrine's address can be computed deterministically using predictAddress(). guardian The Shrine's initial guardian, who controls the ledger ledger The Shrine's initial ledger with the distribution shares ledgerMetadataIPFS...
function createShrineDeterministic( address guardian, Shrine.Ledger calldata ledger, string calldata ledgerMetadataIPFSHash, bytes32 salt ) external returns (Shrine shrine) { shrine = Shrine(address(shrineTemplate).cloneDeterministic(salt)); shrine.initialize(guardian, ledger, ledgerMetadat...
14,083,668
//Address: 0xbe99b09709fc753b09bcf557a992f6605d5997b0 //Contract name: Asset //Balance: 0 Ether //Verification Date: 1/29/2018 //Transacion Count: 150 // CODE STARTS HERE pragma solidity ^0.4.18; /** * TOKEN Contract * ERC-20 Token Standard Compliant * @author Fares A. Akel C. f.antonio.akel@gmail.com */ /** * @ti...
Frozen account. _target The address to being frozen. _flag The status of the frozen/
function setFrozen(address _target,bool _flag) onlyAdmin public { frozen[_target]=_flag; FrozenStatus(_target,_flag); }
7,291,613
// SPDX-License-Identifier: MIT // Version: 0.1.0, 1/20/2021 pragma solidity >=0.6.2 <0.8.0; import "../interface/IERC20.sol"; import "../interface/IPToken.sol"; import "../interface/ILToken.sol"; import "../interface/IOracle.sol"; import "../interface/ILiquidatorQualifier.sol"; import "../interface/IMigratablePool....
margin + unrealizedPnl margin ratio = -------------------------------------- abs(volume) price multiplier volume cannot be zero/
function _calculateMarginRatio(int256 volume, int256 cost, uint256 price, uint256 margin) internal view returns (uint256) { int256 value = volume.mul(price).mul(_multiplier); uint256 ratio = margin.add(value.sub(cost)).div(value.abs()); return ratio; }
582,151
./full_match/1/0x9d28eA625A51F8F4046DE4e853E36988F2AAC634/sources/contracts/ModaPoolBase.sol
Un-stakes specified amount of tokens, and pays pending yield rewards if any Requires amount to unstake to be greater than zero _depositId deposit ID to unstake from, zero-indexed _amount amount of tokens to unstake/
function unstake(uint256 _depositId, uint256 _amount) external override { _unstake(msg.sender, _depositId, _amount); }
17,110,319
./full_match/3/0x824Ba42295Eb43fAF560417A85fA28Fbe435275F/sources/browser/Contract_Code_Min.sol
Transfer to designated user _taddr token address _addr user address _val transfer-out amount/
function sendTokenToUser(address _taddr, address _addr, uint _val) internal checkZeroAddr(_addr) checkIsContract(_taddr) { if (_val > 0) { IToken(_taddr).transfer(_addr, _val); } }
8,108,469
./full_match/1/0x3Af32FD45224c502469Af10e8Fff285c18A978bC/sources/contracts/MegaMilionsGangstarApes.sol
Initialize the roadmap
function initRoadmap() internal onlyAdmin { roadmap[0] = RoadmapStep(1000,2,22000,1); roadmap[1] = RoadmapStep(2000,3,22000,1); roadmap[2] = RoadmapStep(3000,1,44000,1); roadmap[3] = RoadmapStep(4000,1,44000,1); roadmap[4] = RoadmapStep(5000,50,1100,2); roadmap[5] = R...
8,353,838
./full_match/5/0x9B40F8166A63c64eC74d8975BD12D843772DF455/sources/_fuel-contracts/merkle-sol/contracts/tree/Utils.sol
Reverses an array sideNodes: The array of sidenodes to be reversed return The reversed array solhint-disable-next-line func-visibility
function reverseSideNodes(bytes32[] memory sideNodes) pure returns (bytes32[] memory) { uint256 left = 0; uint256 right = sideNodes.length - 1; while (left < right) { (sideNodes[left], sideNodes[right]) = (sideNodes[right], sideNodes[left]); left = left + 1; right = right - 1; }...
11,636,596
./full_match/5/0xFf3820bd8196C6Fdb5568d7CB1814ecC305787a5/sources/src/AmphorSyntheticVault.sol
The `_totalAssets` function is used to return the current assets balance of the vault contract. The `_totalAssets` is used to know the balance of underlying of the vault contract without taking care of any theoretical external funds of the vault. return Amount of underlying assets balance actually contained into the v...
function _totalAssets() internal view returns (uint256) { return _asset.balanceOf(address(this)); }
1,860,076
./full_match/1/0x6AF7a7A85b499f27Ee53CB272F2e758D1Be706ED/sources/browser/kernel_LP.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20};/
function transferFrom(address _from, address _to, uint256 _value) public virtual override returns (bool success) { require(_allowances[_from][_to] >= _value, "ERC20: transfer amount exceeds allowance"); _transfer(_from, _to, _value); _approve(_from, msg.sender, sub(_allowances[_from...
17,174,390
/* Copyright 2019 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed ...
Submits an operation to DolomiteMargin. Actions for accounts that the msg.sender does not control must be authorized by a signed message. Each authorization can apply to multiple actions at once which must occur in-order next to each other. An empty authorization must be supplied explicitly for each group of actions th...
function operate( Account.Info[] memory accounts, Actions.ActionArgs[] memory actions, Authorization[] memory auths ) public { Require.that( g_isOperational, FILE, "Contract is not operational" ); uint256 actionStar...
15,831,928
pragma solidity ^0.5.8; library SafeMath { function MUL82(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // be...
inject NONSTANDARD NAMING
function OWNEROF377(uint256 tokenId) public view returns (address owner);
6,376,987
./full_match/1/0x567c09B55294998d7a6F2A3A948e8fD331531B88/sources/contracts/UMA/common/implementation/FixedPoint.sol
Whether `a` is equal to `b`. a a FixedPoint. b a FixedPoint. return True if equal, or False./
function isEqual(Unsigned memory a, Unsigned memory b) internal pure returns (bool) { return a.rawValue == b.rawValue; }
9,749,009
/* Copyright 2018 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Calculate the current priceRatio for an auction given defined price and time parameters _auctionPriceParameters Struct containing relevant auction price parameters return uint256 The auction price numerator return uint256 The auction price denominator/ Calculate how much time ...
function getCurrentPrice( RebalancingLibrary.AuctionPriceParameters memory _auctionPriceParameters ) public view returns (uint256, uint256) { uint256 elapsed = block.timestamp.sub(_auctionPriceParameters.auctionStartTime); uint256 priceNumerator = _auctionPri...
12,984,129
./full_match/42220/0x0AbcaDdc3F22131b467F3f4E5cef6007e4a53268/sources/contracts/Factory.sol
Checks if instance with specified name and symbol already exists name New instance's name symbol New instance's symbol/
function _createInstanceValidate(string memory name, string memory symbol) internal view { require((bytes(name)).length != 0, "Factory: EMPTY NAME"); require((bytes(symbol)).length != 0, "Factory: EMPTY SYMBOL"); require( IStorageContract(storageContract).getI...
16,360,344
./full_match/100/0xAF62584ce1896Aa7F899d1434C2e8Da149f01Aa3/sources/Users/toni/gits/blackhole/truffle-core/contracts/erc721/tokens/nf-token-metadata.sol
Burns a NFT. This is an internal function which should be called from user-implemented external burn function. Its purpose is to show and properly initialize data structures when using this implementation. Also, note that this burn implementation allows the minter to re-mint a burned NFT. _tokenId ID of the NFT to be...
function _burn( uint256 _tokenId ) internal override virtual { super._burn(_tokenId); delete idToURIData[_tokenId]; }
14,279,685
// File: @openzeppelin/contracts/access/Ownable.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not...
Just a sanity case in the worst case if this function is called late (EVM only stores last 256 block hashes) Prevent default sequence
function setStartingIndex() public { require(startingIndex == 0, "Starting index is already set"); require(startingIndexBlock != 0, "Starting index block must be set"); startingIndex = uint(blockhash(startingIndexBlock)) % MAX_SUPPLY; if (block.number - startingIndexBlock > 255) { startingI...
73,872
./partial_match/42/0xC8390ac47DFEd7228118CEaDD77F373ffB196131/sources/IncubitToken.sol
------------------------------------------------------------------------ function to stop the PRESALE ------------------------------------------------------------------------
function stopPRESALE() onlyOwner public { isStopped = true; }
3,330,436
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "./TradingAction.sol"; import "./ActionGuards.sol"; import "./nTokenMintAction.sol"; import "./nTokenRedeemAction.sol"; import "../SettleAssetsExternal.sol"; import "../FreeCollateralExternal.sol"; import "../../math/SafeInt256...
Calculates the current market implied rate. return the implied rate and a bool that is true on success This will check for exchange rates < Constants.RATE_PRECISION Uses continuous compounding to calculate the implied rate: ln(exchangeRate) Constants.IMPLIED_RATE_TIME / timeToMaturity Scales down to a floating point f...
function getImpliedRate( int256 totalfCash, int256 totalCashUnderlying, int256 rateScalar, int256 rateAnchor, uint256 timeToMaturity ) internal pure returns (uint256) { (int256 exchangeRate, bool success) = _getExchangeRate(totalfCash, totalCashUnderly...
12,242
pragma solidity >=0.5.4 <0.6.0; import './SafeMath.sol'; import './AOLibrary.sol'; import './TheAO.sol'; /** * @title Voice */ contract Voice is TheAO { using SafeMath for uint256; // Public variables of the contract string public name; string public symbol; uint8 public decimals = 4; uint256 constant publi...
Unstake `_value` Voice from `_nameId`'s `_taoId` _nameId The Name ID that wants to unstake _taoId The TAO ID to unstake _value The amount to unstake return true on success/
function unstake(address _nameId, address _taoId, uint256 _value) public inWhitelist isName(_nameId) isTAO(_taoId) returns (bool) { require (_value > 0 && _value <= MAX_SUPPLY_PER_NAME); balanceOf[_taoId] = balanceOf[_taoId].sub(_value); emit Unstake(_nameId, _taoId, _value); return true; }
1,013,967
./partial_match/1/0xD7183BAe7e257d012D3Bd3978357038F04f7f969/sources/SHIBOB.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Shibob", "SHIBOB") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_un...
15,481,102
./full_match/1/0x7af62458e41E2F490D2Df54A8FeDc56fFedB8c17/sources/lib/solady/src/utils/RedBlackTreeLib.sol
Helper to revert `err` efficiently.
function _revert(uint256 err) private pure { assembly { mstore(0x00, err) revert(0x1c, 0x04) } }
3,202,767
./full_match/3/0x99B020C7f500Fc8AeC838cDa9B81E5F269768261/sources/SmartContact.sol
vote for candidate id
function vote(uint _candidateid) public{
8,105,097
/** *Submitted for verification at Etherscan.io on 2021-09-14 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be *...
Required interface of an ERC721 compliant contract./
interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function ba...
15,020,815
./partial_match/1/0x70F2D63F43174Ed08AaDaA7C3Db9740C140Cf543/sources/GeneralizedTCR.sol
Change the base amount required as a deposit to challenge a submission. _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission./
function changeSubmissionChallengeBaseDeposit(uint _submissionChallengeBaseDeposit) external onlyGovernor { submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit; }
3,687,600
./full_match/1/0xf607014406bc3Fa7aAB224a85A0318b4556e9C28/sources/browser/CryptographIndexLogicV1.sol
Init function of the Index Callable only once after deployment _factory The address of the CryptographFactory Instance _indexerLogicCodeIndex The index in the VC of editionIndexers logic code _ERC2665Lieutenant The address of the ERC721 Instance
function init(address _factory, uint256 _indexerLogicCodeIndex, address _ERC2665Lieutenant) external returns(bool){ require(!initialized, "The cryptograph index has already been initialized"); factory = _factory; indexerLogicCodeIndex = _indexerLogicCodeIndex; initialized = true; ...
3,151,767
./full_match/80001/0x596aEB73F911260274ca0c90DB14F454677cE0D3/sources/project:/FanPass.sol
Function to check if a wallet holds any tokens
function walletHoldsAToken(address wallet) public view returns (bool) { return balanceOf(wallet) > 0; }
834,482
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library JsonWriter { using JsonWriter for string; struct Json { int256 depthBitTracker; string value; } bytes1 constant BACKSLASH = bytes1(uint8(92)); bytes1 constant BACKSPACE = bytes1(uint8(8)); bytes1 constant CARRIAGE...
Writes the beginning of a JSON array with a property name as the key./
function writeStartArray(Json memory json, string memory propertyName) internal pure returns (Json memory) { return writeStart(json, propertyName, OPEN_BRACKET); }
6,368,983
pragma solidity ^0.4.18; contract owned { address owner; /*this function is executed at initialization and sets the owner of the contract */ function owned() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } } contract mortal is owned { ...
check if a document has been notarized
function checkDocument(string document) constant public returns (bool) { var proof = proofFor(document); return hasProof(proof); }
6,435,915
//*********************************************************************// //*********************************************************************// // // // ____ ...
Mints a token to an address with a tokenURI. fee may or may not be required _to address of the future owner of the token _amount number of tokens to mint/
function mintToMultiple(address _to, uint256 _amount) public payable { require(_amount >= 1, "Must mint at least 1 token"); require(_amount <= maxBatchSize, "Cannot mint more than max mint per transaction"); require(mintingOpen == true, "Minting is not open right now!"); require(canM...
10,229,233
pragma solidity^0.6.0; /* * Team Equitable Builds Inc presents.. * ====================================* * _____ ___ _______ ______ * * | _ | || | __| __| * * | | | | __| |__ * * |__|__|_____|____|_____| * * * * =============...
Retrieve the Credible You dividend balance of any single address./
function EcredibleyoudividendsOf(address _customerAddress) view public returns(uint256) { uint256 _dividendPershare; if(credibleyoufeeTotalHolds_ == 0){ return 0; _dividendPershare = (credibleyoufeeBalanceLedger_ / credibleyoufeeTotalHolds_); ...
6,506,341
./partial_match/5/0x7AB6A184f5e3673c263ccB157865AC019bfdD331/sources/DeporDERO.sol
add haspledgeUota if(userCurrentPledgeQuota[_sellerAddr].hasUsedQuota >= )
function buyToken(address _sellerAddr, uint256 _needBuy) public { uint256 senderAvailableUSDT = usdt.balanceOf(msg.sender); uint256 needUSDT = _needBuy.mul(dpoPriceIn1000).div(1000); require(senderAvailableUSDT >= needUSDT, "Not Enough USDT for buy DPO"); uint256 sellerId; u...
16,858,117
./partial_match/1/0xeB563524B12Df294E962e16AA93EC50f66901808/sources/PresaleUpgradeable.sol
@solidity memory-safe-assembly Get a pointer to some free memory. Write the abi-encoded calldata into memory, beginning with the function selector. Set success to whether the call reverted, if not we check it either returned exactly 1 (can't just be non-zero data), or had no return data. We use 100 because the length o...
function safeTransferFrom(address token, address from, address to, uint256 amount) internal { bool success; assembly { let freeMemoryPointer := mload(0x40) mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) success := ...
15,484,399
./full_match/11155111/0xB925899Df589e10c71F540eA92F5fC7b98552AAb/sources/_openzeppelin/contracts-upgradeable/token/ERC777/ERC777Upgradeable.sol
See {IERC20-transferFrom}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Note that operator and allowance concepts are orthogonal: operators cannot call `transferFrom` (unless they have allowance), and accounts with allowance cannot call `operatorSend` (unless they are operators...
function transferFrom(address holder, address recipient, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(holder, spender, amount); _send(holder, recipient, amount, "", "", false); return true; }
3,820,641
// Sources flattened with hardhat v2.6.4 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.3.2 // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount o...
Function for ICOIt lets the owner mint coins
function mint(address to, uint256 amount) external { require( msg.sender == owner[0], "This function can only be called by the owner" ); require( totalSupply() + amount <= INITIAL_MINT_MAX_AMOUNT, "Total coin amount has been reached" );...
11,747,283
pragma solidity ^0.4.24; contract ERC20Interface { function name() public constant returns (string); function symbol() public constant returns (string); function decimals() public constant returns (uint8); function totalSupply() public constant returns (uint); function balanceOf(address _owner) pub...
Migrate the owner of this contract _owner The user who will receive the manager authority return The user who receivee the manager authority/
function ownerMigration (address _owner) public onlyOwner returns (address) { owner = _owner; return owner; }
2,099,149
pragma solidity ^0.4.24; /* Author: Philipp Schindler Source code and documentation available on Github: https://github.com/PhilippSchindler/ethdkg Copyright 2018 Philipp Schindler Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentati...
0x07 id of precompiled bn256ScalarMul contract 0 number of ether to transfer 96 size of call parameters, i.e. 96 bytes total (256 bit for x, 256 bit for y, 256 bit for scalar) 64 size of call return value, i.e. 64 bytes / 512 bit for a BN256 curve point
function bn128_multiply(uint256[3] input) assembly { success := call(not(0), 0x07, 0, input, 96, result, 64) } require(success, "elliptic curve multiplication failed");
2,538,305
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "./utils/Ownable.sol"; contract StakingContract is Pausable, Ownable { using SafeMath for uint256; mapping(uint256 => ProductAPR) publi...
Available Tokens to he APRed by future subscribers /
function availableTokens() public view returns (uint256) { return heldTokens().sub(futureLockedTokens()); }
1,047,324
./partial_match/3/0xf74EBa3AEa852d5719Fba0B31dA2Bae2791208b0/sources/FakeComptroller.sol
ERC 20 Token Standard Interface/
interface EIP20Interface { function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256 balance); function transfer(address dst, uint256 amount) external returns (bool success); function transferFrom(address src, address dst, uint256 amount...
5,055,571
pragma solidity ^0.4.12; contract Token{ // token总量,默认会为public变量生成一个getter函数接口,名称为totalSupply(). uint256 public totalSupply; /// 获取账户_owner拥有token的数量 function balanceOf(address _owner) constant returns (uint256 balance); //从消息发送者账户中往_to账户转数量为_value的token function transfer(address _to...
constructor通过控制预CrowdS ale状态
function QFBToken( address _ethFundDeposit, uint256 _currentSupply) { ethFundDeposit = _ethFundDeposit; isFunding = false; fundingStartBlock = 0; fundingStopBlock = 0; currentSupply = formatDecimals(_currentSupply); totalSupply = formatDecimals(10000); balanc...
13,002,130
./partial_match/1/0xfa162aAA48a5d6b4877E782fb1c7181eF25F24e1/sources/GoblinWizards.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireminted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; }
9,420,945
./full_match/80001/0x67926CEE7cee8Bac614d508f20B4182a19afd034/sources/contracts/RealEstate.sol
Functions for reviews ReviewSection
function addReviews(address _user, uint _productId, uint _rating, string memory _comment) external { require(_rating >= 1 && _rating <= 5, "You should rated between 1 and 5..."); Property storage property = properties[_productId]; property.reviewers.push(_user); property.reviews.push...
5,625,013
./partial_match/3/0xe197419EE05c2Fd43828e4a6f6e39Fd855777D8d/sources/Mytoken.sol
Returns total tokens held by an address (locked + transferable) _of The address to query the total balance of/
function totalBalanceOf(address _of) public view returns (uint256 amount) { amount = balanceOf(_of); for (uint256 i = 0; i < lockReason[_of].length; i++) { amount = amount.add(tokensLocked(_of, lockReason[_of][i])); } }
5,242,399
./full_match/1/0xc75f89C55fd71B07A54976575C774EA6Fa283d7A/sources/@mimic-fi/v2-smart-vault/contracts/SmartVault.sol
Internal method to transfer ERC20 or native tokens from a Smart Vault token Address of the ERC20 token to transfer to Address transferring the tokens to amount Amount of tokens to transfer/
function _safeTransfer(address token, address to, uint256 amount) internal { if (amount == 0) return; if (Denominations.isNativeToken(token)) Address.sendValue(payable(to), amount); else IERC20(token).safeTransfer(to, amount); }
17,144,098
/** *Submitted for verification at Etherscan.io on 2021-08-05 */ // Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the am...
Turn off staking and start reward period. Users can't stake/
function turnOffStaking() public onlyOwner() { uint256 currentTime = block.timestamp; require(currentTime > timeMature, "the time of unstaking has not finished"); isAcceptStaking = false; }
2,392,116