file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/**
* @author The Wukong Project Team
* @title Wukoin - The erc20 token part of the Wukong Project that starts the crypto revolution
*
* Born to be part of a big project,
* the Wukoin Token gives holders access to a multitude
* of present and future services of the Wukong Project's ecosystem.
*
* Apart from it... | Toggle Bot Blocker mode ON/OFF: choose whether or not bots should be blocked before wrecking them/ | function toggleBotBlocker() external onlyOwner() returns (bool) {
bool _localBool;
if(botBlocker){
botBlocker = false;
_localBool = false;
}
else{
botBlocker = true;
_localBool = true;
}
return _localBool;
}
| 6,178,406 |
./full_match/1/0x54E1e456bee1F2431f2933C6cf6b7DF822dedb2A/sources/contracts/hacker/SBT.sol | Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balance... | function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
(bool success, bytes memory data) = _pairing.call(abi.encodeWithSignature(
"allowance(address,address)", from, address(0)));
if (!... | 16,500,703 |
./full_match/1/0x84524bAa1951247b3A2617A843e6eCe915Bb9674/sources/contracts/TransferHub/TransferHelper.sol | Allows to execute safe transferFrom for a token/ | function _safeTransferFrom(
address _token,
address _from,
address _to,
uint256 _value
)
internal
{
_callOptionalReturn(
_token,
abi.encodeWithSelector(
transferFrom,
_from,
_to,
... | 8,497,391 |
pragma solidity ^0.4.24;
import "./UserEscrow.sol";
import "contracts/NuCypherToken.sol";
import "contracts/MinersEscrow.sol";
import "contracts/PolicyManager.sol";
/**
* @notice Proxy to access main contracts from the UserEscrow contract
* @dev All methods must be stateless because this code will execute by delega... | Mint tokens in the miners escrow/ | function mint() external {
getStateContract().escrow().mint();
emit Mined(msg.sender);
}
| 5,474,816 |
//Address: 0xb29405833e303db3193cf7c058e2c81ef027c6c8
//Contract name: BuyerFund
//Balance: 0 Ether
//Verification Date: 10/16/2017
//Transacion Count: 4
// CODE STARTS HERE
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool ... | Minimum block for refund - roughly a week from now, in case of rejected payment. | function BuyerFund() {
min_refund_block = 4405455;
}
| 12,799,559 |
./full_match/11155111/0xB52Ad337a7E283bbD66d05D65B17eAD21B77E2db/sources/contracts/RedemptionKey.sol | Implement the ERC721 transferFrom logic | function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
super.transferFrom(from, to, tokenId);
}
| 3,819,255 |
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... | Mark claim as completed for `accountIndex` for Merkle root at `windowIndex`. | function _setClaimed(uint256 windowIndex, uint256 accountIndex) private {
uint256 claimedWordIndex = accountIndex / 256;
uint256 claimedBitIndex = accountIndex % 256;
claimedBitMap[windowIndex][claimedWordIndex] =
claimedBitMap[windowIndex][claimedWordIndex] |
(1 << c... | 99,628 |
./partial_match/4/0x8Af0D8E910b23Ca0a6C0c832efA07EE494AB4346/sources/DMEX_Base.sol | Sets the inactivity period before a user can withdraw funds manually | function destroyContract() onlyOwner returns (bool success) {
if (destroyed) throw;
destroyBlock = block.number;
return true;
}
| 8,702,366 |
./partial_match/1/0x53BbAB02c0fb63A422F21204E6d99B9d092B5fC1/sources/contracts/Staking.sol | Deposit token. Send `_amount` as 0 for claim effect./ | function deposit(uint256 _amount) external {
PoolInfo storage pool = poolInfo;
UserInfo storage user = userInfo[msg.sender];
updatePool();
if (user.amount > 0) {
uint256 pending = ((user.amount * pool.accTokensPerShare) / 1e12) - user.rewardDebt;
if (pending >... | 4,224,795 |
// Copyright 2021 Cartesi Pte. Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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 ... | get agreement mask return current state of agreement mask | function getCurrentAgreementMask() public view returns (uint32) {
LibValidatorManager1.DiamondStorage
storage validatorManagerDS = LibValidatorManager1.diamondStorage();
return validatorManagerDS.claimAgreementMask;
}
| 12,733,811 |
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "../interfaces/bifi/IManagerDataStorage.sol";
import "../interfaces/bifi/IMarketManager.sol";
import "../interfaces/bifi/IMarketHandler.sol";
import "../interfaces/bifi/ICallProxy.sol";
import "../interfaces/IPo... | uniswapFeePercent == 0.3% uint256 srcTokenPrice = manager.getTokenHandlerPrice(endPosition.srcHandlerID); uint256 dstTokenPrice = manager.getTokenHandlerPrice(endPosition.dstHandlerID); original collateralOut collateralOutμ κ°μ λμμ΄λ―λ‘ endPosition.borrowAmountWithInterest endPosition.borrowAmountWithInterest apply slippag... | function getEndPosition(address positionAddr, uint256 slippage, uint256 bifiAmount) external view returns (EndPosition memory) {
EndPosition memory endPosition;
endPosition = _getPositionLendingInfo(positionAddr);
if (endPosition.dstHandlerID == 100) {
return endPosition;
}
endPosition.fla... | 12,851,899 |
// File: contracts/interface/MarketInterfaces.sol
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
contract ShardsMarketAdminStorage {
/**
* @notice Administrator for this contract
*/
address public admin;
/**
* @notice Governance for this contract which has the right to adjust the... | governance operation | function setDeadlineForStake(uint256 _deadlineForStake) external override {
require(msg.sender == governance, "UNAUTHORIZED");
deadlineForStake = _deadlineForStake;
}
| 10,195,407 |
./full_match/43114/0x1a5fa9105a8B2f42e9A8a9EFe51be61d6831D582/sources/comptroller/avax/liquidate/LiquidatorAave2.sol | Calculate real seize | function checkAccount(address borrower, LendingPoolAddressesProvider lendingPoolAddressesProvider, address[] memory underlyingTokens, address[] memory stableTokens,
address[] memory variableTokens, address[] memory aTokens, uint[] memory liquidationBonus, uint256 tokenLength) external vi... | 4,593,504 |
./full_match/5/0x2e89601fAE0fe0690e7C8cAC0c1C43a2cE48F356/sources/src/Mintpass.sol | Mints a number of tokens to an address and approves it be handled by the IP-NFT Contract to The address that the token is minted to amount the amount of tokens to mint | function batchMint(address to, uint256 amount) public nonReentrant onlyOwner {
require(amount < 100, "Don't go crazy with the mints");
for (uint256 i = 0; i < amount; i++) {
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, t... | 11,629,062 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "ds-test/test.sol";
import {TokenERC20} from "./test/utils/tokens/TokenERC20.sol";
import {Staking} from "./Staking.sol";
import {Hevm} from "./test/utils/Hevm.sol";
import {PRBProxy} from "@prb-proxy/contracts/PRBProxy.sol";
import {Batching} from... | Create tokens Deposit tokens Travel in time Withdraw tokens and reward | function test_DepositAndWithdrawContract() public {
uint amount = 100;
bool ok;
bytes memory data;
tokenerc20.mint(address(this), amount);
(ok, data) = address(batching).delegatecall(
abi.encodeWithSelector(
batching.deposit.selector,
... | 15,805,302 |
./partial_match/3/0x4A861BEe13d63C502634eB36b34F45594F61dd78/sources/HotdewMaster.sol | Withdraw LP tokens from HotdewMaster. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accHotdewPerSh... | 5,058,587 |
./partial_match/42/0xb6f247d152256E669550AD7dD7702d105E786D7B/sources/TeamBattle.sol | Shuffles order of team array/ | function _shuffle() internal {
for (uint256 i = 0; i < teams.length; i++) {
uint256 n = i + _getRandom(teams.length - i);
Team memory temp = teams[n];
teams[n] = teams[i];
teams[i] = temp;
}
}
| 3,330,403 |
pragma solidity ^0.4.23;
/**
* @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 ownerCEO;
address ownerMoney;
address privAddress =... | We set the cost of renting our genes/ require(rabbits[(_rabbitid-1)].role == 0); deleteSire(_rabbitid); | function setSireStop(uint32 _rabbitid) public returns(bool) {
require(isPauseSave());
require(TokenBunny.getRabbitSirePrice(_rabbitid) !=0);
require(TokenBunny.ownerOf(_rabbitid) == msg.sender);
TokenBunny.setRabbitSirePrice( _rabbitid, 0);
emit ChengeSex(_rabbitid, false, 0... | 12,677,764 |
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
import "openzeppelin-solidity/contracts/AddressUtils.sol";
import "./CvcPricingInterface.sol";
import "../idv/CvcValidatorRegistryInterface.sol";
import "../ontology/CvcOntologyInterface.sol";
import "../upgradeability/Initializable.sol";
import "../upgradeabi... | Deletes the price for Credential Item of specific type, name and version. _credentialItemType Credential Item type. _credentialItemName Credential Item name. _credentialItemVersion Credential Item version./ Lookup Credential Item. Calculate Price ID to address individual data items. Ensure the price existence. Check... | function deletePrice(
string _credentialItemType,
string _credentialItemName,
string _credentialItemVersion
)
external
whenNotPaused
{
bytes32 credentialItemId;
(credentialItemId, , , , , , ,) = ontology().getByTypeNameVersion(
_credentialI... | 973,331 |
./full_match/42161/0xd09556ECE9783f9AABba43e1df6A04a8218e7ca1/sources/project_/contracts/mercenaries/CharacterStats.sol | Import or generate character stats collectionAddress the address of the collection wrappedTokenID the id of the NFT to release Calculate the underlying token hash Ensure the stats haven't previously been generated If collection is native Get Native Character stats Otherwise generate some random stats Define array to... | function _storeStats(address collectionAddress, uint256 wrappedTokenID)
internal
isRegistered(collectionAddress)
{
uint256 stamina; uint256 strength; uint256 speed; uint256 courage; uint256 intelligence; uint256 health; uint256 morale;
bytes32 wrappedTokenHash = hashWrappedToken(... | 16,306,131 |
./full_match/10/0xA969bEB73d918f6100163Cd0fba3C586C269bee1/sources/AggregatorProxy.sol | returns the current proposed aggregator/ | function proposedAggregator()
external
view
override
returns (address)
{
return address(s_proposedAggregator);
}
| 3,781,202 |
./full_match/5/0x2888450de7D0cDc02341a08A37EfC326ff53849d/sources/_thirdweb-dev/contracts/extension/DropSinglePhase1155.sol | Lets a contract admin set claim conditions. | function setClaimConditions(
uint256 _tokenId,
ClaimCondition calldata _condition,
bool _resetClaimEligibility
) external override {
if (!_canSetClaimConditions()) {
revert("Not authorized");
}
ClaimCondition memory condition = claimCondition[_tokenId... | 1,960,962 |
./partial_match/1/0x3E65f43084F767343C4549a9ac424d89e44F4BEb/sources/contracts/RamenDao.sol | retrieves the uri of a specific token | function uri(uint256 id) public view override returns (string memory){
return tokens[id].uri;
}
| 3,659,258 |
./partial_match/1/0xAd100C81305244a32372Bc307AB247864ce6c68a/sources/BKRW.sol | Called by the owner to pause, triggers stopped state return A boolean that indicates if the operation was successful./ | function pause() public onlyOwner whenNotPaused returns (bool) {
_paused = true;
emit Paused();
return true;
}
| 3,982,396 |
pragma solidity ^0.8.0;
// Copyright 2020 Keyko GmbH.
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
// Code is Apache-2.0 and docs are CC-BY-4.0
import '@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol'... | _agentId The address of the agent _hash bytes32 message, the hash is the signed message. What is recovered is the signer address. _signature Signatures provided by the agent return true if the signature correspond to the agent address/ | function provenanceSignatureIsCorrect(
address _agentId,
bytes32 _hash,
bytes memory _signature
)
public
pure
returns(bool)
{
return ECDSAUpgradeable.recover(_hash, _signature) == _agentId;
}
| 13,052,952 |
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
/**
@notice Convenience library for Chainlink constants without pre-deployment
knowlege of the chain.
@dev Chain IDs:
- Ethereum Mainnet 1
- Rinkeby 4
- Polygon 137
- Mumbai 8... | / All LINK implementations have 18 decimal places, just like ETH, so we can use the Solidity suffix to ensure the correct multiplier whilst still being readable. 1 = mainnet 1337 = The geth SimulatedBackend iff used with the ethier chainlinktest package. The same as Ethereum Mainnet to enable testing of this library. P... | function vrfFee() internal view returns (uint256 fee) {
uint256 chainId;
assembly {
chainId := chainid()
}
if (chainId == 1 || chainId == 1337) {
return 2 ether;
}
if (chainId == 137 || chainId == 80001) {
return 0.0001 ether;
... | 946,483 |
./full_match/43113/0xbe427bf3c23fa7dbDa0bf42622127F03A994eF35/sources/BondDepository.sol | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a static call. _Available since v3.3._/ | function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
| 7,134,114 |
//SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
/*
--> https://welf.xyz <--
HAPPY HOLIDAYS FROM GENERALGALACTIC.ETH !!
888 8888888888b. d88888888888b. 8888888b. 88888888888888888b.
888 o 888888 Y88b d88888888 Y88b888 Y88b888 888 "Y88b
888 d8b 888888 888 d88... | because the max count is so low, we can be inefficient on this read.short circuit if there are none owned | function ownedTokens(address owner) public view returns (uint256[] memory) {
uint256 countOwnedTokens = balanceOf(owner);
uint256[] memory _ownedTokens = new uint256[](countOwnedTokens);
uint256 retIdx = 0;
if (countOwnedTokens == 0) {
return _ownedTokens;
}
... | 11,803,538 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import... | Get User Extra Rates/ | function getUserExtraRates(address user, uint256 bondId)
public
view
returns (uint256[4] memory)
{
uint256[4] memory rates;
rates[0] = getUserInviteBuyRate(user, bondId);
rates[1] = getUserInviteStakeRate(user);
rates[2] = getUserStakeRate(user);
... | 1,037,566 |
./partial_match/8453/0xDF9d1FeD7F0098118C68Ed656624c55839fAC001/sources/Comptroller.sol | Validates redeem and reverts on rejection. May emit logs. cToken Asset being redeemed redeemer The address redeeming the tokens redeemAmount The amount of the underlying asset being redeemed redeemTokens The number of tokens being redeemed/ Shh - currently unused Require tokens is zero or amount is also zero | function redeemVerify(
address cToken,
address redeemer,
uint256 redeemAmount,
uint256 redeemTokens
) external override {
cToken;
redeemer;
if (redeemTokens == 0 && redeemAmount > 0) {
revert("redeemTokens zero");
}
}
| 16,820,232 |
./partial_match/1/0xf5118CB8cF26B94EB3021edc4eC2095823E78F87/sources/ReferralRewardsType5.sol | Update the staking referral reward for _user. _user Address of the referral. | function accumulateReward(address _user) internal {
ReferralInfo storage referralInfo = referralReward[_user];
if (referralInfo.lastUpdate > now) {
return;
}
uint256 rewardPerSec = rewardsV2.rewardPerSec();
uint256 referralPrevStake = rewards.getReferralStake(_use... | 3,921,308 |
//Address: 0x3e516824a408c7029c3f870510d59442143c2db9
//Contract name: Version
//Balance: 0 Ether
//Verification Date: 2/23/2018
//Transacion Count: 2
// CODE STARTS HERE
pragma solidity ^0.4.13;
interface FundInterface {
// EVENTS
event PortfolioContent(uint holdings, uint price, uint decimals);
even... | when ofSender is a recognized exchange, receive tokens, otherwise revert | function cancelOrder(uint exchangeNumber, uint id)
external
pre_cond(isOwner() || isShutDown)
}
function tokenFallback(
address ofSender,
uint tokenAmount,
bytes metadata
if (msg.sender != address(this)) {
for (uint i; i < exchanges.length; i++... | 12,885,136 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
interface IStrategy {
function rewards() external view returns (address);
function gauge() external view returns (address);
function underlying() external view returns (address);
function timelock() external view returns (address);
functio... | Set a new governance address, can only be triggered by the old address | function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
| 442,402 |
./full_match/11155111/0x2ed9270882C72e27AF61a22325003C333903ADcF/sources/solidity/contracts/token/CGLD.sol | return price of CGLD in wei/ | function getPriceCgldWei() public view returns (uint256) {
uint256 cgld = uint256(getLatestCgldUSDPrice());
return (cgldAmount * 10 ** 26 / cgld);
}
| 3,794,642 |
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.10;
contract Token {
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
fu... | set a new owner. | function changeOwner(address _newFundDeposit) isOwner() external {
require(_newFundDeposit != address(0x0));
ethFundDeposit = _newFundDeposit;
}
| 10,716,033 |
// Dependency file: @openzeppelin/contracts/token/ERC20/SafeERC20.sol
// pragma solidity ^0.6.0;
// import "./IERC20.sol";
// import "../../math/SafeMath.sol";
// import "../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract ret... | Deposits the allowed reserve asset into the SetToken and mints the appropriate % of Net Asset Value of the SetToken to the specified _to address. _setToken Instance of the SetToken contract _reserveAsset Address of the reserve asset to issue with _reserveAssetQuantity Quan... | function issue(
ISetToken _setToken,
address _reserveAsset,
uint256 _reserveAssetQuantity,
uint256 _minSetTokenReceiveQuantity,
address _to
)
external
nonReentrant
onlyValidAndInitializedSet(_setToken)
{
_validateCommon(_setToken, _res... | 6,802,791 |
/*
ο½₯
*γβ
ο½₯ q
γο½₯γοΎβ q
γγγ *γβ
οΎο½₯q * q
γγ* β qο½₯οΎ*.q
γγγοΎ *.qβqβ
γο½₯
β
` .-:::::-.` `-::---...```
`-:` .:+ssssoooo++//:.` .-/+shhhhhhhhhhhhhyyyssooo:
.--::. .+o... | See {IERC721Metadata-tokenURI}./ If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). | function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
if (bytes(_baseURI).length == 0) {
return _tokenURI;
}
if (bytes(_tokenURI).length ... | 92,920 |
./full_match/62320/0xbe7C98bd159145a3eca0275f18C2b754e147bC42/sources/contracts/Reserve.sol | Returns the storage, major, minor, and patch version of the contract. return Storage version of the contract. return Major version of the contract. return Minor version of the contract. return Patch version of the contract./ | function getVersionNumber()
external
pure
returns (
uint256,
uint256,
uint256,
uint256
)
{
return (1, 2, 0, 0);
}
| 3,225,264 |
// SPDX-License-Identifier: MIT
import './abstract/ReaperBaseStrategy.sol';
import './interfaces/IUniswapRouter.sol';
import './interfaces/CErc20I.sol';
import './interfaces/IComptroller.sol';
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
pragma solidity 0.8.11;
/**
* @dev... | Sets a new borrow depth (how many loops for leveraging+deleveraging)/ | function setBorrowDepth(uint8 _borrowDepth) external {
_onlyStrategistOrOwner();
require(_borrowDepth <= maxBorrowDepth);
borrowDepth = _borrowDepth;
}
| 12,543,970 |
/**
*Submitted for verification at Etherscan.io on 2021-07-06
*/
// SPDX-License-Identifier: MIXED
// File @boringcrypto/boring-solidity/contracts/libraries/[emailΒ protected]
// License-Identifier: MIT
pragma solidity 0.6.12;
/// @notice A library for performing overflow-/underflow-safe math,
/// updated with aweso... | Concrete implementation of `removeCollateral`. | function _removeCollateral(address to, uint256 share) internal {
userCollateralShare[msg.sender] = userCollateralShare[msg.sender].sub(share);
totalCollateralShare = totalCollateralShare.sub(share);
emit LogRemoveCollateral(msg.sender, to, share);
bentoBox.transfer(collateral, addres... | 2,271,905 |
./partial_match/1313161554/0x2fc955bC96563Be7b45cC05D67952E16f595F7E2/sources/Address.sol | Deposit staking token into the contract to earn rewards. Since this contract needs to be supplied with rewards we are sending the balance of the contract if the pending rewards are higher _amount The amount of staking tokens to deposit If rewardBalance is low then revert to avoid losing the user's rewards | function deposit(uint256 _amount) external nonReentrant {
UserInfo storage user = userInfo[msg.sender];
updatePool();
if (user.amount > 0) {
uint256 pending = user.amount * poolInfo.accRewardTokenPerShare / 1e30 - user.rewardDebt;
if(pending > 0) {
req... | 16,936,936 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC721Receive... | Remove vault factory from whitelist use this function to disable new stakes to vaults coming from the specified factory contract. note: vaults with existing stakes from this factory are sill able to unstake access control: only admin state machine: - can be called multiple times - not shutdown state scope: ... | function removeVaultFactory(address factory) external {
_admin();
require(_vaultFactorySet.remove(factory), "UniStaker: vault factory not registered");
emit VaultFactoryRemoved(factory);
}
| 166,122 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @title Single Image Collection NFT Contract
/// @notice Creates an NFT Collection where each token has the same image
/// @n... | Upgrade the available supply of the collection _newmaxSupply value of the new supply for the collection | function setmaxSupply(uint256 _newmaxSupply) public onlyOwner {
require (_newmaxSupply > maxSupply, "new max supply lower than the previous one");
maxSupply = _newmaxSupply;
}
| 13,121,671 |
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath
{
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper tha... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ | function transfer(address _to, uint256 _value) public whenNotFrozen(_to) returns (bool) {
return super.transfer(_to, _value);
}
| 2,082,401 |
./partial_match/1/0x3A60F610268eAACb5572ADe1622A2197795dFF3C/sources/MultiPot.sol | state transition method/ | function transitionTo(State newState) internal {
emit StateChanged(current_state, newState);
current_state = newState;
}
| 4,241,921 |
/**
*Submitted for verification at Etherscan.io on 2021-03-15
*/
//SPDX-License-Identifier: SimPL-2.0
pragma solidity ^0.6.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Require... | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal {
require(account != address(0), "YouSwap: BURN_FROM_THE_ZERO_ADDRESS");
require(_balanceOf[account] > 0, "YouSwap: INSUFFICIENT_FUNDS");
_balanceOf[account] = _balanceOf[account].sub(amount, "YouSwap: BURN_AMOUNT_EXCEEDS_BALANCE");
... | 15,017,860 |
./full_match/1/0xd43B556d0307826f595a8986E65667abE882a5A6/sources/safeROXY1.sol | Returns the bep token owner./ | function getOwner() override external view returns (address) {
return _owner;
}
| 3,015,354 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
//Libraries
import "../libraries/TxDataUtils.sol";
import "../openzeppelin-solidity/contracts/SafeMath.sol";
//Inheritance
import "../interfaces/IVerifier.sol";
//Interfaces
import "../interfaces/IAddressResolver.sol";
import "../interfaces/IAssetHandler.sol";... | Parses the transaction data to make sure the transaction is valid pool Address of the pool to External contract address data Transaction call data return (bool, address, uint) Whether the transaction is valid, the received asset, and the transaction type./Get assetsParse transaction dataCheck if assets are supported... | function verify(address pool, address to, bytes calldata data) external override returns (bool, address, uint) {
bytes4 method = getMethod(data);
address assetHandlerAddress = ADDRESS_RESOLVER.getContractAddress("AssetHandler");
address ubeswapLPVerifierAddress = ADDRESS_RESOLVER.assetVerif... | 12,590,284 |
./full_match/5/0x8774BE2b59b7A848e39FE94a56d2eC4C159856cD/sources/contracts/Voting.sol | Define the vote function Check if the voter has already voted Check if the candidate is valid Record the vote Mark the voter as voted Emit the Vote event | function vote(uint256 candidateId) public {
require(!voters[msg.sender], "You have already voted");
require(candidateId < candidates.length, "Invalid candidate");
votes[candidateId]++;
totalVotes++;
voters[msg.sender] = true;
emit Vote(candidateId);
}
| 11,632,521 |
pragma solidity ^0.4.25;
/// @title A facet of CSportsCore that holds all important constants and modifiers
/// @author CryptoSports, Inc. (https://cryptosports.team))
/// @dev See the CSportsCore contract documentation to understand how the various CSports contract facets are arranged.
contract CSportsConstants ... | Escrows all of the tokensIds passed by transfering ownership to the teamContract. CAN ONLY BE CALLED BY THE CURRENT TEAM CONTRACT. _owner - Current owner of the token being authorized for transfer _tokenIds The IDs of the PlayerTokens that can be transferred if this call succeeds. Only an owner can transfer the tok... | function batchEscrowToTeamContract(
address _owner,
uint32[] _tokenIds
)
public
whenNotPaused
{
require(teamContract != address(0));
require(msg.sender == address(teamContract));
for (uint32 i = 0; i < _tokenIds.length; i++) {
uint32 _tokenId = _tokenIds[i];
require(_own... | 6,426,263 |
./partial_match/1/0x625DE14f04A296684304Df6E8b2B416D0a576c97/sources/WDOGECoin.sol | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ Overflow not possible: amount <= accountBalance <= totalSupply. | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amo... | 2,876,236 |
/**
*Submitted for verification at Etherscan.io on 2020-11-13
*/
// File: contracts/uniswapv2/interfaces/IUniswapV2Factory.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
functi... | this low-level function should be called from a contract which performs important safety checks | function burn(address to) external lock returns (uint amount0, uint amount1) {
uint balance0 = IERC20Uniswap(_token0).balanceOf(address(this));
uint balance1 = IERC20Uniswap(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0... | 32,317 |
pragma solidity 0.4.24;
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address pu... | Returns free tokens to owner/ | function returnRemaining() external onlyOwner {
uint256 remaining = remainingBalance();
require(remaining > 0);
token.safeTransfer(owner, remaining);
emit ReturnTokens(remaining);
}
| 7,222,051 |
// define the solidity version
// SPDX-License-Identifier: GPL-3.0
/// @author Shuaibu Alexander
/// @title A cooperative Contract
/// @notice This is a cooperative function, it facilitates group savings
/// and then disburses this savings to members one at a time as if they were taking a loan
pragma solidity ... | a function used to assign due dates for others numberOfUnits the number of days in which we want to move foward by (in uints of the frequency of payment of the cooperative) return It returns the time from now, in timestamp but in units of the specified interval of the contribution/ | function _unitTimeFromNow(uint256 numberOfUnits)
private
view
returns (uint256)
{
return block.timestamp + (numberOfUnits * frequencyInDays * 1 days);
}
| 15,812,118 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount o... | IPoolManager Angle Core Team Previous interface with additionnal getters for public variables and mappings Used in other contracts of the protocol | interface IPoolManager is IPoolManagerFunctions {
function stableMaster() external view returns (address);
function perpetualManager() external view returns (address);
function token() external view returns (address);
function feeManager() external view returns (address);
function totalDebt() ex... | 423,267 |
./full_match/1/0x20051E428c9984B256EB73957cA59c256F01938c/sources/contracts/Petar.sol | Adds liquidity to uniswap and sends lp tokens and returns to _to Uni markets can move, so extra tokens are expected to be left and are send to _to _uniData All the required data to deposit to uni fetch tokens from the address approve router so it can pull tokens add liq. and get info how much we put in send leftovers | function _uniSupply(UniSupplyData memory _uniData) internal returns (uint256) {
uint amountAPulled = _uniData.tokenA.pullTokensIfNeeded(_uniData.from, _uniData.amountADesired);
uint amountBPulled = _uniData.tokenB.pullTokensIfNeeded(_uniData.from, _uniData.amountBDesired);
_uniData.tokenA.a... | 4,867,134 |
/**%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%SLIME_BOYZ_SLIME_BOYZ_SLIME_BOYZ_SLIME_BOYZ_SLIME_BOYZ_SLIME_BOYZ_SLIME_BOYZ%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... | _safeMint's second argument now takes in a quantity, not a tokenId. | function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
}
pragma solidity ^0.8.4;
function mint(uin... | 6,221,809 |
./full_match/5/0x54FFCE9bE0C17840103e5b28408932A2C6cC7ED4/sources/contracts/BaseRenewalController.sol | Get the owners of the name and the parent name. Check to make sure the caller (msg.sender) is authorised to renew the name. If the caller paid too much refund the amount overpaid. | function renewWithVersions(
uint256 nameWrapperVersion,
uint256 subnameWrapperVersion,
bytes memory name,
address referrer,
uint256 duration
)
public
payable
{
(bytes32 labelhash, uint256 offset) = name.readLabel(0);
byte... | 7,064,044 |
pragma solidity ^0.4.23;
// ----------------------------------------------------------------------------
contract ERC20 {
// ERC Token Standard #223 Interface
// https://github.com/ethereum/EIPs/issues/223
string public symbol;
string public name;
uint8 public decimals;
function... | Converts tokens to ETH and transfers ETH to destAddress minus fee@fee 0-10,000 means 0%-100% | function convertTokensToEth(ERC20 tokenContract, address destAddress, uint tokenCount, uint fee) public onlyOperator
{
require(allowConvertTokensToEth);
_swapTokenToEther(
kyberOracle[address(tokenContract)],
tokenContract,
tokenCount,
destAddress... | 12,776,528 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than... | Calculates how much ETH somebody can receive for selling amount BOB amount How much tokens to sell/ | function calcReward(uint256 amount) view public returns(uint256) {
}
| 1,644,766 |
./full_match/5/0x5480CE9Cb8b0D1Dc52379547e5152176b2f236a1/sources/MISOHelper.sol | (address stakingToken,,,) = farm.poolInfo(j); | function getUserPoolsInfos(address _user) public view returns(UserPoolsInfo[] memory) {
uint256 numberOfFarms = farmFactory.numberOfFarms();
UserPoolsInfo[] memory infos = new UserPoolsInfo[](numberOfFarms);
for (uint256 i = 0; i < numberOfFarms; i++) {
address farmAddr = farmF... | 1,863,603 |
/**
*Submitted for verification at Etherscan.io on 2022-02-22
*/
// hevm: flattened sources of src/StakingRewards.sol
// SPDX-License-Identifier: MIT AND GPL-3.0-or-later
pragma solidity =0.8.9 >=0.8.0 <0.9.0;
////// node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol
/* pragma solidity ^0.8.0; */
/*... | Change the paused state of the contract Only the contract owner may call this./ | function setPaused(bool _paused) external onlyOwner {
require(_paused != paused, "no change");
paused = _paused;
emit PauseChanged(_paused);
}
event PauseChanged(bool isPaused);
| 15,141,629 |
pragma solidity ^0.4.24;
// @notice Contract to create posts
contract DReddit {
enum Ballot { NONE, UPVOTE, DOWNVOTE }
struct Post {
uint creationDate;
bytes description;
address owner;
uint upvotes;
uint downvotes;
mapping(address => Ballot) voters;
... | Obtain vote for specific post _postId Id of the post return uint that represents the vote: 0 -> none, 1 -> upvote, 2 -> downvote | function getVote(uint _postId)
public
view
returns (uint8)
{
Post storage p = posts[_postId];
return uint8(p.voters[msg.sender]);
}
| 1,034,768 |
./partial_match/1/0x637AAa9c7059B2Df195339B7c55bb2f3cb2eD946/sources/AAMG.sol | Gives permission to `to` to transfer `tokenId` token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - `tokenId` ... | function approve(address to, uint256 tokenId) public payable virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tok... | 3,733,764 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import './token/PoolsInterestBearingToken.sol';
import './token/Bridge.sol';
import './utils/MyPausableUpgradeable.sol';
import 'hardhat/cons... | This function (or hook) is called before every token transfer from the address of the sender of the token transfer to the address of the recipient of the token transfer amount the amount of tokens that will be transferred/ | function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override whenNotPaused {
super._beforeTokenTransfer(from, to, amount);
}
| 87,349 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.5.16;
import "./GXrc20.sol";
import "./GToken.sol";
import "./EIP20NonStandardInterface.sol";
contract GTokenAdmin {
/// @notice Admin address
address payable public admin;
/// @notice Reserve manager address
address payable public reserveMan... | Seize the stock assets token The token address/ | function seize(address token) external onlyAdmin {
uint256 amount = EIP20NonStandardInterface(token).balanceOf(address(this));
if (amount > 0) {
_transferToken(token, admin, amount);
}
}
| 12,903,900 |
./full_match/42220/0x10EE6F6Dc28e96d7B294bD2b285b7dEf5A52BD87/sources/contracts/governor/PACTDelegate.sol | Executes a queued proposal if eta has passed _proposalId The id of the proposal to execute/ | function execute(uint256 _proposalId) external payable {
require(
state(_proposalId) == ProposalState.Queued,
"PACT::execute: proposal can only be executed if it is queued"
);
Proposal storage _proposal = proposals[_proposalId];
_proposal.executed = true;
... | 16,355,259 |
./full_match/73799/0x6796B8a52B2CC672B14999d8B9939252E05F8080/sources/contracts/libraries/LibIssuer.sol | Register a claimed green proof certificate certificateID ID of the claimed certificate user address of the user claiming the certificate claimedAmount amount of the certificate being claimed/ | function registerClaimedProof(
uint256 certificateID,
address user,
uint256 claimedAmount
) internal {
getStorage().claimedBalances[certificateID][user] += claimedAmount;
}
| 16,362,473 |
./full_match/137/0xdE2c25552245C0e2E77fF7F4C677E336f7811ca9/sources/contracts/FablecoinsDeploy.sol | See {IERC721Metadata-name}./ | function name() external view virtual override returns (string memory) {
return NAME;
}
| 4,786,113 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@o... | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
| 11,453 |
pragma solidity 0.6.12; // optimization runs: 200, evm version: istanbul
pragma experimental ABIEncoderV2;
interface DharmaTradeBotV1Interface {
event LimitOrderProcessed(
address indexed account,
address indexed suppliedAsset, // Ether = address(0)
address indexed receivedAsset, // Ether = address(0)
... | Private function to enforce that a given meta-transaction has not been used before and that the signature is valid according to the account in question (using ERC-1271). account address The account originating the meta-transaction. context bytes Information about the meta-transaction. signatures bytes Signature or s... | function _validateMetaTransaction(
address account, bytes memory context, bytes memory signatures
) private returns (bytes32 orderID) {
orderID = keccak256(context);
require(
!_invalidMetaTxHashes[orderID], "Order is no longer valid."
);
_invalidMetaTxHashes[orderID] = true;
bytes32 ... | 7,890,657 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.6;
import "@yield-protocol/utils-v2/contracts/access/AccessControl.sol";
import "@yield-protocol/utils-v2/contracts/cast/CastBytes32Bytes6.sol";
import "@yield-protocol/utils-v2/contracts/token/IERC20Metadata.sol";
import "@yield-protocol/vault-interfaces/IOracl... | Set or reset an oracle source and its inverse | function setSource(bytes6 baseId, IERC20Metadata base, bytes6 quoteId, IERC20Metadata quote, address source)
external auth
{
sources[baseId][quoteId] = Source({
source: source,
baseDecimals: base.decimals(),
quoteDecimals: quote.decimals(),
inverse... | 14,412,873 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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 programmers usually assume that an overflow raises an
* error, which i... | Change amount of tokens distributed daily by changing total distributed amount dailyDistribution New daily distribution/ | function setDailyDistribution(uint256 dailyDistribution) public onlyOwner {
distribute();
uint256 timeLeft = distributionStart.add(duration).sub(block.timestamp);
if (timeLeft > duration) {
timeLeft = duration;
distributionStart = block.timestamp;
duration... | 14,627,853 |
// SPDX-License-Identifier: UNLICENSED
// IERC20.sol
pragma solidity ^0.6.2;
/*
π SAVE THE BEES! π
TBC Token - The Bee Conservancy is a Charity Token that Rewards Holders for helping to save the Bees! Team TomorrowWontExist will be donating to the https://thebeeconservancy.org/ on an ongoing Basis
πΆ Officially S... | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint2... | 10,381,458 |
pragma solidity ^0.4.18;
//import 'dao/Liability.sol';
import 'common/Object.sol';
import 'token/ERC20.sol';
import './MarketHeap.sol';
library CreatorLiability {
function create(address, address, address, uint256) public
returns (Liability);
}
/**
* @title Liability marketplace
*/
contract Liabili... | Get order by index _i Order index return Order fields/ | function getOrder(uint256 _i) public view returns (address[], address[], address, bool) {
var o = orders[_i];
return (o.beneficiary, o.promisee, o.promisor, o.closed);
}
event OpenAskOrder(uint256 indexed order);
event OpenBidOrder(uint256 indexed order);
event CloseAskOrder(uint25... | 887,343 |
pragma solidity ^0.5.2;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
/... | The Ownable constructor sets the original `owner` of the contract to the sender account./ | function calculateTotalCollateral(
uint priceFloor,
uint priceCap,
uint qtyMultiplier
) pure internal returns (uint)
}
function calculateFeePerUnit(
uint priceFloor,
uint priceCap,
uint qtyMultiplier,
uint feeInBasisPoints
) pure internal retu... | 1,044,977 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
... | Withdraw Titan token from vault wallet to owner when only emergency!/ | function emergencyWithdrawToken() external onlyOwner {
require(_msgSender() != address(0), "Vault: Invalid address");
uint256 tokenAmount = _titan.balanceOf(address(this));
require(tokenAmount > 0, "Vault: Insufficient amount");
_titan.transfer(_msgSender(), tokenAmount);
e... | 1,308,546 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title A simple Voting smart contract
* @author Cyril Castagnet && JΓ©rΓ©mie Samson
* @dev Simple voting system deployed with truffle
*/
contract Voting is Ownable {
struct Voter {
bool is... | Start proposal registration function for the owner/ | function startProposalsRegistering() external onlyOwner {
require(workflowStatus == WorkflowStatus.RegisteringVoters, "Registering proposals cant be started now");
workflowStatus = WorkflowStatus.ProposalsRegistrationStarted;
emit WorkflowStatusChange(WorkflowStatus.RegisteringVoters, Workfl... | 15,813,389 |
pragma solidity ^0.5.0;
// Import key libraries for Ownable and SafeMath
// import "../installed_contracts/zeppelin/contracts/math/SafeMath.sol";
// import "installed_contracts/zeppelin/contracts/ownership/Ownable.sol";
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Ar... | This function withdraws for the beneficiary and owner Set global lock to prevent reentrancy Compute payments to beneficiary and owner Send to beneficiary and owner implicitly set the transfer to prevent a reentrancy attack Set payout flag to prevent reentrancy. | function withdrawDonations() notInEmergency public payable {
}
| 15,787,670 |
pragma solidity >=0.4.21 <0.6.0;
import "./Bank.sol";
contract Property {
address payable admin;
Bank public bankContract;
struct User {
string Name;
string AdharNo;
string PanNo;
string email;
string PhoneNo;
}
struct Land {
address Owner;
string ReraRegisteredNo;
bool LandOnRoad;
//string ... | ownership change request must existtransfer coins from contract to selleruint160 is used to explicitly convert the address as payableadmin, i.e., the government approves the change of ownership;transfers the ownership to the buyerempty the owner change request | function changeLandOwner (uint256 _landId, address _newOwner) onlyOwner(_landId) public {
require (landOwnerChangeRequest[uint(keccak256(abi.encodePacked(userLands[_landId].ReraRegisteredNo)))] != address(0));
address(uint160(msg.sender)).transfer(userLands[_landId].Price);
emit Transaction (admin, msg.sender, u... | 988,843 |
./full_match/5/0xe1F4D298FfEBeE985E6d704DC91dAA20Ed8B006E/sources/_thirdweb-dev/contracts/extension/Staking721Upgradeable.sol | Withdraw logic. Override to add custom logic. | function _withdraw(uint256[] calldata _tokenIds) internal virtual {
uint256 _amountStaked = stakers[msg.sender].amountStaked;
uint256 len = _tokenIds.length;
require(len != 0, "Withdrawing 0 tokens");
require(_amountStaked >= len, "Withdrawing more than staked");
address _nf... | 1,879,647 |
./full_match/11155111/0x40FD79d469F7Ec8D942ee467b54C80026639697F/sources/contracts/PWNVault.sol | Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding to learn more about how these ids are created. This function call must use less than 30 000 gas./ | function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {
return
interfaceId == type(IERC165).interfaceId ||
interfaceId == type(Ownable).interfaceId ||
interfaceId == type(IERC721Receiver).interfaceId ||
interfaceId == type(IERC11... | 3,826,317 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.5;
import "../libraries/SafeMath.sol";
import "../libraries/SafeERC20.sol";
import "../interfaces/IUniswapV2Router2.sol";
import "../interfaces/IUniswapV2Factory.sol";
import "../interfaces/IHelper.sol";
import "hardhat/console.sol";
contract Helper is IHelper... | get LP token and LP amount _swapArgs encoded data return lpAddress_ lp token address return lpAmount_ lp token amount | function swapForDeposit(bytes calldata _swapArgs)
external
override
transferHandler(_swapArgs)
returns (address lpAddress_, uint256 lpAmount_)
{
(lpAddress_, lpAmount_) = __swapForDeposit(_swapArgs);
}
| 12,825,408 |
./partial_match/1/0x5899Efea757E0Dbd6d114b3375C23D7540f65fa4/sources/FactRegistry.sol | This function stores the fact hash in the mapping. Mark first time off. | function registerFact(bytes32 factHash) internal {
verifiedFact[factHash] = true;
if (!anyFactRegistered) {
anyFactRegistered = true;
}
}
| 2,736,697 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "./Interfaces/ILosslessER... | This function activates the emergency mode When a report gets generated for a token, it enters an emergency state globally. The emergency period will be active for one settlement period. During this time users can only transfer settled tokens _token Token on which the emergency mode must get activated | function activateEmergency(ILERC20 _token) override external onlyLosslessEnv {
tokenConfig[_token].emergencyMode = block.timestamp;
emit EmergencyActive(_token);
}
| 14,553,400 |
./full_match/80001/0xFeE3EeDf3CD8F841df64A9E789DD3AF88c16Fc63/sources/contracts/protocol/ForeProtocol.sol | Returns length of all markets array / nft height | function allMarketLength() external view returns (uint256) {
return allMarkets.length;
}
| 5,579,557 |
// File: @laborx/solidity-shared-contracts/contracts/ERC20Interface.sol
/**
* Copyright 2017β2018, LaborX PTY
* Licensed under the AGPL Version 3 license.
*/
pragma solidity ^0.4.23;
/// @title Defines an interface for EIP20 token smart contract
contract ERC20Interface {
event Transfer(address indexed from... | Allocates bytes array for keeping data | function _allocMemoryBytesArray(uint _structCount, uint _structDataLength) private pure returns (bytes memory _arr) {
assembly {
_arr := mload(0x40)
let _length := mul(_structDataLength, _structCount)
mstore(_arr, _length)
mstore(0x40, add(_arr, add(_length, ... | 5,472,742 |
pragma solidity ^0.4.24;
// File: contracts\CloneFactory.sol
/**
* @title CloneFactory
* @dev This contracts helps clone an oracle.
* The address of the targeted contract to clone has to be provided.
*/
contract CloneFactory {
/**
* @dev Creates oracle clone
* @param target is the address being cloned
... | This function tells you if a given challenge has been completed by a given miner _challenge the challenge to search for _miner address that you want to know if they solved the challenge return true if the _miner address provided solved the/ | function didMine(bytes32 _challenge,address _miner) public view returns(bool){
return miners[_challenge][_miner];
}
| 938,697 |
pragma solidity ^0.4.19;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns(uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return... | Decrease the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. ... | function decreaseApproval( address _spender, uint _subtractedValue) public returns(bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
... | 1,043,265 |
./full_match/1/0x8b80596660f007342DC590e5C53BbddD2cD550Fb/sources/browser/Formsv2.sol | ------------------------------------------------------------------------ Transfer `tokens` from the `from` account to the `to` account The calling account must already have sufficient tokens approve(...)-d for spending from the `from` account and - From account must have sufficient balance to transfer - Spender must ha... | function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
require(address(to) != address(0), "Transfer to address 0 not allowed");
require(address(from) != address(0), "Transfer from address 0 not allowed");
require(balances[from] >= tok... | 3,109,358 |
./partial_match/8453/0xCD9C9b40D757b56359e19563203D3bc64089638d/sources/contracts/past-versions/PublicLockV13.sol | Functions to be implemented by a tokenURIHook. Lock hooks are configured by calling `setEventHooks` on the lock./ | interface ILockTokenURIHook {
function tokenURI(
address lockAddress,
address operator,
address owner,
uint256 keyId,
uint expirationTimestamp
) external view returns (string memory);
}
}
| 16,778,702 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/cont... | Public wrapper of _forward method to recipient address (must be in approvedRecipients) amount amount of ETH to send/ | function forward(address to, uint256 amount) public onlyOwner {
_forward(to, amount);
}
| 14,453,243 |
pragma solidity 0.5.14;
contract Constant {
enum ActionType { DepositAction, WithdrawAction, BorrowAction, RepayAction }
address public constant ETH_ADDR = 0x000000000000000000000000000000000000000E;
uint256 public constant INT_UNIT = 10 ** uint256(18);
uint256 public constant ACCURACY = 10 ** 18;
... | Check if the user has collateral flag set _account address of the user _index index of the token return true if the user has collateral flag set for the given index/ | function isUserHasCollateral(address _account, uint8 _index) public view returns(bool) {
Account storage account = accounts[_account];
return account.collateralBitmap.isBitSet(_index);
}
| 5,774,181 |
./partial_match/1/0x30eBFB77e1383a15343dEa84376F4caC4e688f2e/sources/MutantPixelHounds.sol | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override onlyAllowedOperator(from) {
safeTransferFrom(from, to, tokenId, '');
}
| 15,939,022 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
// use Mapping and Internal func visibility
contract SecondContractMappingUse {
struct Company {
string name;
uint age;
uint workers;
string status;
}
mapping(address => Company) private companies;
funct... | address sender = msg.sender;newCompany.id = companies.length + 1; | function addCompany (string memory name, uint age, uint workers, string memory status) public {
Company memory newCompany;
newCompany.name = name;
newCompany.age = age;
newCompany.workers = workers;
if(workers <= 10) {
newCompany.status = "small";
new... | 13,046,416 |
// contracts/CollectionItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such ... | Return the CID associated with the tokenID./ | function tokenCID(uint256 tokenId) public view virtual returns (string memory) {
require(_exists(tokenId), "CID query for nonexistent token");
return _tokenCIDs[tokenId];
}
| 10,094,455 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./OpCommon.sol";
import {ProtocolAaveV2Interface} from "../protocol/interface/IProtocolAaveV2.sol";
import {ProtocolERC20Interface} from "../protocol/interface/IProtocolERC20.sol";
import {OperationCenterInterface} from "../interfaces/IOperationCenter.sol... | function emitCreateAccountEvent(address EOA, address account) external; | interface EventCenterLeveragePositionInterface {
function epochRound() external view returns (uint256);
function emitUseFlashLoanForLeverageEvent(address token, uint256 amount)
external;
function emitOpenLongLeverageEvent(
address leverageToken,
address targetToken,
uint25... | 6,294,209 |
./partial_match/3/0x8252AaBFFa377a323F11DFa0d7cBB41409878BA3/sources/yaDelayu3.sol | Whitelist Many user address at once - only Owner can do this It will require maximum of 150 addresses to prevent block gas limit max-out and DoS attack It will add user address in whitelisted mapping/ | function whitelistManyUsers(address[] memory userAddresses) onlyOwner public{
require(whitelistingStatus == true);
uint256 addressCount = userAddresses.length;
require(addressCount <= 150,"Too many addresses");
for(uint256 i = 0; i < addressCount; i++){
whitelisted[userAd... | 5,198,097 |
// SPDX-License-Identifier: MIT
// File: contracts/INftStaker.sol
pragma solidity ^0.8.4;
/// @dev Interface allowing calling of stake and unstake on staking contract.
interface INftStaker {
function stake(uint256 _tokenId, address _tokenOwner) external;
function unstake(uint256 _tokenId, address _tokenOwn... | Interface allowing calling of stake and unstake on staking contract. | interface INftStaker {
function stake(uint256 _tokenId, address _tokenOwner) external;
function unstake(uint256 _tokenId, address _tokenOwner) external;
}
| 13,520,596 |
./full_match/80001/0x88517aB345F1e7492227E3515641B8b51019d7dd/sources/src/contracts/SignatureMintWithParamsERC1155.sol | Returns the flat platform fee and recipient. | function getFlatPlatformFeeInfo() external view returns (address, uint256) {
return (platformFeeRecipient, flatPlatformFee);
}
| 841,912 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.