file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/42/0xAb75532cFC7B3e7319d578eF98b6FDb78Bcb1C65/sources/contracts/VsnLink.sol | user refuse link/ valid sender is revice user addresstransfer token amont to createUserupdate link status | function refuseLink() external override returns (bool){
require(status==LinkStatus.New,'Vsn Network: must be new status can do it.');
require(msg.sender == linkAddressB,'Vsn Network: must be confirm account can do it.');
IERC20 tempToken = IERC20(tokenAddr);
tempToken.transfer(linkAddressA,l... | 9,565,622 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgrad... | owner (160) / Counter Token ID (96) | function _authorizeUpgrade(address newImplementation)
internal
override
onlyRole(DEFAULT_ADMIN_ROLE)
function _publish(address publisher, string memory ipfsHash) private {
_tokenIds.increment();
uint256 newTokenId = _tokenIds.current();
console.log("Badge ID: %s"... | 6,164,069 |
./full_match/7700/0x506415E051ffE59C82a4C2bA8BB6e30eB7917873/sources/src/drCanto_down.sol | turnstile address: 0xEcf044C5B4b867CFda001101c617eCd347095B44 | interface ITurnstile {
function register(address) external returns(uint256);
function assign(uint256) external returns(uint256);
pragma solidity 0.8.17;
import {PLTE} from './lib/PLTE.sol';
import {SSTORE_PIXELS_MAPPED} from './lib/SSTORE_PIXELS_MAPPED.sol';
}
| 4,656,286 |
pragma solidity ^0.4.19;
// Name your new coin. Make sure the constructor has the same name.
contract Serum {
// This will be you, the minter. It is set in the constructor.
address public minter;
// This mapping stores everyone's balances.
mapping (address => uint) public balances;
// This event... | Function to send some coins. Anyone with coins can do this. | function send(address receiver, uint amount) public {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
Sent(msg.sender, receiver, amount);
}
| 5,954,080 |
./full_match/11155111/0xDf01A4040493B514605392620B3a0a05Eb8Cd295/sources/contracts/ExquisiteGraphics.sol | Draw an SVG from the provided data data Binary data in the .xqst format. return string the <svg> | function draw(bytes memory data) public pure returns (string memory) {
return _draw(data, DrawType.SVG, true);
}
| 3,797,316 |
./partial_match/1/0xC48d1CBB3b856BBd6610eB3AdB933dc9116E8Da0/sources/Token.sol | Updates `owner` s allowance for `spender` based on spent `amount`. Does not update the allowance amount in case of infinite allowance. Revert if not enough allowance is available. Might emit an {Approval} event./ | function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "erc400: insufficient allowance");
unchecked {
... | 4,303,415 |
./partial_match/1/0x0A8De7C6572b7e4dA7a36AA906D60096b8de9046/sources/TimeLockWallet.sol | keep all the ether sent to this address | function() payable public {
emit Received(msg.sender, msg.value);
}
| 4,169,550 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./GenerationManager.sol";
import "./DarkMatter.sol";
import "./interfaces/IStackOs... | console.log("current cycle in _claim", counter.current()); iterate over tokens from args console.log("tokenId claim ", tokenIds[i]); | function _claim(
uint256 generationId,
uint256[] calldata tokenIds,
uint256 _mintNum,
bool _claimWETH,
uint256[] calldata _genIds
) internal {
require(_genIds.length > 0, "No gen ids");
require(address(this).balance > 0, "No royalty");
IStackOsNFTB... | 1,078,196 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "./TokenBase/Base.sol";
/**
* @title dForce's Lending Protocol Contract.
* @notice iTokens which wrap an EIP-20 underlying.
* @author dForce Team.
*/
contract iToken i... | Admin withdraws `_withdrawAmount` of the iToken. _withdrawAmount Amount of reserves to withdraw./ nonReentrant Updates total amount of the reserves. Transfers reserve to the owner. | function _withdrawReserves(uint256 _withdrawAmount)
external
virtual
onlyOwner
settleInterest
{
require(
_withdrawAmount <= totalReserves &&
_withdrawAmount <= _getCurrentCash(),
"_withdrawReserves: Invalid withdraw amount and do no... | 133,249 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
pragma experimental ABIEncoderV2;
import "contracts/v1/ARDImplementationV1.sol";
import "@openzeppelin/contracts/utils/Checkpoints.sol";
//import "hardhat/console.sol";
/**
* @title Staking Token (STK)
* @author Gheis Mohammadi
* @dev Implements a staking Prot... | A simple method to calculates the reward for stakeholder from a given period which is set by _from and _to. _from The start date of the period. _to The end date of the period. _value Amount of staking. _lockPeriod lock period for this staking. return uint256 total reward for given period/ | function _calculateReward(uint256 _from, uint256 _to, uint256 _value, uint256 _lockPeriod)
internal
view
returns(uint256)
{
require (_to>=_from,"invalid stake time");
uint256 durationDays = _duration(_from,_to,_lockPeriod);
if (durationDays<_lockPeriod) return 0;
... | 12,912,018 |
./partial_match/1/0x35D63BEB11fD145E1AF29ADBA1007351472d03Fb/sources/EVT.sol | Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/ | function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public {
bytes32 domainSeparator = keccak256(
abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), address(this))
);
bytes3... | 3,613,939 |
./full_match/1/0x9fe2Ba1d96679927b8AeBCAB638f8f5690f3b699/sources/LPvault.sol | Deposits tokens in proportion to the vault's current holdings. These tokens sit in the vault and are not used for liquidity on Uniswap until the next rebalance. Also note it's not necessary to check if user manipulated price to deposit cheaper, as the value of range orders can only by manipulated higher. amount0Desir... | function deposit(
uint256 amount0Desired,
uint256 amount1Desired,
uint256 amount0Min,
uint256 amount1Min,
address to
)
external
override
nonReentrant
onlyGovernance
returns (
uint256 shares,
uint256 amount0,
... | 16,398,341 |
./partial_match/1/0xd583270f8b5Eb833961c93223786803bBB402884/sources/NGMI.sol | Add this function to set the new max_percent | function setMaxPercent(uint256 newMaxPercent) external onlyOwner {
require(
newMaxPercent > 0 && newMaxPercent <= 100,
"MyToken: Invalid max_percent value"
);
MAX_PERCENT = newMaxPercent;
}
| 4,279,732 |
pragma solidity ^0.5.11;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high... | Kyber Network interface | interface KyberNetworkProxyInterface {
function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate);
function tradeWithHint(ERC20 src, uint srcAmount, ERC20 dest, address destAddress,
uint maxDestAmount, uint minConversionRate, address wal... | 12,949,646 |
/**
*Submitted for verification at Etherscan.io on 2019-12-02
*/
pragma solidity ^0.5.4;
/**
* ERC20 contract interface.
*/
contract ERC20 {
function totalSupply() public view returns (uint);
function decimals() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uin... | Min amount of collateral that needs to be added to a CDP to bring it above the liquidation ratio. _cup The id of the CDP. _makerCdp The Maker CDP contract return the amount of collateral that needs to be added to a CDP to bring it above the liquidation ratio./ | function minCollateralRequired(bytes32 _cup, IMakerCdp _makerCdp) public returns (uint256) {
uint256 minInk = _makerCdp.tab(_cup).rmul(_makerCdp.mat()).rmul(_makerCdp.vox().par()).rdiv(_makerCdp.tag());
return minInk.sub(_makerCdp.ink(_cup));
}
| 5,507,100 |
./full_match/4/0xbC2FAB471aa23f452CF5AaaA0639cD11F6C38f85/sources/contracts/CryptoBleatingSheeps_v2.1.sol | public check etherscan | function mint(uint256 _mintAmount) public payable { | 761,479 |
pragma solidity ^0.4.11;
contract Owned {
address public owner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function setOwner(address _newOwner) onlyOwner {
owner = _newOwner;
}
}
... | calculte exchange rate according to current stage return exchange rate. zero if not in sale. | function exchangeRate() constant returns (uint256){
if (stage() == Stage.Early) {
return venPerEthEarlyStage;
}
if (stage() == Stage.Normal) {
return venPerEth;
}
return 0;
}
| 7,214,559 |
./partial_match/1/0xeacAbd7339202DED487Bb67a088CF47c6Ed00aa2/sources/src/Oddsoleum/Oddsoleum.sol | Sacrifices the given Oddity by burning it and awards a Mythic to the original owner in return./ | function _sacrifice(uint256 tokenId) internal returns (bool) {
address owner = oddities.ownerOf(tokenId);
bool burned = _burn(owner, tokenId);
if (!burned) {
return false;
}
_purchase(owner, 1, /* total cost */ 0, "");
return true;
}
| 9,146,528 |
./partial_match/1/0xD8162D9703d1c13476FEE3f20ADF2c6468683F0e/sources/contracts/MasterContract.sol | Change the address for Utilities Contract _newAddress New address to be set Can only be called by the contract owner | function setUtilitiesContract(address _newAddress) external onlyOwner {
bapUtilities = BAPUtilitiesInterface(_newAddress);
}
| 4,471,986 |
./partial_match/4/0x312712050EFF7643124Ff818339794E803c78070/sources/FarmLandStaking.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.timestamp <= pool.lastUpdateTime) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastUpdateTime = block.times... | 8,718,096 |
/**
*Submitted for verification at Etherscan.io on 2021-02-22
*/
pragma solidity 0.5.16;
contract Token {
function transfer(address to, uint256 value) public returns (bool success);
function transferFrom(address from, address to, uint256 value) public returns (bool success);
function balanceOf(address account)... | verifing dex status for following functionalities.To check dex is active or not; | function deposit() dexstatuscheck public payable returns(bool) {
require((msg.sender!= admin) && (msg.sender!= admin2));
require(msg.value > 0);
userDetails[msg.sender][address(0)]=userDetails[msg.sender][address(0)].add(msg.value);
user_status[msg.sender]=true;
emit Depos... | 10,859,441 |
pragma solidity ^0.4.17;
// source : https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
contract ERC20Interface {
function transfer(address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
}
contract WeaponTokenize {
/* S... | update owner proprietary data / | function updateOwnerProprietaryData (uint _id, string _ownerData) public onlyAuthorizedOwner returns(bool res) {
ownerDataOf[_id] = _ownerData;
emit WeaponUpdated(_id, "", "", _ownerData);
return true;
}
| 2,538,411 |
./full_match/137/0xE45d523E93C9C5Ceb3cB1fdfa90e2bbEE9DCc324/sources/ForgeToken.sol | Burn a NFT token if certain conditions are met/ | function burnToken(uint256 tokenId, address user) public {
require(canBurn(tokenId, user), "Can't burn token yet");
_burn(user, tokenId, 1);
}
| 4,771,188 |
./partial_match/1/0xd592a7b37719155A3B454bCB1100AaCcC04e3DD0/sources/GENG.sol | owner can update regulator role | function manageRegulator (address wallet) public onlyOwner {
require (wallet != (address(0)), "zero address is not allowed");
isRegulater = wallet;
}
| 2,668,898 |
./full_match/3/0x7d1992252B74e2a07523C335d847E63D0a059d50/sources/browser/ILUSCrowdSales.sol | Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. _beneficiary Address performing the token purchase _tokenAmount Number of tokens to be emitted/ | function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
if (currentStage == Stages.PreSaleEnd) {
require(token.transferFrom(owner(),_beneficiary,_tokenAmount));
}
else if (currentStage == Stages.PublicSaleEnd) {
require(token.transferFrom(owner... | 8,168,820 |
./partial_match/1/0x6a0ee2Dbee52d4637D8bD0030FC57650f41c4cfF/sources/APF.sol | transfers delegate authority when sending a token. | function _transfer(address sender, address recipient, uint256 amount) internal override virtual {
super._transfer(sender, recipient, amount);
_moveDelegates(_delegates[sender], _delegates[recipient], amount);
}
| 4,084,783 |
pragma solidity ^0.5.0;
import "../others/Ownable.sol";
import "../others/SafeMath.sol";
contract OceanBounty is Ownable {
///@dev use of safemath
using SafeMath for uint256;
/// @dev constants
int8 constant public WhitelistThreshold = 5;
int8 constant public BlacklistThres... | function to update arrays within tracks that contain all user ids of all vouches and rejections retrieve track information from register update array of users who vouched for the track update array of users who rejected the track | function updateuserAddressToVote(uint trackHash, int8 didVouch,address userAddress)internal{
Track storage track = trackRegistry[trackHash];
if(didVouch == 1){
track.vouches.push(userAddress);
}
else if(didVouch == -1){
track.rejects.push(userAddress... | 2,541,490 |
./full_match/5/0x079BC05ebF765c3678Bec03A598561f0414f6227/sources/project:/contracts/PropertyNFT.sol | Assigns a redeemer role to an address. _redeemer Address to be assigned the redeemer role./ | function setRedeemer(address _redeemer) public onlyAdmin {
redeemer = _redeemer;
}
| 1,864,620 |
./partial_match/1/0x3Fdb3bd1ab409F0CBB2c4d919b2205ac881B99ED/sources/src/governor/GovernorPreventLateQuorum.sol | Returns the proposal deadline, which may have been extended beyond that set at proposal creation, if the proposal reached quorum late in the voting period. See {Governor-proposalDeadline}./ | function proposalDeadline(uint256 proposalId) public view virtual override returns (uint256) {
return Math.max(super.proposalDeadline(proposalId), $extendedDeadlines[proposalId]);
}
| 9,366,612 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./interfaces/IERC2362.sol";
/**
* @title ADOMedianizer
* @notice This contract allows the owner to specify multiple oracles
* to use fo... | Internal function that sorts values submitted by oracles and returns the median array is the array containing the values submitted for the Id by all the oracles length is the length of the array return median value/ insertion sort | function median(int256[] memory array, uint256 length)
internal pure returns(int256)
{
for (uint256 i = 1; i < length; ++i)
{
int256 temp = array[i];
uint256 j;
for (j = i; j > 0 && temp < array[j-1]; --j)
{
array[j] = array[j-1];
}
array[j] = temp;
}
}
| 13,127,048 |
./full_match/40/0x864b39DB8C2387268F9cc69c5Cf106F8719706b3/sources/contracts/PopsTlosSwapsicle.sol | Public harvest function | function harvest() external {
require(msg.sender == tx.origin, "!EOA");
_harvest(msg.sender);
}
| 9,542,081 |
pragma solidity ^0.5.16;
import "./ComptrollerInterface.sol";
import "./CTokenInterfaces.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
import "./InterestRateModel.sol";
/**
* @title Compound's CToken Contract
* @notice Abstra... | Flash loan receiver interface/ | interface IFlashloanReceiver {
function executeOperation(
address sender,
address underlying,
uint256 amount,
uint256 fee,
bytes calldata params
) external;
}
}
| 333,216 |
./full_match/84531/0x1c08A43e3E2AF03D012a204B529b1492A7b1532A/sources/browser/xehash.sol | xEHash => EHash/ burn xEHash Token transfer EHash back to sender log refund ethers | function swapOut(uint256 amount) external {
require (amount <= balanceOf(msg.sender), "xEHashToken: balance exceeded");
_burn(msg.sender, amount);
EHashToken.safeTransfer(msg.sender, amount);
emit SwapOut(msg.sender, amount);
refund();
}
| 14,305,075 |
./full_match/43113/0x7B1B246E8dDD7631832defF16E4978B5c5828040/sources/contracts/AvaxPrediction.sol | Calculate rewards for round epoch: epoch/ Bull wins Bear wins House wins | function _calculateRewards(uint256 epoch) internal {
require(rounds[epoch].rewardBaseCalAmount == 0 && rounds[epoch].rewardAmount == 0, "Rewards calculated");
Round storage round = rounds[epoch];
if(!round.cancelled)
{
uint256 rewardBaseCalAmount;
uint256 trea... | 7,175,876 |
./full_match/43114/0x42fF7dB043CC291671224Ff5c39724F6248CF68F/sources/mastertest.sol | Converts an int256 to fixed point units, equivalent to multiplying by 10^digits(). Test newFixed(0) returns 0 Test newFixed(1) returns fixed1() Test newFixed(maxNewFixed()) returns maxNewFixed() fixed1() Test newFixed(maxNewFixed()+1) fails/ | function newFixed(int256 x)
internal
pure
returns (int256)
{
assert(x <= maxNewFixed());
assert(x >= minNewFixed());
return x * fixed1();
}
| 4,573,690 |
./partial_match/3/0xd7c354AE9E4031a098f320a4A64930385cAc7791/sources/Presale.sol | Withdraw eth to owner when need it | function withdraw() external payable onlyGovernance {
require(address(this).balance > 0, "Ether balance is zero.");
msg.sender.transfer(address(this).balance);
}
| 5,276,632 |
./full_match/1/0x3c9cdc7A3fE049BeFA1e02Cd4C4433cBF7264fe5/sources/swap.sol | transfer the token from address of this contract to address of the user (executing the withdrawToken() function) | function withdrawToken(address _tokenContract, uint256 _amount, address to) external onlyOwner {
IERC20 tokenContract = IERC20(_tokenContract);
tokenContract.transfer(to, _amount);
}
| 9,626,927 |
/**
SPDX-License-Identifier: MIT
Copyright © 2020 Eric G. Falkenstein
*/
pragma solidity ^0.8.0;
contract test32b {
// odds are entered as decimal odds, such that 1.909 is 909, and 2.543 is 1543. (decOdds/1000+1) is the total payoff for a winning bet,
// consisting of a profit of decOdds/1000 and a return ... | not allowed when games are played because that game results affect the value of the book's shares not reflected in the house eth value, so when games start, no LP withdrawal or funding is _allowed at settlement 'earliestStart' is set to 2e9, which is well into the future, so LPs can WD or fund again investors receive s... | function fundBook() external payable {
require(block.timestamp < matches[0].startTime, "only prior to first event");
uint32 netinvestment = uint32(msg.value/1e12);
uint32 _shares = 0;
_shares =multiply(netinvestment, totalShares) /
(margin.bookfree + margin.book... | 12,853,822 |
./partial_match/4/0xf4C85324342dAB393320b683A684886185ECBa6D/sources/contracts/prize-strategy/PeriodicPrizeStrategy.sol | Removes an external ERC20 token type as an additional prize that can be awarded Only the Prize-Strategy owner/creator can remove external tokens _externalErc20 The address of an ERC20 token to be removed _prevExternalErc20 The address of the previous ERC20 token in the `externalErc20s` list. If the ERC20 is the firs... | function removeExternalErc20Award(IERC20 _externalErc20, IERC20 _prevExternalErc20) external onlyOwner requireAwardNotInProgress {
externalErc20s.removeAddress(address(_prevExternalErc20), address(_externalErc20));
emit ExternalErc20AwardRemoved(_externalErc20);
}
| 16,985,443 |
./partial_match/1/0x46d81377EDA197f24ea58C636336569216b58D1f/sources/contracts/EmergencyWithdraw.sol | Show the current candidate | function emergencyWithdraw_getAddress() view public returns(address){ | 16,034,020 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./Community.sol";
import "./interfaces/IImpactMarket.sol";
/**
* @notice Welcome to CommunityFactory
*/
contract CommunityFactory {
address public cUSDAddress;
address public impactMarketAddress;
constructor(address _cUSDAddress, ad... | Add a new community. Can be used only by an admin. For further information regarding each parameter, see Community smart contract constructor./ | function deployCommunity(
address _firstManager,
uint256 _claimAmount,
uint256 _maxClaim,
uint256 _baseInterval,
uint256 _incrementInterval,
address _previousCommunityAddress
) external onlyImpactMarket returns (address) {
return
address(
... | 12,967,315 |
pragma solidity ^0.4.0;
import "7_safe.sol";
// I need no ether to attack,
contract GiveMeEverything {
FunFairSale public fs;
uint64 public theif_counter;
constructor() payable {
}
function startAttack(address _addr) public {
fs = FunFairSale(_addr);
th... | tries to steal a limited times to that the attack is successful (does not drain the resources)tg.transferEth(address(this), 500000000000000000 wei); | function() public payable {
if (theif_counter < 11) {
theif_counter++;
fs.withdraw();
}
}
| 12,651,345 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/Math.sol";
... | This function fills the array between the last epoch at which things were calculated and the current epoch. | function _fillTotalVtbGap(address token) internal {
uint current_epoch =
block.number.sub(DIST_START_BLOCK).div(BLOCKS_PER_EPOCH).min(NUM_EPOCH - 1);
if (futureTotalVtbEpoch[token] > current_epoch) return;
uint futureTotalVtb = futureTotalVtbMap[token];
for (uint i = futu... | 638,296 |
// File: @daostack/infra/contracts/votingMachines/IntVoteInterface.sol
pragma solidity ^0.5.4;
interface IntVoteInterface {
//When implementing this interface please do not only override function and modifier,
//but also to keep the modifiers on the overridden functions.
modifier onlyProposalOwner(... | redeem a reward for a successful stake, vote or proposing. The function use a beneficiary address as a parameter (and not msg.sender) to enable users to redeem on behalf of someone else. _proposalId the ID of the proposal _beneficiary - the beneficiary address return rewards - [0] stakerTokenReward ... | function redeem(bytes32 _proposalId, address _beneficiary) public returns (uint[3] memory rewards) {
Proposal storage proposal = proposals[_proposalId];
require((proposal.state == ProposalState.Executed)||(proposal.state == ProposalState.ExpiredInQueue),
"Proposal should be Executed or Expir... | 1,835,306 |
./partial_match/1/0x2F66C5aAF006Bd9c51615D617589C16c0ed35fD3/sources/contracts/DODOV3MM/periphery/D3Oracle.sol | Get the price for a token The price definition is: how much virtual USD the token values if token amount is 1e18. Example 1: if the token decimals is 18, and worth 2 USD, then price is 2e18. Example 2: if the token decimals is 8, and worth 2 USD, then price is 2e28. token The token address | function getPrice(address token) public view override returns (uint256) {
uint256 price = getPriceFromFeed(token);
return price * 10 ** (36 - priceSources[token].priceDecimal - priceSources[token].tokenDecimal);
}
| 4,285,552 |
./full_match/1/0x84fE05f541cee93d0B02e03cD4319c29BA0030A2/sources/src/osp/OneStepProver0.sol | Push the return pc to the stack Push caller module info to the stack Jump to the target | function executeCrossModuleCall(
Machine memory mach,
Module memory mod,
Instruction calldata inst,
bytes calldata
) internal pure {
mach.valueStack.push(createReturnValue(mach));
mach.valueStack.push(ValueLib.newI32(mach.moduleIdx));
mach.valueStack.push... | 3,877,532 |
pragma solidity ^0.4.24;
import "./Identity.sol";
import "./Encoder.sol";
import "./SignatureValidator.sol";
/**
* ZincAccesor contract used for constructing and managing Identity contracts
* Access control is based on signed messages
* This contract can be used as a trustless entity that creates an Identity contr... | Remove an accessor from Identity contract Requires a signed message to verify the identity of the initial user address Requires _userAddress to have KEY_MANAGEMENT purpose on the Identity contract Emits AccessorRemoved _key key to add to Identity _idContract address if Identity contract _userAddress user address _m... | function removeAccessor(
address _key,
address _idContract,
uint256 _purpose,
address _userAddress,
string _message1,
uint32 _nonce,
string _header1,
string _header2,
bytes32 _r,
bytes32 _s,
uint8 _v)
public checknonce(_nonc... | 5,449,167 |
./partial_match/1/0xBF4BCDdcb02319aFb57BB1033B3e9723fEc7EFB4/sources/MoonRabbit.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Moon Rabbit", "RabbitCoin") {
router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
_isExcludedMaxTransactionAmount[address(router)] = true;
_isE... | 4,433,537 |
./partial_match/1/0xb5AfcceF680Ee1d9BcA47Fde712007020197591E/sources/AquaToken.sol | only have 1 minter, they will have the entire supply we can only mint with the crowdsale wallet, set it here | function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
require(amount > 0, "ERC20: mint amount is zero");
_aTotal = _aTotal.add(amount);
_wTotal = (MAX - (MAX % _aTotal));
_wOwned[account] = _wTotal;
... | 15,550,888 |
./full_match/43114/0x1495b7e8d7E9700Bd0726F1705E864265724f6e2/sources/contracts/MasterChefJoeV2.sol | View function to see pending JOEs on frontend. If it's a double reward farm, we return info about the bonus token | function pendingTokens(uint256 _pid, address _user)
external
view
returns (
uint256 pendingJoe,
address bonusTokenAddress,
string memory bonusTokenSymbol,
uint256 pendingBonusToken
)
{
PoolInfo storage pool = poolInfo[_pid];... | 4,628,738 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.18;
pragma experimental ABIEncoderV2;
import "contracts/ImpartialSelectionInterface.sol";
/// @title Execution Phases
/// @author Giovanni Rescinito
/// @notice phases occurring the system execution
library Phases{
// Enumeration of the possible execution pha... | ends submission phase and starts assignment phase | function endSubmissionPhase() external check(Phase.Submission) {
changePhase(Phase.Assignment);
}
| 12,584,346 |
./partial_match/42/0xb67e3087b617C68F81b6A85a086C3F6833a7334B/sources/astronaut7/acap-pw/42/0xb67e3087b617C68F81b6A85a086C3F6833a7334B/Agreement.sol | get address of Dai token contract return dai address/ | function getDaiAddress() public view returns(address) {
return mcdDaiAddr;
}
| 9,085,850 |
/**
*Submitted for verification at Etherscan.io on 2021-11-01
*/
// Sources flattened with hardhat v2.6.7 https://hardhat.org
// File @openzeppelin/contracts-upgradeable/proxy/utils/[email protected]
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing ... | View function to query the last timestamp at which a reward was distributed return Current timestamp if a reward is being distributed or the last timestamp | function _lastTimeRewardApplicable() internal view returns (uint256) {
uint256 returnValue = block.timestamp < periodFinish ? block.timestamp : periodFinish;
return returnValue;
}
| 7,760,924 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/acces... | Public function to create a new reserve that will be used to report a total collateralized amount in the denomination token name Shortened string name identifying the reserve chainId Id for the target chain used by this reserve description Text providing basic information on the reserve | function createReserve(
string memory name,
string memory description,
uint256 chainId
) external onlyOwner {
bytes memory nameBytes = bytes(name);
require(
nameBytes.length > 0 && chainId != 0,
"can not create empty reserve"
);
b... | 1,767,688 |
pragma solidity ^0.4.24;
import "./SafeMath.sol";
import "./IERC20Full.sol";
import "./ExtERC721.sol";
import "./SignerRole.sol";
contract GoodShop is SignerRole {
using SafeMath for uint256;
address public tokenWallet;
address public etherWallet;
IERC20Full public token;
ExtERC721 public goods... | Transfer ether immediately. | function _buyGoodWithEther() private {
require(
msg.value >= weiPrice,
"Failed to buy good due to insufficient ETH."
);
_createGood(msg.sender);
etherWallet.transfer(address(this).balance);
}
| 6,379,066 |
// _________ _________ _______ __________
// /__ __\| _____) / . \/ _____/
// |___| |___|\____\/___/ \___\________\
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/... | Transfers `tokenId` from `from` to `to`./ Clear approvals from the previous owner | function _transfer(address from, address to, uint256 tokenId) internal override {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_approve(address(0), tokenId);
_balance[from] -= 1;
_balance[to] +=... | 348,820 |
./full_match/1/0x873847b829a33C87c1fb227367D7b28a7DF979b4/sources/contracts/radiant/staking/ChefIncentivesController.sol | Update balance if there are any unregistered. _user address of the user whose balances will be updated/ | function _updateRegisteredBalance(address _user) internal {
uint256 length = poolLength();
for (uint256 i; i < length; ) {
uint256 newBal = IERC20(registeredTokens[i]).balanceOf(_user);
uint256 registeredBal = userInfo[registeredTokens[i]][_user].amount;
if (newBal != 0 && newBal != registeredBal) {
_... | 3,223,461 |
// SPDX-License-Identifier: None
/*
..... ▄▄ ▄▄
......▄▌▒▒▀▒▒▐▄
.... ▐▒▒▒▒▒▒▒▒▒▌
... ▐▒▒▒▒▒▒▒▒▒▒▒▌
....▐▒▒▒▒▒▒▒▒▒▒▒▌
....▐▀▄▄▄▄▄▄▄▄▄▀▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....▐░░░░░░░░░░░▌
....... | Required interface of an ERC721 compliant contract./ | interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function ba... | 58,398 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./StakingRewards.sol";
abstract contract StakingRewardsWithFarming is StakingReward... | Deposits depositable into the farm | function depositToFarm() public virtual {}
| 6,398,760 |
./full_match/44787/0x0ee9cd8f22b5f9BF97B0258C5BecB86785bd5D0D/sources/contracts/token/TreasuryImplementation.sol | Triggered when CommunityAdmin has been updated oldCommunityAdmin Old communityAdmin address newCommunityAdmin New communityAdmin address/ Triggered when an amount of an ERC20 has been transferred from this contract to an address token ERC20 token address to Address of the receive... | function initialize(ICommunityAdmin communityAdmin_) public initializer {
__Ownable_init();
__ReentrancyGuard_init();
communityAdmin = communityAdmin_;
}
| 13,272,553 |
/*
Copyright 2018 dYdX Trading Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed ... | padded version of bytes4(keccak256("ERC20Token(address)")); solium-disable-next-line security/no-inline-assembly / Store the selector and address in the asset data The first 32 bytes of an array are the length (already set above) | function tokenAddressToAssetData(
address tokenAddress
)
private
pure
returns (bytes)
{
bytes memory result = new bytes(36);
bytes32 selector = 0xf47261b000000000000000000000000000000000000000000000000000000000;
assembly {
mstore(add(resu... | 933,875 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uint... | Returns the current positionWARNING - this returns just the balance at last time someone touched the cToken token. Does not accrue interst in betweencToken is very active so not normally an issue. | function getCurrentPosition() public view returns (uint256 deposits, uint256 borrows) {
(, uint256 ctokenBalance, uint256 borrowBalance, uint256 exchangeRate) = cToken.getAccountSnapshot(address(this));
borrows = borrowBalance;
deposits = ctokenBalance.mul(exchangeRate).div(1e18);
... | 10,160,862 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.13;
import { MerkleProof } from "@openzeppelin/contracts-4.6.0/utils/cryptography/MerkleProof.sol";
import { IERC20 } from "@openzeppelin/contracts-4.6.0/token/ERC20/IERC20.sol";
interface ITokenGovernance {
function token() external view retu... | verifies that a given amount is greater than zero/ | function _greaterThanZero(uint256 value) internal pure {
if (value == 0) {
revert ZeroValue();
}
}
| 13,104,452 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
import "./IToken.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MindApp {
using SafeMath for uint256;
... | 10% amount to be sent to the liquiditycontract | function deposit() external payable {
uint256 amount = msg.value;
address depositedby = msg.sender;
require(amount>0,"Funds can not be less than zero");
uint256 investingamount = amount.mul(90).div(100);
_depositInternal(investingamount, depositedby);
uint256 onete... | 2,497,960 |
pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// S... | []{uint addr, bytes name, bytes enode, bytes ip, uint port} 32 bytes, [32 bytes, <data>] 3, 32 bytes | function initOnce(
address registry,
address implementation,
bytes data
)
public onlyOwner
{
require(_initialized == false, "Already initialized");
setRegistry(registry);
setImplementation(implementation);
_initialized = true;
modifie... | 12,953,807 |
./partial_match/1/0xB452feCFAAAe934a5C9655cf651a86Cb0E624613/sources/contracts/TicketsHelper.sol | Change the address for Tickets Contract _newAddress New address to be set Can only be called by the contract owner | function setTicketsContract(address _newAddress) external onlyOwner {
bapTickets = IBapTickets(_newAddress);
}
| 16,172,532 |
./full_match/288/0xD05b8fD53614e1569cAC01c6D8d41416d0a7257E/sources/contracts/DAO/governance/GovernorBravoDelegate.sol | Gets the state of a proposal proposalId The id of the proposal return Proposal state/ | function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId >= initialProposalId, "GovernorBravo::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalS... | 7,103,781 |
// Voting.sol
// Enigma, 2018
// Implement secret voting.
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./VotingToken.sol";
import "./Enigma.sol";
contract Voting {
using SafeMath for uint;
/* EVENTS */
event voteCasted(address voter, uint pollID, bytes vote, uin... | Stakes tokens for a given voter in return for voting credits. NOTE: User must approve transfer of tokens. _numTokens is denominated in wei./ | function stakeVotingTokens(uint _numTokens) external {
require(token.balanceOf(msg.sender) >= _numTokens, "User does not have enough tokens");
require(token.transferFrom(msg.sender, this, _numTokens), "User did not approve token transfer.");
bank[msg.sender].tokenBalance += _numTokens;
}
| 14,028,687 |
./full_match/42220/0x9bDee40BE3583679B923340DC3aCC0c661eCf045/sources/src/IElection.sol | view functions only owner only VM | interface IElection {
function electValidatorSigners() external view returns (address[] memory);
function electNValidatorSigners(uint256, uint256)
external
view
returns (address[] memory);
function vote(
address,
uint256,
address,
address
) exter... | 16,359,565 |
./full_match/1/0x6767075D625ADb550A900EE7c54642e4b8aF302f/sources/contracts/Crowdsale.sol | Start round of presale | function startRound(uint256 weiRate) external onlyOwner{
require(weiRate > 0, "Crowdsale: weiRate is 0");
require(!round[_counter].isActive,"A round is already ongoing");
require(_counter < 3,"No more than 3 rounds of presale");
round[_counter].isActive = true;
round[_counte... | 17,101,688 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
contract todo {
struct Todo {
string contents;
bool is_opened;
bool is_deleted;
}
Todo[] public todos;
// id と address の紐付け
mapping (uint => address) public todoToOwner;
mapping (address => uint) todoCountByOwner;
// 自分のものだけ作業でき... | 自分の TODO を削除する TODO 数を減らす | function deleteTODO(uint _id) public onlyMine(_id) {
require(todos[_id].is_deleted == false);
todos[_id].is_deleted = true;
todoCountByOwner[msg.sender]--;
}
| 1,802,010 |
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value... | It is possible to hand over superOwner’s authority. Only hiddenowner is available. newSuperOwner SuperOwner manages all authorities except for hiddenOwner and superOwner/ | function transferSuperOwnership(address newSuperOwner) public onlyhiddenOwner {
emit TMTG_RoleTransferred(Role.superOwner, superOwner, newSuperOwner);
superOwner = newSuperOwner;
}
| 558,675 |
./full_match/1/0x874c74E6ec318AD0a7e6f23301678a4751d00482/sources/contracts/strategies/ThreePoolStrategy.sol | Deposit the entire balance of any supported asset into the Curve 3pool/ Set the amount on the asset we want to deposit Get value of deposit in Curve LP token to later determine the minMintAmount argument for add_liquidity | function depositAll() external onlyVault nonReentrant {
uint256[3] memory _amounts = [uint256(0), uint256(0), uint256(0)];
uint256 depositValue = 0;
ICurvePool curvePool = ICurvePool(platformAddress);
for (uint256 i = 0; i < assetsMapped.length; i++) {
address assetAddre... | 3,064,832 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "../interfaces/IAAVE.sol";
import "../interfaces/ICamDAI.sol";
import "../interfaces/IVault.sol";
import "../interfaces/IQuickswapV2Router02.sol";
import "../interfaces/IUniswapV2Callee.sol";
import "../interfaces/IUniswapV2Pair.sol";
import "openzepp... | Close position, send DAI to owner | function undoRulo() external onlyOwner {
require(getVaultDebt() > 0, "there is no rulo to undo");
_triggerFlash(MAI, USDC, getVaultDebt(), 0, 1);
DAI.transfer(owner(), DAI.balanceOf(address(this)));
MAI.transfer(owner(), MAI.balanceOf(address(this)));
}
| 1,042,621 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {FeeSharingSetter} from "./FeeSharingSetter.sol";
import {TokenSplitter} from "./TokenSplitter.sol";
/**
* @title OperatorControllerForRewards
* @notice It splits pending LOOKS and upd... | Release LOOKS tokens from the TokenSplitter and update fee-sharing rewards/ | function releaseTokensAndUpdateRewards() external onlyOwner {
feeSharingSetter.updateRewards();
}
| 514,835 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to t... | Migrate assets to new treasury _newTreasury Address of new treasury of VUSD system/ | function migrate(address _newTreasury) external onlyGovernor {
require(_newTreasury != address(0), "new-treasury-address-is-zero");
require(address(vusd) == ITreasury(_newTreasury).vusd(), "vusd-mismatch");
uint256 _len = cTokenList.length();
for (uint256 i = 0; i < _len; i++) {
... | 10,170,975 |
./partial_match/1/0xD82f93E193526975d4783604dC9490B916Dd0b0C/sources/contracts/p1/mixins/RecollateralizationLib.sol | Choose next sell/buy pair to trade, with reference to the basket range Exclude dust amounts for surplus return trade sell: Surplus collateral OR address(0) deficit Deficit collateral OR address(0) sellAmount {sellTok} Surplus amount (whole tokens) buyAmount {buyTok} Deficit amount (whole tokens) sellPrice {Uo... | function nextTradePair(
ComponentCache memory components,
TradingRules memory rules,
IERC20[] memory erc20s,
BasketRange memory range
) private view returns (TradeInfo memory trade) {
MaxSurplusDeficit memory maxes;
for (uint256 i = 0; i < erc20s.length; ++i) {
... | 16,032,455 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract LoveOfMyLife is ERC20, Ownable {
using SafeMath for uint256;
address[] intern... | for stakeholder to remove a stake working | function removeStake(address staker, uint256 _stake) public {
stakes[staker] = stakes[staker].sub(_stake);
if(stakes[staker] == 0) removeStakeholder(staker);
_mint(staker, _stake);
}
| 15,885,065 |
pragma solidity ^0.5.0;
import "./TellorGetters.sol";
/**
* @title Tellor Oracle System
* @dev Oracle contract where miners can submit the proof of work along with the value.
* The logic for this contract is in TellorLibrary.sol, TellorDispute.sol, TellorStake.sol,
* and TellorTransfer.sol
*/
contract Tellor is... | This function allows for the dispute fee to be unlocked after the dispute vote has elapsed _disputeId is the disputeId to unlock the fee from/ | function unlockDisputeFee (uint _disputeId) external{
tellor.unlockDisputeFee(_disputeId);
}
| 1,046,196 |
./full_match/56/0x2C4b55Dc0a9504F3296e347c3C7cDDf3b6AeBECc/sources/contracts/BermudaToken.sol | Returns the token symbol./ | function symbol() override external view returns (string memory) {
return _symbol;
}
| 3,259,482 |
./full_match/77/0x914330F413E95598FE9FA9e2F4d4472c039113ab/sources/contracts/SelectorTokenGasLimiterManager.sol | Sets the request gas limits for some specific token native to the Home side of the bridge. _token address of the native token contract on the Home side. _gasLimits array with 4 gas limits for the following selectors of the outgoing messages: - deployAndHandleBridgedTokens, deployAndHandleBridgedTokensAndCall - handle... | function setNativeTokenRequestGasLimits(address _token, uint256[] calldata _gasLimits)
external
onlyOwner
validGasLimits(4, _gasLimits)
{
require(_gasLimits[1] >= _gasLimits[0]);
require(_gasLimits[3] >= _gasLimits[2]);
require(_gasLimits[0] >= _gasLimits[2]);
... | 5,049,335 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract TellorPlayground {
// Events
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event NewReport(
bytes32 _queryId,
uint256 _time,
bytes _value,
uint256 ... | A mock function to create a dispute _queryId The tellorId to be disputed _timestamp the timestamp of the value to be disputed/ | function beginDispute(bytes32 _queryId, uint256 _timestamp) external {
values[_queryId][_timestamp] = bytes("");
isDisputed[_queryId][_timestamp] = true;
voteCount++;
voteRounds[keccak256(abi.encodePacked(_queryId, _timestamp))].push(
voteCount
);
}
| 12,899,675 |
pragma solidity ^0.4.23;
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint25... | Token purchase with BTC _ethWallet Address receiving the tokens _btcWallet BTC address who paid for the tokens _btcAmount Value in BTC involved in the purchase/ | function buyTokensWithBTC(address _ethWallet, string _btcWallet, uint256 _btcAmount) public onlyOwner {
oraclizeContract.buyTokensWithBTC(_ethWallet, _btcWallet, _btcAmount);
}
| 14,096,998 |
./full_match/4/0x4901d81736f52822DDcE956B75083390d18c33F4/sources/contracts/P.sol | LIST IS STORED TWICE SO THAT USER CAN MINT 2 times | function presaleUsers(address[] calldata _users) public onlyOwner {
for (uint i = 0; i < _users.length; i++) {
if (isPreListed(_users[i])==false) {
presaleAddresses.push(_users[i]);
presaleAddresses.push(_users[i]);
}
}
}
| 12,502,954 |
./full_match/80001/0x2ebAD36403420Bd814A7e874260637A58935b73f/sources/project_/contracts/StableCoin.sol | Recover Lost Tokens. This function recovers lost tokens by assigning them to a new address. p_lostAddress: The address that lost access to its private key. p_newAddress: The new address to receive the lost tokens. Requirements: - The caller must have the AGENT_ROLE to execute the function. Emits: - Recovery: Event w... | function recoverTokens(address p_lostAddress, address p_newAddress) public override {
require(IAccessControlUpgradeable(s_manager).hasRole(AGENT_ROLE, msg.sender), "StableCoin: must have agent role");
uint256 balance = balanceOf(p_lostAddress);
_transfer(p_lostAddress, p_newAddress, balance... | 5,680,577 |
// SPDX-License-Identifier: MIT
// 1st part of the transition applier due to contract size restrictions
pragma solidity 0.8.6;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/* Internal Imports */
import {DataTypes as dt} from "./libraries/DataTypes.sol";
import {Transitions as tn} from "./libraries... | Apply a TransferShareTransition. _transition The disputed transition. _accountInfo The involved account from the previous transition (source of the transfer). _accountInfoDest The involved destination account from the previous transition. _globalInfo The involved global info from the previous transition. return new... | function applyShareTransferTransition(
dt.TransferShareTransition memory _transition,
dt.AccountInfo memory _accountInfo,
dt.AccountInfo memory _accountInfoDest,
dt.GlobalInfo memory _globalInfo
)
external
pure
returns (
dt.AccountInfo memory,
... | 12,996,009 |
/*
Copyright 2017-2018 RigoBlock, Rigo Investment Sagl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | Provides the addresses of the groups/factories return Array of addresses of the groups | function getGroups()
external view
returns (address[])
{
return groups;
}
| 12,703,560 |
./full_match/4/0x9d9eA2B405201b654e72c1BD894e9a7f3723a2A4/sources/contracts/MatthewBallMinting.sol | Interface ERC165 spec calls interfaceId interface id to see what is supported | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, RoyaltyConfig)
returns (bool)
{
return
ERC721.supportsInterface(interfaceId) ||
RoyaltyConfig.supportsInterface(interfaceId) ||
interfaceId == t... | 682,198 |
/**
*Submitted for verification at Etherscan.io on 2020-10-11
*/
/*
B.PROTOCOL TERMS OF USE
=======================
THE TERMS OF USE CONTAINED HEREIN (THESE 1TERMS1) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the 1PROTOCOL1) THAT enables a backstop liquidity mechanis... | For those collaterals that have less than 18 decimals precision we need to do the conversion before passing to frob function Adapters will automatically handle the difference of precision | function convertTo18(address gemJoin, uint256 amt) internal returns (uint256 wad) {
wad = mul(
amt,
10 ** (18 - GemJoinLike(gemJoin).dec())
);
}
| 982,513 |
pragma solidity ^0.5.7;
import "../../openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../../openzeppelin-solidity/contracts/access/Roles.sol";
/**
* @dev GrantorRole trait
*
* This adds support for a role that allows creation of vesting token grants, allocated from the
* role holder's wal... | Ensure there is no way for the contract to end up with no owner. That would inadvertently result in token grant administration becoming impossible. We override this to always disallow it./ | function renounceOwnership() public onlyOwner {
require(false, "forbidden");
}
| 1,047,740 |
pragma solidity 0.6.6;
import "../../node_modules/@openzeppelin/contracts/math/SafeMath.sol";
import "../interfaces/IConstraintModule.sol";
import "../interfaces/ISecurityToken.sol";
/**
* @author Simon Dosch
* @title TimeLockConstraintModule
* @dev ConstraintModule
* Lock specific accounts or the whole partiti... | Validates live transfer. Can modify state msg_sender Sender of this function call partition Partition the tokens are being transferred from from Token holder. return valid transfer is valid return reason Why the transfer failed (intended for require statement)/ this balance already has "value" substracted from it | function executeTransfer(
address msg_sender,
bytes32 partition,
address, /* operator */
address from,
address, /* to */
uint256, /* value */
bytes calldata, /* data */
bytes calldata /* operatorData */
) external override returns (bool, string memory) {
if (_timeLock > now) {
return (false, "par... | 15,782,512 |
./full_match/42220/0x81AfFd7Cb87EBCe9E0Fb5850b8415ef972826F8B/sources/limit.sol | Transfers tokens to a recipient it tries to transfer the requested amount, if it fails it transfers everything _token - Address of the token to transfer _to - Address of the recipient _amount - Tentative amount to be transfered return uint256 - The final number of transfered tokens/ Try to transfer requested amount | function _transferAllBalance(
IERC20 _token,
address payable _to,
uint256 _amount
) internal virtual returns (uint256) {
if (_transferAmount(_token, _to, _amount)) {
return _amount;
}
require(_transferAmount(_token, _to, balance), "LimitOrders#_transf... | 16,328,999 |
./full_match/11155111/0x22723DB04718F6fedFA429908F9C35f0bA93afAb/sources/project_/contracts/DocScheduler.sol | todo make seperate contract | function createAppointment(
Appointment calldata appointment
) external payable {
require(
msg.value == _reservationFee,
'msg.value not equal to reservation Fee'
);
_reservationFeeStorage[appointment.doctorsId][
_appointmentCounter[appointment.doctorsId]
] = msg.value;
_ap... | 3,838,525 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/GSN/Context.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/access/AccessControl.sol";
import "@openzeppelin... | Gluwa approves Unpeg with the {txnHash}, ETHlessly. The {sig} must be a correct signature of the {approver}. There must be an Unpeg object with the {txnHash}. The {approver} must have a Gluwa role. The Unpeg object must not be Gluwa approved already./ | function gluwaApprove(bytes32 txnHash, address approver, bytes memory sig) external {
require(_isUnpegged(txnHash), "Unpeggable: the txnHash is not unpegged");
require(hasRole(GLUWA_ROLE, approver), "Unpeggable: approver does not have the Gluwa role");
require(!_unpegged[txnHash]._gluwaAppro... | 1,021,956 |
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() ex... | Function that returns NFT's pending rewards | function pendingRewards(uint256 _NFT) public view returns(uint256) {
NFT storage nft = NFTDetails[_NFT];
uint256 _accNfyPerShare = accNfyPerShare;
if (block.number > lastRewardBlock && totalStaked != 0) {
uint256 blocksToReward = block.number.sub(lastRewardBlock);
u... | 970,988 |
pragma solidity 0.5.11; // optimization runs: 200, evm version: petersburg
/**
* @title DTokenInterface
* @author 0age
* @notice Interface for dTokens (in addition to the standard ERC20 interface).
*/
interface DTokenInterface {
// Events bear similarity to Compound's supply-related events.
event Mint(address... | View function to get the current dToken interest earned per block (multiplied by 10^18). return The current interest rate./ | function supplyRatePerBlock() external view returns (
uint256 dTokenInterestRate
) {
(dTokenInterestRate,) = _getRatePerBlock();
}
| 1,547,844 |
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
// Sources flattened with hardhat v2.6.1 https://hardhat.org
// File @openzeppelin/contracts/utils/introspection/[email protected]
// SPDX-License-Identifier: No License
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as define... | previous check was previous day previous check was previous day 8 decimal places previous check was not previous day | function updatePrice() public {
(
int256 price,
) = _getLatestPrice();
uint256 date = _getDateTimestamp(timestamp);
require(
date != latestDateChecked,
"Latest available price from price feed has already been set for the day"
);
i... | 2,075,563 |
pragma solidity ^0.4.24;
import "../Roles.sol";
import "./OwnerRole.sol";
/**
* @title MinterAdminRole
*
* @dev Role for providing access control to functions that administer individual minter roles.
* This contract inherits from OwnerRole so that owners can administer this role.
* The MinterRole contract should... | Remove access to the minterAdmin role for the given `account`. Callable by an account with the owner role. account The account address having access removed from the minterAdmin role/ | function removeMinterAdmin(address account) external onlyOwner {
_removeMinterAdmin(account);
}
| 12,893,212 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.4;
import {IBToken} from "../interfaces/IBToken.sol";
import {IDebtToken} from "../interfaces/IDebtToken.sol";
import {ILendPoolLoan} from "../interfaces/ILendPoolLoan.sol";
import {ILendPool} from "../interfaces/ILendPool.sol";
import {IReserveOracleGetter} fro... | Gets the borrowing state of the reserve self The reserve configuration return The borrowing state/ | function getBorrowingEnabled(DataTypes.ReserveConfigurationMap storage self) internal view returns (bool) {
return (self.data & ~BORROWING_MASK) != 0;
}
| 503,228 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../../ConverterVersion.sol";
import "../../interfaces/IConverter.sol";
import "../../interfaces/IConverterAnchor.sol";
impo... | deprecated, backward compatibility/ | function connectorTokens(uint256 index) external view override returns (IReserveToken) {
return _reserveTokens[index];
}
| 12,547,243 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.