Unnamed: 0 int64 0 7.36k | comments stringlengths 3 35.2k | code_string stringlengths 1 527k | code stringlengths 1 527k | __index_level_0__ int64 0 88.6k |
|---|---|---|---|---|
93 | // Decreases totalSupply and the corresponding amount of the specified partition of tokenHolder This function can only be called by the authorised operator. _partition The partition to allocate the decrease in balance. _tokenHolder The token holder whose balance should be decreased _value The amount by which to decreas... | function operatorRedeemByPartition(
| function operatorRedeemByPartition(
| 47,803 |
6 | // endBlock = startBlock + 40320;roughly 40,000 blocks per week | endBlock = startBlock + 3; // for testing purposes only 3 blocks used
ipfsHash = ""; // initiate as empty string
bidIncrement = 1 ether; // denominated in ether for testing
| endBlock = startBlock + 3; // for testing purposes only 3 blocks used
ipfsHash = ""; // initiate as empty string
bidIncrement = 1 ether; // denominated in ether for testing
| 21,303 |
115 | // add digit to the result | i += digit;
| i += digit;
| 35,219 |
223 | // Alternate implementationAssumes there are no duplicates / | function unionB(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
bool[] memory includeMap = new bool[](A.length + B.length);
uint256 count = 0;
for (uint256 i = 0; i < A.length; i++) {
includeMap[i] = true;
count++;
}
... | function unionB(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
bool[] memory includeMap = new bool[](A.length + B.length);
uint256 count = 0;
for (uint256 i = 0; i < A.length; i++) {
includeMap[i] = true;
count++;
}
... | 17,425 |
122 | // Delete ad | delete ads[_id];
| delete ads[_id];
| 1,596 |
29 | // set interface main contract | setMiningWarInterface(0x1b002cd1ba79dfad65e8abfbb3a97826e4960fe5);
| setMiningWarInterface(0x1b002cd1ba79dfad65e8abfbb3a97826e4960fe5);
| 66,764 |
78 | // Interface constant for ERC721, to check values in constructor. | bytes4 private constant ERC721_INTERFACE_ID = 0x80ac58cd;
| bytes4 private constant ERC721_INTERFACE_ID = 0x80ac58cd;
| 61,174 |
18 | // return idToNFTItem.getMyItems(_itemsSold); | uint40 totalItemCount = _itemsSold;
uint40 itemCount = 0;
for (uint40 i = 0; i < totalItemCount; i++) {
if (idToNFTItem[i + 1].owner == msg.sender) { itemCount += 1; }
| uint40 totalItemCount = _itemsSold;
uint40 itemCount = 0;
for (uint40 i = 0; i < totalItemCount; i++) {
if (idToNFTItem[i + 1].owner == msg.sender) { itemCount += 1; }
| 26,202 |
82 | // Return All Details about a Influencer Agreement / | function getAgreementDetails() public view returns(address, address, uint256, uint256, uint256, InfluencerAgreementFactory.InfluencerAgreementStatus,
| function getAgreementDetails() public view returns(address, address, uint256, uint256, uint256, InfluencerAgreementFactory.InfluencerAgreementStatus,
| 7,930 |
27 | // check if msg.sender is valid customer | (address customer, uint256 fee, uint256 profit, uint256 timestamp) =
productStorage.getEscrowData(productId, purchaseId);
require(msg.sender == customer);
| (address customer, uint256 fee, uint256 profit, uint256 timestamp) =
productStorage.getEscrowData(productId, purchaseId);
require(msg.sender == customer);
| 855 |
15 | // Biswap NFT Launchpad Pre-market sell Biswap NFT tokens. / | contract LaunchpadNftRandom is ReentrancyGuard, Ownable, Pausable {
using SafeERC20 for IERC20;
IBiswapNFT biswapNFT;
address public treasuryAddress;
IERC20 public immutable dealToken;
struct Launchpad {
uint price;
uint robiBoost;
uint32 totalCount;
uint32 soldCoun... | contract LaunchpadNftRandom is ReentrancyGuard, Ownable, Pausable {
using SafeERC20 for IERC20;
IBiswapNFT biswapNFT;
address public treasuryAddress;
IERC20 public immutable dealToken;
struct Launchpad {
uint price;
uint robiBoost;
uint32 totalCount;
uint32 soldCoun... | 27,063 |
14 | // iterate on all report variants we already have, limited by the oracle members maximum | while (i < _length && currentReportVariants[i].isDifferent(variant)) {
++i;
}
| while (i < _length && currentReportVariants[i].isDifferent(variant)) {
++i;
}
| 32,228 |
151 | // Get the number of DCU to be collected by the target address on the designated transaction pair lock/xtoken xtoken address (or CNode address)/cycle cycle/addr Target address/ return The number of DCU to be collected by the target address on the designated transaction lock | function earned(address xtoken, uint64 cycle, address addr) external view override returns (uint) {
// Load staking channel
StakeChannel storage channel = _channels[_getKey(xtoken, cycle)];
// Call _calcReward() to calculate new reward
uint newReward = _calcReward(channel);
... | function earned(address xtoken, uint64 cycle, address addr) external view override returns (uint) {
// Load staking channel
StakeChannel storage channel = _channels[_getKey(xtoken, cycle)];
// Call _calcReward() to calculate new reward
uint newReward = _calcReward(channel);
... | 55,910 |
158 | // Initialize the money market bController_ The address of the BController interestRateModel_ The address of the interest rate model initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18 name_ EIP-20 name of this token symbol_ EIP-20 symbol of this token decimals_ EIP-20 decimal precision of this token... | function initialize(BControllerInterface bController_,
InterestRateModel interestRateModel_,
uint initialExchangeRateMantissa_,
string memory name_,
string memory symbol_,
| function initialize(BControllerInterface bController_,
InterestRateModel interestRateModel_,
uint initialExchangeRateMantissa_,
string memory name_,
string memory symbol_,
| 46,849 |
5 | // _rate is the amount of tokens for 1 SVC_wallet the address collecting tokens_token the address of the token contract_svc the address of the svc token contract/ | constructor(uint256 _rate, address _wallet, address _token, address _svc, string memory _symbol) public {
require(_rate > 0, "rate is 0");
rate = _rate;
wallet = _wallet;
token = ERC20(_token);
svc = ERC20(_svc);
symbol = _symbol;
}
| constructor(uint256 _rate, address _wallet, address _token, address _svc, string memory _symbol) public {
require(_rate > 0, "rate is 0");
rate = _rate;
wallet = _wallet;
token = ERC20(_token);
svc = ERC20(_svc);
symbol = _symbol;
}
| 21,564 |
37 | // crowdsale aims to sell at least 100 000 LEONS | uint256 public constant crowdsaleTarget = 100000 * 10**18;
uint256 public constant margin = 1000 * 10**18;
| uint256 public constant crowdsaleTarget = 100000 * 10**18;
uint256 public constant margin = 1000 * 10**18;
| 14,561 |
669 | // Reads the uint192 at `rdPtr` in returndata. | function readUint192(
ReturndataPointer rdPtr
| function readUint192(
ReturndataPointer rdPtr
| 40,389 |
13 | // Otherwise, check his parent's membership in system context if account itself does not have the membership in given context, then having his parent in the system context grants him the privilege needed | else if (_isParentInGroup(_assignerId, LibAdmin._getSystemId(), assignerGroup)) {
ret = true;
}
| else if (_isParentInGroup(_assignerId, LibAdmin._getSystemId(), assignerGroup)) {
ret = true;
}
| 20,243 |
93 | // Multiplies two precise units, and then truncates by the full scale, rounding up the result x Left hand input to multiplication y Right hand input to multiplicationreturn Result after multiplying the two inputs and then dividing by the shared scale unit, rounded up to the closest base unit. / | function mulTruncateCeil(uint256 x, uint256 y)
internal
pure
returns (uint256)
| function mulTruncateCeil(uint256 x, uint256 y)
internal
pure
returns (uint256)
| 4,315 |
60 | // Pancake has to add hidden dummy pools in order to alter the emission, here we make it simple and transparent to all. | function updateEmissionRate(uint256 _zfaiPerBlock) public onlyOwner {
massUpdatePools();
emit EmissionRateUpdated(msg.sender, zfaiPerBlock, _zfaiPerBlock);
zfaiPerBlock = _zfaiPerBlock;
}
| function updateEmissionRate(uint256 _zfaiPerBlock) public onlyOwner {
massUpdatePools();
emit EmissionRateUpdated(msg.sender, zfaiPerBlock, _zfaiPerBlock);
zfaiPerBlock = _zfaiPerBlock;
}
| 37,303 |
10 | // OwnableInterface The Ownable contract has an owner address, and provides basic authorization controlfunctions, this simplifies the implementation of "user permissions". / | contract OwnableInterface {
/**
* @dev The getter for "owner" contract variable
*/
function getOwner() public constant returns (address);
/**
* @dev Throws if called by any account other than the current owner.
*/
modifier onlyOwner() {
require (msg.sender == getOwner());
_;
}
}
| contract OwnableInterface {
/**
* @dev The getter for "owner" contract variable
*/
function getOwner() public constant returns (address);
/**
* @dev Throws if called by any account other than the current owner.
*/
modifier onlyOwner() {
require (msg.sender == getOwner());
_;
}
}
| 14,679 |
2,810 | // 1406 | entry "unadzed" : ENG_ADJECTIVE
| entry "unadzed" : ENG_ADJECTIVE
| 18,018 |
123 | // Redeem related | mapping (address => uint256) public redeemFXSBalances;
mapping (address => mapping(uint256 => uint256)) public redeemCollateralBalances; // Address -> collateral index -> balance
uint256[] public unclaimedPoolCollateral; // collateral index -> balance
uint256 public unclaimedPoolFXS;
mapping (addres... | mapping (address => uint256) public redeemFXSBalances;
mapping (address => mapping(uint256 => uint256)) public redeemCollateralBalances; // Address -> collateral index -> balance
uint256[] public unclaimedPoolCollateral; // collateral index -> balance
uint256 public unclaimedPoolFXS;
mapping (addres... | 16,272 |
77 | // last interest index | uint interestIndex;
| uint interestIndex;
| 55,001 |
0 | // ================= STATE VARIABLES ================= / ========= Immutable Storage ========= | uint256 internal constant BASIS_POINTS = 10000;
| uint256 internal constant BASIS_POINTS = 10000;
| 294 |
33 | // ganache-cli -d 1st | address public ACCOUNT_A = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266;
| address public ACCOUNT_A = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266;
| 28,188 |
83 | // calculate time weighted stake | uint256 stakeUnits = currentAmount.mul(stakeDuration);
| uint256 stakeUnits = currentAmount.mul(stakeDuration);
| 28,478 |
10 | // purchase requirements knights | purchaseRequirements[7].tokens = [tokens[5]]; // 5 STG
purchaseRequirements[7].amounts = [250];
purchaseRequirements[8].tokens = [tokens[5]]; // 5 STG
purchaseRequirements[8].amounts = [5*(10**2)];
purchaseRequirements[9].tokens = [tokens[5]]; // 10 STG
purchaseRequirements[9].amounts = [10*(10*... | purchaseRequirements[7].tokens = [tokens[5]]; // 5 STG
purchaseRequirements[7].amounts = [250];
purchaseRequirements[8].tokens = [tokens[5]]; // 5 STG
purchaseRequirements[8].amounts = [5*(10**2)];
purchaseRequirements[9].tokens = [tokens[5]]; // 10 STG
purchaseRequirements[9].amounts = [10*(10*... | 47,101 |
131 | // Set the default reward receiver for the caller. When set to ZERO_ADDRESS, rewards are sent to the caller _receiver Receiver address for any rewards claimed via `claim_rewards` / | function set_rewards_receiver(address _receiver) external;
| function set_rewards_receiver(address _receiver) external;
| 63,118 |
102 | // Queries the approval status of an operator for a given owner _owner The owner of the Tokens _operatorAddress of authorized operatorreturn True if the operator is approved, false if not / | function isApprovedForAll(address _owner, address _operator)
public view returns (bool isOperator)
| function isApprovedForAll(address _owner, address _operator)
public view returns (bool isOperator)
| 17,892 |
12 | // Mineable TokenTurns a wallet into a mine for a specified ERC20 token / | contract OracleToken is Token {
/*Variables*/
bytes32 public currentChallenge;
uint public timeOfLastProof; // time of last challenge solved
uint256 public difficulty = 1; // Difficulty starts low
uint count;
address owner;
string public oracleName;
mapping(uint => uint) values;
... | contract OracleToken is Token {
/*Variables*/
bytes32 public currentChallenge;
uint public timeOfLastProof; // time of last challenge solved
uint256 public difficulty = 1; // Difficulty starts low
uint count;
address owner;
string public oracleName;
mapping(uint => uint) values;
... | 10,097 |
4 | // Mouth N°5 => Angry | function item_5() public pure returns (string memory) {
return
base(
'<g display="inline" ><path fill="#FFFFFF" d="M211.5,246.9c-7.9,1.5-19.6,0.3-23.8-0.9c-4.5-1.3-8.6,3.2-9.7,7.5c-0.5,2.6-1.4,7.7,3.9,10.5c6.7,2.5,6.4,0.1,10.4-2c3.9-2.1,11.3-1.1,17.3,2c6.1,3.1,15.1,2.3,20.2-0.4c3... | function item_5() public pure returns (string memory) {
return
base(
'<g display="inline" ><path fill="#FFFFFF" d="M211.5,246.9c-7.9,1.5-19.6,0.3-23.8-0.9c-4.5-1.3-8.6,3.2-9.7,7.5c-0.5,2.6-1.4,7.7,3.9,10.5c6.7,2.5,6.4,0.1,10.4-2c3.9-2.1,11.3-1.1,17.3,2c6.1,3.1,15.1,2.3,20.2-0.4c3... | 44,680 |
3 | // Separations of concerns, convenience method for Factory/ | function addPermittedCallers(address[] memory _callerAddresses)
public onlyOwner {
for (uint i = 0; i < _callerAddresses.length; i++) {
addPermittedCaller(_callerAddresses[i]);
}
| function addPermittedCallers(address[] memory _callerAddresses)
public onlyOwner {
for (uint i = 0; i < _callerAddresses.length; i++) {
addPermittedCaller(_callerAddresses[i]);
}
| 54,173 |
305 | // Eliminate any chance of jackpot when admin rolls during paused state for testing purposes | if (tokens[tid].level >= paused_level) b = 99999;
if (b < jackpot_prob[tokens[tid].level]) {
| if (tokens[tid].level >= paused_level) b = 99999;
if (b < jackpot_prob[tokens[tid].level]) {
| 43,408 |
113 | // Transfers the amount to recipient.- Add or checks stakeholders array for recipient address- calls for fees distribution Requirements: - recipient cannot be the zero address.- the caller must have a balance of at least amount. / | function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
| function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
| 43,667 |
7 | // NOTE: Trusts the owner not to add a coin twice. Returns the coin index. | function addCoin(
string calldata _name,
AggregatorV3Interface _priceFeed,
uint8 _imprecision
| function addCoin(
string calldata _name,
AggregatorV3Interface _priceFeed,
uint8 _imprecision
| 30,330 |
13 | // addPaperReview -This function verify registered reviewer and verify paper existence. Then it allows to add the comment, status and cid hash file against the paper id._paperidPaper ID, or which reviewed data being added_versionPaper version, for which reviewed data being added_reviewerComments complete comments_revie... | function addPaperReview(uint32 _paperid,uint32 _version,string memory _reviewerComments,string memory _reviewerCid,uint _status) public
| function addPaperReview(uint32 _paperid,uint32 _version,string memory _reviewerComments,string memory _reviewerCid,uint _status) public
| 17,227 |
8 | // Check sender is Fuse admin | require(msg.sender == fuseAdmin, "Sender not Fuse admin.");
| require(msg.sender == fuseAdmin, "Sender not Fuse admin.");
| 67,674 |
43 | // Reentrancy | bool private _isSwapLocked = false;
| bool private _isSwapLocked = false;
| 80,256 |
57 | // Allows the owner to permanently disable token transfers. This can be usedonce side chain is ready and the owner wants to stop transfers to take a snapshotof token balances for the genesis of the side chain. | function freeze() public onlyOwner returns (bool) {
require(!frozen);
frozen = true;
Frozen();
return true;
}
| function freeze() public onlyOwner returns (bool) {
require(!frozen);
frozen = true;
Frozen();
return true;
}
| 9,740 |
11 | // Called when debug. | event Debug(uint256 data, address addr);
| event Debug(uint256 data, address addr);
| 44,950 |
63 | // Convenience functions | function buyAndCreateGame (uint256 amount, uint256 pose, address referral) public payable {
buyTokens (referral);
createGame (amount, pose);
}
| function buyAndCreateGame (uint256 amount, uint256 pose, address referral) public payable {
buyTokens (referral);
createGame (amount, pose);
}
| 26,157 |
468 | // EIP-20 token symbol for this token |
string public constant symbol = "LAVA";
|
string public constant symbol = "LAVA";
| 3,106 |
75 | // serializes Instance struct _record Instance / | function serialize(Instance memory _record) external nonReentrant {
require(msg.sender == _record.uuid, 'ElasticDAO: Unauthorized');
setUint(keccak256(abi.encode(_record.uuid, 'maxVotingLambda')), _record.maxVotingLambda);
setString(keccak256(abi.encode(_record.uuid, 'name')), _record.name);
setBool(... | function serialize(Instance memory _record) external nonReentrant {
require(msg.sender == _record.uuid, 'ElasticDAO: Unauthorized');
setUint(keccak256(abi.encode(_record.uuid, 'maxVotingLambda')), _record.maxVotingLambda);
setString(keccak256(abi.encode(_record.uuid, 'name')), _record.name);
setBool(... | 24,999 |
63 | // computes P + Q input: 4 values of 256 bit each) x-coordinate of point P) y-coordinate of point P) x-coordinate of point Q) y-coordinate of point Q |
bool success;
assembly {
|
bool success;
assembly {
| 5,687 |
37 | // The payment required alongside a burn transaction in order to mint in 1/100,000 ETH | uint32 burnPayment;
| uint32 burnPayment;
| 28,983 |
20 | // Fired whenever a team is transfered from one owner to another | event Transfer(address from, address to, uint256 tokenId);
| event Transfer(address from, address to, uint256 tokenId);
| 64,256 |
21 | // ERC20 Contract definitions / | contract ERC20 {
uint256 public totalETHSupply; // added to the ERC20 for convenience, does not change the protocol
function balanceOf(address who) constant returns (uint);
function allowance(address owner, address spender) constant returns (uint);
function transfer(address to, uint value) returns (bool ok);
... | contract ERC20 {
uint256 public totalETHSupply; // added to the ERC20 for convenience, does not change the protocol
function balanceOf(address who) constant returns (uint);
function allowance(address owner, address spender) constant returns (uint);
function transfer(address to, uint value) returns (bool ok);
... | 39,715 |
169 | // minter will only be tunnel | modifier onlyMinter {
require(hasRole(MINTER_ROLE, msg.sender), "Caller is not a minter");
_;
}
| modifier onlyMinter {
require(hasRole(MINTER_ROLE, msg.sender), "Caller is not a minter");
_;
}
| 22,698 |
37 | // If the action is STORES, and this action has already been executed, throw | require(n_stored == 0, 'Duplicate action: STORES');
| require(n_stored == 0, 'Duplicate action: STORES');
| 48,236 |
5 | // LP pair address. | address public tokenPair;
| address public tokenPair;
| 8,948 |
247 | // Unstake YELD tokens and receive YELDIES tokens tradable for NFTs | function unstakeYELDAndReceiveYELDIES(uint256 _amount) public {
require(_amount <= amountStaked[msg.sender], "NFTManager: You can't unstake more than your current stake");
receiveYELDIES();
amountStaked[msg.sender] = amountStaked[msg.sender].sub(_amount);
IERC20(yeld).transfer(msg.se... | function unstakeYELDAndReceiveYELDIES(uint256 _amount) public {
require(_amount <= amountStaked[msg.sender], "NFTManager: You can't unstake more than your current stake");
receiveYELDIES();
amountStaked[msg.sender] = amountStaked[msg.sender].sub(_amount);
IERC20(yeld).transfer(msg.se... | 16,988 |
6 | // Gets the patient record based on the record id. /onlyBy(owner)restrict access |
returns (
uint,
string memory,
string memory,
string memory,
string memory,
string memory,
string memory,
|
returns (
uint,
string memory,
string memory,
string memory,
string memory,
string memory,
string memory,
| 8,836 |
66 | // allocate the string | bytes memory bstr = new bytes(length);
| bytes memory bstr = new bytes(length);
| 1,227 |
3 | // Mints debt token to the `onBehalfOf` address. The resulting rate is the weighted average between the rate of the new debtand the rate of the previous debt user The address receiving the borrowed underlying, being the delegatee in caseof credit delegate, or same as `onBehalfOf` otherwise onBehalfOf The address receiv... | function mint(
| function mint(
| 25,353 |
481 | // index record next user index mapped by pool | mapping(uint256 => uint256) public nextUser;
| mapping(uint256 => uint256) public nextUser;
| 43,343 |
108 | // Lets the owner transfer ownership of the contract to a new owner. _newOwner The new owner. / | function changeOwner(address _newOwner) external onlyOwner {
require(_newOwner != address(0), "Address must not be null");
owner = _newOwner;
emit OwnerChanged(_newOwner);
}
| function changeOwner(address _newOwner) external onlyOwner {
require(_newOwner != address(0), "Address must not be null");
owner = _newOwner;
emit OwnerChanged(_newOwner);
}
| 22,911 |
0 | // Difficulty starts reasonably low | difficulty = 10**32;
| difficulty = 10**32;
| 16,467 |
113 | // split the contract balance into halves | uint256 half = contractTokenBalance.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
| uint256 half = contractTokenBalance.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
| 10,432 |
67 | // set new owner, burn rate | slot.owner = msg.sender;
slot.burnRate = newBurnRate;
slot.deposit = deposit;
| slot.owner = msg.sender;
slot.burnRate = newBurnRate;
slot.deposit = deposit;
| 28,813 |
31 | // release time of locked | function unlockTimeOf(address _owner) public constant returns (uint timelimit) {
return timeRelease[_owner];
}
| function unlockTimeOf(address _owner) public constant returns (uint timelimit) {
return timeRelease[_owner];
}
| 32,056 |
60 | // daiAvailableToDistribute therefore does not include unused deposits | daiAvailableToDistribute = _balanceAfter.sub(_balanceBefore);
emit LogStep2Complete(daiAvailableToDistribute);
| daiAvailableToDistribute = _balanceAfter.sub(_balanceBefore);
emit LogStep2Complete(daiAvailableToDistribute);
| 28,555 |
41 | // ICrowdsaleProxy created 23/11/2017author Frank Bonnet / | interface ICrowdsaleProxy {
/**
* Receive ether and issue tokens to the sender
*
* This function requires that msg.sender is not a contract. This is required because it's
* not possible for a contract to specify a gas amount when calling the (internal) send()
* function. Solidity impose... | interface ICrowdsaleProxy {
/**
* Receive ether and issue tokens to the sender
*
* This function requires that msg.sender is not a contract. This is required because it's
* not possible for a contract to specify a gas amount when calling the (internal) send()
* function. Solidity impose... | 16,360 |
4 | // Mappings to store admin's address and name for each certificate hash | mapping(bytes32 => address) private CertAdmin;
mapping(bytes32 => string) private CertAdminName;
| mapping(bytes32 => address) private CertAdmin;
mapping(bytes32 => string) private CertAdminName;
| 25,487 |
22 | // updates the whitelist oracle address. Requirements:`newAddress` cannot be a zero address.`caller` should be current admin. / | function updateOracle(address newAddress) public virtual onlyAdmin {
require(newAddress != address(0), "Error: owner cannot be zero");
_whitelist = newAddress;
}
| function updateOracle(address newAddress) public virtual onlyAdmin {
require(newAddress != address(0), "Error: owner cannot be zero");
_whitelist = newAddress;
}
| 9,013 |
47 | // Default is the ecrecover flow with the provided data hash Use ecrecover with the messageHash for EOA signatures | currentOwner = ecrecover(dataHash, v, r, s);
| currentOwner = ecrecover(dataHash, v, r, s);
| 7,675 |
9 | // Require that the specified auction exists / | modifier auctionExists(uint256 auctionId) {
require(_exists(auctionId), "Auction doesn't exist");
_;
}
| modifier auctionExists(uint256 auctionId) {
require(_exists(auctionId), "Auction doesn't exist");
_;
}
| 2,145 |
19 | // Pools and Farms percent from token per block | uint256 public stakingPercent;
| uint256 public stakingPercent;
| 11,467 |
8 | // transfer assets | require(ASSET_TOKEN.transferFrom(msg.sender, address(this), balance));
| require(ASSET_TOKEN.transferFrom(msg.sender, address(this), balance));
| 21,635 |
61 | // Amount tokens charged to add to liquidity. | uint256 tLiquifyFee;
uint256 tMarketingFee;
uint256 tDevFee;
| uint256 tLiquifyFee;
uint256 tMarketingFee;
uint256 tDevFee;
| 35,798 |
220 | // Mapping from marble NFT source uri hash TO NFT ID . / | mapping (uint256 => uint256) public sourceUriHashToId;
constructor()
public
| mapping (uint256 => uint256) public sourceUriHashToId;
constructor()
public
| 23,391 |
8 | // Sender redeems cTokens in exchange for the underlying asset Accrues interest whether or not the operation succeeds, unless reverted redeemTokens The number of cTokens to redeem into underlyingreturn uint 0=success, otherwise a failure (see ErrorReporter.sol for details) / | function redeem(uint redeemTokens) override external returns (uint) {
bytes memory data = delegateToImplementation(abi.encodeWithSignature("redeem(uint256)", redeemTokens));
return abi.decode(data, (uint));
}
| function redeem(uint redeemTokens) override external returns (uint) {
bytes memory data = delegateToImplementation(abi.encodeWithSignature("redeem(uint256)", redeemTokens));
return abi.decode(data, (uint));
}
| 2,856 |
31 | // we check if platform emergency mode is on | if(_emergencyStop) revert EmergencyMode();
Campaign storage campaign = campaigns[_id];
| if(_emergencyStop) revert EmergencyMode();
Campaign storage campaign = campaigns[_id];
| 28,587 |
31 | // this function deploys a new Farming contract and calls the encoded function passed as data. data encoded initialize function for the farming contract (check Farming contract code).return contractAddress new farming contract address.return initResultData new farming contract call result. / | function deploy(bytes memory data) public returns (address contractAddress, bytes memory initResultData) {
initResultData = _call(contractAddress = _clone(farmMainImplAddress), data);
emit FarmMainDeployed(contractAddress, msg.sender, initResultData);
}
| function deploy(bytes memory data) public returns (address contractAddress, bytes memory initResultData) {
initResultData = _call(contractAddress = _clone(farmMainImplAddress), data);
emit FarmMainDeployed(contractAddress, msg.sender, initResultData);
}
| 16,118 |
194 | // Issue can be created via {createNewIssue}./ | function _issueExists(uint256 _issueNumber) internal view virtual returns (bool) {
return issues[_issueNumber].exist ? true : false;
}
| function _issueExists(uint256 _issueNumber) internal view virtual returns (bool) {
return issues[_issueNumber].exist ? true : false;
}
| 31,752 |
60 | // The nft value is to be updated by authenticated oracles | function update(bytes32 nftID_, uint value) public auth {
// switch of collateral risk group results in new: ceiling, threshold for existing loan
nftValues[nftID_] = value;
}
| function update(bytes32 nftID_, uint value) public auth {
// switch of collateral risk group results in new: ceiling, threshold for existing loan
nftValues[nftID_] = value;
}
| 37,229 |
1 | // Pack size will be from 3 to 7 items | for(uint i = 0; i < _ids.length; i++) {
require(balanceOf(owner(), _ids[i]) >= _amounts[i], "Marketplace: Owner does not own enough of each item");
require(activeItems[_msgSender()][_ids[i]] == true, "Marketplace: Already in pack or sold");
activeItems[_msgSender()][_ids[i]] ... | for(uint i = 0; i < _ids.length; i++) {
require(balanceOf(owner(), _ids[i]) >= _amounts[i], "Marketplace: Owner does not own enough of each item");
require(activeItems[_msgSender()][_ids[i]] == true, "Marketplace: Already in pack or sold");
activeItems[_msgSender()][_ids[i]] ... | 22,194 |
155 | // Check end time not before start time and that end is in the future | require(_endTimestamp > _startTimestamp, "End time must be greater than start");
require(_endTimestamp > _getNow(), "End time passed. Nobody can bid.");
| require(_endTimestamp > _startTimestamp, "End time must be greater than start");
require(_endTimestamp > _getNow(), "End time passed. Nobody can bid.");
| 41,725 |
83 | // 0x780e9d63 ===bytes4(keccak256('totalSupply()')) ^bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) ^bytes4(keccak256('tokenByIndex(uint256)')) / |
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f;
|
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f;
| 15,405 |
5 | // Deposit Token to lending pool | IAaveLendingPool(lendingPoolAddress).deposit(tokenAddress, amount, 0);
return true;
| IAaveLendingPool(lendingPoolAddress).deposit(tokenAddress, amount, 0);
return true;
| 28,398 |
23 | // return array of UUID specified by parameters/_requester RDDN Address of the requester/_state 0:Prepared, 1:Executed, 2:Aborted/_direction 0:Deposit, 1:Withdraw/ return array of UUID | function getRequests (
address _requester,
State _state,
Direction _direction
| function getRequests (
address _requester,
State _state,
Direction _direction
| 2,617 |
300 | // pre-set approvals | approveTokenMax(comp, address(UNI_V2_ROUTER));
approveTokenMax(comp, address(SUSHI_V2_ROUTER));
approveTokenMax(comp, address(UNI_V3_ROUTER));
approveTokenMax(address(want), address(cToken));
approveTokenMax(weth, address(FlashLoanLib.SOLO));
| approveTokenMax(comp, address(UNI_V2_ROUTER));
approveTokenMax(comp, address(SUSHI_V2_ROUTER));
approveTokenMax(comp, address(UNI_V3_ROUTER));
approveTokenMax(address(want), address(cToken));
approveTokenMax(weth, address(FlashLoanLib.SOLO));
| 50,866 |
822 | // Create a query dispute passing the parsed attestation.To be used in createQueryDispute() and createQueryDisputeConflict()to avoid calling parseAttestation() multiple times`_attestationData` is only passed to be emitted _fisherman Creator of dispute _deposit Amount of tokens staked as deposit _attestation Attestation... | function _createQueryDisputeWithAttestation(
address _fisherman,
uint256 _deposit,
Attestation memory _attestation,
bytes memory _attestationData
| function _createQueryDisputeWithAttestation(
address _fisherman,
uint256 _deposit,
Attestation memory _attestation,
bytes memory _attestationData
| 84,696 |
83 | // swap pool filling success event | event FillSuccess (
uint256 total,
bytes32 id,
address creator,
uint256 creation_time,
address token_address,
string message
);
| event FillSuccess (
uint256 total,
bytes32 id,
address creator,
uint256 creation_time,
address token_address,
string message
);
| 4,919 |
34 | // maximum available SHPC with a bonus | uint public maxDistributeCoin = 600000000 * 1 ether; //600,000,000 shpc (incl. bonus)
| uint public maxDistributeCoin = 600000000 * 1 ether; //600,000,000 shpc (incl. bonus)
| 43,025 |
12 | // 评价 | struct Comment {
address buyer; // 购买者
uint date; // 日期
uint score; // 评分
string content; // 评论
}
| struct Comment {
address buyer; // 购买者
uint date; // 日期
uint score; // 评分
string content; // 评论
}
| 22,784 |
14 | // minimum amount of value to transfer to beneficiary in automatic mode | uint private quantum;
| uint private quantum;
| 11,047 |
15 | // https:data.chain.link/ethereum/mainnet/crypto-usd/aave-usd Chainlink: AAVE/USD | feedAddress = 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9;
maxStaleness = 1 hours + STALENESS_BUFFER;
| feedAddress = 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9;
maxStaleness = 1 hours + STALENESS_BUFFER;
| 12,217 |
169 | // Withdraw without caring about rewards./_pid The pid specifies the pool | function emergencyWithdraw(uint256 _pid) external;
| function emergencyWithdraw(uint256 _pid) external;
| 39,644 |
22 | // hacker get its reward to a vesting contract | tokenLock = tokenLockFactory.createTokenLock(
address(lpToken),
0x000000000000000000000000000000000000dEaD, //this address as owner, so it can do nothing.
pendingApproval.beneficiary,
claimRewards.hackerVestedReward,
| tokenLock = tokenLockFactory.createTokenLock(
address(lpToken),
0x000000000000000000000000000000000000dEaD, //this address as owner, so it can do nothing.
pendingApproval.beneficiary,
claimRewards.hackerVestedReward,
| 29,111 |
50 | // Whitelist The Whitelist contract has a whitelist of addresses, and provides basic authorization control functions.This simplifies the implementation of "user permissions". / | contract Whitelist is Ownable, RBAC {
string public constant ROLE_WHITELISTED = "whitelist";
/**
* @dev Throws if operator is not whitelisted.
* @param _operator address
*/
modifier onlyIfWhitelisted(address _operator) {
checkRole(_operator, ROLE_WHITELISTED);
_;
}
/**
* @dev add an addr... | contract Whitelist is Ownable, RBAC {
string public constant ROLE_WHITELISTED = "whitelist";
/**
* @dev Throws if operator is not whitelisted.
* @param _operator address
*/
modifier onlyIfWhitelisted(address _operator) {
checkRole(_operator, ROLE_WHITELISTED);
_;
}
/**
* @dev add an addr... | 48,818 |
7 | // Take Avax Rewards | uint256 _avax = address(this).balance; //get balance of native Avax
if (_avax > 0) { //wrap avax into ERC20
WAVAX(wavax).deposit{value: _avax}();
| uint256 _avax = address(this).balance; //get balance of native Avax
if (_avax > 0) { //wrap avax into ERC20
WAVAX(wavax).deposit{value: _avax}();
| 36,905 |
96 | // where block.number is past the endBlock | else if (block.number >= endBlock){
_deltaBlock = endBlock.sub(lastBlock);
}
| else if (block.number >= endBlock){
_deltaBlock = endBlock.sub(lastBlock);
}
| 45,017 |
12 | // Add multiple itemsAll for same priceThis saves sending 10 tickets to create 10 items. | function AddMultipleItems(uint256 price, uint8 howmuch) public {
require(msg.sender == owner);
require(price != 0);
require(howmuch != 255); // this is to prevent an infinite for loop
uint8 i=0;
for (i; i<howmuch; i++){
AddItem(price);
}
}
| function AddMultipleItems(uint256 price, uint8 howmuch) public {
require(msg.sender == owner);
require(price != 0);
require(howmuch != 255); // this is to prevent an infinite for loop
uint8 i=0;
for (i; i<howmuch; i++){
AddItem(price);
}
}
| 40,815 |
136 | // SECRET / | contract ChallengeScienceInterface {
/**
* @dev given genes of current floor and dungeon seed, return a genetic combination - may have a random factor.
* @param _floorGenes Genes of floor.
* @param _seedGenes Seed genes of dungeon.
* @return The resulting genes.
*/
function mixGenes(ui... | contract ChallengeScienceInterface {
/**
* @dev given genes of current floor and dungeon seed, return a genetic combination - may have a random factor.
* @param _floorGenes Genes of floor.
* @param _seedGenes Seed genes of dungeon.
* @return The resulting genes.
*/
function mixGenes(ui... | 41,328 |
13 | // ecMul(h, f1) | (uint256 calc_1_x, uint256 calc_1_y) = MathEC.ecMul(input.bn1, publicKey.x, publicKey.y);
| (uint256 calc_1_x, uint256 calc_1_y) = MathEC.ecMul(input.bn1, publicKey.x, publicKey.y);
| 25,543 |
47 | // Sells CLIMB Tokens And Deposits Underlying Asset Tokens into Seller's Address / | function sell(uint256 tokenAmount) external nonReentrant {
_sell(tokenAmount, msg.sender);
}
| function sell(uint256 tokenAmount) external nonReentrant {
_sell(tokenAmount, msg.sender);
}
| 29,609 |
31 | // Eternal internal functionsGetter Methods | function getSwapOutTicket(string memory _ticket) internal view returns (SwapOutTicketStruct memory) {
DiamondStorage storage ds = diamondStorage();
return ds.SwapOutTickets[_ticket];
}
| function getSwapOutTicket(string memory _ticket) internal view returns (SwapOutTicketStruct memory) {
DiamondStorage storage ds = diamondStorage();
return ds.SwapOutTickets[_ticket];
}
| 33,424 |
64 | // Constructor// _messenger Address of the CrossDomainMessenger on the current layer. / | constructor(address _messenger) {
messenger = _messenger;
}
| constructor(address _messenger) {
messenger = _messenger;
}
| 45,442 |
193 | // withdraw all liquidity and claim all pending reward withdraw all liquidity and claim all pending reward | function exit( uint16 _pid ) public override whenNotPaused
| function exit( uint16 _pid ) public override whenNotPaused
| 35,954 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.