file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.5.4; //import "openzeppelin-solidity/contracts/utils/Address.sol"; import "../Openzeppelin/Address.sol"; import "../Interfaces/IVerifier.sol"; import "../Roles/OrchestratorRole.sol"; import "./KYCVerifier.sol"; import "./PEPListVerifier.sol"; import "./InsiderListVerifier.sol"; /** A controlled...
this could be a problem, if there were enough complex verifiers to run out of gas, but in this case the whole point of the system would be already defeated
function verifyAllTransfer(address _from, address _to, uint _value, bytes calldata _data) external view { bool verified; verified = kycVerifier.verifyTransfer(_from, _to, _value, _data); require(verified, "The transfer is not allowed by the KYCVerifier!"); verified = insiderListVerif...
7,275,961
./full_match/1/0xc8152115298Ff56E6f9fD0610D77E57946900d4A/sources/lybra/miner/esLBRBoost.sol
Function to add a new lock setting
function addLockSetting(esLBRLockSetting memory setting) external onlyOwner { esLBRLockSettings.push(setting); emit NewLockSetting(setting.duration, setting.miningBoost); }
9,793,412
// Sources flattened with hardhat v2.6.8 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/math/SafeMath.sol@v3.4.1-solc-0.7-2 pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity w...
See {IERC20-transfer}./
function transfer(address _recipient, uint256 _amount) public override returns (bool) { _transfer(msg.sender, _recipient, _amount); return true; }
305,854
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 ...
Add users in group Can be called only by contract owner _groupName group name _users user array return code
function addUsersToGroup(bytes32 _groupName, address[] _users) external onlyContractOwner returns (uint) { require(isGroupExists(_groupName)); Group storage _group = groupName2group[_groupName]; uint _groupMembersCount = _group.membersCount; for (uint _userIdx = 0; _userIdx < _user...
259,179
./partial_match/1/0xE5a04D98538231b0fAb9ABa60cd73cE4fF3039DF/sources/EtherFlip.sol
the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal returns (bytes) { uint minLength = length + toOffset; if (to.length < minLength) { } uint j = 32 + toOffset; uint i = 32 + fromOffset; while (i < (32 + fromOffset + lengt...
9,259,533
./partial_match/1/0x1058fba8E10C1dF675C79Ab988c18275F6337051/sources/HolyPool.sol
process withdraw fees if presentpoolToken.safeTransfer(yieldDistributorAddress, feeAmount);
function withdrawFromPool(address _poolAddress, uint256 _amount) public { IHolyPool holyPool = IHolyPool(_poolAddress); IERC20 poolToken = IERC20(holyPool.getBaseAsset()); uint256 amountBefore = poolToken.balanceOf(address(this)); holyPool.withdraw(msg.sender, _amount); uint256 withdrawnAmount = p...
3,937,554
pragma solidity ^0.6.0; import "../interface/IOperableCore.sol"; import "./OperableStorage.sol"; import "./Core.sol"; /** * @title OperableCore * @dev The Operable contract enable the restrictions of operations to a set of operators * * @author Cyril Lapinte - <cyril.lapinte@openfiz.com> * SPDX-License-Identifi...
assignProxyOperators _role operator role. May be a role not defined yet. _operators addresses/
function assignProxyOperators( address _proxy, bytes32 _role, address[] memory _operators) override public onlySysOp returns (bool) { for (uint256 i=0; i < _operators.length; i++) { operators[_operators[i]].proxyRoles[_proxy] = _role; emit ProxyOperatorAssigned(_proxy, _role, _operators[i]);...
7,268,764
pragma solidity ^0.5.16; import "./ComptrollerInterface.sol"; import "./CTokenInterfaces.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./EIP20Interface.sol"; import "./EIP20NonStandardInterface.sol"; import "./InterestRateModel.sol"; /** * @title Compound's CToken Contract * @notice Abstra...
Delegates execution to an implementation contract. It returns to the external caller whatever the implementation returns or forwards reverts./ delegate all other functions to current implementation
function() external payable { (bool success, ) = comptrollerImplementation.delegatecall(msg.data); assembly { let free_mem_ptr := mload(0x40) returndatacopy(free_mem_ptr, 0, returndatasize) switch success case 0 { revert(free_mem_ptr,...
333,497
./full_match/1/0x1d9619E10086FdC1065B114298384aAe3F680CC0/sources/contracts/abstract/JBPayoutRedemptionPaymentTerminal3_1_2.sol
Receives funds belonging to the specified project. _projectId The ID of the project to which the funds received belong. _amount The amount of tokens to add, as a fixed point number with the same number of decimals as this terminal. If this is an ETH terminal, this is ignored and msg.value is used instead. _token The...
function addToBalanceOf( uint256 _projectId, uint256 _amount, address _token, string calldata _memo, bytes calldata _metadata ) external payable virtual override { addToBalanceOf(_projectId, _amount, _token, false, _memo, _metadata); }
8,432,390
/** ``````` * `..--::::::::-----.` * THE GREYHOUND CRYPTO PROJECT (v3) --:::::::::::::::///:- * ...
Send token to deliver Rewards
function deliver(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,) = _getValues1(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount);...
12,582,404
pragma solidity ^0.4.2; // ERC20 Token Interface contract Token { uint256 public totalSupply; function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uin...
Moderator, Admin & Root Functions / Moderator Flags
function setPropertyFlag(uint16 propertyID, uint8 flag) public regulatorAccess(flag == FLAG_NSFW ? LEVEL_1_MODERATOR : LEVEL_2_MODERATOR) { properties[propertyID].flag = flag; if (flag == FLAG_BAN) { properties[propertyID].colors = [0, 0, 0, 0, 0]; } }
1,158,130
./partial_match/1/0x04A39FB8D3C74745BA0E40248d01B893a4835845/sources/FannyVault.sol
We update the pool And pay out rewards to this person Adjust their reward debt and balances
function _withdraw(address from, address to, uint256 amountToWithdraw, uint256 creditPenalty) internal { PoolInfo storage pool = fannyPoolInfo; require(pool.withdrawable, "Withdrawals are closed."); UserInfo storage user = userInfo[from]; updatePool(); updateAndPayOutPendin...
4,226,493
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.7.0; import "./lib/ReEncryptionValidator.sol"; import "./lib/SignatureVerifier.sol"; import "./StakingEscrow.sol"; import "./proxy/Upgradeable.sol"; import "../zeppelin/math/SafeMath.sol"; import "../zeppelin/math/Math.sol"; /** * @title Adjudicator *...
Prolong active sub stake _index Index of the sub stake _additionalDuration Amount of periods for extending sub stake/ Incorrect parameters if the sub stake ends in the next committed period then reset the `lastPeriod` field
function prolongStake(uint256 _index, uint16 _additionalDuration) external onlyStaker { StakerInfo storage info = stakerInfo[msg.sender]; require(_additionalDuration > 0); SubStakeInfo storage subStake = info.subStakes[_index]; uint16 currentPeriod = getCurrentPeriod(); (uint...
1,393,134
pragma solidity ^0.5.0; /** * @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) internal pure returns (uint256) { /...
Allowance is not affected by locking
function allowance(address _owner, address _spender) public view returns (uint256) { return _allowed[_owner][_spender]; }
6,451,266
./full_match/4/0x7A08228b9E10B1B57259A32F9EdEd8dB0fe0B4CF/sources/Contract.sol
function burn( uint256 value) external returns (bool success);event Burn(address indexed from, uint256 value);
interface ERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool...
646,193
// SPDX-License-Identifier: MIT pragma solidity ^0.4.2; contract Election { //mapping to track propaganda => option => votes mapping (uint => mapping(uint => uint)) public propaganda; uint public propagandaCount; //mapping to track address => propaganda => voted/not_voted mapping (address => mapp...
require that they haven't voted before record that voter has voted update candidate vote Count
function vote (uint _propagandaId, uint _option) public { require(!ifVoted(msg.sender, _propagandaId)); voters[msg.sender][_propagandaId] = true; propaganda[_propagandaId][_option] ++; }
1,842,789
./partial_match/1/0x784469841d366Ab7C6a864b5f29Cbb6713B8f2cc/sources/Borrow.sol
Sets Loss Coefficient _coefficient - New loss coefficient/
function setLossCoefficient ( uint256 _coefficient ) public onlyOwner { require(_coefficient >= 1e5, "loss coefficient must be higher 100 000"); lossCoefficient = _coefficient; }
2,816,829
./full_match/1/0x0000000001E835A5D0D176e05499850B636F6B15/sources/contracts/BartrrBase.sol
_amount amount of the wager _paymentToken address of the payment token Protection against negative prices
function _calculateFee(uint256 _amount, address _paymentToken) internal view returns (uint256 fee) { (int256 tokenPrice) = int256(_getLatestPrice(_paymentToken)); if (tokenPrice <= 0) { revert("data feed: negative token price"); uint256 usdPrice = uint256(tokenPrice); ...
3,850,035
// SPDX-License-Identifier: MIT // The difference with GamersePool is without rewardHolder pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./libs/SafeBEP20.sol"; contra...
Update the maximum staking amount per user Only callable by owner. amount: the new maximum staking amount per user/
function updateMaxStakeAmount(uint256 amount) external onlyOwner { maxStakeAmount = amount; }
13,084,607
pragma solidity ^0.6.4; contract Utils { function isContract(address addr) public view returns (bool) { uint32 size; assembly { size := extcodesize(addr) } return size > 0; } function memcpy( bytes memory src, uint256 _offst, uint256 len...
move pointer to free memory spot put function sig at memory spot append argument after function sig
function getTokenBalance(address tokenAddr, address addr) public returns (uint256 bal) { bytes4 sig = bytes4(keccak256("balanceOf(address)")); assembly { let ptr := mload(0x40) mstore(ptr, sig) mstore(add(ptr, 0x04), addr) let resu...
14,019,010
./full_match/44787/0x3966196588981E29e85f5EDCc31ddc8754cD5b20/sources/Users/monk/celo/clabs/contracts/common/MultiSig.sol
Allows to change the number of required confirmations. Transaction has to be sent by wallet. _internalRequired Number of required confirmations for interal txs.
function changeInternalRequirement(uint256 _internalRequired) public onlyWallet validRequirement(owners.length, _internalRequired) { internalRequired = _internalRequired; emit InternalRequirementChange(_internalRequired); }
13,255,097
pragma solidity 0.4.25; contract StandardToken { /* Data structures */ mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; /* Events */ event Transfer(address indexed from, address indexed to, uint256 value); ...
TokenFund emission function. _for is Address of receiver, tokenCount is Number of tokens to issue.
function issueTokens(address _for, uint tokenCount) external isCrowdfundingContract returns (bool) { if (emissionEnabled == false) { revert(); } balances[_for] += tokenCount; totalSupply += tokenCount; return true; }
7,211,999
pragma solidity >=0.4.24; import "../math/SafeMath.sol"; /** * @dev 资产列表共通,除资产负债之外提供一个账目清单数组,便于统计和查找. */ library BalanceList { using SafeMath for uint256; struct element { address addr; uint256 idx; uint256 balance; } struct balanceMap { mapping(address => uint256) mapList; element[] li...
对于已经存在的数据更新状态即可 新建数据
function add( balanceMap storage self, address _addr, uint256 _amount ) internal returns (uint256) { if (exist(self, _addr)) { self.list[self.mapList[_addr]].balance = self.list[self.mapList[_addr]] .balance .add(_amount); require(insert(self, _addr, _amount), "insert dat...
1,847,497
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "./IlluviumPoolBase.sol"; /** * @title Illuvium Core Pool * * @notice Core pools represent permanent pools like ILV or ILV/ETH Pair pool, * core pools allow staking for arbitrary periods of time up to 1 year * * @dev See IlluviumPoolBase for m...
See updateStakeLock() _staker an address to update stake lock _depositId updated deposit ID _lockedUntil updated deposit locked until value/ validate the input time get a link to user data struct, we will write to it later get a link to the corresponding deposit, we may write to it later validate the input against d...
function _updateStakeLock( address _staker, uint256 _depositId, uint64 _lockedUntil ) internal { require(_lockedUntil > now256(), "lock should be in the future"); User storage user = users[_staker]; Deposit storage stakeDeposit = user.deposits[_depositId]; ...
898,375
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which th...
Payable Functions /
function mintCommon() public payable canMintQuantity(1) { require(msg.value >= commonPrice, "Underpriced"); _processMint(); commonPrice = nextPrice(commonPrice); store_withdrawable(msg.sender, msg.value); originalMintCount[msg.sender]++; }
10,142,600
./full_match/1/0x631b949c7e0fdef95e612165798E09aD46b5635c/sources/contracts/oasis-main/OasisAccessPass.sol
Sets the starting duration. _startingDuration Starting duration in seconds./
function setStartingDuration(uint256 _startingDuration) external onlyOwner { startingDuration = _startingDuration; }
3,181,612
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma experimental ABIEncoderV2; import "./ERC2746.sol"; import "./TransactionStateInterface.sol"; import "./WonkaLibrary.sol"; import "./WonkaEngineMetadata.sol"; import "./WonkaEngineRuleSets.sol"; /// @title An Ethereum contract that contains the functional...
This method will set the flag as to whether or not the engine should run in Orchestration mode (i.e., use the sourceMap)
function setOrchestrationMode(bool orchMode, bytes32 defSource) public onlyEngineOwner { wonkaRuleSets.setOrchestrationMode(orchMode, defSource); }
2,479,033
./full_match/4/0xBa7a638a06dBCF2A87CE4425d67f3EA224bFE5b9/sources/github/NFT-Worlds/NFT-Worlds-Staking-Rental-Contract/src/NFTWEscrow.sol
Accumulate rewards for an user. Needs to be called on each staking/unstaking event. Calculate and update the new value user reserves.
function _updateUserRewards(address user, uint32 weight, bool increase) internal virtual returns (uint96) { UserRewards memory userRewards_ = rewards[user]; RewardsPerWeight memory rewardsPerWeight_ = rewardsPerWeight; userRewards_.accumulated = userRewards_.accumulated + userReward...
740,749
./full_match/4/0x8EbD9cEbF73db70788f275EC34a291A569b5098e/sources/contracts/StakingPool.sol
1 = female 2 = male 3 = baby
function initiate(uint256[] memory id, uint256 ape) external onlyOwner { uint8 i; uint256 length = id.length; if (ape == 1) { for (i=0; i < length; i++) { femaleId[id[i]] = true; } } else if (ape == 2) { for (i=0; i < length...
12,510,193
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; /// @title Computes the result of a swap within ticks /// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick. interface ISwapMath { /// @notice Computes the result of swapping some amount in...
Computes the result of a swap within ticks Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick.
interface ISwapMath { function computeSwapStep( uint160 sqrtRatioCurrentX96, uint160 sqrtRatioTargetX96, uint128 liquidity, int256 amountRemaining, uint24 feePips ) external pure returns ( uint160 sqrtRatioNextX96, uint256 a...
13,046,900
./full_match/4/0xf48fFCEe592be31c010A518959CD5060aE5a32d3/sources/mefi/MefiClient.sol
Sets the stored oracle contract with the address resolved by ENS This may be called on its own as long as `useMefiWithENS` has been called previously/
function updateMefiOracleWithENS() internal { bytes32 oracleSubnode = keccak256(abi.encodePacked(ensNode, ENS_ORACLE_SUBNAME)); ENSResolver_Mefi resolver = ENSResolver_Mefi(ens.resolver(oracleSubnode)); setMefiOracle(resolver.addr(oracleSubnode)); }
725,714
./full_match/43113/0x4DB2246a5B5688a314Bf73EDFac7AAe5889e2140/sources/contracts/AaveStrategy.sol
Internal method to get account state Values provided in 1e18 (WAD) instead of 1e27 (RAY)
function _getAccountData() internal view returns ( uint256 balance, uint256 borrowed, uint256 borrowable ) { balance = IERC20(avToken).balanceOf(address(this)); borrowed = IERC20(avDebtToken).balanceOf(address(this)); bo...
7,153,158
./full_match/1/0xb1eAEd6d3EEa121093D60f6859410F58c83dD5Fd/sources/contracts/FullFeatureToken.sol
method which returns the amount of tokens to be taxed during a transfer sender - the address of the originating account amount - the total amount of tokens sent in the transfer if the tax address is the same as the originating account performing the transfer, no tax is applied/
function _taxAmount(address sender, uint256 amount) internal view returns (uint256 taxAmount) { taxAmount = 0; if (taxBPS != 0 && sender != taxAddress) { taxAmount = (amount * taxBPS) / MAX_BPS_AMOUNT; } }
17,113,384
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(ad...
Returns a list of all element IDs assigned to an address. _owner The owner whose tokens we are interested in. Return an empty array
function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); uint256[] memory result = new uint256[](tokenCount); uint256 totalElements = totalSupply(...
12,595,261
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "@openzepp...
Calculates the amounts deposited/withdrawn from the pool amount0 - token0 amount to deposit/withdraw amount1 - token1 amount to deposit/withdraw/
function calculatePoolMintedAmounts( uint256 amount0, uint256 amount1, uint160 priceLower, uint160 priceUpper, address pool ) public view returns (uint256 amount0Minted, uint256 amount1Minted) { uint128 liquidityAmount = getLiquidityForAmounts( ...
1,686,718
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; // 买卖合约示例,通过状态机来实现买卖双方的确认机制。 contract Purchase { uint public value; address payable public seller; address payable public buyer; enum State {Created, Locked, Release, Inactive} State public state; // 条件限制 modifier cond...
退款给卖家,即:将锁定的资金发给卖家 必须先更改状态,然后调用transfer,避免多次调用
function refundSeller() public onlySeller inState(State.Release) { emit SellerRefunded(); state = State.Inactive; seller.transfer(3 * value); }
1,063,765
./partial_match/1/0x15bBeB47e642828778937b90fdA1926b744b0733/sources/WildAbduction.sol
Burn a token - any game logic should be handled before this function./
function burn(uint256 tokenId) external override whenNotPaused { require(admins[_msgSender()], "Only admins can call this"); require(ownerOf(tokenId) == tx.origin, "Oops you don't own that"); if(tokenTraits[tokenId].isCowboy) { emit CowboyBurned(tokenId); } else {...
4,336,559
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppel...
Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-free listings./ Whitelist OpenSea proxy contract for easy trading.
function isApprovedForAll(address _owner, address _operator) public view override returns (bool isOperator) { if(proxyRegistryAddress != address(0)) { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(_owner)) == _operator) { ...
1,183,452
pragma solidity 0.5.16; import "../SafeDecimalMath.sol"; contract MockEtherCollateral { using SafeMath for uint; using SafeDecimalMath for uint; uint public totalIssuedPynths; constructor() public {} // Mock openLoan function function openLoan(uint amount) external { // Increment to...
Increment totalIssuedPynths
function closeLoan(uint amount) external { totalIssuedPynths = totalIssuedPynths.sub(amount); }
1,783,492
./partial_match/42/0x7Dab59e2Ca3a043316C2039453989d8519756d92/sources/DisposableGovernance.sol
Submits a member vote for assessing a claim. Tokens other than those locked under Claims Assessment can be used to cast a vote for a given claim id. claimId Selected claim id. verdict 1 for Accept,-1 for Deny./
function submitMemberVote(uint claimId, int8 verdict) public isMemberAndcheckPause { require(checkVoteClosing(claimId) != 1); uint stat; uint tokens = tc.totalBalanceOf(msg.sender); (, stat) = cd.getClaimStatusNumber(claimId); require(stat >= 1 && stat <= 5); require(cd.getUserClaimVoteMember(...
3,300,217
./full_match/3/0x8768F82F228269698f102F111b581A0B7018d688/sources/browser/DexToDexArb.sol
uint8[] memory a = [1,2];
function show(uint[] calldata a) external pure returns (bytes memory){ bytes memory result = abi.encode(a); return result; }
8,194,643
./full_match/137/0x8F0772AC6F90E1704dc2a10cCe9623B8E335cEAE/sources/GAH.sol
Hook that is called before any transfer of tokens. This includes minting and burning. Calling conditions: - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens will be to transferred to `to`. - when `from` is zero, `amount` tokens will be minted for `to`. - when `to` is zero, `amount` of ``from``'s to...
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
4,674,080
/** *Submitted for verification at Etherscan.io on 2020-12-03 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.12; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, ...
Sends Pending CARMA to the user
function _addUserStake(address _address, uint256 _amount) internal { _mintCarma(); if (users[_address].stake > 0) { _claimReward(); } totalStaked = totalStaked.add(_amount); xcomb.mint(_address, _amount); users[_address].stake = users[_address].stake.ad...
2,128,944
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.3; ///////////////////////////////////////////////////////////////////////////////// // // // // // ██...
Transfers deposit amount after refund to tax collector account. _tokenId ID of the token _refundAmount Amount refunded to current owner Emits a {Collect} event./
function _collectTax(uint256 _tokenId, uint256 _refundAmount) private { Asset storage asset = assets[_tokenId]; address taxCollector = taxCollectors[_tokenId]; uint256 depositAfterRefund = asset.totalDepositAmount - _refundAmount; payable(taxCollector).transfer(depositAfterRefund); ...
11,697,732
./partial_match/1/0xa5E0163f778B05a522dF8fe374f15D4ffbe54C2a/sources/wstACME.sol
inlines syncRewards with redemptions when able
function redeem( uint256 shares, address receiver, address owner ) public override returns (uint256 assets) { return super.redeem(shares, receiver, owner); }
16,142,305
./full_match/84531/0x70302d7cFfCb2a56A39DAf66DC4410fFF2B0242d/sources/contracts/lzApp/LzAppUpgradeable.sol
--------------------------- VIEW FUNCTION ----------------------------------------
function isTrustedRemote( uint16 _srcChainId, bytes calldata _srcAddress ) external view returns (bool) { bytes memory trustedSource = trustedRemoteLookup[_srcChainId]; return keccak256(trustedSource) == keccak256(_srcAddress); } event SetTrustedRemoteAddress(uint16 _rem...
14,311,254
/** *Submitted for verification at Etherscan.io on 2021-08-18 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarv...
called by providers
function migrateProvider(address _newProvider) external onlyAllowed { JointProvider newProvider = JointProvider(_newProvider); if (newProvider.want() == tokenA) { providerA = newProvider; providerB = newProvider; revert("Unsupported token"); } }
2,331,554
pragma solidity >=0.4.22 <0.6.0; contract BatterySwap { struct Battery { uint id; uint capacity; uint year; uint maxCycles; uint cycles; uint soc; uint soh; uint price; uint rate; address owner; uint swapID; } ...
returns requested status(returns -1 for NOTREQUESTED,1 for REQUESTED,2 for ACCEPTED,3 for REJECTED)
function sendStatus(address s) public returns (uint) { return EV[s].reqStatus; }
968,338
./full_match/80001/0xc9304257B62C12a31763a3DC945896fb78a0F34D/sources/contracts/extension/DropSinglePhase.sol
Only Contract owner Should be able to call this function
function updateProductPrice(uint256 _productId, uint256 _price) public { if (!_canSetClaimConditions()) { revert("Not authorized"); } Product memory updateProduct = Product({ productId: _productId, price: _price }); product[_productId] = up...
839,908
./partial_match/1/0x40e420fE3b8002079d19FAd35B647B6392d50b96/sources/Pepe03.sol
Interface of the ERC20 standard as defined in the EIP./
interface I3PepeDivInterface { function accumulativeDividendOf(address _owner, address _token) external returns (uint256); function withdrawnDividendOf(address _owner) external view returns (uint256); function withdrawableDividendOf(address _owner) external view returns (uint256);
9,161,196
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./WitnetRequestsBoardInterface.sol"; /** * @title Block Relay Proxy * @notice Contract to act as a proxy between the Witnet Bridge Interface and the Block Relay. * @author Witnet Foundation */ contract WitnetRequestsBoardProxy { // Address of th...
Posts a data request into the WRB in expectation that it will be relayed and resolved in Witnet with a total reward that equals to msg.value. _requestAddress The request contract address which includes the request bytecode. _inclusionReward The amount of value that will be detracted from the transaction value and res...
function postDataRequest(address _requestAddress, uint256 _inclusionReward, uint256 _tallyReward) external payable returns(uint256) { uint256 n = controllers.length; uint256 offset = controllers[n - 1].lastId; return currentLastId; }
12,850,327
./full_match/1/0x8516f8532AF988579106c9e3c60CBA17D7D9eb04/sources/contracts/OpenSkyCollateralPriceOracle.sol
@inheritdoc IOpenSkyCollateralPriceOracle
function setRoundInterval(uint256 roundInterval) external override onlyOwner { _roundInterval = roundInterval; emit SetRoundInterval(_msgSender(), roundInterval); }
3,145,738
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@...
--- Public functions ---
function publicMint(uint256 _amount) external payable nonReentrant { require(salePhase == SalePhase.PUBLIC, "Dingbots: Public sale phase not running"); require(_amount > 0 && mintCountPublic[msg.sender] + _amount <= MINTS_PER_PUBLIC, "Dingbots: Bad amount"); require(publicCounter + _amount <...
13,442,930
./full_match/97/0x8244460656F5859F0D647c2B122F51d78406a05a/sources/_ankr.com/contracts/earn/BearingToken.sol
other contract references earn config re-defined ERC20 fields specific bond fields pausable reserve
{ event LiquidStakingPoolChanged(address prevValue, address newValue); event InternetBondRatioFeedChanged(address prevValue, address newValue); event CertificateTokenChanged(address prevValue, address newValue); ILiquidTokenStakingPool internal _liquidStakingPool; IInternetBondRatioFeed internal _i...
3,262,000
// SPDX-License-Identifier: UNLICENSED // Copyright (c) WildCredit - All rights reserved // https://twitter.com/WildCredit pragma solidity 0.8.6; import "IERC20.sol"; import "IERC721.sol"; import "ICallee.sol"; import "ILendingPair.sol"; import "ILPTokenMaster.sol"; import "ILendingController.sol"; import "IUniswapV...
'-1' helps prevent _checkReserve fails due to rounding errors
function accrue(address _token) public { if (lastBlockAccrued[_token] < block.number) { uint newDebt = _accrueDebt(_token); uint newSupply = newDebt * _lpRate() / 100e18; totalSupplyAmount[_token] += newSupply; uint newFees = (newDebt - newSupply) == 0 ? 0 : (newDebt - newSupply - 1); ...
6,263,140
pragma solidity ^0.4.24; /** * @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 cheaper than r...
Remove wallet from whitelist. Accept request from the owner only. _wallet The address of whitelisted wallet to remove./
function removeWallet(address _wallet) public onlyOwner { require(_wallet != address(0)); require(isWhitelisted(_wallet)); whitelist[_wallet] = false; whitelistLength--; }
318,810
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /**...
Converts reward HIGH value to stake token (not to be mixed with the pool token), applying the 10^24 multiplication on the reward _reward yield reward _rewardPerToken staked token amount return reward/token/ apply the reverse formula and return
function rewardToToken(uint256 _reward, uint256 _rewardPerToken) public pure returns (uint256) { return (_reward * REWARD_PER_TOKEN_MULTIPLIER) / _rewardPerToken; }
13,030,066
pragma solidity ^0.5.0; import '../node_modules/@openzeppelin/contracts/ownership/Ownable.sol'; import '../node_modules/@openzeppelin/contracts/math/SafeMath.sol'; import './OrgRegistry.sol'; contract UserWallet is Ownable { using SafeMath for uint256; bool public isCollector; uint256 public raisedPoint...
redeem token based on his points; call org contract to redeem
function residentConfirm( uint256 bhash)public onlyOwner() returns (bool) { uint256 points = orgRegistry.calcResidentPoints(orgRegistry.getDeliveredCode(bhash),orgRegistry.getDeliveredAmount(bhash)); raisedPoints.add(points); points.add(currentPoints); currentPoints =...
2,481,365
// SPDX-License-Identifier: MIT /** MIT License Copyright (c) 2021 Woonkly OU Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, ...
Calculate % Of estimated total impact on liquidity/
function getPercImpact(uint256 amount, bool isCOIN) public view returns (uint8) { uint256 reserve = 0; if (isCOIN) { reserve = _coin_reserve; reserve = _tokenB.balanceOf(address(this)); } uint256 p = amount.mul(100).div(reserve); ...
12,911,764
pragma solidity ^0.4.20; //**양종만**정병두**//180419~ /*모든 행위는 1wei단위로 되기때문에 주의해야됨 ex : 총 발행 토큰 111 소수점18자리로 했을때 토탈 토큰 111 000 000 000 000 000 000(wei단위임) 1토큰 전송 남은 토큰 110999999999999999999 토큰Value * 10 ** uint256(소수점자리수)로 미리 계산하면 1토큰 전송시 110 000 000 000 000 000 000 */ //기본 소수점 자리 18 / 변경되면 payable , transfer에서 달라...
지갑에서 지갑으로 토큰 이동 회수용 ex : 1토큰 회수시 1tokenValue = _value;토큰 지갑에서 남아있는 토큰수가 보내려는 토큰보다 많은지 검사오버플로어 검사토큰지갑에서 차감받는 사람지갑에 토큰 저장이벤트 기록을 남김
function admin_from_To_transfer(address _from, address _to, uint256 _value) public isOwner { require(balanceOf[_from] >= _value*_decimals); require(balanceOf[_to] + (_value *_decimals)>= balanceOf[_to]); balanceOf[_from] -= _value*_decimals; balanceOf[_to] += _value*_decimals; emit Transfer(_fro...
1,033,295
pragma solidity >=0.4.25 <0.6.0; import { Bookable } from "./Bookable.sol"; /// @title A supporting contract containing functionality for refunding userss /// @author Ruben B. Meseguer /// @notice Allow users to obtain a refund. /// @dev All function calls are currently implemented without side effects cont...
Check user has booked a place Remove them from array of participants Change their status to cancel Refund 100 percent of the ticket Refund 75 percent of the ticket
function _refund(address participantAddress) internal { require(participants[participantAddress].booked == true); uint amountToRefund; if(_canFullRefund()) { amountToRefund = _getEtherCost(cost) * 7500 / 10000; amountToRefund = _getEtherCost(cost) * 7500 / 10000; ...
12,795,397
pragma solidity ^0.6.7; // SPDX-License-Identifier: MIT /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which i...
SPDX-License-Identifier: MIT
interface IMasterchef { function BONUS_MULTIPLIER() external view returns (uint256); function add( uint256 _allocPoint, address _lpToken, bool _withUpdate ) external; function bonusEndBlock() external view returns (uint256); function deposit(uint256 _pid, uint256 _amount) ...
1,575,603
pragma solidity ^0.4.24; interface PlayerBookReceiverInterface { function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external; function receivePlayerNameList(uint256 _pID, bytes32 _name) external; } contract PlayerBook { using NameFilter for string; using SafeMath f...
make sure name fees paid set up our tx event data and determine if player is new or not fetch player id manage affiliate residuals if no affiliate code was given, no new affiliate code was given, or the player tried to use their own pID as an affiliate code, lolz update last affiliate
function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { require (msg.value >= registrationFee_, "umm..... you have to pay the name fee"); bool _isNewPlayer = determinePID(_addr); ...
467,129
./partial_match/1/0x7A9441B2e4829e18f3bA2C46eC4C274EEF357Bd6/sources/contracts/pricers/ManualPricer.sol
get the live price for the asset overides the getPrice function in OpynPricerInterface return price of the asset in USD, scaled by 1e8/
function getPrice() external view override returns (uint256) { require(now <= lastExpiryTimestamp.add(priceTimeValidity), "ManualPricer: price is no longer valid"); return historicalPrice[lastExpiryTimestamp]; }
2,673,209
./full_match/1/0x018a841F3777694bD4cd718F5f3a30a3a6B592E0/sources/AkatsukiCat.sol
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; }
17,033,627
./full_match/97/0x1c4eA5BBC27d20Fd4a7B6aEc21C109fE24eDA9e8/sources/contracts/protocol/libraries/logic/ValidationLogic.sol
Validates the liquidation action. userConfig The user configuration mapping collateralReserve The reserve data of the collateral params Additional parameters needed for the validation/if collateral isn't enabled as collateral by user, it cannot be liquidated
function validateLiquidationCall( DataTypes.UserConfigurationMap storage userConfig, DataTypes.ReserveData storage collateralReserve, DataTypes.ValidateLiquidationCallParams memory params ) internal view { ValidateLiquidationCallLocalVars memory vars; (vars.collateralReserveActive, , , , vars.c...
3,271,372
./partial_match/1/0x7d7830A8C3143a1171Dfe95E4E6cdCc9480Bb2a2/sources/BeastSale.sol
Withdraw ETH to add UniSwap Liquidity
function withdrawETH() public { require(msg.sender == owner); require(saleClosed == true); owner.transfer(collectedETH); }
4,416,668
pragma solidity >=0.4.22 <0.6.0; contract Creditlist { address public minter;//拥有者地址 // uint num;//名单数量 // uint requ_num;//请求人数 // uint add_num;//已添加人数 string self_name;//拥有者的id ev[] evlist; person[] persons;//信用度名单 requ_person[] requ_persons;//请求权限名单 requ_person[] ...
查看用户是否不可信 function getanswwer(string memory input) public returns(bool,uint,uint){ require(msg.sender == minter, "No right to see information."); for(uint p = 0;p<persons.length;p++){ if(keccak256(abi.encodePacked(persons[p].name)) == keccak256(abi.encodePacked(input))){ return (true,p,p...
function getevnum() public returns(uint){ return evlist.length; }
12,653,952
./full_match/137/0x64A71E67d7823A53E8FFA0C13352A2B447F12603/sources/contracts/AstroChef.sol
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poo...
4,698,806
./full_match/1/0x71a734f01270199D31D3ebB6174569A7cFf3d54a/sources/contracts/auction/Auction.sol
============================================================ Financial Management ============================================================ allows user to refund to their wallet proof merkle proof wonItemsCount user won items count
function refund( bytes32[] calldata proof, uint256 wonItemsCount ) external nonReentrant { uint256 userBidAmount = userBid[msg.sender].amount; require( auctionState == AuctionState.REFUND_STARTED, "Refund not started yet" ); require(finalPr...
9,689,076
./full_match/4/0x8047F563Ce38C4a58d789BCb5770E890783F5916/sources/contracts/ERC721.sol
pull rock info from OG contract: owner, currentlyForSale, price, timesSold
function getRockInfo(uint tokenId) public view returns (address, bool, uint, uint) { return(etherrock.rocks(tokenId)); }
704,885
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 ...
If there is some division reminder, we just collect it too.
function getTotalTokens(uint256 ethAmount, uint256 bonusPercents) private pure returns(uint256) { uint256 tokensAmount = (ethAmount * TOKEN_CENTS) / TOKEN_PRICE; require(tokensAmount > 0); uint256 bonusTokens = (tokensAmount * bonusPercents) / 100; uint256 totalTokens = tokensAmount....
10,985,311
./full_match/80001/0x6E0B2FD55B1a135F83AF33C720961B7A23235e54/sources/contracts/Character.sol
If the item ID is composite, query the compositeTokenDetails If the item ID is not composite, simply query the battleItems
function unequipItem( uint256 characterTokenId, CharData.ItemType itemType ) external onlyEquipManagement { CharData.CharacterEquips storage character = characterEquips[ characterTokenId ]; CharData.CharacterStats storage characterStats = characterStats[ ...
5,653,897
/** *Submitted for verification at Etherscan.io on 2021-08-23 */ // 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 o...
Redeem fund When the fund is redeemed, fees will be collected, and contract access is not allowed amount Redeem amounttake exit feetake performance feetake management fee withdraw cash
function exitPool(uint256 amount) external isAllowExit notAllowContract { address investor = msg.sender; require(balanceOf(investor) >= amount && amount > 0, "Fund.exitPool: Insufficient balance"); uint256 exitFee = _takeExitFee(investor, amount); uint256 exitAmount = amount.sub(exit...
6,627,279
./partial_match/1/0xAe8eEB1f92F0F76D3F21d5887096999254F06EA5/sources/SBCToken.sol
Return the an array containing all the keys WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that this function has an unbounded cost, and using it as p...
function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) { bytes32[] memory store = keys(map._inner); uint256[] memory result; assembly { result := store } return result; }
2,781,431
pragma solidity ^0.5.13; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "solidity-bytes-utils/contracts/BytesLib.sol"; import "./interfaces/ICeloVersionedContract.sol"; i...
Returns the address that signed the provided meta-transaction. destination The address to which the meta-transaction is to be sent. value The CELO value to be sent with the meta-transaction. data The data to be sent with the meta-transaction. _nonce The nonce for this meta-transaction local to this wallet. v The r...
function getMetaTransactionSigner( address destination, uint256 value, bytes memory data, uint256 _nonce, uint8 v, bytes32 r, bytes32 s ) public view returns (address) { bytes32 structHash = _getMetaTransactionStructHash(destination, value, data, _nonce); return Signatures.getSig...
12,857,895
/** *Submitted for verification at Etherscan.io on 2021-07-12 */ pragma solidity 0.8.2; interface IPlatformIntegration { /** * @dev Deposit the given bAsset to Lending platform * @param _bAsset bAsset address * @param _amount Amount to deposit */ function deposit( address _bAsset...
Get the total bAsset value held in the platform _bAsset Address of the bAsset return balance Total value of the bAsset in the platform/
function checkBalance(address _bAsset) external view override returns (uint256 balance) { require(_bAsset == bAsset, "Invalid bAsset"); balance = stakingPools.getStakeTotalDeposited(address(this), poolId); }
2,500,083
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IMatter.sol"; import "./@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./@openzeppelin/contracts/utils/Counters.sol"; import "./@openzeppelin/contracts/access/Ownable.sol"; import "./@openzeppelin/contracts/token/ERC721/extensions/ERC721URISt...
重写合约方法,生成的token防止被转移走
function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata _data ) public override onlyOwner { _beforeMatterTransfer(); return super.safeTransferFrom(from, to, tokenId, _data); }
14,084,193
/** *Submitted for verification at Etherscan.io on 2022-04-06 */ // SPDX-License-Identifier: CC0 /** *Submitted for verification at Etherscan.io on 2022-04-03 */ // File: @openzeppelin/[email protected]/utils/Counters.sol // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @tit...
Owner can withdraw all the eth that was paid to mint NFTs
function withdraw() public onlyOwner { address payable recipient = payable(address(msg.sender)); recipient.transfer(address(this).balance); }
10,796,747
pragma solidity ^0.4.11; // File: contracts/CAVAssetInterface.sol contract CAVAssetInterface { function __transferWithReference(address _to, uint _value, string _reference, address _sender) returns(bool); function __transferFromWithReference(address _from, address _to, uint _value, string _reference, ad...
called by the owner to unpause, returns to normal state Only admin is allowed to execute this method./
function unpause() external onlyAuthorized returns (bool) { paused = false; return true; }
13,026,431
./full_match/43114/0x6a9a9156785e711378B24e30d2771c3868Ab4289/sources/contracts/TOAST2.sol
------------------------------------------------------------------------ Token owner can approve for spender to transferFrom(...) tokens from the token owner's account. The spender contract function receiveApproval(...) is then executed ------------------------------------------------------------------------
function approveAndCall(address spender, uint256 tokens, bytes memory data) public returns (bool success) { require(freezed[msg.sender] != true); allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sen...
4,543,987
/** *Submitted for verification at Etherscan.io on 2021-11-08 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.3; interface IEthemerals { struct Meral { uint16 score; uint32 rewards; uint16 atk; uint16 def; uint16 spd; } function safeTransferFrom(address from, address to, uint256...
adds / removes long shorts does not check underflow should be fine/
function _changeGamePair(uint8 _priceFeedId, bool _long, bool _stake) internal { GamePair memory _gamePair = gamePairs[_priceFeedId]; if(_long) { gamePairs[_priceFeedId].longs = _stake ? _gamePair.longs + 1 : _gamePair.longs -1; gamePairs[_priceFeedId].shorts = _stake ? _gamePair.shorts + 1 : _ga...
8,017,805
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/contracts/bridge/Bridge.sol
Notifies that the wallet is either old enough or has too few satoshi left and qualifies to be closed. walletPubKeyHash 20-byte public key hash of the wallet. walletMainUtxo Data of the wallet's main UTXO, as currently known on the Ethereum chain. Requirements: - Wallet must not be set as the curr...
function notifyWalletCloseable( bytes20 walletPubKeyHash, BitcoinTx.UTXO calldata walletMainUtxo ) external { self.notifyWalletCloseable(walletPubKeyHash, walletMainUtxo); }
4,856,482
./partial_match/8453/0xD65Abd7014B638e4b9b8657063389Eb1abB9689a/sources/contracts/enforcer/HolographRoyalties.sol
Set the wallets and percentages for royalty payouts. Limited to 10 wallets to prevent out of gas errors. For more complex royalty structures, set 100% ownership payout with the recipient being the payment distribution contract. Function can only we called by owner, admin, or identity wallet. Addresses...
function configurePayouts(address payable[] memory addresses, uint256[] memory bps) public onlyOwner { require(addresses.length == bps.length, "ROYALTIES: missmatched lenghts"); require(addresses.length <= 10, "ROYALTIES: max 10 addresses"); uint256 totalBp; for (uint256 i = 0; i < addresses.length; i...
16,799,327
./full_match/40/0x2AE991C66cE9D9Fd4318e67B0b94E2B4170faa5D/sources/contracts/ChainspotProxy.sol
Meta proxy - transfer transaction initiation _token IERC20 Token address (address(0) - native coins) _approveTo address Approve to address _callDataTo address Calldata address _data bytes Calldata
function metaProxy(IERC20 _token, address _approveTo, address _callDataTo, bytes calldata _data) external payable nonReentrant { require(clients[_callDataTo].exists, "ChainspotProxy: wrong client address"); if (address(_token) == address(0)) { proxyCoins(_callDataTo, _data); ...
9,546,761
//Address: 0x198889d1b8948a297048d85eb99d0b692c2a699d //Contract name: TheRichest //Balance: 0 Ether //Verification Date: 12/13/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.19; contract TheRichest { address owner; address public theAddress; uint256 public theBid; functio...
all money will go to dogcharity projects
function gameOver() public { if (msg.sender == owner) { selfdestruct(owner); } }
7,291,156
pragma solidity >=0.4.22 <0.6.0; pragma experimental ABIEncoderV2; contract Join2 { mapping (int64 => offer[10000]) endTimeMap; //only Date, 0 means no endTime mapping (int64 => uint256) public mapindex; mapping (address => bool) verifiers; //int64[] indices; mapping (address =>...
emit tripStart(tripAddress, tripKey, msg.sender, block.number);
function startTrip(int64 endTime, uint256 index) public { require(endTimeMap[endTime][index].reservedAdress == msg.sender && endTimeMap[endTime][index].started == 0); endTimeMap[endTime][index].started = block.number; }
7,229,578
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; uint public NUM_INITIAL_AIRLINES = 4; uint public INSURANCE_ST_PAID = 1; uint public INSURANCE_ST_CLOSED = 2; uint public INSURANCE_ST_...
Transfers eligible payout funds to insuree/
function pay(address passengerAddress) external requireIsOperational { uint256 balance = passengerBal[passengerAddress]; require(address(this).balance > balance, 'Not enough contact balance'); passengerBal[passengerAddress] = 0; passengerAddress.transfer(balance); }
7,220,724
./full_match/5/0x93EA5c5f0961E9912E77211ef5888618E4DC7e7e/sources/src/token/ERC1155/extensions/lockable/ERC1155Lockable.sol
@inheritdoc IERC1155Lockable/
function unlockByFacet( address account, uint256 id, uint256 amount ) public virtual override { if (address(this) != msg.sender) { revert SenderIsNotSelf(); } _unlock(account, id, amount); }
1,890,665
pragma solidity ^0.4.24; /** * @title SpinWinInterface */ interface SpinWinInterface { function refundPendingBets() external returns (bool); } /** * @title AdvertisingInterface */ interface AdvertisingInterface { function incrementBetCounter() external returns (bool); } contract SpinWinLibr...
Player exchanges token for Wei tokenAmount The amount of token to be exchanged return Return true if success/ Generate exchangeId Make sure we don't process the exchange bet twice Update exchange metric Store the info about this exchange/ Burn token at this address/ If send failed, let player withdraw via playerWithdr...
function exchangeToken(uint256 tokenAmount) public isExchangeAllowed(msg.sender, tokenAmount) { (uint256 weiValue, uint256 sendWei, uint256 tokenRemainder, uint256 burnToken) = _lib.calculateExchangeTokenValue(settingAddress, tokenAmount); _setting.spinwinIncrementUintSetting('totalTokenExchanges'); bytes32 ...
6,478,575
./full_match/5/0xf4E8C58FFd75279C73A4b92438e71eB2b7Ddc81f/sources/contracts/FairAuctionGoer.sol
Returns whether the sale has already ended/
function hasEnded() public view returns (bool){ return END_TIME <= _currentBlockTimestamp(); }
11,635,588
./full_match/97/0x042238D9e76CcacA649572EE7DDd2Bccb49596b1/sources/project_/contracts/diamond/libraries/LibTestnetStorageReset.sol
Redeploy a new LibApxReward contract, the new contract modifies the storage location. So there is no need to reset the storage of this contract
function _resetApxRewardStorage() private { }
3,262,701
pragma solidity ^0.5.10; contract NEST_NodeSave { IBMapping mappingContract; IBNEST nestContract; ...
inject NONSTANDARD NAMING
function CHECKNODEALLAMOUNT929() public view returns (uint256) {
898,755
./full_match/4/0x95d4254e8AE36a924AB13891b4AC48121dA670F5/sources/browser/_Vote.sol
0 - define virtual proposal action function all new votes will override this method with the intended function to be activated on vote passing1- define ACTIVATION function2- define power function simple 1:1 token to vote
function myVotingPower(address _address) public view returns(uint256) { uint256 _power = 0; function proposalAction() public virtual returns (bool); require(voteEnd < now, "Voting still ongoing"); require(!decisionActivated, "Vote decision has already been activated"); proposal...
13,319,330
./full_match/41/0x2E33255F0fa6Ebff0fA644795ecF3d6d67c7785b/sources/contracts/openzeppelin/token/ERC20/presets/ERC20PresetMinterPauser.sol
Unpauses all token transfers. See {ERC20Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`./
function unpause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), 'ERC20PresetMinterPauser: must have pauser role to unpause'); _unpause(); }
16,372,799
./full_match/1/0xcC9C64f3640B418d4373Cb584B93Caccd128DC6b/sources/contracts/WagmiFootball.sol
assignTeam( _team, _tokenId);
function Airdrop(uint256 _t,uint256 _mintAmount, address _receiver) public onlyOwner { require(totalSupply() + _mintAmount <= supplyLimit, 'Max supply exceeded!'); _safeMintTeam(_receiver, _mintAmount,_t); }
9,788,759
// SPDX-License-Identifier: MIT /** * Author: Lambdalf the White */ pragma solidity 0.8.10; import "../ERC1155Base.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. */ abstract contract ERC1155BaseBurn...
xref:ROOT:erc1155.adocbatch-operations[Batched] version of {burnFrom}. Emits a {IERC1155-TransferBatch} event. Requirements: - `ids` and `amounts` must have the same length./
function batchBurnFrom( address account_, uint256[] memory ids_, uint256[] memory amounts_ ) public virtual { _batchTransfer( msg.sender, account_, address( 0 ), ids_, amounts_, "" ); }
2,482,962
./full_match/43113/0x62270cdf489c3403507e71B1D11592431b02Affd/sources/project_/contracts/Twenty6Fifty2.sol
minting process for the main sale _numberOfTokens number of tokens to be minted/
function mint(uint64 _numberOfTokens) external payable { require(block.timestamp >= SALE_OPENS && block.timestamp <= SALE_CLOSES, "Public sale closed"); require(totalSupply() + _numberOfTokens <= MAX_SUPPLY, "Not enough left"); require(TOKEN_PRICE * _numberOfTokens <= msg.value, 'Missing eth...
13,212,956
//Address: 0x14b2d558687942834839874d33a73c852be5401d //Contract name: AuctionableWorldCupPlayerToken //Balance: 0.07 Ether //Verification Date: 6/15/2018 //Transacion Count: 54 // CODE STARTS HERE pragma solidity 0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic au...
Starts an Auction by setting endsAtBlock past current block. auctionIndex Index of Auction in auctions array./
function _startAuction(uint256 auctionIndex) internal { auctions[auctionIndex].endsAtBlock = block.number + AUCTION_BLOCK_LENGTH; }
6,393,285
pragma solidity ^0.5.16; contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private initializing; /** * @dev Modifier to...
Allow the owner to update the owner of the TornomyERC20 token.
function transferTokenOwnership(TornomyTokenGateway _nextTokenOwner) public onlyOwner { token.transferOwnership(address(_nextTokenOwner)); _nextTokenOwner.claimTokenOwnership(); }
1,984,773