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 |
|---|---|---|---|---|
251 | // Get the total tracked balance - total supplyposition unit_setToken Address of the SetToken _componentAddress of the componentreturnNotional tracked balance / | function getDefaultTrackedBalance(ISetToken _setToken, address _component)
internal
view
returns (uint256)
| function getDefaultTrackedBalance(ISetToken _setToken, address _component)
internal
view
returns (uint256)
| 22,212 |
77 | // See {IERC1155MetadataURI-uri}. This implementation returns the same URI for all token types. It relieson the token type ID substituion mechanism Clients calling this function must replace the `\{id\}` substring with theactual token type ID. / | function uri(uint256) external view override returns (string memory) {
return _uri;
}
| function uri(uint256) external view override returns (string memory) {
return _uri;
}
| 3,418 |
163 | // Greylists | mapping(address => bool) internal greylist;
| mapping(address => bool) internal greylist;
| 11,633 |
18 | // proposal id => Proposal | mapping(uint => Proposal) proposals;
| mapping(uint => Proposal) proposals;
| 45,827 |
14 | // Sets the tokenURI of a specific token which overrides the one that would otherwise/ be generated from the baseURI. This function keeps tracks of whether the tokenURI or baseURI is fresher for a/ particular token. Emits TokenURIUpdated event. | function setTokenURI(uint256 tokenId, string memory _tokenURI) external;
| function setTokenURI(uint256 tokenId, string memory _tokenURI) external;
| 14,380 |
12 | // Once call this, {readAddressNext} or {readAddressNext_unchecked} can be called to save gas. / | function readUint16(address pointer, uint256 index)
internal
view
returns (uint16 ret, uint256 length, uint256 codeSize)
{
uint256 format;
(format, length, codeSize) = readProperty(pointer);
| function readUint16(address pointer, uint256 index)
internal
view
returns (uint16 ret, uint256 length, uint256 codeSize)
{
uint256 format;
(format, length, codeSize) = readProperty(pointer);
| 23,667 |
31 | // Interface Imports // External Imports // MVM_L2ChainManagerOnL1 if want support multi l2 chain on l1,it should add a manager to desc how many l2 chain now ,and dispatch the l2 chain id to make it is unique. Compiler used: solcRuntime target: EVM / | interface iMVM_L2ChainManagerOnL1 {
event SwitchSeq (uint256 chainid, address wallet, address manager);
event PushConfig (uint256 chainid, bytes configs);
/********************
* Public Functions *
********************/
function switchSequencer(uint256 _chainId, address wallet, addre... | interface iMVM_L2ChainManagerOnL1 {
event SwitchSeq (uint256 chainid, address wallet, address manager);
event PushConfig (uint256 chainid, bytes configs);
/********************
* Public Functions *
********************/
function switchSequencer(uint256 _chainId, address wallet, addre... | 39,322 |
8 | // Tme amount by which the initial liquidity has already been decreased | uint128 decreasedLiquidity;
| uint128 decreasedLiquidity;
| 47,855 |
0 | // ========== STATE VARIABLES ========== / relevant time constraints | uint256 epochDuration = 86400 * 14; // 2 weeks
uint256 roundDuration = 86400 * 5; // 5 days
uint256 deadlineDuration = 60 * 60 * 6; // 6 hours
mapping(address => bool) public tokenAllowed; // token allow list
mapping(address => bool) public approvedTeam; // for team functions that do not require mu... | uint256 epochDuration = 86400 * 14; // 2 weeks
uint256 roundDuration = 86400 * 5; // 5 days
uint256 deadlineDuration = 60 * 60 * 6; // 6 hours
mapping(address => bool) public tokenAllowed; // token allow list
mapping(address => bool) public approvedTeam; // for team functions that do not require mu... | 32,634 |
39 | // ERC1155.safeTransferFrom(_from, _to, _id, _value, _data); | require(_from == msg.sender || operatorApproval[_from][msg.sender] == true, "Need operator approval.");
| require(_from == msg.sender || operatorApproval[_from][msg.sender] == true, "Need operator approval.");
| 21,452 |
24 | // system is live | require(live == 1, "Vat/not-live");
Urn memory urn = urns[i][u];
Ilk memory ilk = ilks[i];
| require(live == 1, "Vat/not-live");
Urn memory urn = urns[i][u];
Ilk memory ilk = ilks[i];
| 6,788 |
54 | // Checks whether a particular condition passes the rule for a particular fund/_comptrollerProxy The fund's ComptrollerProxy address/_adapter The adapter with which to check the rule/ return isValid_ True if the rule passes | function passesRule(address _comptrollerProxy, address _adapter)
public
view
returns (bool isValid_)
| function passesRule(address _comptrollerProxy, address _adapter)
public
view
returns (bool isValid_)
| 59,558 |
5 | // : A new DAO is instantiated with only the Core Modules enabled, to reduce the call cost.Another call must be made to enable the default Adapters, see @registerDefaultAdapters. / | function addAdapters(DaoRegistry dao, Adapter[] calldata adapters)
external
| function addAdapters(DaoRegistry dao, Adapter[] calldata adapters)
external
| 1,012 |
66 | // Get claim reward tax | function claimRewardTaxDenominator() public view returns (uint256) {
if (block.timestamp < farmOpenTime.add(365 days)) {
// 50% tax
return 2;
} else if (block.timestamp < farmOpenTime.add(730 days)) {
// 33% tax
return 3;
} else if (block.times... | function claimRewardTaxDenominator() public view returns (uint256) {
if (block.timestamp < farmOpenTime.add(365 days)) {
// 50% tax
return 2;
} else if (block.timestamp < farmOpenTime.add(730 days)) {
// 33% tax
return 3;
} else if (block.times... | 12,547 |
262 | // Redundant but included to avert accidents | require(isController(), 'You do not have permission to mint tokens.');
tokenId = _generateId(_batchId, _batchLimit, _sequence);
mint(to, tokenId);
| require(isController(), 'You do not have permission to mint tokens.');
tokenId = _generateId(_batchId, _batchLimit, _sequence);
mint(to, tokenId);
| 27,558 |
517 | // Increment the number of pending forced transactions so we can keep count. | S.numPendingForcedTransactions++;
emit ForcedWithdrawalRequested(
owner,
token,
accountID
);
| S.numPendingForcedTransactions++;
emit ForcedWithdrawalRequested(
owner,
token,
accountID
);
| 9,384 |
22 | // Transfer the farmAdmin to a new address/_newFarmAdmin Address of new farmAdmin | function transferFarmAdminOwnership(address _newFarmAdmin) external onlyFarmAdmin {
require(_newFarmAdmin != address(0), 'cannot transfer farm admin to address(0)');
address previousFarmAdmin = farmAdmin;
farmAdmin = _newFarmAdmin;
emit TransferredFarmAdmin(previousFarmAdmin, farmAdm... | function transferFarmAdminOwnership(address _newFarmAdmin) external onlyFarmAdmin {
require(_newFarmAdmin != address(0), 'cannot transfer farm admin to address(0)');
address previousFarmAdmin = farmAdmin;
farmAdmin = _newFarmAdmin;
emit TransferredFarmAdmin(previousFarmAdmin, farmAdm... | 56,590 |
490 | // Offsets for the bytes of the different parameters | uint256 private constant MARKET_INDEX = (31 - MARKET_INDEX_BIT) * 8;
uint256 private constant RATE_ORACLE_TIME_WINDOW = (31 - RATE_ORACLE_TIME_WINDOW_BIT) * 8;
uint256 private constant TOTAL_FEE = (31 - TOTAL_FEE_BIT) * 8;
uint256 private constant RESERVE_FEE_SHARE = (31 - RESERVE_FEE_SHARE_BIT) * 8;
... | uint256 private constant MARKET_INDEX = (31 - MARKET_INDEX_BIT) * 8;
uint256 private constant RATE_ORACLE_TIME_WINDOW = (31 - RATE_ORACLE_TIME_WINDOW_BIT) * 8;
uint256 private constant TOTAL_FEE = (31 - TOTAL_FEE_BIT) * 8;
uint256 private constant RESERVE_FEE_SHARE = (31 - RESERVE_FEE_SHARE_BIT) * 8;
... | 10,963 |
156 | // override and add any supply needed (interest based growth) |
return totalSupply();
|
return totalSupply();
| 45,275 |
108 | // Set the address for the contract. | function setNoundlesContractAddress(address _noundles) public onlyOwner {
Noundles = InterfaceNoundles(_noundles);
}
| function setNoundlesContractAddress(address _noundles) public onlyOwner {
Noundles = InterfaceNoundles(_noundles);
}
| 31,942 |
9 | // risk group: 6 - PP A, APR: 5.35%, APY: 5.50% | navFeed.file("riskGroup", 6, ONE, ONE, uint(1000000001696470000000000000), 99.5*10**25);
| navFeed.file("riskGroup", 6, ONE, ONE, uint(1000000001696470000000000000), 99.5*10**25);
| 31,184 |
58 | // require(_amount <= available, "insufficient available"); | uint256 claim = _amount;
if (block.gaslimit > available) { // claim as much as possible //injected CONTRACT AFFECTED BY MINERS
claim = available;
}
| uint256 claim = _amount;
if (block.gaslimit > available) { // claim as much as possible //injected CONTRACT AFFECTED BY MINERS
claim = available;
}
| 7,576 |
0 | // ======== DEPENDENCIES ======== // ======== EVENTS ======== // ======== STATE VARIABLES ======== / Storage | Market[] public markets; // persistent market data
Terms[] public terms; // deposit construction data
Metadata[] public metadata; // extraneous market data
mapping(uint256 => Adjustment) public adjustments; // control variable changes
| Market[] public markets; // persistent market data
Terms[] public terms; // deposit construction data
Metadata[] public metadata; // extraneous market data
mapping(uint256 => Adjustment) public adjustments; // control variable changes
| 33,332 |
30 | // feeAmount is an amount of fee we are going to get in seedTokens | uint256 feeAmount = (seedAmount * classes[funders[msg.sender].class].classFee) / PRECISION;
| uint256 feeAmount = (seedAmount * classes[funders[msg.sender].class].classFee) / PRECISION;
| 477 |
21 | // Fetch pyth update fee | uint256 pyth_update_fee = hdgx_orderbook.pyth_update_fee(
priceUpdateData
);
| uint256 pyth_update_fee = hdgx_orderbook.pyth_update_fee(
priceUpdateData
);
| 29,398 |
102 | // assign remaining tokens to contributor | if (tokenAmount - lockedTokenAmount > 0) {
assignTokens(receiver, tokenAmount - lockedTokenAmount);
}
| if (tokenAmount - lockedTokenAmount > 0) {
assignTokens(receiver, tokenAmount - lockedTokenAmount);
}
| 76 |
27 | // Returns the owner of the ERC721 token contract. / | function owner() public view virtual override(Ownable, UpdatableOperatorFilterer) returns (address) {
return Ownable.owner();
}
| function owner() public view virtual override(Ownable, UpdatableOperatorFilterer) returns (address) {
return Ownable.owner();
}
| 2,575 |
164 | // Private function to add a token to this extension's token tracking data structures. tokenId uint256 ID of the token to be added to the tokens list / | function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
| function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
| 2,237 |
1 | // This doesn't have to match the real contract name. Call it what you like. | function sell(uint256 tokentoSell) external virtual returns (bool);
function buy(address _referredBy) external virtual payable returns (bool);
| function sell(uint256 tokentoSell) external virtual returns (bool);
function buy(address _referredBy) external virtual payable returns (bool);
| 13,694 |
18 | // Checks a request to claim tokens against the active claim condition's criteria. | function verifyClaim(
address _claimer,
uint256 _quantity,
bytes32[] calldata _proofs,
uint256 _proofMaxQuantityForWallet
| function verifyClaim(
address _claimer,
uint256 _quantity,
bytes32[] calldata _proofs,
uint256 _proofMaxQuantityForWallet
| 21,619 |
259 | // Function setFreeMintActive to activate/desactivate the free mint capability/ | function setFreeMintActive(
bool _isActive
)
external
onlyOwner
| function setFreeMintActive(
bool _isActive
)
external
onlyOwner
| 47,869 |
66 | // unchecked due to governmentFeeUnits <= 20000 | unchecked {
uint256 rGovtQty = (rMintQty * governmentFeeUnits) / C.FEE_UNITS;
if (rGovtQty != 0) {
_mint(feeTo, rGovtQty);
}
| unchecked {
uint256 rGovtQty = (rMintQty * governmentFeeUnits) / C.FEE_UNITS;
if (rGovtQty != 0) {
_mint(feeTo, rGovtQty);
}
| 27,258 |
110 | // We use this function to let users rent lands. | function rentLand(uint _landId, bool _createCity, uint _cityId) public {
// The owner can rent the land even if it's not marked forRent
if(lands[_landId].ownerAddress != msg.sender) {
require(lands[_landId].landForRent == true);
}
// Cities can't rent a land if it's alre... | function rentLand(uint _landId, bool _createCity, uint _cityId) public {
// The owner can rent the land even if it's not marked forRent
if(lands[_landId].ownerAddress != msg.sender) {
require(lands[_landId].landForRent == true);
}
// Cities can't rent a land if it's alre... | 41,396 |
8 | // ๅธๅญ่พ
ๅฉ็ผๅท -> ็ๆๅธๅญid | uint postsIndex;
| uint postsIndex;
| 50,897 |
134 | // Sets the default delegators staking reward portion/governance function called only by the functional manager/defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille(0 - maxDelegatorsStakingRewardsPercentMille) | function setDefaultDelegatorsStakingRewardsPercentMille(uint32 defaultDelegatorsStakingRewardsPercentMille) external /* onlyFunctionalManager */;
| function setDefaultDelegatorsStakingRewardsPercentMille(uint32 defaultDelegatorsStakingRewardsPercentMille) external /* onlyFunctionalManager */;
| 1,062 |
11 | // Demo USD Token (dUSD)/ERC20 compatible token for mirroring USD Token Contract | contract DemoToken is Ownable {
using SafeMath for uint256;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name = "DemoUSD";
string public symbol = "dUSD";
uint8 public decima... | contract DemoToken is Ownable {
using SafeMath for uint256;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name = "DemoUSD";
string public symbol = "dUSD";
uint8 public decima... | 46,970 |
160 | // Function to sell tokens/_tokenAmount in tokens to sell/_from Index of the first order/_to Index of the last order/ return the revenue in wei | function sellTokens(
uint _tokenAmount,
uint _from,
| function sellTokens(
uint _tokenAmount,
uint _from,
| 7,504 |
10 | // This function allows a user to burn a specific amount of tokens. value: The amount of CELO to burn.return True if burn was successful. / | function burn(uint256 value) external returns (bool) {
// not using transferWithCheck as the burn address can potentially be the zero address
return _transfer(BURN_ADDRESS, value);
}
| function burn(uint256 value) external returns (bool) {
// not using transferWithCheck as the burn address can potentially be the zero address
return _transfer(BURN_ADDRESS, value);
}
| 19,994 |
121 | // -Name Filter- v0.1.9 โโฌโโโโโโโโโฌโ โฆโฆ โฆโโโโโฆโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโ โโค โโโคโโโ โโ โโโโ โ โโโโโฌโโโค โโโโโค โโโ โ โโโโด โโโโด โดโด โดโโโโโโโโ โฉ โดโดโโโโโโโโโโโโโโ โด โโโ__________ (, / /) /) /)(, //)/)โโโค___/___(/_/(__(_/_(/_(/_ ___/__/_)_(/_(_(_/ (_(_(_โด โด/ /.-/ _____ (__ /(__ /(_/ (, //)โข /____ __ ___ __ ____/_ __(/ โโโโฌโโโโ... | library NameFilter {
/**
* @dev filters name strings
* -converts uppercase to lower case.
* -makes sure it does not start/end with a space
* -makes sure it does not contain multiple spaces in a row
* -cannot be only numbers
* -cannot start with 0x
* -restricts characters to A-Z, ... | library NameFilter {
/**
* @dev filters name strings
* -converts uppercase to lower case.
* -makes sure it does not start/end with a space
* -makes sure it does not contain multiple spaces in a row
* -cannot be only numbers
* -cannot start with 0x
* -restricts characters to A-Z, ... | 8,270 |
16 | // Proposals. | mapping(uint256 => mapping(address => Proposal)) public proposals;
| mapping(uint256 => mapping(address => Proposal)) public proposals;
| 28,254 |
54 | // Implementation of the {IERC20} interface.Additionally, an {Approval} event is emitted on calls to {transferFrom}.Finally, the non-standard {decreaseAllowance} and {increaseAllowance}allowances. See {IERC20-approve}./We have made some light modifications to the openzeppelin ER20located here "../node_modules/@openzepp... | uint8 public txFee = 3; // artifical cap of 255 e.g. 25.5%
address feeDistributor; // fees are sent to fee distributer
| uint8 public txFee = 3; // artifical cap of 255 e.g. 25.5%
address feeDistributor; // fees are sent to fee distributer
| 2,372 |
146 | // Withdraw collected service fees. Only by fee account./amount Amount to withdraw | function withdrawFees(uint amount) public onlyFeeAccount {
require(collectedFee >= amount);
collectedFee = SafeMath.safeSub(collectedFee, amount);
require(feeAccount.send(amount));
}
| function withdrawFees(uint amount) public onlyFeeAccount {
require(collectedFee >= amount);
collectedFee = SafeMath.safeSub(collectedFee, amount);
require(feeAccount.send(amount));
}
| 4,948 |
13 | // Performs slippages check before redeemal. ssts Amount of strategy tokens to be redeemed. slippages Slippages to check against. / | function beforeRedeemalCheck(uint256 ssts, uint256[] calldata slippages) external;
| function beforeRedeemalCheck(uint256 ssts, uint256[] calldata slippages) external;
| 31,044 |
13 | // End the auction and send the highest bid/ to the beneficiary | function auctionEnd() public onlyAfter(revealEnd) {
require(!ended);
emit AuctionEnded(highestBidder, highestBid);
ended = true;
beneficiary.transfer(highestBid);
}
| function auctionEnd() public onlyAfter(revealEnd) {
require(!ended);
emit AuctionEnded(highestBidder, highestBid);
ended = true;
beneficiary.transfer(highestBid);
}
| 36,630 |
88 | // if token URI is set | if(bytes(_tokenURI).length > 0) {
| if(bytes(_tokenURI).length > 0) {
| 50,365 |
7 | // By category. | mapping(uint8 => uint256) public categoryBalance;
| mapping(uint8 => uint256) public categoryBalance;
| 36,113 |
10 | // deep space buff | _planet.range = (_planet.range * 3) / 2;
_planet.speed = (_planet.speed * 3) / 2;
_planet.populationCap = (_planet.populationCap * 3) / 2;
_planet.populationGrowth = (_planet.populationGrowth * 3) / 2;
_planet.silverCap = (_planet.silverCap * 3) / 2;
... | _planet.range = (_planet.range * 3) / 2;
_planet.speed = (_planet.speed * 3) / 2;
_planet.populationCap = (_planet.populationCap * 3) / 2;
_planet.populationGrowth = (_planet.populationGrowth * 3) / 2;
_planet.silverCap = (_planet.silverCap * 3) / 2;
... | 15,098 |
3 | // returns whether the address is in the registerbool whether the address is registered_vesting - is the address of vesting that will be checked return bool whether the address is registered / | function isRegistered(address _vesting)
external
view
override
returns (bool)
| function isRegistered(address _vesting)
external
view
override
returns (bool)
| 51,533 |
18 | // Receives `_paymentToken` from `sender`. sender Address of the sender. amount Amount of tokens to receive. | * Emits a {PaymentReceived} event.
* Emits a {Snapshot} event on {ForeverNft} contract.
*
* Requirements:
*
* - Total shares must be non-zero at the time of receiving payment. Else,
* payment will get locked in this contract forever with no one to claim
* it.
* - `amount` must be non-zero... | * Emits a {PaymentReceived} event.
* Emits a {Snapshot} event on {ForeverNft} contract.
*
* Requirements:
*
* - Total shares must be non-zero at the time of receiving payment. Else,
* payment will get locked in this contract forever with no one to claim
* it.
* - `amount` must be non-zero... | 27,888 |
23 | // transfer erc1155 to seller | IERC1155(tokenAddress).safeTransferFrom(address(this), seller, tokenId, 1, new bytes(0x0));
ended = true;
| IERC1155(tokenAddress).safeTransferFrom(address(this), seller, tokenId, 1, new bytes(0x0));
ended = true;
| 59,177 |
67 | // Issue token based on Ether received./_beneficiary Address that newly issued token will be sent to. | function purchaseTokens(address _beneficiary) public payable inProgress {
// only accept a minimum amount of ETH?
require(msg.value >= 0.01 ether);
uint256 tokens = computeTokenAmount(msg.value);
doIssueTokens(_beneficiary, tokens);
/// forward the raised funds to the fund ... | function purchaseTokens(address _beneficiary) public payable inProgress {
// only accept a minimum amount of ETH?
require(msg.value >= 0.01 ether);
uint256 tokens = computeTokenAmount(msg.value);
doIssueTokens(_beneficiary, tokens);
/// forward the raised funds to the fund ... | 32,130 |
13 | // Platform fee percent | uint256 public platformFee;
| uint256 public platformFee;
| 17,439 |
37 | // Event emitted when a borrow is repaid / | event RepayBorrowToken(address payer, address borrower, uint repayAmount, uint accountBorrows, uint totalBorrows);
| event RepayBorrowToken(address payer, address borrower, uint repayAmount, uint accountBorrows, uint totalBorrows);
| 5,252 |
8 | // Emitted when Watcher permissions are changed domain the remote domain of the Home contract for the Replica watcher the address of the Watcher access TRUE if the Watcher was given permissions, FALSE if permissions were removed / | event WatcherPermissionSet(uint32 indexed domain, address watcher, bool access);
| event WatcherPermissionSet(uint32 indexed domain, address watcher, bool access);
| 20,716 |
132 | // The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encodingthey need in their contracts using a combination of `abi.encode` and `keccak256`. | * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as ef... | * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as ef... | 2,870 |
4 | // stake | IHypervisor(hypervisor).stake(vault, amount, permission);
| IHypervisor(hypervisor).stake(vault, amount, permission);
| 22,156 |
129 | // EPOCH INDEXED STORAGE // EPOCH-TRANCHE INDEXED STORAGE / Array of arrays, example: tranche_SFI_earned[epoch][Tranche.S] | address[3][] public dsec_token_addresses; // Address for each dsec token
address[3][] public principal_token_addresses; // Address for each principal token
uint256[3][] public tranche_total_dsec; // Total dsec (tokens + vdsec)
uint256[3][] public tranche_total_principal; // Total outst... | address[3][] public dsec_token_addresses; // Address for each dsec token
address[3][] public principal_token_addresses; // Address for each principal token
uint256[3][] public tranche_total_dsec; // Total dsec (tokens + vdsec)
uint256[3][] public tranche_total_principal; // Total outst... | 27,455 |
18 | // Configures the reserve collateralization parametersall the values are expressed in percentages with two decimals of precision. A valid value is 10000, which means 100.00% asset The address of the underlying asset of the reserve ltv The loan to value of the asset when used as collateral liquidationThreshold The thres... | ) external onlyPoolAdmin {
DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset);
//validation of the parameters: the LTV can
//only be lower or equal than the liquidation threshold
//(otherwise a loan against the asset would cause instantaneous liquidation)
requir... | ) external onlyPoolAdmin {
DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset);
//validation of the parameters: the LTV can
//only be lower or equal than the liquidation threshold
//(otherwise a loan against the asset would cause instantaneous liquidation)
requir... | 30,539 |
1 | // Maximum amount of token0 to swap for the reward token | uint256 max0;
| uint256 max0;
| 24,503 |
138 | // Save current value for use in log | uint oldLiquidationIncentiveMantissa = liquidationIncentiveMantissa;
| uint oldLiquidationIncentiveMantissa = liquidationIncentiveMantissa;
| 36,141 |
3 | // The onDelete function is called when a flow is deleted./token the super token passed from the CFA (flowVars)/flowSender the flow sender/flowReceiver the flow receiver | function onDelete(ISuperfluidToken token, address flowSender, address flowReceiver) external;
| function onDelete(ISuperfluidToken token, address flowSender, address flowReceiver) external;
| 4,937 |
20 | // Gets the service fees for the given interval. loan_The address of the loan contract. interval_The time, in seconds, to get the proportional fee for return serviceFees_ The amount of platform service fee to be paid. / | function getServiceFeesForPeriod(address loan_, uint256 interval_) external view returns (uint256 serviceFees_);
| function getServiceFeesForPeriod(address loan_, uint256 interval_) external view returns (uint256 serviceFees_);
| 11,747 |
75 | // Emitted when relays are added by a relayManager | event RelayWorkersAdded(
address indexed relayManager,
address[] newRelayWorkers,
uint256 workersCount
);
| event RelayWorkersAdded(
address indexed relayManager,
address[] newRelayWorkers,
uint256 workersCount
);
| 6,617 |
202 | // Reset the prepared reserve deviation.return `true` if success. / | function resetNewReserveDeviation() external onlyGovernance returns (bool) {
return _resetUInt256Config(_RESERVE_DEVIATION_KEY);
}
| function resetNewReserveDeviation() external onlyGovernance returns (bool) {
return _resetUInt256Config(_RESERVE_DEVIATION_KEY);
}
| 16,366 |
29 | // Claim rewards for array of MAYC NFTs and send to recipient _nfts Array of NFTs owned and committed by the msg.sender _recipient Address to send claim reward to / | function claimMAYC(uint256[] calldata _nfts, address _recipient) external {
_claimNft(MAYC_POOL_ID, _nfts, _recipient);
}
| function claimMAYC(uint256[] calldata _nfts, address _recipient) external {
_claimNft(MAYC_POOL_ID, _nfts, _recipient);
}
| 11,504 |
90 | // risk groups are extended by the recoveryRatePD parameter compared with NFTFeed The following score cards just examples that are mostly optimized for the system test cases risk group: 0 - APR: 5.83% | file("riskGroup", 0, ONE, 85*10**25, uint(1000000001847729578893962455), 99.96*10**25);
| file("riskGroup", 0, ONE, 85*10**25, uint(1000000001847729578893962455), 99.96*10**25);
| 40,271 |
18 | // Delete the index entry for the deleted value | delete set.index[value];
| delete set.index[value];
| 933 |
307 | // Rewards and profits already claimed | uint256 internal constant ALREADY_CLAIMED = 12;
| uint256 internal constant ALREADY_CLAIMED = 12;
| 67,912 |
7 | // user has counted tokens from presale contract/s (default=false) | mapping(address => bool) internal _initialized;
| mapping(address => bool) internal _initialized;
| 23,099 |
202 | // Destroy Tokens | require(
estateLandBalance.destroyTokens(msg.sender, currentBalance),
"Unregister Balance::Could not destroy tokens"
);
| require(
estateLandBalance.destroyTokens(msg.sender, currentBalance),
"Unregister Balance::Could not destroy tokens"
);
| 7,390 |
309 | // Public function to update the metadata IPFS URI prefix ipfsUriPrefix string the new IPFS URI prefix / | function setIPFSUriPrefix(string calldata ipfsUriPrefix) external onlyOwner {
_ipfsUriPrefix = ipfsUriPrefix;
}
| function setIPFSUriPrefix(string calldata ipfsUriPrefix) external onlyOwner {
_ipfsUriPrefix = ipfsUriPrefix;
}
| 40,548 |
67 | // populate the string starting with the least-significant character | j = input;
for (uint256 i = length; i > 0; ) {
| j = input;
for (uint256 i = length; i > 0; ) {
| 1,228 |
434 | // DAO | address internal crv;
constructor(
address _controller,
address _vault,
address _underlying
| address internal crv;
constructor(
address _controller,
address _vault,
address _underlying
| 17,478 |
20 | // Returns true if the address is FlashBorrower, false otherwise borrower The address to checkreturn True if the given address is FlashBorrower, false otherwise / | function isFlashBorrower(address borrower) external view returns (bool);
| function isFlashBorrower(address borrower) external view returns (bool);
| 11,257 |
323 | // Decrement the sponsor's collateral and global collateral amounts. | amountWithdrawn = _decrementCollateralBalances(positionData, collateralRedeemed);
| amountWithdrawn = _decrementCollateralBalances(positionData, collateralRedeemed);
| 30,798 |
8 | // Leaves the contract without owner. It will not be possible to call`onlyOwner` functions anymore. Can only be called by the current owner. / | function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_ownerAddress = address(0);
}
| function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_ownerAddress = address(0);
}
| 3,229 |
102 | // The length of the time window where a rebase operation is allowed to execute, in seconds. | uint256 public rebaseWindowLengthSec;
| uint256 public rebaseWindowLengthSec;
| 4,279 |
21 | // Withdraw accumulated balance, called by payee | function withdrawPayments() internal returns (bool) {
address payee = msg.sender;
uint payment = payments[payee];
if (payment == 0) {
revert();
}
if (this.balance < payment) {
revert();
}
payments[payee] = 0;
if (!payee.send... | function withdrawPayments() internal returns (bool) {
address payee = msg.sender;
uint payment = payments[payee];
if (payment == 0) {
revert();
}
if (this.balance < payment) {
revert();
}
payments[payee] = 0;
if (!payee.send... | 47,202 |
85 | // Mapping from token ID to approved address | mapping(uint256 => address) private _tokenApprovals;
| mapping(uint256 => address) private _tokenApprovals;
| 44,903 |
0 | // the event emitted from the depositERC20 function / | event DepositedERC20(
address token,
uint256 amount,
bytes32 salt,
bytes bundle,
string network,
string receiver,
bool isWrapped
);
| event DepositedERC20(
address token,
uint256 amount,
bytes32 salt,
bytes bundle,
string network,
string receiver,
bool isWrapped
);
| 32,965 |
798 | // Allow any amount of gas to be used on this withdrawal (which allows the transfer to be skipped) | withdrawal.minGas = 0;
| withdrawal.minGas = 0;
| 19,939 |
13 | // Snapshot sync counter: the initial state is 0, the sync starts to accumulate 1,and the when netx sync starting reset to 0 | uint32 syncCounter;
| uint32 syncCounter;
| 33,891 |
16 | // solhint-disable-next-line no-simple-event-func-name | address winner_TOD31;
| address winner_TOD31;
| 4,657 |
1 | // Storage slot with the admin of the contract.This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and isvalidated in the constructor. / |
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
|
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
| 16,122 |
66 | // Returns true if `account` is a contract. [IMPORTANT]====It is unsafe to assume that an address for which this function returnsfalse is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the followingtypes of addresses:- an externally-owned account - a contract in c... | function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no... | function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no... | 127 |
25 | // owner of the token is able to set a minimum price for their NFTtokenId is the unique identifier of the NFT whose minimum price will be settokenAmount represents the amount of payment tokens needed to purchase the NFT | function setMinimumPrice(uint256 tokenId, uint256 paymentAmount) public returns (bool) {
//verification check that the minimum price is only set by the owner of the token
require(msg.sender == ownerOf(tokenId), "price can only be set by the owner");
//map the minimum price to the unique toke... | function setMinimumPrice(uint256 tokenId, uint256 paymentAmount) public returns (bool) {
//verification check that the minimum price is only set by the owner of the token
require(msg.sender == ownerOf(tokenId), "price can only be set by the owner");
//map the minimum price to the unique toke... | 45,608 |
56 | // Throws if the contract is paused. / | function _requireNotStakingPaused() internal view virtual {
require(!stakingPaused(), "Pausable: paused");
}
| function _requireNotStakingPaused() internal view virtual {
require(!stakingPaused(), "Pausable: paused");
}
| 1,221 |
282 | // Deposit ether to get wrapped ether | function deposit() external payable;
| function deposit() external payable;
| 2,926 |
32 | // Emits a {TransferSingle} event. Requirements: - `from` cannot be the zero address.- `from` must have at least `amount` tokens of token type `id`. / | function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _as... | function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _as... | 5,831 |
88 | // See {IERC20-totalSupply}./ | function totalSupply() external override view returns (uint256) {
return _totalSupply;
}
| function totalSupply() external override view returns (uint256) {
return _totalSupply;
}
| 16,419 |
19 | // length prefix + 1 entry for each | bytes29[] memory _encodedCalls = new bytes29[](
_calls.length + CALLS_PREFIX_ITEMS
);
_encodedCalls[0] = abi.encodePacked(uint8(_calls.length)).ref(0);
| bytes29[] memory _encodedCalls = new bytes29[](
_calls.length + CALLS_PREFIX_ITEMS
);
_encodedCalls[0] = abi.encodePacked(uint8(_calls.length)).ref(0);
| 26,742 |
58 | // Construct a new Route token / | constructor() public {
balances[_msgSender()] = uint256(totalSupply);
emit Transfer(address(0), _msgSender(), totalSupply);
}
| constructor() public {
balances[_msgSender()] = uint256(totalSupply);
emit Transfer(address(0), _msgSender(), totalSupply);
}
| 23,233 |
10 | // How much platform fees have been accrued. / | uint128 public platformFeesAccrued;
| uint128 public platformFeesAccrued;
| 8,048 |
19 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value. | function approve(address _spender, uint256 _value) returns(bool){
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| function approve(address _spender, uint256 _value) returns(bool){
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| 29,565 |
20 | // ่ฎฎๅๅฏน็ฌฌ_indexไธชๆๆก่ฟ่กๆ็ฅจ | function examine(uint256 _index, bool _bool)
public
| function examine(uint256 _index, bool _bool)
public
| 15,723 |
51 | // Crowdsale Start time has been changed | event StartsAtChanged(uint256 startsAt);
| event StartsAtChanged(uint256 startsAt);
| 36,550 |
319 | // with 0 amount{0,1} and sending the donation amount(s) from the callback/recipient The address which will receive the token0 and token1 amounts/amount0 The amount of token0 to send/amount1 The amount of token1 to send/data Any data to be passed through to the callback | function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
| function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
| 5,328 |
139 | // Called by buyers to purchase tokens. All ETH sent to this function is converted into tokens, which are sentto `beneficiary`. Tokens can only be bought while the Crowdsale is active. The amount of ETH received must not be less than theminimum or more than the maximum. / | function buyTokens(address beneficiary) public payable nonReentrant {
require(isActive(), "Crowdsale: not active");
uint256 weiAmount = msg.value;
require(weiAmount >= MIN_PURCHASE_AMOUNT, "Crowdsale: insufficient ETH");
require(weiAmount <= MAX_PURCHASE_AMOUNT, "Crowdsale: excessiv... | function buyTokens(address beneficiary) public payable nonReentrant {
require(isActive(), "Crowdsale: not active");
uint256 weiAmount = msg.value;
require(weiAmount >= MIN_PURCHASE_AMOUNT, "Crowdsale: insufficient ETH");
require(weiAmount <= MAX_PURCHASE_AMOUNT, "Crowdsale: excessiv... | 22,268 |
46 | // Check exit is valid and doesn't already exist. | require(_amount > 0);
require(exits[_utxoPos].amount == 0);
| require(_amount > 0);
require(exits[_utxoPos].amount == 0);
| 53,126 |
3 | // This initializes our contract state (sets enum to Pending once the program starts) | constructor () public {
}
| constructor () public {
}
| 40,241 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.