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 |
|---|---|---|---|---|
150 | // / | newShareRate = SHARE_RATE_MAX;
| newShareRate = SHARE_RATE_MAX;
| 579 |
89 | // Queued debt amount [wad] | uint256 public override queuedDebt;
| uint256 public override queuedDebt;
| 37,388 |
30 | // If the recipient had bid for the Sketch, remove the bid and make it possible to refund its value | Bid storage bid = sketchIndexToHighestBid[sketchIndex];
if (bid.bidder == to) {
accountToWithdrawableValue[to] += bid.value;
sketchIndexToHighestBid[sketchIndex] = Bid(false, sketchIndex, 0x0, 0);
}
| Bid storage bid = sketchIndexToHighestBid[sketchIndex];
if (bid.bidder == to) {
accountToWithdrawableValue[to] += bid.value;
sketchIndexToHighestBid[sketchIndex] = Bid(false, sketchIndex, 0x0, 0);
}
| 15,877 |
293 | // Publish allows for setting the link, image of the ad./ unit that is identified by the idx which was returned during the buy step./ The link and image must be full web3-recognizeable URLs, such as:/- bzz:a5c10851ef054c268a2438f10a21f6efe3dc3dcdcc2ea0e6a1a7a38bf8c91e23/- bzz:mydomain.eth/ad.png/- https:cdn.mydomain.co... | function publish(uint _idx, string calldata _link, string calldata _image, string calldata _title, bool _NSFW) public {
Ad storage ad = ads[_idx];
require(msg.sender == ad.owner,"Sender is not slot owner!");
ad.link = _link;
ad.image = _image;
ad.title = _title;
ad.NS... | function publish(uint _idx, string calldata _link, string calldata _image, string calldata _title, bool _NSFW) public {
Ad storage ad = ads[_idx];
require(msg.sender == ad.owner,"Sender is not slot owner!");
ad.link = _link;
ad.image = _image;
ad.title = _title;
ad.NS... | 49,162 |
6 | // Retrieve raw trait IDs for a given seed value. | function getStartingTraitsBySeed(uint256 seed)
public
pure
returns (Traits memory)
| function getStartingTraitsBySeed(uint256 seed)
public
pure
returns (Traits memory)
| 6,562 |
30 | // prod accounts | address private _accountFee = 0x7554CEA927C9D9b0329470d73aD4D03533Ce9538;
address private _accountSales = 0xA267ffeAD14B0F302e6AA10f156Ad41D17d2278D;
| address private _accountFee = 0x7554CEA927C9D9b0329470d73aD4D03533Ce9538;
address private _accountSales = 0xA267ffeAD14B0F302e6AA10f156Ad41D17d2278D;
| 11,794 |
224 | // Set bonusMultiplier. Can only be called by the owner. | function setBonusMultiplier(uint256 _bonusMultiplier) public onlyOwner {
bonusMultiplier = _bonusMultiplier;
}
| function setBonusMultiplier(uint256 _bonusMultiplier) public onlyOwner {
bonusMultiplier = _bonusMultiplier;
}
| 38,764 |
12 | // Validate Content Hash alone of a student _transcriptHash - Transcript Hash of the documentreturn Returns true if validation is successful / | function validateTranscriptHash(Document storage self, bytes32 _transcriptHash) public view returns(bool) {
bytes32 transcriptHash = self.transcriptHash;
return transcriptHash == _transcriptHash;
}
| function validateTranscriptHash(Document storage self, bytes32 _transcriptHash) public view returns(bool) {
bytes32 transcriptHash = self.transcriptHash;
return transcriptHash == _transcriptHash;
}
| 45,204 |
3 | // Sets a new controller. address_ Address of the controller. / | function setController(address address_) external onlyOwner {
require(
address_ != address(0x0),
"controller address cannot be the null address"
);
emit Controller(ticker, address(controller), address_);
controller = SmartController(address_);
require(... | function setController(address address_) external onlyOwner {
require(
address_ != address(0x0),
"controller address cannot be the null address"
);
emit Controller(ticker, address(controller), address_);
controller = SmartController(address_);
require(... | 18,500 |
10 | // ============================== ERC20 | event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
| event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
| 3,648 |
60 | // The struct consists of ERC20-style token metadata. | struct ERC20Metadata {
string name;
string symbol;
uint8 decimals;
}
| struct ERC20Metadata {
string name;
string symbol;
uint8 decimals;
}
| 32,379 |
11 | // Emitted after a successful token claim/to recipient of claim/amount of tokens claimed | event Claim(address indexed to, uint256 amount);
| event Claim(address indexed to, uint256 amount);
| 2,927 |
67 | // Retrieve the dividend balance of any single address. / | function dividendsOf(address _customerAddress) public view returns (uint) {
return (uint) ((int)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
| function dividendsOf(address _customerAddress) public view returns (uint) {
return (uint) ((int)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
| 63,767 |
77 | // this should never happen | require(_payableGovernanceAddresses.length == _payableGovernanceShares.length, "Payable governance length mismatch!");
| require(_payableGovernanceAddresses.length == _payableGovernanceShares.length, "Payable governance length mismatch!");
| 36,462 |
1 | // Returns the address of the current pending owner. / | address payable public pendingOwner;
event NewOwner(address indexed previousOwner, address indexed newOwner);
event NewPendingOwner(
address indexed oldPendingOwner,
address indexed newPendingOwner
);
| address payable public pendingOwner;
event NewOwner(address indexed previousOwner, address indexed newOwner);
event NewPendingOwner(
address indexed oldPendingOwner,
address indexed newPendingOwner
);
| 31,624 |
10 | // burn the LP | sAMMUsdcDei.burn(me);
console.log("[+] my USDC balance: %s", usdc.balanceOf(me));
console.log("[+] my DEI balance: %s", dei.balanceOf(me));
console.log("[+] my LP token balance: %s\n", sAMMUsdcDei.balanceOf(me));
| sAMMUsdcDei.burn(me);
console.log("[+] my USDC balance: %s", usdc.balanceOf(me));
console.log("[+] my DEI balance: %s", dei.balanceOf(me));
console.log("[+] my LP token balance: %s\n", sAMMUsdcDei.balanceOf(me));
| 43,446 |
96 | // maxTransactionAmount | maxTransactionAmount = 1000000000000000000000000;
maxWallet = 20000000000000000000000;
swapTokensAtAmount = totalSupply * 10 / 2500;
buyMarketingFee = _buyMarketingFee;
buyLiquidityFee = _buyLiquidityFee;
buyDevFee = _buyDevFee;
buyTotalFees = buyMarketingFee ... | maxTransactionAmount = 1000000000000000000000000;
maxWallet = 20000000000000000000000;
swapTokensAtAmount = totalSupply * 10 / 2500;
buyMarketingFee = _buyMarketingFee;
buyLiquidityFee = _buyLiquidityFee;
buyDevFee = _buyDevFee;
buyTotalFees = buyMarketingFee ... | 8,917 |
10 | // Enables or disables approval for a third party ("operator") to manage all of`msg.sender`'s assets. It also emits the ApprovalForAll event. The contract MUST allow multiple operators per owner. _operator Address to add to the set of authorized operators. _approved True if the operators is approved, false to revoke ap... | function setApprovalForAll(
| function setApprovalForAll(
| 48,311 |
105 | // Take timeDiff in seconds (Dividend) and MINT_PERIOD_DURATION as (Divisor)return Calculate the numberOfWeeks since last mint rounded down to 1 week / | function weeksSinceLastIssuance() public view returns (uint) {
// Get weeks since lastMintEvent
// If lastMintEvent not set or 0, then start from inflation start date.
uint timeDiff = lastMintEvent > 0 ? now.sub(lastMintEvent) : now.sub(INFLATION_START_DATE);
return timeDiff.div(MINT... | function weeksSinceLastIssuance() public view returns (uint) {
// Get weeks since lastMintEvent
// If lastMintEvent not set or 0, then start from inflation start date.
uint timeDiff = lastMintEvent > 0 ? now.sub(lastMintEvent) : now.sub(INFLATION_START_DATE);
return timeDiff.div(MINT... | 10,431 |
95 | // The old address, can be address(0). oldAddress and newAddress cannot both equal address(0). | address oldAddress;
| address oldAddress;
| 56,728 |
21 | // mappings | mapping(address => uint256) public _balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
| mapping(address => uint256) public _balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
| 9,644 |
53 | // Change Presale Publicsale end time | function changeEndTime(uint256 _endTime) public onlyOwner {
require(endTime > startTime);
endTime = _endTime;
}
| function changeEndTime(uint256 _endTime) public onlyOwner {
require(endTime > startTime);
endTime = _endTime;
}
| 21,340 |
49 | // Accounts for rounding errors when unwrapping wstETH | amount = amount.sub(
IERC20(steth).balanceOf(address(this)).sub(stethBalance)
);
| amount = amount.sub(
IERC20(steth).balanceOf(address(this)).sub(stethBalance)
);
| 59,252 |
6 | // The entire array was composed of a single value. | ret = createUniqueArray(input, 1);
return ret;
| ret = createUniqueArray(input, 1);
return ret;
| 40,630 |
38 | // raid character (token 0) live in 7 and have random special skills | if (newNarcoId==0){
narcos[0].homeLocation=7; // in vice island
narcos[0].skills[4]=800; // defense
narcos[0].skills[5]=65535; // carry
}
| if (newNarcoId==0){
narcos[0].homeLocation=7; // in vice island
narcos[0].skills[4]=800; // defense
narcos[0].skills[5]=65535; // carry
}
| 16,209 |
25 | // Interface for Project data contracts/ | contract ProjectManager is ErrorCodes, Util, ProjectState, ProjectEvent, BidState {
Project[] projects;
uint bidId; // unique identifier for bids
/*
note on mapping to array index:
a non existing mapping will return 0, so 0 should not be a valid value in a map,
otherwise exists() will not work
*/
... | contract ProjectManager is ErrorCodes, Util, ProjectState, ProjectEvent, BidState {
Project[] projects;
uint bidId; // unique identifier for bids
/*
note on mapping to array index:
a non existing mapping will return 0, so 0 should not be a valid value in a map,
otherwise exists() will not work
*/
... | 32,352 |
13 | // Finally, purchase tokens. | purchaseTokens(msg.value, _referredBy);
| purchaseTokens(msg.value, _referredBy);
| 16,515 |
100 | // set warmup period in epoch's numbers for new stakers _warmupPeriod uint / | function setWarmup( uint _warmupPeriod ) external onlyOwner {
warmupPeriod = _warmupPeriod;
emit LogWarmupPeriod(_warmupPeriod);
}
| function setWarmup( uint _warmupPeriod ) external onlyOwner {
warmupPeriod = _warmupPeriod;
emit LogWarmupPeriod(_warmupPeriod);
}
| 26,981 |
3 | // Checks that _data is valid (not calling anything it shouldn't) | require(Util.getSig(_data) == preSaleSTO.getInitFunction(), "Invalid data");
| require(Util.getSig(_data) == preSaleSTO.getInitFunction(), "Invalid data");
| 8,456 |
4 | // Check for batch minting | if (quantity > 1) {
for (uint16 i = quantity; i > 0; i--) {
containerInfo.value.deployedAt.safeMint(purchaseCaller, containerInfo.value.idCounter);
containerInfo.value.idCounter++;
}
| if (quantity > 1) {
for (uint16 i = quantity; i > 0; i--) {
containerInfo.value.deployedAt.safeMint(purchaseCaller, containerInfo.value.idCounter);
containerInfo.value.idCounter++;
}
| 30,386 |
85 | // 客户查找自己已购买的商品数组 | function getGoodsByCustomer(string _phone)constant returns(bytes32[]) {
bytes32 tempPhone = stringToBytes32(_phone);
address tempCustomerAddr = customerPhone[tempPhone];
return customer[tempCustomerAddr].buyGoods;
}
| function getGoodsByCustomer(string _phone)constant returns(bytes32[]) {
bytes32 tempPhone = stringToBytes32(_phone);
address tempCustomerAddr = customerPhone[tempPhone];
return customer[tempCustomerAddr].buyGoods;
}
| 25,132 |
33 | // Maintain a maximum allowable transfer size (in Ether) for the deposit manager. | uint256 private _etherLimit;
bool private _originatesFromReserveTrader; // unused, don't change storage layout
uint256 private constant _version870 = 5; //inject NONSTANDARD NAMING
| uint256 private _etherLimit;
bool private _originatesFromReserveTrader; // unused, don't change storage layout
uint256 private constant _version870 = 5; //inject NONSTANDARD NAMING
| 14,285 |
215 | // Gets the amount of an underlying token that `amount` of `yieldToken` is exchangeable for.//yieldToken The address of the yield token./amount The amount of yield tokens.// return The amount of underlying tokens. | function convertYieldTokensToUnderlying(address yieldToken, uint256 amount) public view returns (uint256) {
YieldTokenParams storage yieldTokenParams = _yieldTokens[yieldToken];
ITokenAdapter adapter = ITokenAdapter(yieldTokenParams.adapter);
return amount * adapter.price() / 10 ** yieldToke... | function convertYieldTokensToUnderlying(address yieldToken, uint256 amount) public view returns (uint256) {
YieldTokenParams storage yieldTokenParams = _yieldTokens[yieldToken];
ITokenAdapter adapter = ITokenAdapter(yieldTokenParams.adapter);
return amount * adapter.price() / 10 ** yieldToke... | 6,165 |
1 | // Supply & Cost | uint256 public mintCost = 0.003 ether;
uint256 public maxSupply = 6665;
| uint256 public mintCost = 0.003 ether;
uint256 public maxSupply = 6665;
| 27,406 |
393 | // Emitted when borrow cap for a dToken is changed | event NewBorrowCap(DToken indexed dToken, uint newBorrowCap);
| event NewBorrowCap(DToken indexed dToken, uint newBorrowCap);
| 13,381 |
37 | // 允许发行方提取 BIX | function withdraw_bix() public {
require(msg.sender == DepositAddress);
require(AllowWithdrawAmount > 0);
BixToken.transfer(msg.sender, AllowWithdrawAmount);
// 提取完后 将额度设置为 0
AllowWithdrawAmount = 0;
emit WithdrawBix(AllowWithdrawAmount);
}
| function withdraw_bix() public {
require(msg.sender == DepositAddress);
require(AllowWithdrawAmount > 0);
BixToken.transfer(msg.sender, AllowWithdrawAmount);
// 提取完后 将额度设置为 0
AllowWithdrawAmount = 0;
emit WithdrawBix(AllowWithdrawAmount);
}
| 46,888 |
44 | // issue debit dolllars | _balanceOf[msgSender] = _balanceOf[msgSender].add(DebitDollarDepositAmount);
_totalSupply = _totalSupply.add(DebitDollarDepositAmount);
emit Transfer(address(0), msgSender, DebitDollarDepositAmount);
return "Debit Dollars issued successfully";
| _balanceOf[msgSender] = _balanceOf[msgSender].add(DebitDollarDepositAmount);
_totalSupply = _totalSupply.add(DebitDollarDepositAmount);
emit Transfer(address(0), msgSender, DebitDollarDepositAmount);
return "Debit Dollars issued successfully";
| 13,486 |
415 | // -1 | t0 = PairingsBn254.copy(t1);
t0.sub_assign(one_fr);
t2.mul_assign(t0);
| t0 = PairingsBn254.copy(t1);
t0.sub_assign(one_fr);
t2.mul_assign(t0);
| 16,184 |
76 | // restore dynamicFee after buyback | _liquidityFee = dynamicFee;
| _liquidityFee = dynamicFee;
| 39,642 |
192 | // Function a contract must implement in order to receive ownership of a position via thetransferPosition function or the atomic-assign to the "owner" field when opening a position. fromAddress of the previous ownerpositionIdUnique ID of the positionreturn This address to keep ownership, a different address to pass-on ... | function receivePositionOwnership(
address from,
bytes32 positionId
)
external
| function receivePositionOwnership(
address from,
bytes32 positionId
)
external
| 72,264 |
43 | // 0x43a61a8e == rootOwnerOf(uint256) | calldata = abi.encodeWithSelector(0x43a61a8e, parentTokenId);
assembly {
callSuccess := staticcall(gas, rootOwnerAddress, add(calldata, 0x20), mload(calldata), calldata, 0x20)
if callSuccess {
rootOwner := mload(calldata)
}
| calldata = abi.encodeWithSelector(0x43a61a8e, parentTokenId);
assembly {
callSuccess := staticcall(gas, rootOwnerAddress, add(calldata, 0x20), mload(calldata), calldata, 0x20)
if callSuccess {
rootOwner := mload(calldata)
}
| 634 |
18 | // Throws if called by any account which does not have MINTER_ROLE. / | 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");
_;
}
| 13,165 |
48 | // Admin can give '_account' address operator privileges. _account address that should be given operator privileges. / | function addOperator(address _account) public onlyAdminOrRelay {
_addOperator(_account);
}
| function addOperator(address _account) public onlyAdminOrRelay {
_addOperator(_account);
}
| 24,484 |
101 | // add a new auction to exchange, deposit the bonds in question into exchange contract | function addAuction(AUCTION memory _auction) public override returns(bool){
require(contract_is_active==true,"contract is not active");
_auction.auctionTimestamp=now;
require(_auction.auctionDuration>=24*60*60,"timestamp error");
require(_auction.auctionDuration<=24*30*60*60,"timesta... | function addAuction(AUCTION memory _auction) public override returns(bool){
require(contract_is_active==true,"contract is not active");
_auction.auctionTimestamp=now;
require(_auction.auctionDuration>=24*60*60,"timestamp error");
require(_auction.auctionDuration<=24*30*60*60,"timesta... | 14,384 |
3 | // See {IDigitalReserve-strategyTokenCount}. / | function strategyTokenCount() public view override returns (uint256) {
return _strategyTokens.length;
}
| function strategyTokenCount() public view override returns (uint256) {
return _strategyTokens.length;
}
| 71,872 |
47 | // Changes The Price Of A Fixed Price Sale SaleIndex The Sale Index To Edit Price The Sale Price (IN WEI) / | function __ChangeFixedPrice(uint SaleIndex, uint Price) external onlyAdmin { FixedPriceSales[SaleIndex]._Price = Price; }
/**
* @dev Changes The MintPass ProjectID
* @param SaleIndex The Sale Index To Edit
* @param MintPassProjectID The Mint Pass ProjectID
*/
function __ChangeFixedPrice... | function __ChangeFixedPrice(uint SaleIndex, uint Price) external onlyAdmin { FixedPriceSales[SaleIndex]._Price = Price; }
/**
* @dev Changes The MintPass ProjectID
* @param SaleIndex The Sale Index To Edit
* @param MintPassProjectID The Mint Pass ProjectID
*/
function __ChangeFixedPrice... | 19,805 |
6 | // modified matchAndTransfer method src/ExchangeV2Core.sol were thebase currency funds are transfered to orderRight.maker or the orderRight.taker / | function matchAndTransferAuction(LibOrder.Order memory orderLeft, LibOrder.Order memory orderRight, uint amountFromAuction) internal {
(LibAsset.AssetType memory makeMatch, LibAsset.AssetType memory takeMatch) = matchAssets(orderLeft, orderRight);
bytes32 leftOrderKeyHash = LibOrder.hashKey(orderLef... | function matchAndTransferAuction(LibOrder.Order memory orderLeft, LibOrder.Order memory orderRight, uint amountFromAuction) internal {
(LibAsset.AssetType memory makeMatch, LibAsset.AssetType memory takeMatch) = matchAssets(orderLeft, orderRight);
bytes32 leftOrderKeyHash = LibOrder.hashKey(orderLef... | 30,902 |
84 | // Extension of ERC20 standard designed for simple 'personal token' deployments. / | contract PersonalERC20 is MinterRole, ERC20Burnable, ERC20Pausable {
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
/**
* @dev Sets the values for `name`, `symbol`, 'init', 'owner'. All four of
* these values are immutable: they can only be ... | contract PersonalERC20 is MinterRole, ERC20Burnable, ERC20Pausable {
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
/**
* @dev Sets the values for `name`, `symbol`, 'init', 'owner'. All four of
* these values are immutable: they can only be ... | 32,447 |
292 | // mumbai | registry := 0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c
| registry := 0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c
| 62,721 |
80 | // Call the implementation. out and outsize are 0 because we don't know the size yet. | let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
| let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
| 59,981 |
79 | // The Rate of SWAMPWOLF token by BNB ( 2430 SWAMPWOLF / 1 BNB ) | uint256 public rate = 243e1;
| uint256 public rate = 243e1;
| 8,149 |
102 | // Safely transfers 'tokenId' token from 'from' to 'to'. Requirements: - 'from' cannot be the zero address.- 'to' cannot be the zero address.- 'tokenId' token must exist and be owned by 'from'. | * - If the caller is not 'from', it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
... | * - If the caller is not 'from', it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If 'to' refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
... | 25,948 |
6 | // Return filled amount of an order.order Order object.returnfilledAmountThe amount of already filled. / | function getOrderFilledAmount(Order memory order) public view returns (int256 filledAmount) {
bytes32 orderHash = order.getOrderHash();
filledAmount = _orderFilled[orderHash];
}
| function getOrderFilledAmount(Order memory order) public view returns (int256 filledAmount) {
bytes32 orderHash = order.getOrderHash();
filledAmount = _orderFilled[orderHash];
}
| 2,902 |
152 | // add addresses to whitelist / | function addAddressesToWhitelist(address[] _addresses) external onlyOwner {
for (uint i = 0; i < _addresses.length; i++) {
whitelist[_addresses[i]] = true;
emit WhitelistedAddressAdded(_addresses[i]);
}
}
| function addAddressesToWhitelist(address[] _addresses) external onlyOwner {
for (uint i = 0; i < _addresses.length; i++) {
whitelist[_addresses[i]] = true;
emit WhitelistedAddressAdded(_addresses[i]);
}
}
| 29,890 |
147 | // Reduce number of external calls (SLOADs stay the same) | VaultAPI[] private _cachedVaults;
RegistryAPI public registry;
| VaultAPI[] private _cachedVaults;
RegistryAPI public registry;
| 41,402 |
8 | // Return amount of tokens that {account} gets during rebase Used both internally and externally to calculate the rebase amount account is an address of token holder to calculate forreturn amount of tokens that player could get / | function rebaseOwing (address account) public view returns(uint256) {
Account memory _account = _accounts[account];
uint256 newRebase = totalRebase.sub(_account.lastRebase);
uint256 proportion = _account.balance.mul(newRebase);
| function rebaseOwing (address account) public view returns(uint256) {
Account memory _account = _accounts[account];
uint256 newRebase = totalRebase.sub(_account.lastRebase);
uint256 proportion = _account.balance.mul(newRebase);
| 45,508 |
340 | // calculate the total underlaying 'want' held by the strat. | function balanceOf() public view returns (uint256) {
return balanceOfWant() + balanceOfPool();
}
| function balanceOf() public view returns (uint256) {
return balanceOfWant() + balanceOfPool();
}
| 13,692 |
2 | // Ensure that the seller has enough balance to sell | require(address(msg.sender).balance > price, "Not enough balance to sell");
| require(address(msg.sender).balance > price, "Not enough balance to sell");
| 8,449 |
92 | // Function to mint tokens. | * NOTE: restricting access to owner only. See {BEP20Mintable-mint}.
*
* @param account The address that will receive the minted tokens
* @param amount The amount of tokens to mint
*/
function _mint(address account, uint256 amount) internal override onlyOwner {
super._mint(account, a... | * NOTE: restricting access to owner only. See {BEP20Mintable-mint}.
*
* @param account The address that will receive the minted tokens
* @param amount The amount of tokens to mint
*/
function _mint(address account, uint256 amount) internal override onlyOwner {
super._mint(account, a... | 15,165 |
54 | // Bytes written to out so far | uint256 outcnt;
| uint256 outcnt;
| 79,738 |
401 | // If collateralSlice == collateralToSell => auction completed => debtFloor doesn't matter | uint256 _auctionDebtFloor = vaults[auction.vault].auctionDebtFloor;
if (debt - owe < _auctionDebtFloor) {
| uint256 _auctionDebtFloor = vaults[auction.vault].auctionDebtFloor;
if (debt - owe < _auctionDebtFloor) {
| 33,975 |
43 | // TODO: remove before hook unless needed | _beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(... | _beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(... | 69,219 |
128 | // cToken address on Compound | address cToken;
| address cToken;
| 54,458 |
129 | // Asset id to be sold | uint64 assetId;
| uint64 assetId;
| 69,028 |
2 | // Encodes the argument json bytes into base64-data uri format json raw json to base64 and turn into a data-uri / | function encodeMetadata(bytes memory json) public pure returns (string memory) {
return string(abi.encodePacked("data:application/json;base64,", base64Encode(json)));
}
| function encodeMetadata(bytes memory json) public pure returns (string memory) {
return string(abi.encodePacked("data:application/json;base64,", base64Encode(json)));
}
| 13,584 |
65 | // See {ERC2981-_feeDenominator}. / | function feeDenominator() external pure returns (uint96) {
return _feeDenominator();
}
| function feeDenominator() external pure returns (uint96) {
return _feeDenominator();
}
| 19,119 |
3 | // A member decided that they did not want to be part of the protocol | event MemberRageQuit(uint256 indexed knotIndex);
| event MemberRageQuit(uint256 indexed knotIndex);
| 17,087 |
170 | // SparkleTokenCrowdsale Contract contructor / | constructor(ERC20 _tokenAddress, uint256 _tokenRate, uint256 _tokenCap, uint256 _startTime, uint256 _endTime, address _depositWallet, bool _kycRequired)
| constructor(ERC20 _tokenAddress, uint256 _tokenRate, uint256 _tokenCap, uint256 _startTime, uint256 _endTime, address _depositWallet, bool _kycRequired)
| 25,667 |
56 | // Fetch the BoostOffer for the delegator | BoostOffer storage offer = offers[userIndex[delegator]];
| BoostOffer storage offer = offers[userIndex[delegator]];
| 32,784 |
154 | // mapping (address => bytes32) private revokingHash_; | mapping (bytes32 => OCSPRevocation) private cbRevoking_;
| mapping (bytes32 => OCSPRevocation) private cbRevoking_;
| 48,070 |
111 | // Bird's BErc20WBTCDelegator Contract BTokens which wrap an EIP-20 underlying and delegate to an implementation / | contract BErc20WBTCDelegator is BTokenInterface, BErc20Interface, BDelegatorInterface {
/**
* @notice Construct a new money market
* @param underlying_ The address of the underlying asset
* @param bController_ The address of the BController
* @param interestRateModel_ The address of the interest... | contract BErc20WBTCDelegator is BTokenInterface, BErc20Interface, BDelegatorInterface {
/**
* @notice Construct a new money market
* @param underlying_ The address of the underlying asset
* @param bController_ The address of the BController
* @param interestRateModel_ The address of the interest... | 49,331 |
25 | // The contract is in force, accepting payments and/ granting tokens. | Open,
| Open,
| 51,084 |
97 | // How many tokens one gets from a certain amount of ethereum. | function ethereumToTokens_(uint _ethereumAmount)
public
view
returns(uint)
{
require(_ethereumAmount > MIN_ETH_BUYIN, "Tried to buy tokens with too little eth.");
if (icoPhase) {
return _ethereumAmount.div(tokenPriceInitial_) * 1e18;
}
| function ethereumToTokens_(uint _ethereumAmount)
public
view
returns(uint)
{
require(_ethereumAmount > MIN_ETH_BUYIN, "Tried to buy tokens with too little eth.");
if (icoPhase) {
return _ethereumAmount.div(tokenPriceInitial_) * 1e18;
}
| 52,317 |
1 | // All returned prices calculated with this precision (18 decimals) | uint256 private constant PRECISION = 10**DECIMALS; //1e18 == $1
uint256 public constant DECIMALS = 18;
uint256 private constant USDC_RAW_PRICE = 1e6;
uint256 private constant USDT_RAW_PRICE = 1e6;
| uint256 private constant PRECISION = 10**DECIMALS; //1e18 == $1
uint256 public constant DECIMALS = 18;
uint256 private constant USDC_RAW_PRICE = 1e6;
uint256 private constant USDT_RAW_PRICE = 1e6;
| 19,472 |
29 | // reset state back to Initial Reporter | IInitialReporter _initialParticipant = getInitialReporter();
delete participants;
participants.push(_initialParticipant);
_initialParticipant.resetReportTimestamp();
| IInitialReporter _initialParticipant = getInitialReporter();
delete participants;
participants.push(_initialParticipant);
_initialParticipant.resetReportTimestamp();
| 32,510 |
39 | // Updates the beneficiary params of a community_community address of the community _originalClaimAmountmaximum base amount to be claim by the beneficiary _maxTotalClaim limit that a beneficiary can claimin total _decreaseStep value decreased from maxTotalClaim each time a is beneficiary added _baseInterval base interv... | function updateBeneficiaryParams(
ICommunity _community,
uint256 _originalClaimAmount,
uint256 _maxTotalClaim,
uint256 _decreaseStep,
uint256 _baseInterval,
uint256 _incrementInterval,
uint256 _maxBeneficiaries
| function updateBeneficiaryParams(
ICommunity _community,
uint256 _originalClaimAmount,
uint256 _maxTotalClaim,
uint256 _decreaseStep,
uint256 _baseInterval,
uint256 _incrementInterval,
uint256 _maxBeneficiaries
| 23,919 |
47 | // Returns number of deposits for the given address. Allows iteration over deposits.See getDeposit_user an address to query deposit length forreturn number of deposits for the given address / | function getDepositsLength(address _user) external view returns (uint256) {
// read deposits array length and return
return users[_user].deposits.length;
}
| function getDepositsLength(address _user) external view returns (uint256) {
// read deposits array length and return
return users[_user].deposits.length;
}
| 46,932 |
30 | // ВЬЮГА->[ВЬЮ]-ГА^^^ | syllab_rule SYLLABER_16 language=Russian
| syllab_rule SYLLABER_16 language=Russian
| 40,417 |
353 | // Checks if a specific token is controlled by the Prize Pool/controlledToken The address of the token to check/ return True if the token is a controlled token, false otherwise | function _isControlled(address controlledToken) internal view returns (bool) {
return _tokens.contains(controlledToken);
}
| function _isControlled(address controlledToken) internal view returns (bool) {
return _tokens.contains(controlledToken);
}
| 54,872 |
25 | // Lock | uint constant public operVestingSupply = 30000000 * E18;
uint constant public operVestingLockDate = 3 * month;
uint constant public operVestingTime = 24;
uint constant public mktVestingSupply = 30000000 * E18;
uint constant public mktVestingLockDate = 2 * month... | uint constant public operVestingSupply = 30000000 * E18;
uint constant public operVestingLockDate = 3 * month;
uint constant public operVestingTime = 24;
uint constant public mktVestingSupply = 30000000 * E18;
uint constant public mktVestingLockDate = 2 * month... | 41,922 |
4 | // Ensures tx is included in block no after deadline. | modifier ensure(uint256 deadline) {
require(deadline >= block.timestamp, "DEADLINE EXPIRED");
_;
}
| modifier ensure(uint256 deadline) {
require(deadline >= block.timestamp, "DEADLINE EXPIRED");
_;
}
| 51,125 |
3 | // uint256 private _jewelFinalPaymentAmountETH = 3.16 ether;~5000 EUR = ~3.16 ETH (1 EUR ~= 0.00063 ETH) | uint256 private _jewelFinalPaymentAmountETH = 0.003 ether; // only for testing purposes
| uint256 private _jewelFinalPaymentAmountETH = 0.003 ether; // only for testing purposes
| 26,125 |
4 | // stake - amount of ether staked for this relay/unstakeDelay - number of blocks to elapse before the owner can retrieve the stake after calling 'unlock'/withdrawBlock - first block number 'withdraw' will be callable, or zero if the unlock has not been called/owner - address that receives revenue and manages relayManag... | struct StakeInfo {
uint256 stake;
uint256 unstakeDelay;
uint256 withdrawBlock;
address payable owner;
}
| struct StakeInfo {
uint256 stake;
uint256 unstakeDelay;
uint256 withdrawBlock;
address payable owner;
}
| 21,738 |
5 | // Gets the approved address for a token ID, or zero if no address set_tokenId uint256 ID of the token to query the approval of return address currently approved for the given token ID/ | function getApproved(uint256 _tokenId) public view returns (address) {
return address(0);
}
| function getApproved(uint256 _tokenId) public view returns (address) {
return address(0);
}
| 46,980 |
71 | // may need to be computed due to EVM rounding errors | uint256 computedValue;
if(!self.isCanceled){
if(self.totalValuation == self.currentBucket){
| uint256 computedValue;
if(!self.isCanceled){
if(self.totalValuation == self.currentBucket){
| 13,354 |
66 | // Helper to decode rule arguments | function __decodeRuleArgs(bytes memory _encodedArgs)
internal
pure
returns (
address caller_,
uint256[] memory investmentAmounts_,
uint256 gav_
)
| function __decodeRuleArgs(bytes memory _encodedArgs)
internal
pure
returns (
address caller_,
uint256[] memory investmentAmounts_,
uint256 gav_
)
| 18,331 |
54 | // Internal function to burn the tokens from an account after expiration. account Address of the account. / | function _clear(address account) internal {
require(!_notExpired(), "ACOToken::_clear: Token not expired yet");
require(!_accountHasCollateral(account), "ACOToken::_clear: Must call the redeem method");
_callBurn(account, balanceOf(account));
}
| function _clear(address account) internal {
require(!_notExpired(), "ACOToken::_clear: Token not expired yet");
require(!_accountHasCollateral(account), "ACOToken::_clear: Must call the redeem method");
_callBurn(account, balanceOf(account));
}
| 14,771 |
46 | // Determine the dDai to redeem using the exchange rate. | dDaiBurned = (daiToReceive.mul(_SCALING_FACTOR)).div(_dDaiExchangeRate);
| dDaiBurned = (daiToReceive.mul(_SCALING_FACTOR)).div(_dDaiExchangeRate);
| 30,750 |
26 | // the version number representing the type of aggregator the proxypoints to. / | function version()
external
view
override
returns (uint256)
| function version()
external
view
override
returns (uint256)
| 53,528 |
317 | // EIP20Gateway ContractEIP20Gateway act as medium to send messages from origin chain toauxiliary chain. Currently gateway supports stake and revert stake message. / | contract EIP20Gateway is GatewayBase {
/* Events */
/** Emitted whenever a stake process is initiated. */
event StakeIntentDeclared(
bytes32 indexed _messageHash,
address _staker,
uint256 _stakerNonce,
address _beneficiary,
uint256 _amount
);
/** Emitted wh... | contract EIP20Gateway is GatewayBase {
/* Events */
/** Emitted whenever a stake process is initiated. */
event StakeIntentDeclared(
bytes32 indexed _messageHash,
address _staker,
uint256 _stakerNonce,
address _beneficiary,
uint256 _amount
);
/** Emitted wh... | 28,671 |
177 | // ========== Burns and givebacks ========== / Give USDC profits back. Goes through the minter | function giveCollatBack(uint256 collat_amount) external onlyByOwnGovCust {
collateral_token.approve(address(amo_minter), collat_amount);
amo_minter.receiveCollatFromAMO(collat_amount);
}
| function giveCollatBack(uint256 collat_amount) external onlyByOwnGovCust {
collateral_token.approve(address(amo_minter), collat_amount);
amo_minter.receiveCollatFromAMO(collat_amount);
}
| 57,721 |
91 | // Returns whether swaps and deposits are currently pausedreturn isPaused Whether swaps and deposits are currently paused / | function paused() external view returns (bool isPaused);
| function paused() external view returns (bool isPaused);
| 36,248 |
184 | // Generation |
string[] private doing = [
"Love Making",
"Fucking",
"Wanking",
"Blowing",
"Nailing",
"Noodling",
"Boning",
"Banging",
|
string[] private doing = [
"Love Making",
"Fucking",
"Wanking",
"Blowing",
"Nailing",
"Noodling",
"Boning",
"Banging",
| 48,266 |
100 | // TestNetaddress private constant uniswapV2Router=0xE592427A0AEce92De3Edee1F18E0157C05861564;MainNet | address private constant uniswapV2Router=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
| address private constant uniswapV2Router=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
| 42,561 |
1 | // Allows the initial operator (deployer) to set the operator.Note - crvDepositor has no way to change this back, so it's effectively immutable / | function setOperator(address _operator) external {
require(msg.sender == operator, "!auth");
operator = _operator;
}
| function setOperator(address _operator) external {
require(msg.sender == operator, "!auth");
operator = _operator;
}
| 15,840 |
2 | // Set the factory address and allow it to regiser a new market _factory factory address / | function setFactory(address _factory) external override onlyOwner {
require(_factory != address(0), "ERROR: ZERO_ADDRESS");
factory = _factory;
emit FactorySet(_factory);
}
| function setFactory(address _factory) external override onlyOwner {
require(_factory != address(0), "ERROR: ZERO_ADDRESS");
factory = _factory;
emit FactorySet(_factory);
}
| 32,852 |
81 | // Query if a contract implements interface `id`./id the interface identifier, as specified in ERC-165./ return `true` if the contract implements `id`. | function supportsInterface(bytes4 id) external view returns (bool) {
return
id == 0x01ffc9a7 || //ERC165
id == 0xd9b67a26 || // ERC1155
id == 0x80ac58cd || // ERC721
id == 0x5b5e139f || // ERC721 metadata
id == 0x0e89341c; // ERC1155 metadata
}... | function supportsInterface(bytes4 id) external view returns (bool) {
return
id == 0x01ffc9a7 || //ERC165
id == 0xd9b67a26 || // ERC1155
id == 0x80ac58cd || // ERC721
id == 0x5b5e139f || // ERC721 metadata
id == 0x0e89341c; // ERC1155 metadata
}... | 71,322 |
40 | // Calculates the annual rate for a given reward rate and specific interval/_rateMantissa The reward rate as a mantissa between [0, 1e18]/_timeDelta The interval in seconds/ return rate as a mantissa between [0, 1e18] | function _intervalRewardRate(
uint256 _rateMantissa,
uint256 _timeDelta
| function _intervalRewardRate(
uint256 _rateMantissa,
uint256 _timeDelta
| 17,577 |
128 | // deploying minimal proxy contracts, also known as "clones". > To simply and cheaply clone contract functionality in an immutable way, this standard specifies> a minimal bytecode implementation that delegates all calls to a known, fixed address. The library includes functions to deploy a proxy using either `create` (t... | library Clones {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `master` and `salt` multiple time will revert, since
* the clones cann... | library Clones {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `master` and `salt` multiple time will revert, since
* the clones cann... | 69,640 |
88 | // Check if claim period is active | require(now >= CLAIM_START_DATE);
require(now < CLAIM_END_DATE);
| require(now >= CLAIM_START_DATE);
require(now < CLAIM_END_DATE);
| 36,374 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.