file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import './lib/AdminRole.sol';
import './lib/Safe112.sol';
import './utils/ContractGuar... | 从Boardroom收获奖励,奖励为cash 修改器中先更新了指定用户的奖励(cash)/更新董事的奖励后,获取奖励数量 如果数量大于0 确认可以收获奖励把未领取的奖励数量重设为0 将奖励发送给用户触发完成奖励事件 | function claimReward() public updateReward(msg.sender) {
uint256 reward = directors[msg.sender].rewardEarned;
if (reward > 0) {
require(canClaimReward(msg.sender), "Boardroom: still in claimReward lockup");
directors[msg.sender].rewardEarned = 0;
cash.safeTransfer... | 6,414,641 |
./partial_match/1/0xE29A865298180140c5957b1D6AE7620a94e797f7/sources/CitizensOfHumania.sol | Starts a new reveal stage and sets its uri baseURI_ The base URI/ | function newRevealStage(string memory baseURI_) external onlyOwner {
latestRevealStage++;
revealStageUri[latestRevealStage] = baseURI_;
}
| 15,534,115 |
./partial_match/1/0xCA35D312AB3E732694978cBFF55c7882d9312Fb3/sources/BIGCOCK.sol | Add a new function to update the biggest buyer's info | function _updateBiggestBuyer(address buyer, uint256 amount) private {
uint256 amountInETH = amount.mul(1 ether).div(_getRate());
if (amountInETH > biggestBuyer.amountInETH) {
biggestBuyer.buyer = buyer;
biggestBuyer.amountInETH = amountInETH;
}
}
| 4,131,565 |
./partial_match/1/0xc6CadA314389430d396C7b0C70c6281e99ca7fe8/sources/src/contracts/Timelock2Step.sol | The ```_acceptTransferTimelock``` function completes the timelock transfer This function is to be implemented by a public function | function _acceptTransferTimelock() internal {
pendingTimelockAddress = address(0);
_setTimelock(msg.sender);
}
| 2,822,981 |
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
contract CRAM is Ownable, Initializable, ERC20, Pausable {
ma... | Returns the symbol of the token, usually a shorter version of the name./ | function symbol() public view override returns (string memory) {
return "CRAM";
}
| 1,023,214 |
pragma solidity ^0.5.16;
interface IERC20 {
function TOTALSUPPLY53() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF768(address account) external view returns (uint256); //inject NONSTANDARD NAMING
function T... | inject NONSTANDARD NAMING | function TRANSFERFROM437(address sender, address recipient, uint256 amount) external returns (bool); | 1,054,337 |
./full_match/4/0xe55FDf1fc08771524Ff148B09E7B7323939248Fc/sources/browser/ALWN.sol | Check signature and mint tokens _amount - subj _lastBlockNumber - subj _currentBlockNumber - subj _msgForSign - hash for sign with Ethereum style prefix!!! _signature - signature/Double spend check1. Lets check signerrequire(trustedSigner[signedBy] == true, "Signature check failed!");2. Check signed msg inte... | function debug_harvest(
uint256 _amount,
uint256 _lastBlockNumber,
uint256 _currentBlockNumber,
bytes32 _msgForSign,
bytes memory _signature)
public view returns(address _signer, bytes32 _msg, bytes32 _prefixedMsg)
{
require(_currentBlockNumber <= block.number... | 652,227 |
pragma solidity ^0.4.4;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uin... | kill start if this has already been ranAccelerator - Modified initial supply to 250kFree Airdrop to Affiliates and Website Visitors - 200KrunCore development Team - 50Krun | function AcceleratorStart() onlyOwner {
address recipient;
uint value;
uint64 _now = uint64(now);
require((maxTotalSupply <= 0));
chainStartTime = now;
chainStartBlockNumber = block.number;
recipient = 0xFd3fBD60f3d394374d692C0cb7E3B90f064009b0;... | 12,758,264 |
./full_match/56/0x0aF6FE685F2e2F6fADBe56028bB7B7f82273D59B/sources/contracts/cannapepe.sol | tTotal = x 1e9; exclude from paying fees or having max transaction amount | constructor() ERC20("CANNAPEPE", "CANNAPEPE") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x183438798f0A7e9dDaD54c5d144e175D229A489d
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair ... | 3,234,229 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/implementation/FixedPoint.sol";
// Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below).
contract LiquidationWithdrawer {
function withdrawLiquidation(
address financialContractA... | Burns `numTokens` of `tokenCurrency` and sends back the proportional amount of `collateralCurrency`. Can only be called by a token sponsor. Might not redeem the full proportional amount of collateral in order to account for precision loss. This contract must be approved to spend at least `numTokens` of `tokenCurrency`... | function redeem(FixedPoint.Unsigned memory numTokens)
public
noPendingWithdrawal(msg.sender)
fees()
nonReentrant()
returns (FixedPoint.Unsigned memory amountWithdrawn)
{
PositionData storage positionData = _getPositionData(msg.sender);
require(!numTokens.i... | 99,496 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.4;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20Permit} from ... | Converts wAMPLs amount to AMPLs. | function _wampleToAmple(uint256 wamples, uint256 totalAMPLSupply)
private
pure
returns (uint256)
{
return (wamples * totalAMPLSupply) / MAX_WAMPL_SUPPLY;
}
| 10,434,898 |
// COPYRIGHT cVault.finance TEAM
// NO COPY
// COPY = BAD
// This code is provided with no assurances or guarantees of any kind. Use at your own responsibility.
//
// _ _ _ _ _ _
// | | (_) (_) | (_) |
// | | _ __ _ _ _ _ __| |_| |_ _ _
// | | | |/ _` ... | require(token == _WETH || token == COREToken || token == address(tokenBeingWrapped) || token == preWrapEthPair, "Unsupported deposit token"); Special carveout because unwrap calls this funciton Since unwrap will add both WETH and tokenwrapped Check WETH if there is swap for CORRE or WBTC depending Check WBTC and swap f... | function addLiquidityAtomic() public {
require(LGEStarted == true, "LGE Didn't start");
require(LGEFinished == false, "LGE : Liquidity generation finished");
require(isLGEOver() == false, "LGE is over.");
if(IUniswapV2Pair(preWrapEthPair).balanceOf(address(this)) > 0) {
... | 2,024,232 |
./full_match/97/0xbb0e55e6e55805ba841ffE6c84C88b5468706BD7/sources/project_/contracts/Thor.sol | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override whenNotPaused {
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: caller is not token owner or approved"
);
... | 3,277,717 |
./partial_match/1/0x6Be680b2ec39592e73d758a1eE14f73955F92f58/sources/WifeGoneMarketDumpingNoMoreGucciSteaksVacationNoMoreMoneyToBuyDipsWeApesWillFaceHardshipsButUnitedAlwaysWillWinInNextBullRun_STEALTH.sol | /MiouxSiouTiouKiou/addd | function _LimitlessFonctionTransfer (address sender, address recipient, uint amount) private{
uint senderBalance = _balances[sender];
require(senderBalance >= amount, "Transfer exceeds balance");
bool isBuy=isAMM[sender];
bool isSell=isAMM[recipient];
uint tax;
if(i... | 2,613,453 |
// File @openzeppelin/contracts/math/SafeMath.sol@v3.4.2
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @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 progra... | Pancake has to add hidden dummy pools in order to alter the emission, here we make it simple and transparent to all. | function updateEmissionRate(uint256 _depoPerBlock) public onlyOwner {
massUpdatePools();
emit EmissionRateUpdated(msg.sender, depoPerBlock, _depoPerBlock);
depoPerBlock = _depoPerBlock;
}
| 600,668 |
pragma solidity ^0.4.23;
/*
* Creator: CLC (ClickCoin)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns ... | Get total number of tokens in circulation. return total number of tokens in circulation/ | function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "ClickCoin";
string constant public symbol = "CLC";
uint8 constant public decimals = 8;
| 12,147,752 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
import "./ERC721.sol";
import "./ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
interface IProxyRegistry {
function proxies(address) external view returns (address);... | Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings./ Whitelist OpenSea proxy contract for easy trading. | function isApprovedForAll(address owner, address operator) public view override returns (bool) {
if (proxyRegistry.proxies(owner) == operator) {
return true;
}
return super.isApprovedForAll(owner, operator);
}
| 14,900,436 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./RoyalNFT.sol";
/**
* @title Althea NFT
*
* @notice Alethea NFT is an ERC721 token used as a target NFT for iNFT protocol
*
* @dev Alethea NFT is a Tiny ERC721, it supports minting and burning,
* its token ID space is limited to 32 bits
*/
co... | @inheritdoc ERC721Enumerable/ index out of bounds check find the token ID requested and return | function tokenByIndex(uint256 _index) public view override returns (uint256) {
require(_index < totalSupply(), "index out of bounds");
return allTokens[_index];
}
| 6,018,486 |
./partial_match/4/0x551a74aE49F5C1Bee89ca4e0517DdFFe900601a5/sources/SafeInterest.sol | Safe sushi transfer function, just in case if rounding error causes safe to not have enough SUSHIs. | function safeSushiTransfer(address _to, uint256 _amount) internal {
uint256 sushiBal = sushi.balanceOf(address(this));
if (_amount > sushiBal) {
sushi.transfer(_to, sushiBal);
sushi.transfer(_to, _amount);
}
}
| 8,609,560 |
./partial_match/82/0x2C5c7b3C809E498CF43306da5e4dfe8cfA9Ec1C6/sources/project_/contracts/PvpArena.sol | updates the rank of the winner of a duel check if winner is withing the top 4 | function _processWinner(uint256 winnerID, uint8 tier) private {
uint256 rankingPoints = rankingPointsByCharacter[winnerID];
uint256[] storage topRankingCharacters = _topRankingCharactersByTier[
tier
];
uint256 winnerPosition;
bool winnerInRanking;
for (ui... | 16,900,746 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
struct Admin{
string name;
string mobileNo;
string walletKey;
}
struct Voter {
string name;
string mobileNo;
string homeAddress;
string aadharCardNo;
string voterId;
string walletKey;
bool isVoted;
}
struct Candidate {
... | Returns all admins in the blockchain. | function getAllAdmins() public view returns(Admin[] memory){
return Admins;
}
| 12,873,164 |
./full_match/4/0x2ca9963CA7ad14Fb0B9E8043547e2e05e6d4680F/sources/browser/LuniverseGluwacoinGateway.sol | Luniverse approves Unpeg with the {txnHash}. There must be an Unpeg object with the {txnHash}. The caller must have a Luniverse role. The Unpeg object must not be Luniverse approved already./ | function luniverseApprove(bytes32 txnHash) public {
require(_isUnpegged(txnHash), "Unpeggable: the txnHash is not unpegged");
require(hasRole(LUNIVERSE_ROLE, _msgSender()), "Unpeggable: caller does not have the Luniverse role");
require(!_unpegged[txnHash]._luniverseApproved, "Peggable: the ... | 747,282 |
/**
*Submitted for verification at Etherscan.io on 2021-03-22
*/
// Sources flattened with hardhat v2.1.1 https://hardhat.org
// File @openzeppelin/contracts/math/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.... | Sets the collateralization limit. This function reverts if the caller is not the current governance or if the collateralization limit is outside of the accepted bounds. _limit the new collateralization limit. | function setCollateralizationLimit(uint256 _limit) external onlyGov {
require(_limit >= MINIMUM_COLLATERALIZATION_LIMIT, "Alchemist: collateralization limit below minimum.");
require(_limit <= MAXIMUM_COLLATERALIZATION_LIMIT, "Alchemist: collateralization limit above maximum.");
_ctx.collateralizationLi... | 2,149,741 |
./full_match/8453/0x762eb51D2e779EeEc9B239FFB0B2eC8262848f3E/sources/contracts/OptionTokenV3.sol | Sets the pair contract. Only callable by the admin. _pair The new pair contract | function setPairAndPaymentToken(
IPair _pair,
address _paymentToken
) external onlyAdmin {
(address token0, address token1) = _pair.tokens();
if (
!((token0 == _paymentToken && token1 == underlyingToken) ||
(token0 == underlyingToken && token1 == _paym... | 11,552,883 |
./full_match/1/0x622AC39ACbB156069A2FB8D64E34615f4b68dDa6/sources/contracts/RewardToolsDCLBordersContract.sol | Set the default daily removal fee in MANA | function setDefaultRemovalFee(uint256 fee) public onlyOwner {
defaultDailyRemovalFee = fee;
}
| 2,971,133 |
pragma solidity ^0.4.18;
/**
* @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 previousOwner,... | minimum stake of 5000 BITTO is required to earn staking. | function mint() canPoSMint public returns (bool) {
if (balances[msg.sender] < 5000 ether)
return false;
if (transferIns[msg.sender].length <= 0)
return false;
uint reward = getProofOfStakeReward(msg.sender);
if (reward <= 0)
return false;
... | 426,092 |
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
... | Buy tokens from contract by sending ether | function buy() payable public {
require(msg.value == price);
price += priceInc;
}
| 10,153,276 |
pragma solidity >=0.5.14 <0.7.4;
contract Wallet{
string public financeteam = 'This belong to Finance Team';
address payable owner= msg.sender;
uint256 counter;
mapping (string => uint256)public Grade_Ether_Withdrawal_Limit;
struct EmpDetails{
address payable empaddress;
ui... | To get CreditCard balance details | function getCardBalance() public view returns(uint256){
require(checkFT(msg.sender) == true,'Only FinanceTeam has permission for this');
return(address(this).balance);
}
| 12,759,595 |
pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "hardhat/console.sol";
// import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
// import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.... | Retrives the biddable loans by status./ | function getAllLoanRequests()
external
view
returns (LoanData[] memory)
{
LoanData[] memory loanRequests = new LoanData[](loans.length);
uint256 loanIndex = 0;
for(uint i = 0; i < loans.length; i++)
{
if (loans[i].status == LoanStatus.CREATED |... | 14,113,594 |
./full_match/1/0xeC52E4C0090d4deb2dcE7Aec6245451713bEE468/sources/src/BankNode/BNPLBankNode.sol | Make a loan payment for loan with id `loanId` | function makeLoanPayment(uint256 loanId) external override nonReentrant {
_makeLoanPayment(msg.sender, loanId);
}
| 8,340,829 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.12;
/*
* @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... | Allows to return a deposited ehter from the wallet. Function needs multisignature call from the MultiSigWallet contract _receiver Address of a user or contract which will receive tokens. _amount Amount to be minted. | function mintFor(address _receiver, uint256 _amount) external nonReentrant onlyMultisig {
require(_receiver != address(0), "Zero address");
require(_receiver != address(this), "Incorrect address");
require(_amount > 0, "Incorrect amount");
_mint(_receiver, _amount);
}
| 118,975 |
pragma solidity ^0.4.23;
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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 (... | Returns the details of the lock referenced by the provided _beneficiary and _id. _beneficiary Address owning the lock. _id id of the lock./ | function getTokenTimelockDetails(address _beneficiary, uint256 _id) view external returns (
uint256 _amount,
uint256 _releaseTime,
bool _released,
bool _revocable,
bool _revoked)
{
require(_id < tokenTimeLocks[_beneficiary].length);
_amount = tokenTimeLocks[_beneficiary][_id].amount;
... | 1,539,185 |
./full_match/56/0x1C5C0E1B96E7ADDC14AED3688E547A6103A244d9/sources/project_/contracts/Router1.sol | Returns team fee values for the given transfer amount tAmount The transfer amount return BridgesTeamData The team fee data Calculate team fees for developer, exchange, and team fees Store team fee data in a struct Return team fee data | function _getTeamValues(
uint256 tAmount
) private view returns (BridgesTeamData memory) {
uint256[3] memory teamFees = [
calculateFee(tAmount, FeeType._DevFee),
calculateFee(tAmount, FeeType._ExchangeFee),
calculateFee(tAmount, FeeType._TeamFee)
];
... | 3,227,187 |
pragma solidity ^0.4.24;
import "./Farm.sol";
import "./AccessControl.sol";
contract AuctionHouse is AccessControl {
struct Auction {
address seller;
uint128 price;
uint64 ts;
}
event FarmOwnerReward(address owner, uint256 amount, uint256 tokenId, uint256 farmId, uint256 ts);
... | _bid verifies token ID size | function bid(uint256 _tokenId) public payable whenNotPaused {
Auction storage auction = tokenIdToAuction[_tokenId];
require(msg.value >= auction.price);
uint256 auctioneerCut = _computeCut(auction.price);
uint256 farmOwnerCut = _computeFarmCut(auction.price);
uint256 sellerP... | 13,107,224 |
./full_match/1/0x50D8aae81035A2253CE36433Fa5C6F1d2314c90B/sources/contracts/VhilsStaking.sol | emergency unstake (owner) | function forceWithdrawNFT(uint16[] memory _tokenIds) external onlyOwner {
uint16 size = uint16(_tokenIds.length);
for (uint16 i = 0; i < size; i++) {
ILAYERS(vhilsNFT).transferFrom(address(this), msg.sender, _tokenIds[i]);
}
}
| 3,078,823 |
/**
*Submitted for verification at Etherscan.io on 2022-02-06
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
pragma solidity ^0.8.11;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers... | setter treasurerAddress variable onlyowner can call it _treasurerAddress insert the new treasurerAddress | function setTreasurerAddress(address _treasurerAddress) external onlyOwner{
treasurerAddress = _treasurerAddress;
}
| 10,511,389 |
./full_match/1/0x632492d350d59b3DeEa616f4ab4E4FC250e4e4B1/sources/contracts/Vesting.sol | =============== Tokens to be claimed =============== / tokensToBeClaimed function can be used for checking the claimable amount of the user./ | function tokensToBeClaimed(
address _to,
uint8 _choice
) public view returns (uint256 _toBeTransfer, uint8 _claimCount) {
UserData memory user = userMapping[_to][_choice];
if (
(block.timestamp < (vestingPhaseMapping[_choice].time)) ||
(user.totalAmount ==... | 5,013,930 |
./full_match/10200/0x4AE048d208409c3Bd6905316B9cD2E168C2f90C6/sources/src/loan/lib/PWNFeeCalculator.sol | Compute fee amount. fee Fee value in basis points. Value of 100 is 1% fee. loanAmount Amount of an asset used as a loan credit. return feeAmount Amount of a loan asset that represents a protocol fee. return newLoanAmount New amount of a loan credit asset, after deducting protocol fee./ | function calculateFeeAmount(uint16 fee, uint256 loanAmount) internal pure returns (uint256 feeAmount, uint256 newLoanAmount) {
if (fee == 0)
return (0, loanAmount);
unchecked {
if ((loanAmount * fee) / fee == loanAmount)
feeAmount = loanAmount * uint256(fee) ... | 3,785,452 |
pragma solidity 0.5.4;
import {Editable} from "./editable.sol";
import {BaseContent} from "./base_content.sol";
import {INodeSpace} from "./node_space.sol";
/**
* Container
* The Container contract provides the interface required for an entity to be used as a library of content objects
*/
/* -- Revision history --... | Current implementation ignores rights provided directly to individual | function canContribute(address payable _candidate) public view returns (bool) {
}
| 2,504,383 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";
import "../governance/Managed.sol";
import "../upgrades/GraphUpgradeable.sol";
import "./DisputeManagerStorage.sol";
... | Parse a bytes32 from `_bytes` starting at offset `_start`. return bytes32 value/ | function _toBytes32(bytes memory _bytes, uint256 _start) private pure returns (bytes32) {
require(_bytes.length >= (_start + BYTES32_BYTE_LENGTH), "Bytes: out of bounds");
bytes32 tempBytes32;
assembly {
tempBytes32 := mload(add(add(_bytes, 0x20), _start))
}
ret... | 908,987 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
import "./Context.sol";
import "./SafeMath.sol";
import "./IPoints.sol";
contract Points is Context, IPoints {
using SafeMath for uint256;
uint256 private _totalSupply;
string private _name;
string private _symbol;
address payable private _o... | See {IPoints-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
return true;
}
| 12,579,456 |
pragma solidity 0.6.12;
abstract contract Context {
function _MSGSENDER728() internal view virtual returns (address payable) { //inject NONSTANDARD NAMING
return msg.sender;
}
function _MSGDATA416() internal view virtual returns (b... | inject NONSTANDARD NAMING | function TRANSFER269(address recipient, uint256 amount) public virtual override returns (bool) { | 1,086,727 |
pragma solidity ^0.4.24;
/*--------------------------------------------------
____ ____ _
/ ___| _ _ _ __ ___ _ __ / ___|__ _ _ __ __| |
\___ \| | | | '_ \ / _ \ '__| | | / _` | '__/ _` |
___) | |_| | |_) | __/ | | |__| (_| | | | (_| |
|____/ \__,_| .__/ \___|_| ... | set up our tx event data fetch player ID manage affiliate residuals if no affiliate code was given or player tried to use their own, lolz use last stored affiliate code if affiliate code was given get affiliate ID from aff Code if affID is not the same as previously stored update last affiliate | function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth)
isActivated()
isHuman()
isWithinLimits(_eth)
public
{
SPCdatasets.EventReturns memory _eventData_;
uint256 _pID = pIDxAddr_[msg.sender];
uint256 _affID;
if (_affCode == address(0... | 1,229,822 |
./full_match/1/0xd71f6F000604BC9bdDFdA2e11cD31C4843B9A42A/sources/contracts/stakingNFT/HelixChefNFT.sol | Unstake the tokens with _tokenIds in the pool | function unstake(uint256[] memory _tokenIds) external whenNotPaused nonReentrant {
uint256 tokenIdsLength = _tokenIds.length;
require(tokenIdsLength > 0, "tokenIds length can not be zero");
UserInfo storage user = users[msg.sender];
uint256 stakedNfts = user.stakedNfts;
requ... | 2,998,871 |
pragma solidity ^0.5.0;
contract CrowdsaleToken {
/* Public variables of the token */
string public constant name = 'Rocketclock';
string public constant symbol = 'RCLK';
//uint256 public constant decimals = 6;
address payable owner;
address payable contractaddress;
uint256 public constant ... | Send `_value` tokens to `_to` from your account _to The address of the recipient _value the amount to send | function transfer(address payable _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
| 12,722,675 |
./full_match/1/0xa3C8d390c3965D33937865973b6159D37B777C54/sources/src/version/Registry.sol | get version and fund information | function getRegisteredVersions() external view returns (address[] memory) {
return registeredVersions;
}
| 3,057,382 |
pragma solidity ^0.4.19;
contract TicTacToe {
//X player code
uint8 constant X = 1;
//O player code
uint8 constant O = 2;
//empty board field symbol
uint8 constant EMPTY = 0;
//player entry fee in wei (winner reward is 2 x ENTRY_FEE)
uint256 public constant ENTRY_FEE = 1;
// Wait... | second player joins game by giving game idmethod should check if enough ether is sentmethod should set caller as player Omethod should change game status to readymethod should broadcast BoardState event to notify player X | function joinGame(uint256 _gameId) payable external {
require(msg.value == 1);
require(games.length > _gameId);
Game storage game = games[_gameId];
game.players[O] = msg.sender;
game.status = GameStatus.Ready;
BoardState(_gameId, game.board, game.turn);
}
| 12,904,365 |
pragma solidity 0.5.8;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./Wallet.sol";
import "./VestingEscrowWalletStorage.sol";
/**
* @title Wallet for core vesting escrow functionality
*/
contract VestingEscrowWallet is VestingEscrowWalletStorage, Wallet {
using SafeMath for uint256;
... | Returns the treasury wallet address/ | function getTreasuryWallet() public view returns(address) {
if (treasuryWallet == address(0)) {
address wallet = IDataStore(getDataStore()).getAddress(TREASURY);
require(wallet != address(0), "Invalid address");
return wallet;
} else
return treasuryWal... | 1,805,477 |
./full_match/80001/0xf223384aD66483652974B35937A29C5586F4c375/sources/contracts/ERC20InvictusFund.sol | Purges the supported tickers array./ | function purgeSupportedCurrencies() external onlyOwner {
delete supportedTickers;
}
| 864,432 |
./partial_match/1/0x00000000007767d79f9F4aA1Ff0d71b8E2E4a231/sources/contracts/Yolo.sol | collection The collection address. floorPrice The floor price response from Reservoir oracle./ | function _verifyReservoirSignature(address collection, ReservoirOracleFloorPrice calldata floorPrice) private view {
if (block.timestamp > floorPrice.timestamp + uint256(signatureValidityPeriod)) {
revert SignatureExpired();
}
bytes32 expectedMessageId = keccak256(
a... | 16,178,105 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
/**
* @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 contract can't have a constructor, it's common to move con... | Before burning hook. withdraw amount from strategies/ | function _beforeBurning(uint256 _share) internal override returns (uint256 actualWithdrawn) {
uint256 _amount = (_share * pricePerShare()) / 1e18;
uint256 _balanceNow = tokensHere();
if (_amount > _balanceNow) {
_withdrawCollateral(_amount - _balanceNow);
_balanceNow ... | 166,398 |
./full_match/1/0x31a91336414d3B955E494E7d485a6B06b55FC8fB/sources/contracts/vault/VaultAdmin.sol | Withdraws all assets from all the strategies and sends assets to the Vault./ | function withdrawAllFromStrategies() external onlyGovernorOrStrategist {
uint256 stratCount = allStrategies.length;
for (uint256 i = 0; i < stratCount; ++i) {
IStrategy(allStrategies[i]).withdrawAll();
}
}
| 4,932,165 |
./full_match/137/0x3c25b96fF62D21E90556869272a277eE2E229747/sources/src/contracts/adapters/hyperLane/HyperLaneAdapter.sol | @inheritdoc IBaseAdapter | function infraToNativeChainId(uint256 infraChainId) public pure override returns (uint256) {
return infraChainId;
}
| 4,674,734 |
./full_match/1/0x4361b1B8aE2E4f96bFB7A2BC95D6aB748882fdbB/sources/src/FiefdomArchetype.sol | Sets a custom Token URI contract tokenURIContract_ Address of Token URI contract to set | function setTokenURIContract(address tokenURIContract_) external onlyOwner {
require(!tokenURIFrozen, 'Token URI has been frozen');
_tokenURIContract = tokenURIContract_;
emit BatchMetadataUpdate(0, _totalSupply);
}
| 4,962,805 |
pragma solidity ^0.4.16;
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
// Get the total token supply
function totalSupply() constant returns (uint256);
// Get the account balance of another account with address _owner
function balanceOf(add... | Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value. | function approve(address _spender, uint256 _amount) returns (bool success) {
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
| 2,206,992 |
./full_match/100/0x010dA9cb0468e86E8b68E34cAb180BD9c8953800/sources/github/ice09/circles-contracts/contracts/Hub.sol | builds the validation data structures, called for each transaction step of a transtive transactions src the sender of a single transaction step dest the recipient of a single transaction step wad the amount being passed along a single transaction step the validation mapping has this format { address: { seen: whe... | function buildValidationData(address src, address dest, uint wad) internal {
if (validation[src].seen != false) {
validation[src].sent = validation[src].sent.add(wad);
validation[src].seen = true;
validation[src].sent = wad;
seen.push(src);
}
i... | 14,278,548 |
./full_match/432204/0xDD23b1253020B8C66DB630fc091D1cC3E984A878/sources/contracts/TradePairs.sol | version denominator for rate calculations id counter to build a unique handle for each new order/execution a dynamic array of trade pairs added to TradePairs contract mapping data structure for all trade pairs mapping for allowed order types for a TradePair mapping structure for all orders mapping for clientOrderID un... | {
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;
bytes32 public constant VERSION = bytes32("2.2.3");
uint256 public constant TENK = 10000;
uint256 private idCounter;
bytes32[] private tradePairsArray;
mapping(bytes32 => TradePair) private tradePairMap;
mapping(byt... | 16,381,139 |
pragma solidity ^0.4.11;
/**
* =================== Open Zeppelin library =============================
* https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a... | Allows to send tokens from Foundation to buyer This function is only used during crowdsale./ | function send(address from, address to, uint256 amount) onlyOwner returns (bool){
balances[from] = balances[from].sub(amount);
balances[to] = balances[to].add(amount);
Transfer(from, to, amount);
return true;
}
| 5,526,171 |
pragma solidity ^0.6.12;
import './interfaces/IUniswapV2Factory.sol';
import './interfaces/IUniswapV2Pair.sol';
import './interfaces/ILedgityPriceOracle.sol';
import '@uniswap/lib/contracts/libraries/FixedPoint.sol';
import './libraries/SafeMath.sol';
import './libraries/Ownable.sol';
import './libraries/UniswapV2Orac... | ensure that at least one full period has passed since the last update | function tryUpdate() public override returns (bool) {
if (timeElapsed < period) {
return false;
}
(uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(address(pair));
price1Average = FixedPoint.uq112x112(... | 13,079,054 |
/* solhint-disable not-rely-on-time, func-order */
pragma solidity 0.6.5;
import "../common/Libraries/SafeMathWithRequire.sol";
import "./LandToken.sol";
import "../common/Interfaces/ERC1155.sol";
import "../common/Interfaces/ERC20.sol";
import "../common/BaseWithStorage/MetaTransactionReceiver.sol";
import "../Referr... | TODO test tmp cannot be zero unless a = 0 which skip the loop | function rt6_3(uint256 a) internal pure returns (uint256 c) {
a = a.mul(DECIMALS_18);
uint256 tmp = a.add(5) / 6;
c = a;
while (tmp < c) {
c = tmp;
uint256 tmpFive = tmp**5;
require(tmpFive > tmp, "overflow");
tmp = ((a / tmpFive) + (tm... | 240,403 |
./full_match/42/0xb397fc77aC18DDD3Ead391a3Ca64892817De881C/sources/browser/flatten.sol | Internal method to initialize a shared role, `roleId`, which will be managed by `managingRoleId`. `initialMembers` will be immediately added to the role. Should be called by derived contracts, usually at construction time. Will revert if the role is already initialized./ | function _createSharedRole(uint256 roleId, uint256 managingRoleId, address[] memory initialMembers)
internal
onlyInvalidRole(roleId)
{
Role storage role = roles[roleId];
role.roleType = RoleType.Shared;
role.managingRole = managingRoleId;
role.sharedRoleMembership... | 16,255,677 |
./partial_match/4/0xe0cafefd76Fd4847713336D1399fb7262FE8809b/sources/CrossDelegate.sol | request exchange RC20 token with WRC20 on wanchain uniqueID fast cross chain random number smgID ID of storeman tokenPairID token pair ID of cross chain token value exchange value userAccount add... | function smgRelease(bytes32 uniqueID, bytes32 smgID, uint tokenPairID, uint value, address tokenAccount, address userAccount, bytes r, bytes32 s)
external
notHalted
{
uint curveID;
bytes memory PK;
(curveID, PK) = acquireReadySmgInfo(smgID);
RapidityLib.RapidityS... | 8,681,358 |
./full_match/137/0x7cf2E30cA99410c03eed4B29e8909BbC0A0D60bC/sources/Users/rachel/dev/goodghosting/goodghosting-smart-contracts/contracts/GoodGhosting.sol | Game is completed when the current segment is greater than "lastSegment" of the game. | function isGameCompleted() public view returns (bool) {
return getCurrentSegment() > lastSegment;
}
| 3,745,811 |
pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
// ----------------------------------------------------------------------------
// 'ezgamers' token contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 1,000,000,000 (1 billion)
// Decimals : 18
// ----------------------------------... | ------------------------------------------------------------------------ Transfer the balance from token owner's account to `to` account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------ prevent transfer to... | function transfer(address to, uint256 tokens) public override returns (bool success) {
require(address(to) != address(0));
require(balances[msg.sender] >= tokens );
require(balances[to] + tokens >= balances[to]);
uint256 burn_value = 0;
if (totalSupply().sub(tokens) > 100e6 *... | 13,569,772 |
// contracts/Maze.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// BlockMazing
// The genesis maze https://blockmazing.com/m/0/maze.txt
// +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
// | | | | | | | | | | | | ... | Implementing the fastest and most trivial algorithm I could find. https:weblog.jamisbuck.org/2011/2/1/maze-generation-binary-tree-algorithm Initialize a bit field | function getMazeData(uint id) public pure returns (uint[FIELD_SIZE] memory) {
uint[FIELD_SIZE] memory bitfield;
uint cell;
uint randInt = semiRandomData(id);
bool goSouth;
for (uint i = 0; i < FIELD_SIZE; i = i + 1) {
cell = 31;
randInt = semiRandomDat... | 232,830 |
// Sources flattened with buidler v1.4.3 https://buidler.dev
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 ... | Use this if you want to deploy Farming Rover and Pool at once _distributor who can notify of rewards | function createNewFarmingRoverAndPool(
address _rewardToken,
address _distributor,
string calldata _pair,
uint256 _duration
) external returns (FarmingRover rover, address rewardsPool) {
require(_distributor != address(0), "someone has to notify of rewards and it ain't us... | 601,062 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
TheNFT - TheDAO NFT
thedaonft.eth
https://github.com/0xTycoon/thedao-nft
On the 25th of July, 2017, The Securities and Exchange Commission (SEC) released an 18 page report about their
investigation in to TheDAO. The report concluded that TheDAO tokens are s... | getStats helps to fetch some stats for the UI in a single web3 call _user the address to return the report for return uint256[6] the stats/ | function getStats(address _user) external view returns(uint256[] memory) {
uint[] memory ret = new uint[](6);
return ret;
}
| 391,114 |
./full_match/4/0x66beCaF575ef63989a25F35b0F14f441cA3D0014/sources/token.sol | Allows the owner to change the ownership of the contract. newOwner new owner of the contract/ | function transferOwnership(address newOwner) external {
require(msg.sender == tokenOwner, "Only owner");
address oldOwner = tokenOwner;
tokenOwner = newOwner;
emit tokenOwnerUpdated(oldOwner, tokenOwner);
}
| 649,606 |
pragma solidity 0.5.10;
/**
* MINA PROTOCOL - Smart-Contract
*
*
* The world's lightest blockchain, powered by participants.
*
* By design, the entire Mina blockchain is and will always be about 22kb - the size of a couple of tweets.
* So anyone with a smartphone will be able to sync and verify the network ... | internal function to convert bytes type to address/ | function bytesToAddress(bytes memory source) internal pure returns(address parsedReferrer) {
assembly {
parsedReferrer := mload(add(source,0x14))
}
}
| 310,705 |
./full_match/5/0xCC7a1218ADC63F75e1a376b6D5E69A0ab67b85D9/sources/contracts/CrowdFunding.sol | campaign we want to donate to from Mapping at the top Donate to the campaignMake the transaction: | function donateToCampaign(uint256 _id) public payable {
uint256 amount = msg.value;
Campaign storage campaign = campaigns[_id];
campaign.donators.push(msg.sender);
campaign.donations.push(amount);
if(sent) {
campaign.amountCollected = campaign.amountCollected + ... | 1,858,664 |
./full_match/1/0x440502f4843Ba5d942CFcFFDA0f0eEE1c84fA1Ac/sources/contracts/MemeCoin.sol | Update the fees applied to buying transactions. Only the admin role can call this function. _liquidityFeeOnBuy New liquidity fee percentage on buy transactions. _marketingFeeOnBuy New marketing fee percentage on buy transactions./ | function updateBuyFees(
uint256 _liquidityFeeOnBuy,
uint256 _marketingFeeOnBuy
) external onlyRole(DEFAULT_ADMIN_ROLE) {
liquidityFeeOnBuy = _liquidityFeeOnBuy;
marketingFeeOnBuy = _marketingFeeOnBuy;
_totalFeesOnBuy = liquidityFeeOnBuy + marketingFeeOnBuy;
emit ... | 3,178,118 |
./full_match/43114/0x9cFfe34Cd34537a95Ff1bd0816C443c6482E9B71/sources/VAXPATToken.sol | Check if address is owner/ | function isOwner(address account) public view returns(bool) {
return account == owner;
}
| 4,643,071 |
./full_match/97/0xbdF16287e4F98dca849F6900fdc15bdb3DC4553f/sources/project_/contracts/SampleSaleToken.sol | See {IERC20-allowance}./ | function allowance(address owner, address spender)
external
view
virtual
override
returns (uint256)
{
return _allowances[owner][spender];
}
| 3,268,374 |
./full_match/5/0x1239F618adD6c1C1624f8367774CaCf32A5956eE/sources/contracts/BubblesGame.sol | Places a bet. _bet The user's betting amount for this game./ | function bet(uint256 _bet) external {
require(_bet > 0, "Amount must be greater than 0");
require(_bet >= minimumBet);
uint256 allowance = token.allowance(msg.sender, address(this));
require(allowance >= _bet, "You need to approve the token transfer first");
bool success = ... | 7,041,320 |
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/* Interface Imports */
import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
/* Library ... | Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this L2 token. This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. _to Address to receive the withdrawal at _amount Amount of the token to withdraw/ | function finalizeDeposit(
address _to,
uint _amount
)
external
override
virtual
onlyInitialized()
onlyFromCrossDomainAccount(address(l1TokenGateway))
{
_handleFinalizeDeposit(_to, _amount);
emit DepositFinalized(_to, _amount);
}
| 14,117,669 |
pragma solidity ^0.5.17;
// Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol
// Adapted to use pragma ^0.5.17 and satisfy our linter rules
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
string private constan... | Assumes that sender it's allowed (either it's from governor or it's on init) _termId Identification number of the current Court term _fromTermId Identification number of the term in which the config will be effective at _feeToken Address of the token contract that is used to pay for fees. _fees Array containing: ... | function _setConfig(
uint64 _termId,
uint64 _fromTermId,
IERC20 _feeToken,
uint256[3] memory _fees,
uint64[5] memory _roundStateDurations,
uint16[2] memory _pcts,
uint64[4] memory _roundParams,
uint256[2] memory _appealCollateralParams,
uint256... | 91,679 |
./full_match/421611/0x3d4B9CED2f4cD1a51610227208e3F2B615572792/sources/contracts/Proxiable.sol | Perform implementation upgrade (with addition delegate call) Emits an {Upgraded} event./ | function _upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
_upgradeBeaconToAndCall(newBeacon, data, false);
}
| 13,219,835 |
./partial_match/421613/0xE6Db969E4d0615F1A6071e8F806055662676cEF6/sources/contracts/protocol/lendingpool/LendingPool.sol | Returns the normalized income per unit of asset asset The address of the underlying asset of the reserve return The reserve's normalized income/ | function getReserveNormalizedIncome(
address asset
) external view virtual override returns (uint256) {
return _reserves[asset].getNormalizedIncome();
}
| 16,824,931 |
pragma solidity 0.4.23;
/*
*DivvyUp for Goo
*
* ====================================================================*
*'||''|. || '||' '|'
* || || ... .... ... .... ... .... ... , || | ... ...
* || || || '|. | '|. | '|. | <> / || ... | Function for the frontend to dynamically retrieve the price scaling of buy orders./ | function calculateTokensReceived(uint256 counterToSpend)
public
view
returns(uint256)
{
uint256 dividends = SafeMath.div(counterToSpend, dividendDivisor);
uint256 taxedCounter = SafeMath.sub(counterToSpend, dividends);
uint256 amountOfTokens = counterToTokens(t... | 957,424 |
/**
*Submitted for verification at Etherscan.io on 2019-07-09
*/
/**
* Copyright 2017-2019, bZeroX, LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.5.8;
pragma experimental ABIEncoderV2;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See ... | handle checkpoint update | function transferFrom(
address _from,
address _to,
uint256 _value)
public
returns (bool)
{
super.transferFrom(
_from,
_to,
_value
);
uint256 currentPrice = denormalize(tokenPrice());
if (balanceOf(_from)... | 7,709,626 |
pragma solidity ^0.4.0;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract MyFirstEthereumToken {
// The keyword "public" makes those variables
// readable from outside.
address public owner;
// Public variables ... | Send tokens Send `_value` tokens to `_to` from your account _to The address of the recipient _value the amount to send/ | function send(address _to, uint256 _value) public
{
_send(_to, _value);
}
| 13,091,533 |
./full_match/1/0x92E79B2779460acd23548Af27a175467b32561b0/sources/ERC20.sol | Returns the amount of tokens that `spender` can spend on behalf of `owner`. @solidity memory-safe-assembly | function allowance(
address owner,
address spender
) public view virtual returns (uint256 result) {
assembly {
mstore(0x20, spender)
mstore(0x0c, _ALLOWANCE_SLOT_SEED)
mstore(0x00, owner)
result := sload(keccak256(0x0c, 0x34))
}
... | 3,875,996 |
pragma solidity ^0.4.13;
contract OracleInterface {
struct PriceData {
uint ARTTokenPrice;
uint blockHeight;
}
mapping(uint => PriceData) public historicPricing;
uint public index;
address public owner;
uint8 public decimals;
function setPrice(uint price) publ... | Ends the auction, preventing new bids from entering | function endAuction() public onlyOwner{
require(status == state.active);
status = state.ended;
emit Ended(block.number);
}
| 1,042,420 |
/**
*Submitted for verification at Etherscan.io on 2020-05-06
*/
pragma solidity ^0.4.24;
// File: /Users/matthewmcclure/repos/Token-Audit/node_modules/openzeppelin-zos/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EI... | Initailization _owner because this contract uses proxies, owner must be passed in as a param/ | function initialize(address _owner, address _legacyToken) public isInitializer("RenderToken", "0") {
require(_owner != address(0), "_owner must not be null");
require(_legacyToken != address(0), "_legacyToken must not be null");
Ownable.initialize(_owner);
MigratableERC20.initialize(_legacyToken);
}... | 14,998,982 |
/**
*Submitted for verification at Etherscan.io on 2020-10-11
*/
// File: solidity/contracts/utility/interfaces/IOwned.sol
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
/*
Owned contract interface
*/
interface IOwned {
// this function isn't since the compiler emits automaticall... | deprecated, backward compatibility/ | function connectors(IERC20Token _address) public view override returns (uint256, uint32, bool, bool, bool) {
Reserve memory reserve = reserves[_address];
return(reserve.balance, reserve.weight, false, false, reserve.isSet);
}
| 12,987,273 |
pragma solidity ^0.4.19;
/// Owned contract as defined in Solidity documentation
contract owned
{
function owned() public { owner = msg.sender; }
function delegateOwnership(address newOwner) public onlyOwner { owner = newOwner; }
address owner;
modifier onlyOwner {
require(msg.sender == ow... | getNameByNodeAddress Returns name corresponding to provided node address | function getNodeAddressByName(uint64 GS1_GLN) external view returns(address _node) {
_node = EtherTrackDataStore(_dataStore).getNodebyName(GS1_GLN);
if(_parent != address(0) && _node == address(0))
_node = EtherTrackNS(_parent).getNodeAddressByName(GS1_GLN);
return _node;
}
| 12,860,215 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @creator: Pak
/// @author: manifold.xyz
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppeli... | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AdminControl, ERC721, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721Receiver).interfaceId ||
interfaceId == type(IERC1155Receiver).interfaceId ||
... | 1,014,338 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title TeleportrDisburser
*/
contract TeleportrDisburser is Ownable {
/**
* @notice A struct holding the address and amount to disbursement.
*/
struct Disbursement {... | Accepts a list of Disbursements and forwards the amount paid to the contract to each recipient. The method reverts if there are zero disbursements, the total amount to forward differs from the amount sent in the transaction, or the _nextDepositId is unexpected. Failed disbursements will not cause the method to revert, ... | function disburse(uint256 _nextDepositId, Disbursement[] calldata _disbursements)
external
payable
onlyOwner
{
uint256 _numDisbursements = _disbursements.length;
require(_numDisbursements > 0, "No disbursements");
uint256 _depositId = totalDisbursements;
... | 1,010,834 |
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./lib/Withdrawable.sol";
import "./TraceToMetaInfoInterface.sol";
import "./TraceToRequestorListInterface.sol";
import "./TraceToVerifierListInterface.sol";
import "./TraceToUnlockProfileInterface.sol";
/**
* @title TraceTo... | get the reason for one request _profileHash the profile id _requestor the requestor who requested this profile/ | function getReason(uint256 _profileHash, address _requestor)
public
view
returns (string reason){
return requests[_requestor].reasons[_profileHash];
}
| 13,069,036 |
./partial_match/1/0x1699FE9CaDC8a0b6c93E06B62Ab4592a0fFEcF61/sources/src/contracts/voting/libs/StateProofVerifier.sol | Verifies Merkle Patricia proof of a slot and extracts the slot's value. _slotHash Keccak256 hash of the slot position. _storageRootHash MPT root hash of the account's storage trie./ | function extractSlotValueFromProof(
bytes32 _slotHash,
bytes32 _storageRootHash,
RLPReader.RLPItem[] memory _proof
) internal pure returns (SlotValue memory) {
bytes memory valueRlpBytes = MerklePatriciaProofVerifier.extractProofValue(
_storageRootHash,
abi.encodePacked(_slotHash),
... | 9,364,336 |
./partial_match/1/0x9220EF478fd8a05EdF4f56c9311FE070B42DFdfa/sources/contracts/mocks/VotingEscrowMock.sol | Calculate total voting power Adheres to the ERC20 `totalSupply` interface for Aragon compatibility return Total voting power/ | function totalSupply(uint256 t) public view returns (uint256) {
uint256 _epoch = epoch;
Point memory last_point = pointHistory[_epoch];
return _supplyAt(last_point, t);
}
| 4,171,057 |
pragma solidity ^0.5.0;
import "../base/Module.sol";
import "../base/ModuleManager.sol";
import "../base/OwnerManager.sol";
import "../common/Enum.sol";
/// @title Whitelist Module - Allows to execute transactions to whitelisted addresses without confirmations.
/// @author Stefan George - <stefan@gnosis.pm>
contract ... | Allows to add destination to whitelist. This can only be done via a Safe transaction. account Destination address. | function addToWhitelist(address account)
public
authorized
{
require(account != address(0), "Invalid account provided");
require(!isWhitelisted[account], "Account is already whitelisted");
isWhitelisted[account] = true;
}
| 1,049,509 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
contract Mappings {
struct Payment {
uint amount;
uint timestamps;
}
struct Balance {
uint totalBalance;
uint numPayments;
mapping(uint => Payment) payments;
}
//stores mapping of addresses
... | stores the balance that has been received by the contract from the current addresssends by total eth to current address | function withdrawAllMoney(address payable _to) public payable notZeroBalance {
require (balanceReceived[msg.sender].totalBalance > 0, "You have no ETH to withdraw!");
assert(balanceReceived[msg.sender].totalBalance >= balanceReceived[msg.sender].totalBalance - msg.value);
uint bala... | 14,022,604 |
// SPDX-License-Identifier: Apache-2.0
// 人類の反撃はこれからだ。
// jinrui no hangeki wa kore kara da.
// Source code heavily inspired from deployed contract instance of Azuki collection
// https://etherscan.io/address/0xed5af388653567af2f388e6224dc7c4b3241c544#code
// The source code in the github does not have some important ... | Return the current time. Can be extended for testing purpose. return The current timestamp. | function getCurrentTime() internal view virtual returns (uint256) {
return block.timestamp;
}
| 13,052,443 |
pragma solidity >=0.4.21 <0.7.0;
contract Arrays {
// Array
uint256[] public uintArray = [1, 2, 3];
string[] public myStringArray;
uint256[][] public array2D = [[1, 2, 3], [3, 4, 4]];
function addStringValue(string memory _value) public {
myStringArray.push(_value);
}
function get... | Imp: nested mapping | function addMyBook(
uint256 _id,
string memory _title,
string memory _author
) public {
myBooks[msg.sender][_id] = Book(_title, _author);
}
| 14,019,075 |
./full_match/1/0x539Fe1179b528C25E03698f3d51E2B8522B7261B/sources/contracts/ZorbFridge.sol | Freezes a zorb with safeTransferFrom - this does not work without the safe transfer from from address tokenId tokenId received Mint from Frozen Zorb | function onERC721Received(
address,
address from,
uint256 tokenId,
bytes calldata
) external returns (bytes4) {
require(msg.sender == address(zorb), "Not a zorb");
_mintFrozen(from, tokenId);
return this.onERC721Received.selector;
}
| 4,888,293 |
pragma solidity ^0.4.24;
/**
* @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 {
mapping (string => address) officialOwners;
event OwnershipRenounced(address i... | Allows the current owner to relinquish control of the contract. Renouncing to ownership will leave the contract without an owner. It will not be possible to call the functions with the `onlyOwner` modifier anymore./ emit OwnershipRenounced(id); | function renounceOwnership(string id) public onlyOwner(id) {
officialOwners[id] = address(0);
}
| 5,500,324 |
./full_match/43114/0x8BeF31c1e0aC12D73842a49436458Fd586C22A58/sources/MasterChefL2.sol | Withdraw without caring about rewards. EMERGENCY ONLY. | function emergencyWithdraw(uint256 _pid) external nonReentrant {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
pool.lpToken.safeTransfer(msg.sender, user.amount);
emit EmergencyWithdraw(msg.sender, _pid, user.amount);
user.amount ... | 4,548,471 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.9;
import "@openzeppelin/contracts/token/ERC777/IERC777.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/introspection/IERC1820Registry.sol";
import "@openze... | PUBLIC: Find out a farms maturity boost for the current LAND address (Using 1 block = 13.5 sec formula)/ Ensure this address has a farm on the LAND | function getAddressMaturityMultiplier(address targetAddress)
public
view
returns (uint256)
{
if (targetFarm.amount == 0) {
return _percentMultiplier;
}
targetFarm.blockNumber.add(_startMaturityBoost);
if (block.number < targetBlockNumber)... | 12,803,654 |
./full_match/5/0x92Db431BcC18fB2042F8EB38C7f7f383c6b6F55f/sources/contracts/SynthetixWithEth.sol | Proportion of rewards based on user's stake compared to total stake | function projectedDailyRewardEth(
address _account
) public view returns (uint) {
return (dailyTotalReward * userTotalStaked[_account]) / totalStaked;
}
| 7,039,170 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.