file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0x256D8718b4321Db10C694FD7AE0E0a80EA90E73E/sources/BIGAPECOIN.sol | force Swap back if slippage issues. | function forceSwapBack() external onlyOwner {
require(balanceOf(address(this)) >= swapTokensAtAmount, "Can only swap when token amount is at or higher than restriction");
swapping = true;
swapBack();
swapping = false;
emit OwnerForcedSwapBack(block.timestamp);
}
| 2,620,747 |
... | inject NONSTANDARD NAMING | function BALANCEOF371(address who) external view returns (uint256); | 15,873,278 |
./partial_match/8453/0x6c0B6cDBf6e1910CD5821440872a6C6145526658/sources/BaseBridge.sol | assert and increment the nonce. no message shuffling queue the following msgs inside of a stack to simulate a successful send on src, but not fully delivered on dst warning, might run into gas issues trying to forward through a bunch of queued msgs shift all the msgs over so we can treat this like a fifo via array.pop(... | function receivePayload(
uint16 _srcChainId,
bytes calldata _path,
address _dstAddress,
uint64 _nonce,
uint _gasLimit,
bytes calldata _payload
) external override receiveNonReentrant {
StoredPayload storage sp = storedPayload[_srcChainId][_path];
... | 16,692,450 |
pragma solidity ^0.5.16;
import "./VToken.sol";
import "./ErrorReporter.sol";
import "./PriceOracle.sol";
import "./ComptrollerInterface.sol";
import "./ComptrollerStorage.sol";
import "./Unitroller.sol";
import "./Governance/XVS.sol";
import "./VAI/VAI.sol";
/**
* @title Venus's Comptroller Contract
* @author Venu... | Validates seize and reverts on rejection. May emit logs. vTokenCollateral Asset which was used as collateral and will be seized vTokenBorrowed Asset which was borrowed by the borrower liquidator The address repaying the borrow and seizing the collateral borrower The address of the borrower seizeTokens The number o... | function seizeVerify(
address vTokenCollateral,
address vTokenBorrowed,
address liquidator,
address borrower,
uint seizeTokens) external {
vTokenCollateral;
vTokenBorrowed;
liquidator;
borrower;
seizeTokens;
if (false) {
... | 1,063,651 |
pragma solidity >=0.4.24 <0.6.0;
/*
* 安全操作函数
* SafeMath to avoid data overwrite
*/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
require(a == 0 || c / a == b, "overwrite error");
return c;
}
function div(uint a, uint b) internal pur... | criterias that be a candidate | function candidateCriteria(address candidate, uint256 pledge) private view returns(bool){
uint256 balance = justitia.residePledge(candidate);
if(MINIMUM_PLEDGE_TOKEN <= balance && balance >= pledge){
return true;
}
return false;
}
| 6,440,565 |
pragma solidity ^0.4.21;
interface SvEns {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, add... | Constructs a new ENS registrar./ | function SvEnsRegistry() public {
records[0x0].owner = msg.sender;
}
| 2,282,066 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// ... | See {IERC721RedeemBase-redemptionRate}/ | function redemptionRate() external view virtual override returns (uint16) {
return _redemptionRate;
}
| 1,513,042 |
pragma solidity 0.7.3;
import "@openzeppelin/contracts-upgradeable/math/MathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgra... | update the contribution amount for the beneficiary | function _deposit(uint256 amount, address sender, address beneficiary) internal {
require(amount > 0, "deposit 0");
require(beneficiary != address(0), "holder undefined");
uint256 toMint = totalSupply() == 0
? amount
: amount.mul(totalSupply()).div(underlyingBalanceWithInvestment());
... | 14,634,233 |
./full_match/4/0x41921B07BbdC5660c309A17c30F797c4340112Ab/sources/contracts/dildaoDegenPass.sol | Function that is used to extend/renew multiple tokens expiry date for 365 days free of charge, only callable by the owner. _tokenIds The token IDs to extend/renew./ | function ownerRenewTokenLong(uint[] calldata _tokenIds) external onlyOwner {
require(_tokenIds.length > 0, "Invalid array length.");
for (uint i=0; i<_tokenIds.length; i++) {
require(_exists(_tokenIds[i]), "Token does not exist.");
uint _currentexpiryTime = expi... | 12,440,078 |
./full_match/11155111/0xCF4eddFEA1A91C87cA82F34113c5C609E579ecbD/sources/project_/contracts/onefile_exhcange.sol | Calculates current state of the order. Will revert transaction if this order is not fillable for any reason, or if the order signature is invalid. orderParam The OrderParam object containing Order data. orderAddressSet An object containing addresses common across each order. return An OrderInfo object containing the ... | function getOrderInfo(OrderParam memory orderParam, OrderAddressSet memory orderAddressSet)
internal
view
returns (OrderInfo memory orderInfo)
{
require(getOrderVersion(orderParam.data) == SUPPORTED_ORDER_VERSION, ORDER_VERSION_NOT_SUPPORTED);
Order memory order = getOrd... | 3,787,531 |
./partial_match/1/0x44383018ecf3DBED34eE621439a5Ff6002e8209b/sources/contracts/libraries/GovernanceUtilV1.sol | Returns resolution info of the given account for a cover product's incident. Warning: this function does not validate the input arguments. s Specify store instance account Specify the account to get stakes coverKey Enter cover key productKey Enter product key incidentDate Enter incident date totalStakeInWinningCa... | function getResolutionInfoForInternal(
IStore s,
address account,
bytes32 coverKey,
bytes32 productKey,
uint256 incidentDate
)
public
view
returns (
uint256 totalStakeInWinningCamp,
uint256 totalStakeInLosingCamp,
uint256 myStakeInWinningCamp
)
{
(uint256 ... | 10,998,095 |
./full_match/5/0x13FDeFcadca58916f3BFDD492dBa2F522fb58558/sources/ERC1410Operator.sol | Revokes authorisation of an operator previously given for a specified partition of `tokenHolder` _partition The partition to which the operator is de-authorised _operator An address which is being de-authorised | function revokeOperatorByPartition(
bytes32 _partition,
address _operator,
address tokenHolder
) external onlyOwner {
operatorForThisPartition[tokenHolder][_partition][_operator] = false;
emit RevokedOperatorByPartition(_partition, _operator, tokenHolder);
}
| 1,852,810 |
./full_match/1/0xBCF9F4c6FC589c89d4aAdE063010D0f5B3733680/sources/contracts/staking/Staking.sol | Delegate tokens to an indexer. _delegator Address of the delegator _indexer Address of the indexer to delegate tokens to _tokens Amount of tokens to delegate return Amount of shares issued of the delegation pool/ Only delegate a non-zero amount of tokens Only delegate to non-empty address Only delegate to staked ind... | function _delegate(
address _delegator,
address _indexer,
uint256 _tokens
) private returns (uint256) {
require(_tokens > 0, "!tokens");
require(_indexer != address(0), "!indexer");
require(stakes[_indexer].hasTokens(), "!stake");
DelegationPool storage p... | 4,905,316 |
// SPDX-License-Identifier: UNLICENSED
// This code is taken from https://github.com/OpenZeppelin/openzeppelin-labs
// with minor modifications.
pragma solidity ^0.7.0;
import './UpgradeabilityProxy.sol';
/**
* @title OwnedUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with basic authori... | Allows the proxy owner to upgrade the current version of the proxy and call the new implementation to initialize whatever is needed through a low level call. implementation representing the address of the new implementation to be set. data represents the msg.data to bet sent in the low level call. This parameter may ... | function upgradeToAndCall(address implementation, bytes memory data) payable public onlyProxyOwner {
upgradeTo(implementation);
require(success);
}
| 302,189 |
./full_match/1/0x7358Eb6EBEd017345940328ce20B5ddc2B91F9b0/sources/src/Core.sol | Bridges funds in native or erc20 and a payment transaction payload to the destination chain lzBridgeData The configuration for the cross bridge transaction tokenData The token swap data and payment transaction payload lzTxObj The configuration of gas and dust for post bridge execution/ only swap if we need to | function bridgeAndExecute(
LzBridgeData calldata lzBridgeData,
TokenData calldata tokenData,
IStargateRouter.lzTxObj calldata lzTxObj
) external payable handleFees(lzBridgeData.fee, tokenData.amountIn, tokenData.tokenIn) {
_receiveErc20(tokenData.amountIn, tokenData.tokenIn);
... | 16,572,390 |
pragma solidity ^0.4.25;
import "./ERC721XToken.sol";
// Our own token based on ERC721x Token
contract ZombieCard is ERC721XToken {
// map to monitor the supply of SE and LE cards
// SE = Standard Edition
// LE = Limited Edition
mapping(uint => uint) internal tokenIdToIndividualSupply;
// map to s... | Symbol of the token on wallets / marketplaces / exchanges | function symbol() external view returns (string) {
return "ZCX";
}
| 6,439,926 |
./partial_match/1/0xB2E2af80192e0715a7C31D4b86394e3943D13888/sources/ERC1155Azuki.sol | Creates `amounts` new tokens for `to`, using the next available `ids`. - the caller must have the `MINTER_ROLE`./ | function autoMintBatch(address to, uint256[] memory amounts) external onlyMinter {
require(to != address(0), "ERC1155: mint to the zero address");
for (uint256 i = 0; i < amounts.length; i++) {
autoMint(to, amounts[i]);
}
}
| 3,900,411 |
pragma solidity ^0.4.11;
contract token { function transfer(address, uint){ } }
contract CrowdsaleWatch {
address public beneficiary;
uint public fundingGoal; uint public amountRaised; uint public deadline; uint public price;
token public tokenReward;
mapping(address => uint256) public balanceOf;
... | checks if the goal or time limit has been reached and ends the campaign / | function checkGoalReached() afterDeadline {
if(amountRaised >= fundingGoal && !fundingGoalReached){
fundingGoalReached = true;
GoalReached(beneficiary, amountRaised);
}
crowdsaleClosed = true;
}
| 6,509,975 |
pragma solidity ^0.4.23;
contract DrainMe {
//constants
address public winner = 0x0;
address public owner;
address public firstTarget = 0x461ec7309F187dd4650EE6b4D25D93c922d7D56b;
address public secondTarget = 0x1C3E062c77f09fC61550703bDd1D59842C22c766;
address[] public players;
mapping(address=>bool) approvedPla... | require (msg.value >= 0.03 ether); | function test() public payable {
require(msg.sender == owner);
bytes32 hash = keccak256(blockhash(block.number-1));
uint256 secret = uint256(hash);
what(secret);
if(secret%5==0){
contr.DranMe();
contr.becomePlayer.value(0.02 ether)();
contr... | 15,439,695 |
./full_match/9001/0x9142f0e8dA6C6798b207536567B883269bf0A9E3/sources/contracts/StarFarmLib.sol | Add the specified preset starPerBlock | function addBlockReward(uint256 _block, uint256 _reward) external onlyOwner {
require(_block > block.number,"block error");
blockReward.push(BlockReward({
plannedBlock: _block,
plannedReward: _reward
}));
}
| 11,534,124 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
// OpenZeppelin contracts
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "hardhat/console.sol";
error MintTimeNotPu... | only the owner can change the baseURI | function revealTokens() public onlyOwner {
reveal = true;
}
| 6,378,271 |
./partial_match/42220/0x553a2a1B70725C1042A0D76e16f4f5a683648dEB/sources/src/shared/message/TokenMessageLib.sol | Encode the WithTokens portion of a message into bytes. The WithTokens portion of a message follows a simple specification: WITH TOKENS - bridge - 1 byte. - assetIdentifier - 2 bytes + assetIdentifier bytearray - amount - 32 bytes. @custom:reverts AssetIdentifierLength() if the asset identifier is ... | function encodeWithTokens(TokenMessage memory message) internal pure returns (bytes memory) {
if (message.assetIdentifier.length > type(uint16).max || message.assetIdentifier.length == 0) {
revert AssetIdentifierLength();
}
if (message.amount == 0) {
revert ZeroAmount... | 3,498,080 |
/**
*Submitted for verification at Etherscan.io on 2021-06-24
*/
pragma solidity ^0.4.24;
contract SimpleMultiSig {
// EIP712 Precomputed hashes:
// keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)")
bytes32 constant EIP712DOMAINTYPE_HASH = 0xd87cd6ef79d4e2b... | Note that address recovered from signatures must be strictly increasing, in order to prevent duplicates EIP712 scheme: https:github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md | function execute(uint8[] sigV, bytes32[] sigR, bytes32[] sigS, address destination, uint value, bytes data, address executor, uint gasLimit) public {
require(sigR.length == threshold);
require(sigR.length == sigS.length && sigR.length == sigV.length);
require(executor == msg.sender || executor == address(... | 7,730,822 |
/* 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... | Gets Number of tokens deposit in a vote using Claim assessor's address and claim id. return tokens Number of deposited tokens./ | function getTokensClaim(
address _of,
uint _claimId
)
external
view
returns (
uint claimId,
uint tokens
)
{
return (_claimId, allvotes[userClaimVoteCA[_of][_claimId]].tokens);
}
| 2,578,309 |
./partial_match/3/0x3CCE8F87fC3de880bDD29bDa04E0a10aD2Ad161C/sources/Mining.sol | User storage user = findUser(msg.sender); | function obtainCar() public returns(uint256[] memory,uint256[] memory) {
User memory user = users[msg.sender];
require(user.investment>0,"Tokens to 0");
require(!obtainRecord[duration()][msg.sender],"Have been received");
(uint256[18] memory _carI... | 5,068,369 |
/**
*
* FEAR OF MISSING OUT!
*
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in... | 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 _lamboFactory(address from, address to, uint256 amount) internal virtual { }
| 55,478 |
./full_match/1/0xC4dde7b7946F8b8498850D78cC4fC79bd7C3201E/sources/contracts/TokenSale.sol | Transfer the tokens to the user | function claim() external whenClaimingPeriod {
uint256 tokensToClaim = getVestedAmount(msg.sender) -
claimedAmount[msg.sender];
require(tokensToClaim > 0, "No tokens to claim");
yoloToken.transfer(msg.sender, tokensToClaim);
claimedAmount[msg.sender] += tokensToClaim;
... | 4,838,598 |
// SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity ^0.8.10;
import "./mixins/NonTransferrableErc20.sol";
import "./mixins/Vesting.sol";
import "./mixins/Claiming.sol";
import "./mixins/MerkleDistributor.sol";
import "./vendored/mixins/StorageAccessible.sol";
/// @dev The token that manages how the CoW Prot... | This function verifies the provided input proof based on the provided input. If the proof is valid, the function [`performClaim`] is called for the claimed amount. index The index that identifies the input claim. claimType See [`performClaim`]. claimant See [`performClaim`]. claimableAmount The maximum amount that ... | function claim(
uint256 index,
ClaimType claimType,
address claimant,
uint256 claimableAmount,
uint256 claimedAmount,
bytes32[] calldata merkleProof
) external payable {
_claim(
index,
claimType,
claimant,
cl... | 12,096,484 |
pragma solidity ^0.4.24;
interface ERC20 {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function name() external view returns (string);
function symbol() external view returns (string);
fu... | ERC165: 주어진 인터페이스가 구현되어 있는지 확인합니다. ERC165 ERC20 | function supportsInterface(bytes4 interfaceID) external view returns (bool) {
return
interfaceID == this.supportsInterface.selector ||
interfaceID == 0x942e8b22 ||
interfaceID == 0x36372b07;
}
| 923,872 |
./full_match/1/0x4452b85dE653D2c39f565Bba8f0CbebbF76fDc57/sources/EMPlaws.sol | This function is meant to propose that a law is removed nothing ot be done | function proposeLawRemoval(address _associatedContract) external
checkProposedLawRemoval(_associatedContract)
{
}
| 9,785,330 |
pragma solidity 0.5.7;
import "./SafeMath.sol";
// Factory interface
contract FactoryInterface {
function deploy(bytes memory code, bytes32 salt) public returns(address);
}
// Wallet interface
contract WalletInterface {
function setOwner(address payable _owner) public;
}
// Datastore contract
contract VersionCo... | public function to view a user's wallet balance | function viewBalance(string memory _username) public view returns (uint256) {
bytes memory usernameBytes = bytes(_username);
bytes32 usernameKey = keccak256(usernameBytes);
require(users[usernameKey].exists, "User does not exist.");
User storage user = users[usernameKey];
return(user.walletAddr... | 12,736,156 |
./partial_match/42/0xd670bc0919f73bE421cCA8664d3F46e528cc2bf3/sources/ExportCdpProxy.sol | Use a packed `signature` to add this contract as a delegate of caller on the `target` contract. target The contract to add delegation to. user The user delegating access. delegate The address obtaining access. signature A packed signature. | function addDelegatePacked(IDelegable target, address user, address delegate, bytes memory signature) internal {
bytes32 r;
bytes32 s;
uint8 v;
(r, s, v) = unpack(signature);
target.addDelegateBySignature(user, delegate, type(uint256).max, v, r, s);
}
| 3,319,341 |
// SPDX-License-Identifier: GNU-GPL v3.0 or later
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import '@openzeppelin/contracts/utils/introspection/ERC165Checker.sol';
import "./interfaces/IRevest.sol";
im... | return the new (or reused) ID | function splitFNFT(
uint fnftId,
uint[] memory proportions,
uint quantity
function extendFNFTMaturity(
uint fnftId,
uint endTime
) external returns (uint) {
}
| 22,837 |
pragma solidity >=0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
uint256 public MAX_AUTO_REGISTERED_AIRLINES = 4;
uint256 public INSURANCE_STATUS_UNKNOWN = 0;
uint256 public INSURANCE_STATUS_IN_P... | Credits payouts to insurees/ | function creditInsurees(bytes32 flightKey) external requireIsOperational {
InsuranceInfo storage insurance = insurances[flightKey];
if (insurance.status == INSURANCE_STATUS_IN_PROGRESS) {
uint256 insurancePayoutValue = getInsurancePayoutValue(flightKey);
uint256 balance = pas... | 14,109,004 |
./partial_match/80001/0x11AB5b46C42EfBB73c0264093fbF764Eeb619047/sources/contracts/impls/core/WitnetBytecodesDefault.sol | Tells whether provided address could eventually upgrade the contract. false if the WRB is intrinsically not upgradable, or `_from` is no owner | function isUpgradableFrom(address _from) external view override returns (bool) {
address _owner = __bytecodes().owner;
return (
isUpgradable()
&& _owner == _from
);
}
| 8,800,129 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "../SimpleStaking.sol";
import "../../Interfaces.sol";
import "../UniswapV2SwapHelper.sol";
/**
* @title Staking contract that donates earned interest to the DAO
* allowing stakers to deposit Token
* or withdraw their stake in Token
* the contracts b... | Set Gas cost to interest collection for this contract _collectInterestGasCost Gas cost to collect interest _rewardTokenCollectCost gas cost to collect reward tokens/ | function setcollectInterestGasCostParams(
uint32 _collectInterestGasCost,
uint32 _rewardTokenCollectCost
) external {
_onlyAvatar();
collectInterestGasCost = _collectInterestGasCost;
compCollectGasCost = _rewardTokenCollectCost;
}
| 14,052,107 |
// File: contracts/interfaces/IDelegable.sol
pragma solidity ^0.6.10;
interface IDelegable {
function ADDDELEGATE653(address) external; //inject NONSTANDARD NAMING
function ADDDELEGATEBYSIGNATURE882(address, address, uint, uint8, bytes32, byt... | inject NONSTANDARD NAMING | function NONCES538(address user) external view returns (uint256); | 12,707,171 |
./partial_match/4/0x771ab0d54eD3B4FF0Ba80809b88D1F035FA4eae4/sources/SupplySchedule.sol | Convert a high precision decimal to a standard decimal representation./ | function preciseDecimalToDecimal(uint256 i)
internal
pure
returns (uint256)
{
uint256 quotientTimesTen = i /
(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);
if (quotientTimesTen % 10 >= 5) {
quotientTimesTen += 10;
}
return quoti... | 8,509,733 |
pragma solidity ^0.4.11;
/*
* 'LOOK' token sale contract
*
* Refer to https://lookscoin.com/ for more information.
*
* Developer: LookRev
*
*/
/*
* ERC20 Token Standard
*/
contract ERC20 {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _who) constant re... | Tell how many tokens given spender is currently allowed to transfer from given owner. _owner address to get number of tokens allowed to be transferred from the owner of _spender address to get number of tokens allowed to be transferred by the owner of return number of tokens given spender is currently a... | function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| 15,809,691 |
./full_match/1/0x4ED76F1BA3DCdEDa0EDaeE876267f04e5E076769/sources/contracts/Buffer.sol | ============ Function to Initialize Contract ============ | function initialize(
address _owner,
address _marketWallet
) public payable initializer {
shareDetailLength = _shares.length;
require(shareDetailLength == 5, "Shares info length is invalid");
for (uint256 i = 0; i < shareDetailLength; i++) {
totalShares += _sh... | 2,913,572 |
./partial_match/1/0xC62b8c58984a7f9E15933bC9E20159D240Ab0D8D/sources/contracts/interfaces/IParaProxyInterfaces.sol | These functions are expected to be called frequently by tools. | struct Implementation {
address implAddress;
bytes4[] functionSelectors;
}
| 2,783,924 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721.sol";
import "./Ownable.sol";
contract Edgerunners is ERC721, Ownable {
using Address for address;
using Strings for uint256;
// metadata
bool public metadataLocked = false;
string public baseURI = "";
// supply an... | Withdraw ether from this contract, callable by shareholder/ | function withdrawShareholder() external {
require(msg.sender == shareholderAddress, "Only Shareholder");
uint256 balance = address(this).balance;
uint256 availableToWithdraw = ((balance + withdrawnByOwner + withdrawnByShareholder) * SHAREHOLDER_PERCENTAGE / 100) - withdrawnByShareholder;
... | 11,767,512 |
// 8888888888 .d88888b. Y88b d88P .d8888b. d8888 888b d888 8888888888
// 888 d88P" "Y88b Y88b d88P d88P Y88b d88888 8888b d8888 888
// 888 888 888 Y88o88P 888 888 d88P888 88888b.d88888 888
// 8888888 888 888 Y888P 888 ... | See {IERC721Metadata-tokenURI}./ | function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory baseURI = _baseURI();
return
... | 1,121,363 |
pragma solidity 0.4.19;
import "./PayrollInterface.sol";
import "../node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol";
import "../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol";
contract Payroll is PayrollInterface {
using SafeMath for uint256;
struct Token {
address ... | Changes the contract state to Blocked, so employees won't able to receive payments / | function blockPayments()
external
onlyByOwner
{
paymentsState = State.Blocked;
LogPaymentsBlocked(getTime());
}
| 6,484,483 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.4 <0.8.0;
pragma experimental ABIEncoderV2;
import "https://github.com/vigilance91/solidarity/EIP/introspection/Canary/encoder/iEncoderEIP801.sol";
import "https://github.com/vigilance91/solidarity/EIP/introspection/Canary/encoder/abiEncoderEIP801.sol";
///... | return {bytes} payload for a `blockAge` call to an external contract or proxy | function blockAge(
)public pure override returns(
bytes memory
){
return abiEncoderEIP801.SIG_BLOCK_AGE;
}
| 12,716,045 |
./full_match/56/0xD8cf478df654912431f1b41B635a7C8393B8a495/sources/project_/contracts/BUSDStakerV12.sol | Withdraw claimable reward | function redepositAllCapital() external {
(uint256[] memory activeDeposits, uint256 idsLen) = getActiveDeposit(
msg.sender
);
require(idsLen != 0, "No deposit available");
(uint256 _apr, uint256 _devFee) = getCurrentUserFees(msg.sender);
(uint256 _rApr, ) = getCu... | 3,252,422 |
./full_match/7001/0x40aF9F5720d7C573d06F9D2003Aa1d7dD60eD97B/sources/contracts/Bitsave.sol | check savings interest by reading the storage of userChildContract TODO: Use bitsave token instead | function handleUsersInterest(
string calldata nameOfSaving,
address childContractAddress,
address _ownerAddress
) public payable {
userChildContract = UserContract(payable(childContractAddress));
uint256 interestAccumulated = userChildContract.getSavingInterest(
... | 13,228,890 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
contract OxyaStaking is Ownable, ReentrancyGuard {
mapping(uint256 => address) public depositaries;
address public OxyaAddress;
bool public isActive = false;
event Staked(address owner, uint256 tokenId, uint256 timeframe);
event Unsta... | unstake tokens out of the contract _tokenIds tokenIds of token to unstake/ | function batchUnstake(uint256[] memory _tokenIds) public {
for (uint256 i = 0; i < _tokenIds.length; i++) {
unstake(_tokenIds[i]);
}
}
| 12,886,204 |
// SPDX-License-Identifier: MIT License
pragma solidity >=0.7.0 <0.9.0;
import ''; //insert token contract here
contract Faucet {
srch public token; //"srch" must be changed to reflect your token contract
bool public activeFaucet;
mapping(address => bool) public hasClaimed; //map address... | function to power on the fuacet | function activateFaucet() public { | 6,441,237 |
./partial_match/1/0x2fC947e908Bc9a0A1E3098a34115765376d0b87f/sources/GamblxJackpot.sol | Returns current game jackpot./ | function getPlayedGameJackpot()
public
view
returns (uint)
{
return getGameJackpot(game);
}
| 2,670,021 |
./full_match/1/0x58e27aCD119a13Bb41C795B9362B6C6dD39e0F3b/sources/erc-payable-token/contracts/token/ERC1363/IERC1363.sol | IERC1363 Interface Interface for a Payable Token contract as defined in/ | interface IERC1363 is IERC20, IERC165 {
function transferAndCall(address to, uint256 value) external returns (bool);
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value) external returns (b... | 3,098,369 |
./full_match/43114/0x6351C5c0F6A7b9519F459d7C98aADA73594Ced5a/sources/perklefarms.sol | See {ERC20-_beforeTokenTransfer}. Requirements: - minted tokens must not cause the total supply to go over the cap./ | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {
require(totalSupply().add(amount) <= _cap, "BEP20Capped: cap exceeded");
}
| 4,608,566 |
./full_match/1/0x9642c7026822391100a4773d7aA597AE18ECE7dd/sources/Synthetix.sol | Check if a specific currency's rate hasn't been updated for longer than the stale period./ sUSD is a special case and is never stale. | function rateIsStale(bytes32 currencyKey)
public
view
returns (bool)
{
if (currencyKey == "sUSD") return false;
return lastRateUpdateTimes(currencyKey).add(rateStalePeriod) < now;
}
| 16,502,924 |
// PensionPlan
// Warning: For protection of our investors, Pension Plan token should not be purchased before 6/10/2021. Such practice will result in address being excluded from transacting forever and lost of investment.
// Sources flattened with hardhat v2.6.4 https://hardhat.org
// File @openzeppelin/contracts/tok... | Creates a new snapshot and returns its snapshot id. Emits a {Snapshot} event that contains the same id. {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a set of accounts, for example using {AccessControl}, or it may be open to the public. [WARNING] ==== While... | function _snapshot() internal returns (uint256) {
_currentSnapshotId.increment();
uint256 currentId = _getCurrentSnapshotId();
emit Snapshot(currentId);
return currentId;
}
| 1,187,228 |
./full_match/1/0x817987c96b71875c7F61e36E45F950dE9b6FAbb7/sources/@openzeppelin/contracts/token/ERC20/ERC20.sol | Moves `amount` of tokens from `sender` to `recipient`. This 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 virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender... | 8,316,663 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.21 <0.7.0;
pragma experimental ABIEncoderV2;
contract Administrateur {
string idAdmin;
string nomAdmin;
string prenomAdmin;
uint256 numeroTel;
string mailAdmin;
string password;
//declaration de structure pour les roles
struct ro... | récupéré les nom de roles contenu dans le tableau listRole | function changeEmail(string memory newEmail) public {
mailAdmin = newEmail;
}
| 12,779,395 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;
import "../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contra... | Views / Mutators / Events / SPDX-License-Identifier: MIT | interface IWETH {
function deposit() external payable;
function withdraw(uint256) external;
} | 1,251,787 |
./partial_match/4/0x90b353612aaC7c3c90F3207b57c00487828Edd02/sources/Lock.sol | Allows beneficiary of locked asset to claim asset after lock-up period ends id Id of the locked asset/ | function claim(uint256 id) external {
LockedAsset memory lockedAsset = _lockedAssets[id];
require(
lockedAsset.status == Status.OPEN,
"LOCK: Lock is already closed!!"
);
uint256 amount = 0;
if (ETH_ADDRESS == lockedAsset.token) {
amount =... | 8,747,223 |
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.4;
import "./interface/IProcessPayments.sol";
import "./interface/IMerchant.sol";
import "./chainlink/IAggregatorV3.sol";
import "./token/IERC20.sol";
import "./utils/Context.sol";
import "./utils/Ownable.sol";
contract POS is IProcessPayments, Ownable {
addre... | returns the latest round price from chainlink oracle. Requirements: `_oracleAddress` the address of the oracle. return the current latest price from the oracle./ | function fetchOraclePrice(string memory _ticker)
private
view
returns (uint256)
{
address oracleAddress = _oracles[bytes(_ticker)];
(, int256 price, , , ) = IAggregatorV3(oracleAddress).latestRoundData();
return uint256(price);
}
| 13,124,893 |
./full_match/8453/0xC64149c0e8A67A88Fc2345A450367088c2341612/sources/@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol | Returns the stream with all its properties. Throws if the id does not point to a valid stream. streamId The id of the stream to query. Returns the stream object./ | function getStream(uint256 streamId)
external
view
streamExists(streamId)
returns (
address sender,
address recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime,
uint256 remainingBalance,
uint256 ratePerSecond
)
{
... | 11,546,432 |
pragma solidity 0.7.0;
import "./Modules/Administration.sol";
import "./Math/SafeMath.sol";
import "./Interfaces/ERC20Interface.sol";
contract PaymentChannels is Administration {
using SafeMath for uint256;
string constant public VERSION = "0.4.3alpha";
bytes private prefix = "\x19Ethereum Signed Message:\n32"... | make sure that once the channel is finalized ONLY the destination can withdraw funds lets close the channel | function closeErcChannel(
bytes32 _channelId,
address _tokenAddress)
public
returns (bool)
{
require(channelIds[_channelId]);
require(ercChannels[_channelId].state == ChannelStates.finalized);
require(msg.sender == ercChannels[_channelId].destination);
require(_tokenAddress == ercChannels[_channelId].... | 1,779,690 |
./partial_match/3/0x3281A3E6A5287B11b23F1Ecd164Ec287803E6d9a/sources/ANALFARMING.sol | View function to see pending tokens on frontend. | function pendingAnal(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accAnalPerShare = pool.accAnalPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (block.number > po... | 5,078,736 |
./full_match/1/0x1c2220437B068A8C124AC1d158f7F786fbeA701e/sources/lend-core/contracts/protocol/tokenization/HToken.sol | @inheritdoc IHToken | function withdrawLTRewards(address stHope, address to) external onlyPoolAdmin returns (uint256) {
if (to == address(0)) to = msg.sender;
uint256 claimableTokens = IStakingHOPE(stHope).claimableTokens(address(this));
require(claimableTokens > 0, 'no rewards to claim');
address _minter = IStakingHOPE(... | 9,653,912 |
./full_match/4/0x161a27c5D793c9D72687a6d6771BA08a6765Bf18/sources/_aave/periphery-v3/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol | @inheritdoc IStakedTokenTransferStrategy | function dropApproval() external onlyRewardsAdmin {
IERC20(UNDERLYING_TOKEN).approve(address(STAKE_CONTRACT), 0);
}
| 12,530,975 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./ACPI1.sol";
import "./ACPI2.sol";
import "./ACPI3.sol";
import "./ACPI4.... | @inheritdoc IACPIMaster | function tokenToClaim() external view override returns (uint256) {
return _tokenToClaim();
}
| 939,975 |
./partial_match/42/0x3c5406ddCE4836eA2E5817DCF021fE1E9B0796cC/sources/GebProxyIncentivesActions.sol | Generates debt and sends COIN amount (deltaWad) and provides it as liquidity to Uniswap manager address taxCollector address coinJoin address uniswapRouter address - Uniswap V2 Router safe uint - Safe Id wad uint - Amount of debt to generate minTokenAmounts uint[2] - minimum ETH/Token amounts when providing liqu... | function generateDebtAndProvideLiquidityUniswap(
address manager,
address taxCollector,
address coinJoin,
address uniswapRouter,
uint safe,
uint wad,
uint[2] calldata minTokenAmounts
) external payable {
DSTokenLike systemCoin = DSTokenLike(CoinJoi... | 3,422,533 |
./partial_match/56/0xF526A916E1dc0Ce92c44C9542523FDe9663A2F3D/sources/StratX_Value.sol | Harvest farm tokens Swap half earned to token0 Swap half earned to token1 | function earn() public whenNotPaused {
require(isAutoComp, "!isAutoComp");
if (onlyGov) {
require(msg.sender == govAddress, "Not authorised");
}
if (isCAKEStaking) {
IPancakeswapFarm(farmContractAddress).withdraw(pid, 0);
}
earnedAmt = distr... | 11,133,908 |
./partial_match/1/0x34E5E2E571ea4C54A2106C7D8f4DF9A6366ef5d4/sources/contracts/BaconCoin/BaconCoin3.sol | TransferFrom func must be overwritten to also moveDelegates when balance is transferred | function transferFrom(address src, address dst, uint256 amount) public override returns (bool) {
require(super.transferFrom(src, dst, amount));
_moveDelegates(delegates[src], delegates[dst], amount);
return true;
}
| 4,481,833 |
./full_match/1/0xeBaaa4A1645d9693689E66525a8C2e6153f44Cc4/sources/contracts/RINGV3.sol | Open Trading & Add Liquidity | function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Rout... | 9,769,039 |
./full_match/80001/0x060a72D4b25E187AEdCC1712a41EAa3621ad5EB3/sources/SnowBall-v1/SupportController.sol | 创建新合约 更新地址map controller授權asset給Vault合約 | function createVault(ERC20 asset_, string memory name_, string memory symbol_, uint8 factor_, uint8 ratio_) external returns (address vaultAddr) {
Vault vault = new Vault(msg.sender, asset_, name_, symbol_, factor_, ratio_);
vaultAddr = address(vault);
allVaults[msg.sender].push(va... | 9,485,364 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title: MinteVipTicket
/// @authors: manifold.xyz & Collector
import "./ERC721Creator.sol";
contract MVIP is ERC721Creator {
uint256 public price = 40000000000000000; //0.04 ETH
bool public saleIsActive = true;
uint private rand;
const... | See {ICreatorCore-setBaseTokenURI}./ | function setBaseTokenURI(string calldata uri) external override adminRequired {
_setBaseTokenURI(uri);
}
| 6,220 |
pragma solidity ^0.5.0;
import "../TransferManager.sol";
import "./BlacklistTransferManagerStorage.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/**
* @title Transfer Manager module to automate blacklist and restrict transfers
*/
contract BlacklistTransferManager is BlacklistTransferManagerStora... | Used to add the blacklist type _startTime Start date of the blacklist type _endTime End date of the blacklist type _blacklistName Name of the blacklist type _repeatPeriodTime Repeat period of the blacklist type in days/ | function addBlacklistType(uint256 _startTime, uint256 _endTime, bytes32 _blacklistName, uint256 _repeatPeriodTime) public withPerm(ADMIN) {
_addBlacklistType(_startTime, _endTime, _blacklistName, _repeatPeriodTime);
}
| 12,908,400 |
/****
*
* 888b 88 ,ad8888ba, 88
* 8888b 88 d8"' `"8b 88
* 88 `8b 88 d8' 88
* 88 `8b 88 ,adPPYba, 88 ,adPPYYba, ,adPPYba, 88,dPPYba,
* 88 `8b 88 a8" ... | for govern value/ | function setRate(uint256 burn_rate, uint256 reward_rate) public
onlyGovernance
{
require(_maxGovernValueRate >= burn_rate && burn_rate >= _minGovernValueRate,"invalid burn rate");
require(_maxGovernValueRate >= reward_rate && reward_rate >= _minGovernValueRate,"invalid reward rate");
... | 13,064,971 |
pragma solidity 0.5.16;
interface IBEP20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
... | Atomically decreases 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 {BEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have a... | function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
return true;
}
| 444,937 |
// SPDX-License-Identifier: BUSL-1.1 AND Unlicense AND MIT AND GPL-2.0-or-later
////// SPDX-License-Identifier-FLATTEN-SUPPRESS-WARNING: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
/// @notice E... | / if there is no affiliate 100% of the baseFee should go to feeRecipient | function _distributeFees(uint256 fees0, uint256 fees1) internal {
uint256 baseFee = IICHIVaultFactory(ichiVaultFactory).baseFee();
uint256 baseFeeSplit = (affiliate == NULL_ADDRESS)
? PRECISION
: IICHIVaultFactory(ichiVaultFactory).baseFeeSplit();
address feeRecipient... | 1,119,762 |
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol | Reads the bytes10 at `cdPtr` in calldata. | function readBytes10(
CalldataPointer cdPtr
) internal pure returns (bytes10 value) {
assembly {
value := calldataload(cdPtr)
}
}
| 3,218,208 |
pragma solidity ^0.4.24;
// File: contracts/zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @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 publi... | Returns the length in runes of the slice. Note that this operation takes time proportional to the length of the slice; avoid using it in loops, and call `slice.empty()` if you only need to know whether the slice is empty or not. self The slice to operate on. return The length of the slice in runes./ Sta... | function len(slice self) internal returns (uint l) {
var ptr = self._ptr - 31;
var end = ptr + self._len;
for (l = 0; ptr < end; l++) {
uint8 b;
if (b < 0x80) {
ptr += 1;
ptr += 2;
ptr += 3;
ptr += 4;
... | 1,242,845 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
interface INFTContract {
function Mint(address _to, uint256 _quant... | Set the NFT contract address/ | function setNFTContract(address _NFTContract) external onlyOwner {
NFTContract = INFTContract(_NFTContract);
}
| 14,099,879 |
./full_match/1/0xF81A9cE3098Cdf4f4F6f1467E1bA23f2F5331163/sources/GOLDKILLER.sol | exclude from paying fees or having max transaction amount | function _beforeTokenTransfer(
address from,
address to,
uint256 amount
function _afterTokenTransfer(
address from,
address to,
uint256 amount
}
}
}
}
constructor() ERC20("The Gold Killer", "Aqua Regia") {
IUniswapV2Router02 _uniswapV2Router = IUn... | 16,418,271 |
/*
file: OZRealestatesToken.sol
ver: 0.1.0
modifier: Chris Kwan
date: 26-Aug-2017
email: ecorpnu AT gmail.com
(Adapted from VentanaToken.sol by Darryl Morris)
A collated contract set for a token sale specific to the requirments of
Ozreal's OZRealestates token product.
This software is distributed in the h... | ICO must be successful Notify the Ozreal contract it has been sent tokens | function transfer(address _to, uint _amount)
public
preventReentry
returns (bool)
{
require(icoSuccessful);
super.transfer(_to, _amount);
if (_to == Ozreal)
require(Notify(Ozreal).notify(msg.sender, _amount));
return true;
}
| 6,582,407 |
./full_match/1/0x666E6748db572ebC3AE40e4Ce7748bC9bE7A5AAe/sources/Users/kstasi/Documents/side/dANT/contracts/RewardsType2.sol | Assess new reward. _user Address of the user. | function updateStakingReward(address _user) internal override {
super.updateStakingReward(_user);
executeUnstakes(_user);
}
| 4,935,822 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./interfaces/ICozy.sol";
import "./interfaces/ICozyInvest.sol";
interface ICrvDepositZap {
function add_liquidity(
uint256[... | Protected divest method for exiting a position entered using this contract's `invest` method _ethMarket Address of the market to repay ETH to _recipient Address where any leftover ETH should be transferred _yearnRedeemAmount Amount of Yearn receipt tokens to redeem _curveMinAmountOut The minAmountOut we expect to r... | function divest(
address _ethMarket,
address _recipient,
uint256 _yearnRedeemAmount,
uint256 _curveMinAmountOut
) external payable {
require((_ethMarket == moneyMarket || _ethMarket == protectionMarket), "Invalid borrow market");
ICozyEther _market = ICozyEther(_ethMarket);
uint256 _qu... | 156,301 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
import "./Commons.sol";
import "./IdentityContractFactory.sol";
import "./ClaimVerifier.sol";
import "./IEnergyToken.sol";
import "./EnergyTokenLib.sol";
import "./../dependencies/erc-1155/contracts/ERC1155.sol";
import "./IERC165.sol";
/**
* The EnergyToken co... | Do not set forward kind of generation plant because storage plants can have multiple forwards for the same balance period. | function createPropertyForwards(uint64 _balancePeriod, ComplexDistributor _distributor, EnergyTokenLib.Criterion[] calldata _criteria) external override(IEnergyToken) onlyStoragePlants(msg.sender, _balancePeriod) onlyDistributors(address(_distributor), _balancePeriod) {
require(_balancePeriod > Commons.getB... | 5,474,586 |
./full_match/1/0xF75D485E9cd0063947e255a214e60bc247fF40f5/sources/convex-platform/contracts/contracts/BaseRewardPool.sol | also withdraw from linked rewards | function withdraw(uint256 amount, bool claim)
public
updateReward(msg.sender)
returns(bool)
{
require(amount > 0, 'RewardPool : Cannot withdraw 0');
for(uint i=0; i < extraRewards.length; i++){
IRewards(extraRewards[i]).withdraw(msg.sender, amount);
}... | 4,880,813 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
//
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since w... | Distributes the dev fund to the developer addresses, callable by anyone Reset dev fund to 0 before distributing any funds Distribute dev fund according to percentages | function distributeDevFund() public virtual {
uint256 totalDistributionAmount = devFund;
devFund = 0;
for (uint256 i = 0; i < devCount; i++) {
uint256 devPercentage = devAllocations[devIDs[i]];
uint256 allocation = totalDistributionAmount.mul(devPercentage).div(
... | 87,741 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Unicode.sol";
import "./UTF8Encoder.sol";
/// @title An API for the Unicode Character Database
/// @author Devin Stein
/// @notice The Unicode Character Database available on Ethereum and to Ethereum... | Check if `_char` is a mark This is only for a single Unicode character not entire strings _char the character to get return True if the character is a mark | function isMark(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "M";
}
| 953,392 |
pragma solidity ^0.4.0;
import "./Owned.sol";
contract HelpOn is Owned {
event UserCreated(uint id, string fullName, string sity, UserRole role);
enum UserRole {
NONE, //0 - user has no role
GETTER, //1 - user who want money for a life
GIVER, //2 - user who want to share money with ... | todo check giver rightstransfer money to organization | function voitForCloseHelpRequest(uint requestId, bool appruved) public onlyGiver {
require(helpRequests.length > requestId, "Help request not found");
require(helpRequestVoiting[requestId].total <= 3, "Voiting is over");
require(helpRequests[requestId].status == HelpRequestStatus.CLOSING, "I... | 6,354,964 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import... | get specified pool supply return pool's supply/ if_succeeds {:msg "getPoolSupply: returns pool's supply"} $result == poolInfo[_mode].supply; | function getPoolSupply(StakeMode _mode) public view returns(uint256) {
return poolInfo[_mode].supply;
}
| 445,604 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Initial funding for the insurance. Unless there are too many delayed flights resulting in insurance payouts, the contract should be self-sustaining/ | function fund () public payable
{
require (airlines[msg.sender] == true,'the airline is not registered yet');
funds[msg.sender] += msg.value;
}
| 12,912,644 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "base64-sol/base64.sol";
import "./constants/Colors.sol";
/// @title Hair SVG generator
library HairDetail {
/// @dev Hair N°1 => Classic Brown
function item_1() public pure returns (string memory) {
return base(classi... | Hair N°5 => Classic Blue | function item_5() public pure returns (string memory) {
return base(classicHairs(Colors.BLUE));
}
| 1,028,749 |
pragma solidity 0.4.19;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed prev... | override transferFrom token for a specified address to add onlyWhenTransferEnabled and validDestination _from The address to transfer from. _to The address to transfer to. _value The amount to be transferred./ | function transferFrom(address _from, address _to, uint _value)
public
validDestination(_to)
onlyWhenTransferEnabled
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
| 927,204 |
pragma solidity 0.6.8;
interface ERC20 {
function TOTALSUPPLY387() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF98(address account) external view returns (uint256); //inject NONSTANDARD NAMING
function TRA... | inject NONSTANDARD NAMING | function ADD133(uint256 a, uint256 b) internal pure returns (uint256) { | 14,036,548 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
// Base
import "./openzeppelin-presets/ERC1155PresetMinterPauserSupplyHolder.sol";
// Meta transactions
import { ERC2771Context } from "@openzeppelin/contracts/metatx/ERC2771Context.sol";
// Protocol control center.
import { ProtocolControl } from "./Pro... | Lets a redeemable token holder to redeem token. Get redeemer Burn NFTs of the 'unredeemed' state. Get access nft Id Transfer Access NFTs to redeemer | function redeemToken(uint256 _tokenId, uint256 _amount) external whenNotPaused {
address redeemer = _msgSender();
require(tokenState[_tokenId].isRedeemable, "AccessNFT: This token is not redeemable for access.");
require(
balanceOf(redeemer, _tokenId) >= _amount && _amount > 0,
... | 5,521,677 |
pragma solidity ^0.4.18;
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 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); //... | return total tokens supplied | function totalNumberTokenSold() public view returns (uint256) {
return totalNumberTokenSold;
}
| 5,378,743 |
pragma solidity >=0.6.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "../utils/Ownable.sol";
/**
* @dev Interface of the ERC20 standard + mint & burn
*/
interface _IERC20 is IERC20 {
/**
* @dev Mint Function
*/
function mint(... | Exists Does not exist | function lockBepro(uint256 _beproAmount) public {
require(_beproAmount > 0, "BEPRO Amount is to be higher than 0");
require(beproToken.transferFrom(msg.sender, address(this), _beproAmount), "Needs Allowance");
if(voters[msg.sender].beproLocked != 0){
voters[msg.sender].votesDele... | 12,737,456 |
//Address: 0x1de89382684ce5a99fc9d3d4b709706d6a013571
//Contract name: SolutionGame
//Balance: 0.542 Ether
//Verification Date: 6/15/2018
//Transacion Count: 89
// CODE STARTS HERE
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
... | Returns whether the specified token exists _tokenId uint256 ID of the token to query the existence of return whether the token exists/ | function exists(uint256 _tokenId) public view returns (bool) {
address owner = tokenOwner[_tokenId];
return owner != address(0);
}
| 6,409,397 |
./full_match/1313161554/0x85B70E933Fe6d0e5FBe83B8D93141499E4C556aa/sources/contracts/RewardDistributor.sol | Accrue JOE/AVAX to the market by updating the supply index rewardType 0: JOE, 1: AVAX cToken The market whose supply index to update/ | function updateRewardSupplyIndex(uint8 rewardType, address cToken)
internal
{
require(rewardType < rewardAddresses.length, "rewardType is invalid");
RewardMarketState storage supplyState = rewardSupplyState[rewardType][
cToken
];
uint256 supplySpeed = rewardSu... | 13,231,508 |
pragma solidity 0.5.15;
pragma experimental ABIEncoderV2;
import 'ROOT/trading/IFillOrder.sol';
import 'ROOT/libraries/ReentrancyGuard.sol';
import 'ROOT/libraries/math/SafeMathUint256.sol';
import 'ROOT/reporting/IMarket.sol';
import 'ROOT/libraries/token/IERC20.sol';
import 'ROOT/trading/IOrders.sol';
import 'ROOT/... | Fill an order _orderId The id of the order to fill _amountFillerWants The number of attoShares desired _tradeGroupId A Bytes32 value used when attempting to associate multiple orderbook actions with a single TX _fingerprint Fingerprint of the filler used to naively restrict affiliate fee dispursement return The amo... | function publicFillOrder(bytes32 _orderId, uint256 _amountFillerWants, bytes32 _tradeGroupId, bytes32 _fingerprint) external returns (uint256) {
address _filler = msg.sender;
Trade.Data memory _tradeData = Trade.create(storedContracts, _orderId, _filler, _amountFillerWants, _fingerprint);
(u... | 971,831 |
// chief.t.sol - test for chief.sol
// Copyright (C) 2017 DappHub, LLC
// 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 ver... | Upset the order. Update the elected set to reflect the new order. Now restore the old order using a slate ID. Update the elected set to reflect the restored order. | function test_voting_by_slate_id() public {
assert(gov.balanceOf(address(uLarge)) == uLargeInitialBalance);
bytes32 slateID = initial_vote();
uLarge.doApprove(gov, address(chief), uLargeInitialBalance);
uLarge.doLock(uLargeInitialBalance);
address[] memory uLargeSlate = ne... | 12,597,519 |
./full_match/56/0x4d2FA1E81661ecaF1FABdB9FF08c582F1ACEf003/sources/contracts/Token.sol | Get daily sell limit factor for a wallet address/ | function _getDailySellLimitFactor(address _address) private view returns (uint256) {
uint256 balance = IERC20(address(this)).balanceOf(_address);
uint256 balanceOfPair = IERC20(address(this)).balanceOf(pair);
if (balanceOfPair == 0) {
return 0;
}
uint256 holdingPercent = balance.mul(100).di... | 3,255,017 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.