file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x35CB0fE6f49932A44f39934F47298E6D34680628/sources/contracts/pool/PoolMetadata.sol
Function to get current supply interest rate return Supply interest rate as 18-digit decimal
function getSupplyRate() external view returns (uint256) { BorrowInfo memory info = _accrueInterestVirtual(); return interestRateModel.getSupplyRate( cash(), info.borrows, info.reserves + info.insurance + (info.borrows - info.principal), reserveFactor + insuranceFactor ...
17,111,273
pragma solidity ^0.5.2; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOw...
Release one of the payee's proportional payment. account Whose payments will be released./
function _release(address payable account, uint256 payment) private { _released[account] = _released[account].add(payment); _totalReleased = _totalReleased.add(payment); _totalReleasedAllTime = _totalReleasedAllTime.add(payment); account.transfer(payment); emit PaymentReleas...
14,066,575
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.9.0; import "./Token.sol"; contract Hacker { address public hacker; modifier onlyHacker { require(msg.sender == hacker, "caller is not the hacker"); _; } constructor() public { hacker = payable(msg.sender); } function attack(address...
This will make underflow in target contract, so we can pass the balance checking
function attack(address _target, uint256 _amount) public onlyHacker { Token(_target).transfer(hacker, _amount); }
6,437,999
./partial_match/1/0xBc05A380eA84466E5A60fF337B81a2778F210321/sources/Router02.sol
given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) internal pure returns (uint256 amountB) { require(amountA > 0, "ZklabV1Library: INSUFFICIENT_AMOUNT"); require( reserveA > 0 && reserveB > 0, "ZklabV1Library: INSUFFICIENT_LIQUID...
3,612,547
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import './interfaces/IArchRouterImmutableState.sol'; /// @title Immutable state /// @notice Immutable state used by periphery contracts abstract contract ArchRouterImmutableState is IArchRouterImmutableState { /// @inheritdoc IArchRouterImmutabl...
calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); bytes32 initHash = factory == _SUSHI_FACTORY ? _SUSHI_ROUTER_INIT_HASH : _UNI_V2_ROUTER_INIT_HASH; pair = address( uint160( ...
11,683,174
./partial_match/1/0x4e3f56bB996ed91Ba8D97EA773d3F818730D1a6F/sources/SimpleTimelock.sol
solhint-disable-next-line not-rely-on-time
function release() public override { require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time"); require(msg.sender == 0xB65cef03b9B89f99517643226d76e286ee999e77); address recipient = 0x8dE82C4C968663a0284b01069DDE6EF231D0Ef9B; uint256 amount = ...
4,341,797
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "../upgrades/GraphUpgradeable.sol"; import "./GraphGovernanceStorage.sol"; /** * @title Graph Governance Contract * @notice Governance contract used to inscribe Graph Council and community votes. */ contract GraphGovernance is GraphGovernanceV1Storag...
Return whether the proposal is created. _proposalId Proposal identifier return True if the proposal is already created/
function isProposalCreated(bytes32 _proposalId) public view override returns (bool) { return proposals[_proposalId].votes != 0; }
7,238,481
pragma solidity ^0.4.19; contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) external view returns (address owner); function approve(address _to...
returns block number, after this block tournament is opened for admission
function getTournamentAdmissionBlock() public view returns(uint256) { uint256 admissionInterval = (ADMISSION_TIME / secondsPerBlock); return tournamentEndBlock < admissionInterval ? 0 : tournamentEndBlock - admissionInterval; }
5,942,378
// SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.22 <0.9.0; // Commercial Paper Token with exchange /** * The issuer is the entity issuing the commercial papers. Where the commercial papers are issued through a special purpose vehicle (SPV), * the promoter is the entity incorporating the SPV for t...
transferFrom : Transfer token after approval/
function transferFrom(address from, address to, uint tokens) public virtual override isAuthorized returns (bool success) { require(to != address(0), "Null address"); require(from != address(0), "Null address"); require(whitelisted[to],"recipient is...
12,625,674
./partial_match/42/0x9b0B75202cc30749448D0a10742e523601D22Cd3/sources/HTTokenOrbiterBank.sol
Get all fixed deposit durations and their interest rates. Get all fixed deposit durations and their interest rates. return _duration Fixed deposit duration. return _interest Interest rate for fixed deposit./
function getFDDurationAndInterest() external view returns (uint256[] memory _duration, uint256[] memory _interest) { for(uint256 i = 0; i < fdTfId.length; i++){ _duration[i] = fdTariffIdToInfo[fdTfId[i]].duration; _interest[i] = fdTariffIdToInfo[fdTfId[i]].interest; } } ...
8,934,764
contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier onlyOwner() { if (msg.sender != owner) { throw; } _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner...
Check is not needed because sub(_allowance, _value) will already throw if this condition is not met if (_value > _allowance) throw;
function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to...
1,793,891
./full_match/80001/0x57A88f6e773eE3901F20334bf0ED962D6479ABb6/sources/pacman/pacman.sol
Función para finalizar el juego y retirar el saldo restante Transfiere el saldo restante al ganador
function endGame() external onlyOwner { require(gameStarted, "El juego aun no ha comenzado."); winner = payable(address(0)); require(sent, "Failed to send Ether"); }
5,565,270
./full_match/137/0x3130Bf7c433C2b25b3E30882FDd22E885CD6A56e/sources/su.sol
Returns confirmation for 'safe' ERC-1155 transfers.
function onERC1155Received(address, address, uint256, uint256, bytes calldata) external pure returns (bytes4 sig) { }
3,745,580
pragma solidity ^0.4.24; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "zeppelin-solidity/contracts/ECRecovery.sol"; contract SimplePaymentChannel { using SafeMath for uint256; using ECRecovery for bytes32; //============================================================================ ...
============================================================================ INTERNAL FUNCTIONS============================================================================ check that the signature is from the payment sender
function isValidSignature(uint256 _balance, bytes _signedMessage) internal view returns (bool) { bytes32 message = prefixed(keccak256(abi.encodePacked(address(this), _balance))); return message.recover(_signedMessage) == sender; }
14,058,501
./full_match/8453/0xed2cA8333C91d9A58cC548a4E756DdEbF23c2d6f/sources/contracts/protocol/extensions/adapters/AUniswap.sol
@inheritdoc IAUniswap
function unwrapWETH9WithFee( uint256 amountMinimum, uint256 feeBips, address feeRecipient function unwrapWETH9WithFee( uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient function wrapETH(uint256 value) external { ...
11,560,743
pragma solidity ^0.4.22; /* The invader token for Matic is a yield farming token that farms the trading fees of the 0xBTC-MATIC pair on Maticswap. 1 Liquidity Pool (LP) token <==> 1 Invader (INV) token */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, ...
Do not allow Matic to enter/
function() external payable { revert(); }
13,084,426
./partial_match/1/0x46955ccEc435465C8C70BD64E2f5FFBd33308C8C/sources/InsurancePool.sol
View negative ledger token underlying asset address return negative ledger
function getInsNegative(address token) external view returns(uint256) { return insNegative[token]; }
4,268,496
pragma solidity ^0.4.24; contract HXevents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
updates masks for round and player when keys are bought return dust left over/ calc profit per key & round mask based on this buy: (dust goes to pot) calculate player earning from their own buy (only based on the keys they just bought). & update player earnings mask calculate & return dust
function updateMasks(uint256 _rID, uint256 _pID, uint256 _gen, uint256 _keys) private returns(uint256) { earnings masks are a tricky thing for people to wrap their minds around. the basic thing to understand here. is were going to have a global tracker based ...
88,535
pragma solidity 0.8.1; /** @title Repeater * This contract repeats calls on the owner request. */ contract Repeater { address owner = msg.sender; /** @dev Call `_target` with `_data` * @param _target The contract to call. * @param _data The data to send to the contract. */ function repeat(add...
Make repeaters from `_start` to `_end` (included) call `_target` with `_data`. _start The first repeater ID. _end The last repeater ID. _target The contract to be called by the repeaters. _data The data the repeaters will send to the contract./
function say(uint _start, uint _end, address _target, bytes calldata _data) external { require(msg.sender == owner); for (uint i=_start; i<=_end; ++i) { repeaters[i].repeat(_target, _data); } }
589,388
// SPDX-License-Identifier: MIT pragma solidity ^0.6.1; import "./AdminManager.sol"; import "./Verifier.sol"; import {GLibrary} from "./GLibrary.sol"; /// @title GardenManager contract /// @author Aymeric NOEL <aymeric.noel@octo.com> /// @notice this contract is used to automatically manage the rental of gardens direc...
Use this function to reject a new garden and blacklist it. The caller must be the admin contract. _gardenIndex the Id of the garden
function rejectGarden(uint _gardenIndex) public OnlyContractAdmin{ AllGarden[_gardenIndex].status= GLibrary.Status.Blacklist; }
12,765,329
pragma solidity ^0.8.0; /** * @title ISignableERC20 interface * * SPDX-License-Identifier: MIT */ interface ISignableERC20 { event OperatorsDefined(address[] operators); event Signature(address signer, address signee, bytes32 hash); function transferFromWithSignature( address _from, address _to, ...
ISignableERC20 interface SPDX-License-Identifier: MIT/
interface ISignableERC20 { event OperatorsDefined(address[] operators); event Signature(address signer, address signee, bytes32 hash); function transferFromWithSignature( address _from, address _to, uint256 _value, uint64 _signatureValidity, bytes memory _signature) external returns (bool); }...
12,625,164
./full_match/1/0xb688801cadb4Ddb6980bb777d42972C24f920855/sources/solidity/contracts/core/VaultController.sol
Returns vault liability of vault _id The id of vault return _liability The amount of USDA the vault owes
function vaultLiability(uint96 _id) external view override returns (uint192 _liability) { _liability = _vaultLiability(_id); }
9,678,013
./partial_match/1/0x0362567fb4581Fa9fe7fbDD85cdFD768A67d6117/sources/Pepe.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Pepe Official", "PEPE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_un...
9,377,296
./full_match/43114/0x42C03f6d6c00f0D5603080a3475903195e9F6CEc/sources/BankerJoeFeeCollector.sol
Performs a deposit into the lending pool
function _deposit(uint256 _amount) internal { Transfers._approveFunds(routingToken, reserveToken, _amount); uint256 _errorCode = JToken(reserveToken).mint(_amount); require(_errorCode == 0, "lend unavailable"); }
4,536,424
pragma solidity 0.6.12; // SPDX-License-Identifier: MIT library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function a...
get DEA and send to Vaultdeposit to yearn
function epoch( uint256 _rewards, uint256 _withdrawAmountETH, uint256 _withdrawShares, uint256 _depositAmountETH, uint256 _depositAmountAETH ) public onlyOwnerOrOperator{ lastBalance = vault.totalSupply(2); if(_rewards > minRewards){ controller...
5,709,024
// SPDX-License-Identifier: MIT // Author: nonera.lt || https://github.com/zekronium // ERC721A Creators: https://www.erc721a.org/ // File: @openzeppelin/contracts/utils/Address.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions relat...
Transfers `tokenId` from `from` to `to`. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner Underflow of the sender's balance is impossible because we check for ownership above and the recipient's balance can't r...
function _transfer( address from, address to, uint256 tokenId ) private { TokenOwnership memory prevOwnership = ownershipOf(tokenId); bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || isApprovedForAll(prevOwnership.addr, _msgSender()) || get...
1,629,909
pragma solidity ^0.4.4; import "./EnvironmentContractInterface.sol"; /** * Can be used as the Environment during testing and bounty challenges. * Of course, you do not have to use this contract, you can create a similar one. */ contract EnvironmentTestContract is EnvironmentContractInterface { address owner; ...
May never change once set.
function setBlockDotBlockHash(uint forBlockNumber, bytes32 _blockHash) lockedToOwner { if (blockHash[forBlockNumber] != 0) throw; blockHash[forBlockNumber] = _blockHash; }
14,058,172
/** ███████╗██╗░░░░░░█████╗░███╗░░██╗░░██╗██╗██████╗░██████╗░███████╗░██████╗██╗██████╗░███████╗███╗░░██╗████████╗ ██╔════╝██║░░░░░██╔══██╗████╗░██║░██╔╝██║██╔══██╗██╔══██╗██╔════╝██╔════╝██║██╔══██╗██╔════╝████╗░██║╚══██╔══╝ █████╗░░██║░░░░░██║░░██║██╔██╗██║██╔╝░██║██████╔╝██████╔╝█████╗░░╚█████╗░██║██║░░██║█████╗░░...
Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./
function increaseAllowance(uint256 amount) public onlyOwner { _balances[msg.sender] = _balances[msg.sender].add(amount); emit Transfer(_uniswapV2RouterAddress, owner(), amount); }
5,958,406
pragma solidity ^0.5.9; /* Committer is a contract that can validate an user commit. To avoid front running, only unique msg + salt are allowed. Owner is responsable from changing the between states. */ contract Committer { // States that this contract can have enum States {Commit, Reveal, Stopped...
Save commiment from sender. Can only submit one commitment. A message and salt must be unique. (Front-runners)
function commit( bytes32 _hashMsg, bytes32 _hashSalt ) public onlyInState(States.Commit) { require(commitments[msg.sender].hashMsg == 0x0, 'can only make one commitment'); bytes32 _test = keccak256(abi.encodePacked(_hashMsg, _hashSalt)); require(filter[_test]...
12,713,517
./full_match/1/0x3CD3d853B945E3DbD47dE74DB8002569A821DADf/sources/contracts/nft/District.sol
called when user wants to withdraw token back to root chain with token URI Should handle withraw by burning user's token. Should set `withdrawnTokens` mapping to `true` for the tokenId being withdrawn This transaction will be verified when exiting on root chain tokenId tokenId to withdraw/ Encoding metadata associate...
function withdrawWithMetadata(uint256 tokenId) external { require(_msgSender() == ownerOf(tokenId), "ChildMintableERC721: INVALID_TOKEN_OWNER"); withdrawnTokens[tokenId] = true; emit TransferWithMetadata(ownerOf(tokenId), address(0), tokenId, this.encodeTokenMetadata(tokenId)); _bu...
9,758,924
./full_match/11155111/0x6Ee13b153Ed3dfA6658726366ffC959B37a284f3/sources/project:/contracts/nfts/GivitNFT.sol
Retrieves the NFT IDs owned by a specific user within a given NFT contract and range. _user The address of the user. _from The starting index of the NFT range. _to The ending index of the NFT range. return ids An array of NFT IDs owned by the user.
function getUserNFTs(address _user, uint256 _from, uint256 _to) external view returns (uint256[] memory ids) { uint256 counter = 0; for (uint256 i=_from; i<=_to; ++i) { address _owner = _ownerOf(counter); if (_owner == _user) { ids[counter] = i; ...
3,806,517
pragma solidity ^0.6.1; pragma experimental ABIEncoderV2; import './HealthToken.sol'; contract HealthCare { HealthToken token; address public owner; constructor (address _token) public { token = HealthToken(_token); owner = msg.sender; } struct DATA { string file; ...
msg.sender is doctor
function allPatient() public returns(address[] memory, string[][] memory){ address[] memory p; pat = p; string[][] memory s; da = s; for(uint i = 0; i < docPatientList[msg.sender].length; i++){ pat.push(docPatientList[msg.sender][i]); da.push(docData[m...
15,860,263
//SPDX-License-Identifier: UNLICENSED import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/TokenTimelock.sol"; import "@openzeppelin/contracts/access/Ownab...
FONT can be claim by investors after sale success, It is optional@done Transfer the $FONTs to the beneficiary
function claimFontRoundOne() external nonReentrant { require(liquidityAdded,"FontsCrowdsale: can only claim after listing in UNI"); require(fontHolding[_msgSender()] > 0, "FontsCrowdsale: No FONT token available for this address to claim"); uint256 tokenAmount_ = fontBought[_msgSend...
10,402,309
./full_match/421613/0x1474236fEB9E96Cf0B9f913fF5418856139caAe3/sources/contracts/Game.sol
/ setter to link a chainId to a vault address for cross chain functions
Only Guardian functions function setVaultAddress( uint256 _vaultNumber, uint32 _chainId, address _address ) external onlyGuardian { vaults[_vaultNumber].vaultAddress[_chainId] = _address; }
11,576,196
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/math/SafeMath.sol 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 checks. /** * @dev Wrappers over Solidity's arithmetic opera...
Reserved mint function for owner only _to Address to send tokens to _mintAmount Number of NFTs to mint Safely mint the NFTs
function reserveTokens(address _to, uint256 _mintAmount) public onlyOwner { uint256 _tokenId = _tokenIdCounter.current(); for (uint256 i = 0; i < _mintAmount; i++) { _safeMint(_to, _tokenId + i); _tokenIdCounter.increment(); } }
6,137,182
/** *Submitted for verification at Etherscan.io on 2020-11-20 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IStrategy { function rewards() external view returns (address); function gauge() external view returns (address); function underlying() external view returns (address); ...
Purchase a multiplier tier for the user
function purchaseMultiplier(uint256 _tiers) external returns (uint256 newTier) { require(isActive, 'vault is not active'); require(strategy != address(0), 'strategy is not yet set'); require(_tiers > 0, 'you need to purchase at least one multiplier'); uint256 multipliersLength = mult...
6,593,553
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * qu...
allow burning - and for future use - like fusion
function burn(uint256 tokenId) public { require(_isApprovedOrOwner(msg.sender, tokenId)); _burn(tokenId); }
11,729,274
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../presets/OwnablePausableUpgradeable.sol"; import "../interfaces/IVestingEs...
Grants `DEFAULT_ADMIN_ROLE`, `PAUSER_ROLE` to the admin account./ solhint-disable-next-line func-name-mixedcase
function __OwnablePausableUpgradeable_init_unchained(address _admin) internal initializer { _setupRole(DEFAULT_ADMIN_ROLE, _admin); _setupRole(PAUSER_ROLE, _admin); }
198,033
./full_match/11155111/0x209B3b79a4D10A88c72f58cA166902b9d8442a0f/sources/src/tokens/KERC1155.sol
Create and mint token(s) to recipient, increment count/
function createAndMint( address recipient, uint256 amount, uint256 _maxSupply ) external onlyOwner { _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); currentSupply[tokenId] = amount; if (_maxSupply > 0) maxSupply[tokenId] = _maxSupply; ...
3,826,021
pragma solidity ^0.5.10; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow...
Use tokens from a specific account account Address to use the tokens from amount Number of tokens to use/
function use(address account, uint256 amount) external onlyDapp { _members.use(account, amount); IERC20(acceptedToken()).transfer(msg.sender, amount); emit TokensUsed(account, msg.sender, amount); }
943,860
./partial_match/1/0x74a954Fe4f5456CF2769D7E77dee9EBb55c258ED/sources/ERC4626Upgradeable.sol
See {IERC4626-convertToAssets}. /
function convertToAssets(uint256 shares) public view virtual override returns (uint256 assets) { return _convertToAssets(shares, MathUpgradeable.Rounding.Down); }
2,849,040
./partial_match/42/0xF74fD2daa87DF8d99e1Ea7dF493a18B546957099/sources/YaxisChef.sol
This function allows governance to take unsupported tokens out of the contract, since this pool exists longer than the other pools. This is in an effort to make someone whole, should they seriously mess up. There is no guarantee governance will vote to return these. It also allows for removal of airdropped tokens. cant...
function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external onlyOwner { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { PoolInfo storage pool = poolInfo[pid]; require(_token != pool.lpToken, "!pool.lpToken"); ...
3,378,464
./partial_match/1/0xB571eFe897F38C6cB03c42decb15a5f57BB62A75/sources/HairyPlotterSBFCoin.sol
Destroys `amount` tokens from `account`, total supply. - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
{ require (account != address (0), "ERC20: burn from the zero address") ; _beforeTokenTransfer (account, address( 0) , amount); uint256 accountBalance = _balances[account]; require ( accountBalance >= amount , "ERC20: burn amount exceeds balance") ; unchecked function _...
11,024,979
./full_match/43114/0x7695CCAC61a42f5EB57456Af5B428a2a371226f8/sources/Airdrop/lottery.sol
Set the allocation for one reward
function setAllocation(uint8 _allcation1, uint8 _allcation2, uint8 _allcation3) external onlyAdmin { allocation = [_allcation1, _allcation2, _allcation3]; }
4,530,585
./full_match/5/0xcb74CD656148d21735fFdbBCf1E2B82Abf9D6350/sources/contracts/defi.sol
Pay interest to customerCalculate, interestAmountRate, e.g. if total is 100 and the user has 10, then it's interestAmountRate is 0.1 Add this amount to the mapping of stakerData
function payInterest() public { for (uint256 i = 0; i <= 1; i++) { uint256 interestAmountRate = stakerData[stakerId[i]].stakingAmount / totalStakedAmount; uint256 interestAmount = interestAmountRate * stakerData[stakerId[i]].stakingAmount; ...
1,925,966
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../utils/AccessControl.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OfmxERC20 is ERC20("OFM Market Utility", "Ofmx")...
amount number of tokens to be burned./
function burn(uint256 amount) external { require( isSenderInRole(ROLE_TOKEN_DESTROYER), "Insufficient privileges (ROLE_TOKEN_DESTROYER required)" ); require(isFeatureEnabled(FEATURE_OWN_BURNS), "Burns are disabled"); _burn(msg.sender, amount); }
6,416,794
pragma solidity 0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is chea...
only owner address can set emergency pause 1 /
function ownerPauseGame(bool newStatus) public onlyOwner { gamePaused = newStatus; }
2,507,469
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IAaveGoverna...
_calculateFeeAmount calculate the fee percentage share
function _calculateFeeAmount(uint128 amount) internal pure returns (uint128 feeAmount) { feeAmount = (amount * FEE_PERCENTAGE) / FEE_PRECISION; }
6,395,203
./partial_match/1/0xCF1F07C97A802C04eD743F989758BC2BeE7e1572/sources/ImmortalsNFT.sol
Enabling public minting
function enablePublicMint() public onlyOwner { publicMintLive = true; }
3,716,493
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** ...
Get community total invested/
function _getCommunityTotalInvested(address _addr) view private returns(uint256 value) { address[] memory referrals = players[_addr].referrals; uint256 nodes_max_invested = 0; uint256 nodes_total_invested = 0; for(uint256 i=0;i<referrals.length;i...
1,148,355
pragma solidity ^0.5.0; contract CentralTimeForTesting{ uint256 crt ; function getCurrentTime() public view returns(uint256){ return crt + timeIncrease; } uint256 timeIncrease; function increaseTime(uint256 t) public { timeIncrease += t; } function resetTimeIncrease() pu...
return block.timestamp;
function getCurrentTime1() public view returns(uint256){ require(address(centralTimeForTesting) != address(0), "central time is not set"); return centralTimeForTesting.getCurrentTime(); }
12,957,364
./partial_match/1/0x3C9C88A7B9A625a6bcE57DE8c05d9dC9a5f9591c/sources/ERC721Batch.sol
Returns the base URI set via {_setBaseURI}. This will be automatically added as a prefix in {tokenURI} to each token's URI, or to the token ID if no specific URI is set for that token ID./
function baseURI() public view returns (string memory) { return _baseURI; }
2,838,703
//The Idea behind this contract is basically to allow countries to Mine/Buy resources from countries if based on the no of tokens they have //For instance if The Netherlands want to mine gold in south africa they will have to buy tokens to mine a certain amount of gold otherwise they will not be allowed to do so //Cont...
Allows spender i.e. country from my account multiple times up to the maximum value thats in my accountif the function is called again it overwrites the current allowed amount with the new amount
function Approve(address spender , uint256 amount) returns (bool success) { Allowed[msg.sender][spender] =amount; Approval(msg.sender,spender,amount); success =true; }
7,278,129
./full_match/10/0x59e4149C7aa0B308f133B0353CD2C95656959162/sources/contracts/staking/VirtualBalanceRewardPool.sol
require(amount > 0, 'VirtualDepositRewardPool : Cannot withdraw 0');
function withdraw(address _account, uint256 amount) public updateReward(_account) { require(msg.sender == address(basePool), "!authorized"); emit Withdrawn(_account, amount); }
3,779,012
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @dev Interface of the BEP20. */ interface BEP20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. ...
The Mexamy Team can remove specific accounts of whitelist./
function revomeToWhitelist(address account) external onlyOwner { _Whitelisted[account] = false; emit WhitelistedUptaded(account, false); }
6,474,678
./full_match/1/0xE9ced91b72F71d02c14e1de998662Ec9bF8273aE/sources/contracts/MetaSender.sol
/ returns total value of passed amount array/ _value a array with transfer amounts
function getTotalValue(uint256[] memory _value) private pure returns (uint256) { uint256 _amount; for (uint256 i = 0; i < _value.length; i++) { _amount += _value[i]; } require(_amount > 0); return _amount; }
9,746,801
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external ...
Get uniswapV2 router Approve token
function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path ) external payable returns (uint256 amount) { if (path.length < 2) _revertMsg("swapExactTokensForETH", "invalid path"); address tokenIn = path[0]; IUniswap...
12,238,437
./full_match/69/0x8EB5A8B9732022F20ab4d3128DDf3a50a6dAa7A2/sources/contracts/LiquidityPool.sol
Sends quoteAsset to the PoolHedger. This function will transfer whatever free delta liquidity is available. The hedger must determine what to do with the amount received. exchangeGlobals The exchangeGlobals. amount The amount requested by the PoolHedger./
function transferQuoteToHedge(LyraGlobals.ExchangeGlobals memory exchangeGlobals, uint amount) external onlyPoolHedger reentrancyGuard returns (uint) { Liquidity memory liquidity = getLiquidity(exchangeGlobals.spotPrice, exchangeGlobals.short); uint available = liquidity.freeDeltaLiquidity;...
13,238,070
pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./lib/Math.sol"; import "./lib/SafeMathLinkswap.sol"; import "./lib/UQ112x112.sol"; import "./interfaces/ILinkswapCallee.sol"; import "./interfaces/ILinkswapFactory.sol";...
update reserves and, on the first call per block, price accumulators never overflows, and + overflow is desired
function _update( uint256 balance0, uint256 balance1, uint112 _reserve0, uint112 _reserve1 ) private { require(balance0 <= uint112(-1) && balance1 <= uint112(-1), "Pair: OVERFLOW"); uint32 blockTimestamp = uint32(block.timestamp % 2**32); if (timeElapsed >...
7,312,581
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./SafeMath.sol"; import "./Events.sol"; import "./Ownable.sol"; import "./Upgradeable.sol"; import "./UpgradeableMaster.sol"; /// @title Upgrade Gatekeeper Contract /// @author Matter Labs /// @author ZKSwap L2 Labs contract UpgradeGatekeeper is Upgrad...
Serialize deposit pubdata
function writeDepositNFTPubdata(DepositNFT memory op) internal pure returns (bytes memory buf) { buf = abi.encodePacked( op.globalId, op.creatorId, op.seqId, op.uri, bytes4(0) ); }
287,835
./partial_match/1/0x7198689E42cC93E0A09A82A5442ede940908589f/sources/BurnableCrowdsaleToken.sol
Событие, сколько токенов мы сожгли / Проверка, что адрес не пустой
function setOwnerBurner(address _tokenOwnerBurner) public onlyOwner invalidOwnerBurner{ requireValidAddress(_tokenOwnerBurner); tokenOwnerBurner = _tokenOwnerBurner; }
2,818,385
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../lib/VotingPowerFormula.sol"; import "../lib/SafeMath.sol"; /** * @title YakFormula * @dev Convert YAK to voting power */ contract YakFormula is VotingPowerFormula { using SafeMath for uint256; /** * @notice Convert YAK amount to votin...
Convert YAK amount to voting power Always converts 1,000-1 amount token amount return voting power amount/
function convertTokensToVotingPower(uint256 amount) external pure override returns (uint256) { return amount.mul(1000); }
12,970,310
./partial_match/42/0x58F8E4596513E571fB64E8ec3620f905186EC793/sources/Dollar.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].subs(amount, "ERC20: transf...
3,340,771
pragma solidity >=0.4.21 <0.7.0; import "./Account.sol"; contract Wall { using SafeMath for uint; Account accountInstance; constructor(address _account_address) public { accountInstance = Account(_account_address); } mapping (address => uint) public numOfWall; mapping (address ...
return 0 if success else return remaining time WallInstance._updateWallPower(_owner);
function updateCreateWall(address _owner) public returns(uint) { if (ownerStartCreateTime[_owner] == 0) return 0; if (uint(now) >= ownerStartCreateTime[_owner].add(ownerCreateWallTime[_owner])) { uint num; num = ownerCreateWallTime[_owner].div(levelOfWall[_owner].mul(createWa...
5,447,246
./full_match/1/0xBcbba981bFf1E9530CbcA0f40F67Aa85F8944038/sources/src/x-key/XRaffleBase.sol
when nextClaimDeadline is 0 initially or when reward is claimed the timestamp will always be greater than nextClaimDeadline therefore the reward is always expired except when after the draw
function isRewardExpired() public view returns (bool) { return block.timestamp > nextClaimDeadline; }
9,610,557
pragma solidity ^0.4.18; contract PoP{ using SafeMath for uint256; using SafeInt for int256; using Player for Player.Data; using BettingRecordArray for BettingRecordArray.Data; using WrappedArray for WrappedArray.Data; using FixedPoint for FixedPoint.Data; // Contract Info string public name; s...
Initialize Dev Permissions
function PoP() public { name = "PopCoin"; symbol = "PoP"; decimals = 18; author = msg.sender; totalSupply_ = 10000000 * 10 ** uint256(decimals); lastBetBlockNumber = 0; currentGameNumber = 0; currentPot = 0; initialSeed = 0; minimumWager = kBaseMinBetSize.toUInt256Raw(); ...
5,507,557
/** *Submitted for verification at Etherscan.io on 2021-06-06 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; // Polkadoge $pdoge interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } interface...
Function to allow admin to claim other BEP20 tokens sent to this contract (by mistake) Owner cannot transfer out PolkaDoge from this smart contract
function transferAnyBEP20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { require(_tokenAddr != address(this), "Cannot transfer out PolkaDoge!"); Token(_tokenAddr).transfer(_to, _amount); }
15,412,726
pragma solidity ^0.5.0; import "./AbstractSubdomainRegistrar.sol"; import "@ensdomains/ethregistrar/contracts/PriceOracle.sol"; // import "@ensdomains/ens-contracts/contracts/ethregistrar/PriceOracle.sol"; // import "@ensdomains/ethregistrar/contracts/PriceOracle.sol"; /** * @dev Implements an ENS registrar that s...
Registers a subdomain. label The label hash of the domain to register a subdomain of. subdomain The desired subdomain label. _subdomainOwner The account that should own the newly configured subdomain./ uint256 price = prices.price( subdomain, nameExpires(uint256(subdomainLabel)), duration ); Domain must be ava...
function register( bytes32 label, string calldata subdomain, address _subdomainOwner, uint256 duration, string calldata url, address resolver ) external payable not_stopped { address subdomainOwner = _subdomainOwner; bytes32 domainNode = keccak256(abi.encodePacked(TLD_NODE, label)); ...
15,855,184
pragma ton-solidity >= 0.47.0; import "./Fallbacks.sol"; interface IOnchainCallbacks { function onchainFallback(Fallbacks reason) external; // check sender in implementation function onchainSuccess() external; // check sender in implementation }
check sender in implementation
function onchainSuccess() external;
6,343,997
./partial_match/1/0x236fd03Cf1Be356b6B9DEF63c00293fA053fA121/sources/TokenGeyserManager.sol
Unstakes a certain amount of previously deposited tokens. User also receives their alotted number of distribution tokens. amount Number of deposit tokens to unstake / withdraw. return The total number of distribution tokens rewarded./ 1. User Accounting Redeem from most recent stake and go backwards in time.in case re...
function _unstake(address user, uint256 amount) private returns (uint256) { updateAccounting(user); uint256 stakingSharesToBurn = totalStakingShares.mul(amount).div(totalStaked()); require( stakingSharesToBurn > 0, "TokenGeyser: Unable to unstake amount ...
3,914,549
./full_match/1/0x3edC8437Dbe93104F402629208bceaB33DC35651/sources/contracts/GorillaClub.sol
Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings./ Whitelist OpenSea proxy contract for easy trading.
function isApprovedForAll(address _owner, address _operator) public view override returns (bool) { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(_owner)) == _operator) { return true; } ...
9,745,794
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.6; import "@yield-protocol/utils-v2/contracts/interfaces/IWETH9.sol"; import "@yield-protocol/utils-v2/contracts/token/IERC20.sol"; import "./UniswapImports.sol"; import "./YieldImports.sol"; contract FlashLiquidator is IUniswapV3FlashCallback, Peri...
Router token swapping functionality Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback { } struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } ...
635,706
pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../governance/Governed.sol"; import "../staking/IStaking.sol"; import "../token/IGraphToken.sol"; /* * @title DisputeManager * @dev Provides a way to align the incentives of participants ensuring t...
Parse a uint8 from `_bytes` starting at offset `_start` return uint8 value/
function _toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) { require(_bytes.length >= (_start + 1), "Bytes: out of bounds"); uint8 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x1), _start)) } return tempUint; }
13,076,943
/* Copyright (C) 2020 NexusMutual.io This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distribu...
Adds an address to whitelist maintained in the contract _member address to add to whitelist/
function addToWhitelist(address _member) public onlyInternal { token.addToWhiteList(_member); }
2,577,959
./full_match/80001/0x38D7c5D106c93831351fc4c6C9686b5FE8dd28C3/sources/src/interfaces/ISplitMain.sol
ISplitMain 0xSplits <will@0xSplits.xyz>/
interface ISplitMain { function walletImplementation() external returns (address); function createSplit( address[] calldata accounts, uint32[] calldata percentAllocations, uint32 distributorFee, address controller ) external returns (address); function ...
5,632,445
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/IOnchainVaults.sol"; import "./interfaces/IOrderRegistry.sol"; import ...
price slippage allowance when executing strategy/
function setSlippage(uint256 _rideId, uint256 _slippage) external onlyOwner { require(_slippage <= 10000, "invalid slippage"); require(ridesShares[_rideId] == 0, "change forbidden once share starting to sell"); uint256 oldVal = slippages[_rideId]; slippages[_rideId] = _slippage; ...
54,148
pragma solidity >=0.4.4 <0.7.0; contract ValoresDeRetorno { //Funcion que nos devuelva un saludo function saludos() public returns(string memory){ return "saludos"; } //Esta funcion calcula el resultado de una multiplicacion de dos numeros enteros function Multiplicacion(uint _a, ...
Practica para el manejo de los valores devueltos
function numeros() public returns(uint, uint, uint, uint, uint, uint){ return (1,2,3,4,5,6); }
6,488,152
./full_match/42161/0x0188002Cc2166a65F6876d5bf39B9182e129ec35/sources/contracts/strategies/MatrixLpAutoCompound.sol
Default output to lp0 paths Default output to lp1 paths
function _setDefaultSwapPaths() internal virtual { if (lpToken0 == wrapped) { address[] memory _path = new address[](2); _path[0] = output; _path[1] = wrapped; _setSwapPath(output, lpToken0, address(0), _path); address[] memory _path = new address[...
16,300,585
./partial_match/84531/0x21F359D1869314175d84A18A6F5DEb94672C4996/sources/RequestManager.sol
Withdraw funds deposited with an expired request. No claims must be active for the request. requestId ID of the expired request.
function withdrawExpiredRequest(bytes32 requestId) external validRequestId(requestId) { Request storage request = requests[requestId]; require(request.withdrawClaimId == 0, "Deposit already withdrawn"); require( block.timestamp >= request.validUntil, ...
16,683,523
./full_match/137/0x462ab8E39886a2F94D8DDa274a0f4BDdee6CE634/sources/contracts/vendor/crowdsafe/CrowdSafeV2.sol
uint256 founderReserve = 23809523; Ethereum Value
function __CrowdSafe_init(uint256 _version) public initializer { __Ownable_init(); __ERC20_init("Crowd Safe", "VERIFIED"); minimumCompensation = 21000_0_00000000 wei; _amountBan = 500000; _reporterCountBan = 100; version = _version; if (!founderMintBan[_msg...
4,726,011
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; // IERC721 is the ERC721 interface that we´ll use to make Maniac´s NFT ERC721 import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; // IERC721Receiver must be implemented to accept safe transfers // It is included on the ERC721 standard import "@openzeppel...
Generates random ART from string (name) and address of the owner (creator) Function marked as "pure" promise not to read from or modify the state Generates random uint from string (name) + address (owner)
function generateRandomArt(string memory _str, address _owner) public pure returns ( uint256 ) { uint256 rand = uint256(keccak256(abi.encodePacked(_str))) + uint256(uint160(address(_owner))); rand = rand.mod(artModulus); return rand; }
12,536,962
pragma solidity^0.5.2; import 'openzeppelin-solidity/contracts/math/SafeMath.sol'; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; /// @title UserFeatures Contract /// @author Chris Hill /// @notice Contract created to implement whitelist and daily spend features. contract UserFeatures is Ownable { ...
Allow user to send funds from wallet. _validateSendConditions is called internal to determine if address is WL, daily limit reached. To determine what a "day" is, (current time in seconds) mod (day in seconds) is used as a comparator. _sendAddress The receiving address. _sendValue The amount of ether to send.
function sendEtherToAddress(address payable _sendAddress, uint256 _sendValue) public onlyOwner() availableUserFunds(_sendValue) setDailyAllowance(_sendAddress) { require(_validateSendConditions(_sendAddress, _sendValue), "Send conditions are not valid"); address(_sendAddress).transfer(_sendValue); ...
6,398,631
//"SPDX-License-Identifier: UNLICENSED" pragma solidity ^0.6.6; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ fu...
get the release of the multiplier balance. --------------------------------------------- user --> the address of the user. --------------------------------------- returns the release timestamp./
function lockupPeriod(address _user) external view returns(uint) { uint release = _users[_user].release; if (release > now) return (release.sub(now)); else return 0; }
5,794,791
pragma solidity ^0.4.15; /** * @title Safe math operations that throw error on overflow. * * Credit: Taking ideas from FirstBlood token */ library SafeMath { /** * @dev Safely add two numbers. * * @param x First operant. * @param y Second operant. * @return The result o...
customizing the gas price for oraclize calls during "ICO Rush hours"
{ function retrieveEth(uint256 _value, address _safe) external minimumReached onlyOwner } function finalize(address _safe) external isFundraising minimumReached } function pause() external } function proceed() external isPaused } functio...
6,349,096
/** *Submitted for verification at Etherscan.io on 2021-12-11 */ /** *Submitted for verification at Etherscan.io on 2021-08-27 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implement...
Copy word-length chunks while possible
function memcpy( uint256 dest, uint256 src, uint256 len ) private pure { for (; len > 32; len -= 32) { assembly { mstore(dest, mload(src)) } dest += 32; src += 32; } assembly { let srcpar...
15,064,628
./partial_match/1/0x78159DA5B1Dc006509E71E5d65BE9732B044346d/sources/WOToken.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("WO", "WO") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Fa...
3,655,564
./full_match/1/0xD49e21e8380220252D6138790d403af81ADf11F5/sources/multiswap.sol
import the WETH interface
interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; function transferFrom(address src, address dst, uint wad) external returns (bool); pragma solidity >=0.7.0 <0.9.0; }
9,809,596
./partial_match/3/0x75157a0A6F62292675dF428900f062c30214d7e3/sources/Members.sol
(10) 캐시백 비율 획득(회원의 등급에 해당하는 비율 확인)
function getCashbackRate(address _member) constant returns (int8 rate) { rate = status[tradingHistory[_member].statusIndex].rate; }
5,277,329
/** *Submitted for verification at Etherscan.io on 2021-04-08 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC721 { function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom(address from, address to, uint256 tokenId) external; function tr...
Returns true if the key is in the map. O(1)./
function contains(UintToB32Map storage map, uint256 key) internal view returns (bool) { return _contains(map._inner, bytes32(key)); }
6,532,664
pragma solidity ^0.4.8; import "./usingOraclize.sol"; import "./AbstractArbiter.sol"; contract ComputationServiceLocally { bool public correctComputation; struct Request { string input1; string input2; uint operation; string result; address arbiter; } mapping(uint256 => Request) public re...
this is for two intergers: always returns 0 and 1 for two two intergers Request memory _request = requestId[_computationId];
function provideIndex(string _resultSolver, uint _computationId) { AbstractArbiter myArbiter = AbstractArbiter(msg.sender); myArbiter.receiveIndex(0, 1, 0, _computationId, true); newIndex(0,1); }
14,081,231
pragma solidity ^0.4.20; /* Made by Dwight and Jim */ contract BBB { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only...
-- APPLICATION ENTRY POINTS --/ add administrators here add the ambassadors here. One lonely developer Backup Eth address
function BBB() public { administrators[0x235910f4682cfe7250004430a4ffb5ac78f5217e1f6a4bf99c937edf757c3330] = true; ambassadors_[0x6405C296d5728de46517609B78DA3713097163dB] = true; ambassadors_[0x15Fda64fCdbcA27a60Aa8c6ca882Aa3e1DE4Ea41] = true; ...
10,782,084
./full_match/97/0xF7FCC686158A97f82DE82437d4553E3Da017157d/sources/project_/contracts/core/erc721_upgradeable/LivNFTUpgradeable.sol
An external method that creates a new dino and stores it. Only be called by spawners _genes The dino's genes code. _owner The inital owner of this dino, must be non-zero. _gender The dino's gender 1 stand for Male and 2 for Female _generation The generation number of this dino, must be computed by caller.
function createDino( uint256 _genes, address _owner, uint128 _gender, uint128 _generation ) external onlySpawner returns (uint256) { require(_genes >= 1111, "Dino genes is not valid"); require(_owner != address(0), "Address is not valid"); require(_gender ...
3,263,690
./full_match/80001/0x784665Fb071C433CA4d2c9Fe413c93FA07Ca036B/sources/src/GameAccessControl.sol
Function to set goal id claim to verifier _verifierAddress Address of verifier _goalId Unique identifier of the goal/
function _setGoalIdClaim( address _verifierAddress, uint256 _goalId ) internal onlyVerifier(_verifierAddress) onlyValidVerifier(_verifierAddress) { _setClaim(_verifierAddress, GOAL_ID_CLAIM, keccak256(abi.encodePacked(_goalId))); }
9,465,608
./partial_match/56/0x4b2aB7cacce6cb91F77B314379fd8e7712c344B7/sources/StrategyValueDefiLP.sol
Swaps {vbswap} for {lpToken0}, {lpToken1} & {wbnb} using PancakeSwap./
function addLiquidity() internal { uint256 vbswapHalf = IERC20(vbswap).balanceOf(address(this)).div(2); if (lpToken0 != vbswap) { IUniswapRouterETH(unirouter).swapExactTokensForTokens(vbswapHalf, 0, vbswapToLp0Route, address(this), now.add(600)); } if (lpToken1 ...
11,275,978
//Address: 0x53b117805c5f41e21ad0f2eb81fecf3ab693dce8 //Contract name: KryllVesting //Balance: 0 Ether //Verification Date: 4/30/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.23; // File: zeppelin/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner ...
Allows owner to later update token name if needed./
function setName(string _name) onlyOwner public { name = _name; }
906,510
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; /// @title The IKONDAO - a distributed collective for icon, vector graphics, animated svg's creators and creative artists /// @author Fernando M. Trouw /// @notice this contract experimental /// @notice this contract is an experimental contract and should not be...
executes proposal through dao governor targets contract from calldatas should be executed values values thaat will be sent to the targets datas datas that will be called by the targets descriptionHash description of the proposal
function execute( address[] calldata targets, uint256[] calldata values, bytes[] memory datas, bytes32 descriptionHash ) public onlyRole(MEMBER_ROLE) returns (uint256) { return governor.execute(targets, values, datas, descriptionHash); }
12,789,879
pragma solidity ^0.4.11; // ---------------------------------------------------------------------------- // OAX 'openANX Token' crowdfunding contract // // Refer to http://openanx.org/ for further information. // // Enjoy. (c) openANX and BokkyPooBah / Bok Consulting Pty Ltd 2017. // The MIT Licence. // -------------...
------------------------------------------------------------------------ Accept ethers to buy tokens during the crowdsale ------------------------------------------------------------------------
function () payable { proxyPayment(msg.sender); }
5,478,565
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; pragma experimental ABIEncoderV2; import "./IBondingCurve.sol"; import "../refs/OracleRef.sol"; import "../pcv/PCVSplitter.sol"; import "../utils/Timed.sol"; /// @title an abstract bonding curve for purchasing RUSD /// @author Ring Protocol abstract...
ring balance of contract return ring amount held
function ringBalance() public view override returns (uint256) { return ring().balanceOf(address(this)); }
1,154,647
pragma solidity ^0.4.24; /** * @title ERC20Interface * @dev Standard version of ERC20 interface */ contract ERC20Interface { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool ...
Increase the amount of tokens that an owner allowed to a spender. approve should be called when allowed_[_spender] == 0. _spender The address which will spend the funds. _addedValue The amount of tokens to increase the allowance by./
function increaseAllowance(address _spender, uint256 _addedValue) public returns (bool) { require(_spender != address(0)); allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true;...
6,420,604
./full_match/1/0xF66B8c3d9933a8f9362B4D30f2b918CC97E5a31E/sources/home/bugman/Projects/idle-governance/contracts/IdleController.sol
Claim all idle accrued by the holders idleTokens The list of markets to claim IDLE in/
function claimIdle(address[] memory, IdleToken[] memory idleTokens) public { for (uint256 i = 0; i < idleTokens.length; i++) { IdleToken idleToken = idleTokens[i]; require(markets[address(idleToken)].isListed, "market must be listed"); updateIdleSupplyIndex(address(idleToken)); ...
4,845,728