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 |
|---|---|---|---|---|
23 | // add address to the list | minters.push(_account);
| minters.push(_account);
| 37,065 |
14 | // Update UniV3 observations/desToken Token to be priced/quoteToken Token used for pricing/data Dex parameters | function updateV3Observation(address desToken, address quoteToken, bytes memory data) external override {
if (data.toDex() == DexData.DEX_UNIV3) {
increaseV3Observation(desToken, quoteToken, data.toFee());
}
}
| function updateV3Observation(address desToken, address quoteToken, bytes memory data) external override {
if (data.toDex() == DexData.DEX_UNIV3) {
increaseV3Observation(desToken, quoteToken, data.toFee());
}
}
| 2,152 |
10 | // 특정 NFT 토큰 아이디에 대한 추가적인 NFT 토큰 발행(owner만 호출 가능) | function addTokenSupply(uint256 tokenId, uint256 amount) public onlyOwner nonReentrant {
_mint(msg.sender, tokenId, amount, '');
}
| function addTokenSupply(uint256 tokenId, uint256 amount) public onlyOwner nonReentrant {
_mint(msg.sender, tokenId, amount, '');
}
| 29,273 |
10 | // uint256 ico_finish = 1512565200; | uint256 ico_finish = 1513774800;
| uint256 ico_finish = 1513774800;
| 13,634 |
124 | // --- CDP Confiscation --- | function grab(bytes32 i, address u, address v, address w, int dink, int dart) external note auth {
Urn storage urn = urns[i][u];
Ilk storage ilk = ilks[i];
urn.ink = _add(urn.ink, dink);
urn.art = _add(urn.art, dart);
ilk.Art = _add(ilk.Art, dart);
int dtab = _mul(i... | function grab(bytes32 i, address u, address v, address w, int dink, int dart) external note auth {
Urn storage urn = urns[i][u];
Ilk storage ilk = ilks[i];
urn.ink = _add(urn.ink, dink);
urn.art = _add(urn.art, dart);
ilk.Art = _add(ilk.Art, dart);
int dtab = _mul(i... | 7,845 |
7 | // Emitted when the price oracle sentinel is updated. oldAddress The old address of the PriceOracleSentinel newAddress The new address of the PriceOracleSentinel / | event PriceOracleSentinelUpdated(address indexed oldAddress, address indexed newAddress);
| event PriceOracleSentinelUpdated(address indexed oldAddress, address indexed newAddress);
| 36,390 |
9 | // Salvages a token. We should not be able to salvage CRV and 3CRV (underlying)./ | function salvage(address recipient, address token, uint256 amount) public onlyGovernance {
// To make sure that governance cannot come in and take away the coins
require(!unsalvagableTokens[token], "token is defined as not salvageable");
IERC20(token).safeTransfer(recipient, amount);
}
| function salvage(address recipient, address token, uint256 amount) public onlyGovernance {
// To make sure that governance cannot come in and take away the coins
require(!unsalvagableTokens[token], "token is defined as not salvageable");
IERC20(token).safeTransfer(recipient, amount);
}
| 6,240 |
6 | // what is the ETH/USD conversion rate? | function getConversionRate(uint256 ethAmount) public view returns(uint256){
uint256 ethPrice = getPrice();
uint256 ethAmountInUsd = (ethPrice * ethAmount) / 10**18;
return ethAmountInUsd;
}
| function getConversionRate(uint256 ethAmount) public view returns(uint256){
uint256 ethPrice = getPrice();
uint256 ethAmountInUsd = (ethPrice * ethAmount) / 10**18;
return ethAmountInUsd;
}
| 12,165 |
73 | // Change WETH Token address. Call by only Governance. / | function changeWethTokenAddress(address wethAddress_)
external
onlyGovernance
| function changeWethTokenAddress(address wethAddress_)
external
onlyGovernance
| 892 |
164 | // returns the address of the LendingPoolLiquidationManager. Since the manager is used through delegateCall within the LendingPool contract, the proxy contract pattern does not work properly hence the addresses are changed directly. return the address of the Lending pool liquidation manager/ | function getLendingPoolLiquidationManager() public view returns (address) {
return getAddress(LENDING_POOL_LIQUIDATION_MANAGER);
}
| function getLendingPoolLiquidationManager() public view returns (address) {
return getAddress(LENDING_POOL_LIQUIDATION_MANAGER);
}
| 9,026 |
4 | // Pending brains of Unitroller/ | address public pendingComptrollerImplementation;
| address public pendingComptrollerImplementation;
| 19,676 |
90 | // Mint LP's here. | defPair.mint(address(this));
| defPair.mint(address(this));
| 12,672 |
3 | // Stores tokens standard | string public tokenStandard = "CAT-1400";
| string public tokenStandard = "CAT-1400";
| 7,289 |
35 | // pl1lockedAmount = pl1lockedAmount.sub(lockedLiquidity[lpId].marginAmount.add(lockedLiquidity[lpId].marginFee)); | }
| }
| 30,232 |
51 | // Submit transcode receipt and invoke transcoding verification _jobId Job identifier _segmentNumber Segment sequence number in stream _dataStorageHash Content-addressed storage hash of segment data _dataHashes Hash of segment data and hash of transcoded segment data _broadcasterSig Broadcaster's signature over segment... | function verify(
uint256 _jobId,
uint256 _claimId,
uint256 _segmentNumber,
string _dataStorageHash,
bytes32[2] _dataHashes,
bytes _broadcasterSig,
bytes _proof
)
external
| function verify(
uint256 _jobId,
uint256 _claimId,
uint256 _segmentNumber,
string _dataStorageHash,
bytes32[2] _dataHashes,
bytes _broadcasterSig,
bytes _proof
)
external
| 2,356 |
19 | // Currency name. / | string public name;
| string public name;
| 48,509 |
10 | // Returns the debt ceiling of the reserve asset The address of the underlying asset of the reservereturn The debt ceiling of the reserve / | function getDebtCeiling(address asset) external view returns (uint256) {
return IPool(ADDRESSES_PROVIDER.getPool()).getConfiguration(asset).getDebtCeiling();
}
| function getDebtCeiling(address asset) external view returns (uint256) {
return IPool(ADDRESSES_PROVIDER.getPool()).getConfiguration(asset).getDebtCeiling();
}
| 4,425 |
78 | // Swaps `amounts[path.length-1]` `path[path.length-1]` to `to` on this chain Triggered by `anySwapOutExactTokensForTokens` | function anySwapInExactTokensForTokens(
bytes32 txs,
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline,
uint fromChainID
| function anySwapInExactTokensForTokens(
bytes32 txs,
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline,
uint fromChainID
| 63,247 |
7 | // Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. / | event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);
| event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);
| 9,896 |
11 | // ERC20Basic Simpler version of ERC20 interface / | interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, addres... | interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, addres... | 23,908 |
13 | // if vendor for asset already exists overwrite startBlock with the value that vendor initally held instead | if (addr != address(0)) {
| if (addr != address(0)) {
| 47,667 |
14 | // Emitted when governance class tokens are activated. | event Activated(address indexed owner, uint256 indexed tokenId);
| event Activated(address indexed owner, uint256 indexed tokenId);
| 23,750 |
16 | // Submits a new score for a player. Restricted to caller of createLeaderboard(). | function submitScore(uint256 leaderboardId, address player, uint256 newScore) external;
| function submitScore(uint256 leaderboardId, address player, uint256 newScore) external;
| 9,415 |
18 | // Returns whether the prize period is over/ return True if the prize period is over, false otherwise | function isPrizePeriodOver() external view returns (bool) {
return _isPrizePeriodOver();
}
| function isPrizePeriodOver() external view returns (bool) {
return _isPrizePeriodOver();
}
| 31,839 |
15 | // Interface for contracts conforming to ERC-721 / | contract ERC721Interface {
function ownerOf(uint256 assetId) public view returns (address);
function safeTransferFrom(address from, address to, uint256 assetId) public;
function isAuthorized(address operator, uint256 assetId) public view returns (bool);
}
| contract ERC721Interface {
function ownerOf(uint256 assetId) public view returns (address);
function safeTransferFrom(address from, address to, uint256 assetId) public;
function isAuthorized(address operator, uint256 assetId) public view returns (bool);
}
| 16,503 |
35 | // cancel timelocked action _index uint256 / | function nullify(uint256 _index) external onlyGovernor {
permissionQueue[_index].nullify = true;
}
| function nullify(uint256 _index) external onlyGovernor {
permissionQueue[_index].nullify = true;
}
| 61,974 |
30 | // ============ External Imports ============ | import {Address} from "@openzeppelin/contracts/utils/Address.sol";
/**
* @title UpgradeBeaconProxy
* @notice
* Proxy contract which delegates all logic, including initialization,
* to an implementation contract.
* The implementation contract is stored within an Upgrade Beacon contract;
* the implementation contr... | import {Address} from "@openzeppelin/contracts/utils/Address.sol";
/**
* @title UpgradeBeaconProxy
* @notice
* Proxy contract which delegates all logic, including initialization,
* to an implementation contract.
* The implementation contract is stored within an Upgrade Beacon contract;
* the implementation contr... | 16,485 |
15 | // How much native currency did we just swap into? | uint256 newBalance = address(this).balance;
| uint256 newBalance = address(this).balance;
| 34,422 |
6 | // function mint(address to) external returns (uint liquidity); | function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
| function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
| 22,034 |
71 | // -- APPLICATION ENTRY POINTS --/ |
function adminInitialSet()
public
|
function adminInitialSet()
public
| 44,672 |
102 | // account for deposit | uint value = treasury.valueOf( token, amount );
accountingFor( token, amount, value, true );
IERC20(token).approve(address(curve3Pool), amount); // approve curve pool to spend tokens
uint curveAmount = curve3Pool.add_liquidity(curveToken, amounts, minAmount); // deposit into curve
... | uint value = treasury.valueOf( token, amount );
accountingFor( token, amount, value, true );
IERC20(token).approve(address(curve3Pool), amount); // approve curve pool to spend tokens
uint curveAmount = curve3Pool.add_liquidity(curveToken, amounts, minAmount); // deposit into curve
... | 31,331 |
2 | // the current supply rate. Expressed in ray | uint128 currentLiquidityRate;
| uint128 currentLiquidityRate;
| 2,508 |
50 | // setPool _pid the pool id _allocPoint the pool allocation point _registered does this pool is registered (default true). _depositPause pause pool deposit (default false).This parameter can be used by the UI to include or exclude the pool _descriptionHash the hash of the pool description. / | function setPool(uint256 _pid,
uint256 _allocPoint,
bool _registered,
bool _depositPause,
string memory _descriptionHash)
| function setPool(uint256 _pid,
uint256 _allocPoint,
bool _registered,
bool _depositPause,
string memory _descriptionHash)
| 13,628 |
153 | // Check if the name string is valid (Alphanumeric and spaces without leading or trailing space) / | function validateName(string memory str) public pure returns (bool){
bytes memory b = bytes(str);
if(b.length < 1) return false;
if(b.length > 16) return false; // Cannot be longer than 16 characters
if(b[0] == 0x20) return false; // Leading space
if (b[b.length - 1] == 0x20)... | function validateName(string memory str) public pure returns (bool){
bytes memory b = bytes(str);
if(b.length < 1) return false;
if(b.length > 16) return false; // Cannot be longer than 16 characters
if(b[0] == 0x20) return false; // Leading space
if (b[b.length - 1] == 0x20)... | 11,156 |
122 | // user activity details: | mapping(address => Staking[]) public stakings;
mapping(address => Loan[]) public loans;
mapping(address => uint256) public launchReward;
| mapping(address => Staking[]) public stakings;
mapping(address => Loan[]) public loans;
mapping(address => uint256) public launchReward;
| 30,241 |
14 | // decode a uq112x112 into a uint with 18 decimals of precision | function decode112with18(uq112x112 memory self) internal pure returns (uint) {
return uint(self._x) / 5192296858534827;
}
| function decode112with18(uq112x112 memory self) internal pure returns (uint) {
return uint(self._x) / 5192296858534827;
}
| 30,638 |
41 | // Upgrade the backing implementation of the proxy and call a functionon the new implementation.This is useful to initialize the proxied contract. newImplementation Address of the new implementation. data Data to send as msg.data in the low level call.It should include the signature and the parameters of the function t... | function upgradeToAndCall(address newImplementation, bytes calldata data)
external
payable
ifAdmin
| function upgradeToAndCall(address newImplementation, bytes calldata data)
external
payable
ifAdmin
| 548 |
9 | // solhint-disable avoid-low-level-calls slither-disable-next-line low-level-calls | (bool success, ) = to.call{ value: value }("");
| (bool success, ) = to.call{ value: value }("");
| 8,982 |
2 | // store voted accounts | mapping(address => bool) public voters;
| mapping(address => bool) public voters;
| 40,855 |
120 | // Checks whether the period in which the crowdsale is open has already elapsed.return Whether crowdsale period has elapsed / | function hasClosed() public view returns (bool) {
// solhint-disable-next-line not-rely-on-time
return _openingTime > 0 && _isStopped;
}
| function hasClosed() public view returns (bool) {
// solhint-disable-next-line not-rely-on-time
return _openingTime > 0 && _isStopped;
}
| 24,466 |
10 | // 3D state by tokenId | mapping(uint256 => ThreeDState) public tokenThreeDState;
| mapping(uint256 => ThreeDState) public tokenThreeDState;
| 16,034 |
158 | // If token was not sold, return ownership to the seller | transferToken(auctionId, address(this), auction.seller);
| transferToken(auctionId, address(this), auction.seller);
| 79,549 |
36 | // Block-scoping these variables saves some gas. | uint256 stopped_;
uint256 zph_;
assembly {
let slot1 := sload(1)
stopped_ := and(slot1, 0xff )
hop_ := and(shr(8, slot1), 0xffff)
zph_ := shr(24, slot1)
}
| uint256 stopped_;
uint256 zph_;
assembly {
let slot1 := sload(1)
stopped_ := and(slot1, 0xff )
hop_ := and(shr(8, slot1), 0xffff)
zph_ := shr(24, slot1)
}
| 54,388 |
133 | // APIS Crowd Pre-Sale 토큰의 프리세일을 수행하기 위한 컨트랙트 / | contract ApisCrowdSale is Ownable {
// 소수점 자리수. Eth 18자리에 맞춘다
uint8 public constant decimals = 18;
// 크라우드 세일의 판매 목표량(APIS)
uint256 public fundingGoal;
// 현재 진행하는 판매 목표량
// QTUM과 공동으로 판매가 진행되기 때문에, QTUM 쪽 컨트렉트와 합산한 판매량이 총 판매목표를 넘지 않도록 하기 위함
uint256 public fundingGoalCur... | contract ApisCrowdSale is Ownable {
// 소수점 자리수. Eth 18자리에 맞춘다
uint8 public constant decimals = 18;
// 크라우드 세일의 판매 목표량(APIS)
uint256 public fundingGoal;
// 현재 진행하는 판매 목표량
// QTUM과 공동으로 판매가 진행되기 때문에, QTUM 쪽 컨트렉트와 합산한 판매량이 총 판매목표를 넘지 않도록 하기 위함
uint256 public fundingGoalCur... | 10,721 |
87 | // Si lo quiere en ETHcomprobamos que hayamos alcanzado el softCap | assert(isSoftCapComplete);
| assert(isSoftCapComplete);
| 9,213 |
29 | // check if we are safely over the required collateral ratio if so, there is no need to add anything to get over | if (minCollateralValue <= cCollateralValue) {
return 0;
}
| if (minCollateralValue <= cCollateralValue) {
return 0;
}
| 33,928 |
2 | // Throws an error if the value of ETH sent to the function is invalid. / | error InvalidETHValue();
| error InvalidETHValue();
| 33,790 |
3 | // STANDARD interface/_conditionData The encoded data from getConditionData() | function ok(uint256 _taskReceiptId, bytes calldata _conditionData, uint256)
public
view
virtual
override
returns(string memory)
| function ok(uint256 _taskReceiptId, bytes calldata _conditionData, uint256)
public
view
virtual
override
returns(string memory)
| 11,676 |
67 | // See IMedia This method is loosely based on the permit for ERC-20 tokens inEIP-2612, but modifiedfor ERC-721. / | function permit(
address spender,
uint256 tokenID,
EIP712Signature memory sig
| function permit(
address spender,
uint256 tokenID,
EIP712Signature memory sig
| 37,658 |
40 | // Emitted when a new authorizer is set by `setAuthorizer`. / | event AuthorizerChanged(IAuthorizer indexed newAuthorizer);
| event AuthorizerChanged(IAuthorizer indexed newAuthorizer);
| 4,722 |
37 | // 再投資所有股息/ | function reinvest() public {
// 獲得所有股息
uint funds = dividendsOf(msg.sender);
require(funds > 0, "You have no dividends");
// 做出更正,之後的事件將為0
UserRecord storage user = user_data[msg.sender];
user.funds_correction = user.funds_correction.add(int(funds));
// 申請費... | function reinvest() public {
// 獲得所有股息
uint funds = dividendsOf(msg.sender);
require(funds > 0, "You have no dividends");
// 做出更正,之後的事件將為0
UserRecord storage user = user_data[msg.sender];
user.funds_correction = user.funds_correction.add(int(funds));
// 申請費... | 4,663 |
86 | // 1111111111111 | function exchangeRateCurrent() external view returns (uint256 exchangeRate);
function repay(address borrower, uint256 repayAmount)
external
returns (uint256, bytes memory);
function borrowBalanceStored(address account)
external
view
returns (uint256);
| function exchangeRateCurrent() external view returns (uint256 exchangeRate);
function repay(address borrower, uint256 repayAmount)
external
returns (uint256, bytes memory);
function borrowBalanceStored(address account)
external
view
returns (uint256);
| 43,066 |
11 | // Compute the number of tokens to be rewarded to the sender Note: it's important for this calculation that both wei and PDT have the same number of decimal places (18) | uint numTokens = amount.mul(rate);
| uint numTokens = amount.mul(rate);
| 33,126 |
3 | // Verify the time is non-zero | require(_time > 0);
payments.push(Payment({
sender: msg.sender,
receiver: _receiver,
timestamp: block.timestamp,
time: _time,
weiValue: _weiValue,
weiPaid: 0,
isFork: false,
parentIndex: 0,
| require(_time > 0);
payments.push(Payment({
sender: msg.sender,
receiver: _receiver,
timestamp: block.timestamp,
time: _time,
weiValue: _weiValue,
weiPaid: 0,
isFork: false,
parentIndex: 0,
| 32,137 |
9 | // create new one by recursion | if (referrerAddress != owner) { //推荐人不是合约所有人
| if (referrerAddress != owner) { //推荐人不是合约所有人
| 19,099 |
117 | // 화이트리스트에 등록되어있으면 바로 출금한다 | if(whiteList.isInWhiteList(_beneficiary) == true) {
withdrawal(_beneficiary);
}
| if(whiteList.isInWhiteList(_beneficiary) == true) {
withdrawal(_beneficiary);
}
| 10,705 |
264 | // Funds sent in this way are stored in an intermediate {Escrow} contract, sothere is no danger of them being spent before withdrawal.dest The destination address of the funds. amount The amount to transfer. / | function _asyncTransfer(address dest, uint256 amount) internal virtual {
_escrow.deposit{ value: amount }(dest);
| function _asyncTransfer(address dest, uint256 amount) internal virtual {
_escrow.deposit{ value: amount }(dest);
| 25,732 |
4 | // Record the voter's address. | proposal.voters.push(msg.sender);
| proposal.voters.push(msg.sender);
| 5,825 |
5 | // Logging / | import { console } from "hardhat/console.sol";
/**
* @title Helper_TestRunner
*/
contract Helper_TestRunner {
struct TestStep {
string functionName;
bytes functionData;
bool expectedReturnStatus;
bytes expectedReturnData;
bool onlyValidateFlag;
}
function runSingl... | import { console } from "hardhat/console.sol";
/**
* @title Helper_TestRunner
*/
contract Helper_TestRunner {
struct TestStep {
string functionName;
bytes functionData;
bool expectedReturnStatus;
bytes expectedReturnData;
bool onlyValidateFlag;
}
function runSingl... | 19,833 |
15 | // @Dev resets data access index to 0 | function ResetDataAccessGrower () returns (string message)
| function ResetDataAccessGrower () returns (string message)
| 16,996 |
119 | // More than this much time must pass between rebase operations. | uint256 public minRebaseTimeIntervalSec;
| uint256 public minRebaseTimeIntervalSec;
| 1,054 |
147 | // `owner | (block.timestamp << BITPOS_START_TIMESTAMP) | flags`. | result := or(owner, or(shl(BITPOS_START_TIMESTAMP, timestamp()), flags))
| result := or(owner, or(shl(BITPOS_START_TIMESTAMP, timestamp()), flags))
| 11,332 |
3 | // ======================================================================================SYSTEM SETTINGS, OPERATED VIA OWNER(DAO/TIMELOCK)====================================================================================== / | receive() external payable { }
/**
* @dev pause the contract
*/
function pause() public onlyRole(PAUSER_ROLE) {
_pause();
}
| receive() external payable { }
/**
* @dev pause the contract
*/
function pause() public onlyRole(PAUSER_ROLE) {
_pause();
}
| 32,199 |
358 | // Max referral commission rate: 10%. | uint16 public constant MAXIMUM_REFERRAL_COMMISSION_RATE = 1000;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
ev... | uint16 public constant MAXIMUM_REFERRAL_COMMISSION_RATE = 1000;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
ev... | 3,745 |
68 | // Mapping from token ID to owner address | mapping(uint256 => address) private _owners;
| mapping(uint256 => address) private _owners;
| 27,092 |
50 | // calculates the delta between supply and redeem for currency and deposit or get them from the reserve | adjustCurrencyBalance(epochID, epochSupplyOrderCurrency, epochRedeemOrderCurrency);
| adjustCurrencyBalance(epochID, epochSupplyOrderCurrency, epochRedeemOrderCurrency);
| 26,969 |
124 | // Conditon (2): NFT repay or auction buy | (Lien memory lien, uint256 lienId) = abi.decode(data, (Lien, uint256));
| (Lien memory lien, uint256 lienId) = abi.decode(data, (Lien, uint256));
| 30,160 |
14 | // =============================== Public variables of the token | using SafeMath for uint256;
string constant public name = "BitPhantom";
string constant public symbol = "BTF";
uint256 constant public decimals = 18;
uint256 constant public maxSupply = 15000 * (10**decimals); //500 million tokens
uint256 public totalSupply;
bool public safeguard; //p... | using SafeMath for uint256;
string constant public name = "BitPhantom";
string constant public symbol = "BTF";
uint256 constant public decimals = 18;
uint256 constant public maxSupply = 15000 * (10**decimals); //500 million tokens
uint256 public totalSupply;
bool public safeguard; //p... | 12,825 |
80 | // Increase the amount of tokens that an owner has allowed to a spender. This method should be used instead of approve() to avoid the double approval vulnerability described above.spender The address which will spend the funds.addedValue The amount of tokens to increase the allowance by./ | function increaseAllowance(address spender, uint256 addedValue)
public
whenTokenNotPaused
returns (bool)
| function increaseAllowance(address spender, uint256 addedValue)
public
whenTokenNotPaused
returns (bool)
| 39,800 |
113 | // Handle the receipt of an NFT The ERC721 smart contract calls this function on the recipient | * after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
* otherwise the caller will revert the transaction. The selector to be
* returned can be obtained as `this.onERC721Received.selector`. This
* function MAY throw to revert and reject the transfer.
* Note: the ... | * after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
* otherwise the caller will revert the transaction. The selector to be
* returned can be obtained as `this.onERC721Received.selector`. This
* function MAY throw to revert and reject the transfer.
* Note: the ... | 11,484 |
0 | // PUBLIC STATE VARIABLES / | struct Voter {
uint8 lockupDuration;
uint16 voteEpoch;
uint releaseDate;
uint tokensLocked;
uint gasTarget;
}
| struct Voter {
uint8 lockupDuration;
uint16 voteEpoch;
uint releaseDate;
uint tokensLocked;
uint gasTarget;
}
| 2,627 |
15 | // divides two wad, rounding half up to the nearest wada wadb wad return the result of a/b, in wad/ | function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 halfB = b / 2;
return halfB.add(a.mul(WAD)).div(b);
}
| function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 halfB = b / 2;
return halfB.add(a.mul(WAD)).div(b);
}
| 31,899 |
70 | // mint 1PLACE to the Decentraplace-Reserveafter every 11th alteration/burn | _mint(payable(0xebDd474f45eEADcAaa1fbF98Fd221446e2854DB4), 1);
| _mint(payable(0xebDd474f45eEADcAaa1fbF98Fd221446e2854DB4), 1);
| 25,194 |
5 | // Returns the result of removing a prefix of length `prefix` bits from the/ given label (i.e. shifting its data to the left). | function removePrefix(D.Label memory l, uint prefix) internal pure returns (D.Label memory r) {
require(prefix <= l.length, "Bad lenght");
r.length = l.length - prefix;
r.data = l.data << prefix;
}
| function removePrefix(D.Label memory l, uint prefix) internal pure returns (D.Label memory r) {
require(prefix <= l.length, "Bad lenght");
r.length = l.length - prefix;
r.data = l.data << prefix;
}
| 46,334 |
15 | // Assigns ownership of a specific Cow to an address. | function _transfer(address _from, address _to, uint256 _tokenId) internal {
// there is no way to overflow this
ownershipTokenCount[_to]++;
// transfer ownership
cowIndexToOwner[_tokenId] = _to;
// When creating new snakes _from is 0x0, but we can't account that address.
... | function _transfer(address _from, address _to, uint256 _tokenId) internal {
// there is no way to overflow this
ownershipTokenCount[_to]++;
// transfer ownership
cowIndexToOwner[_tokenId] = _to;
// When creating new snakes _from is 0x0, but we can't account that address.
... | 19,785 |
7 | // indefinite-term loan | owedPerDay = traderInterest.interestOwedPerDay;
maxDuration = 2628000; // approx. 1 month
| owedPerDay = traderInterest.interestOwedPerDay;
maxDuration = 2628000; // approx. 1 month
| 11,218 |
2 | // Address where funding comes from (Gitcoin Grants multisig) | address public immutable funder;
| address public immutable funder;
| 20,908 |
142 | // Emits a {MigrationsStarted} event. Requirements:- Caller must have owner role.- Migrating isn't allowed. / | function allowMigrations() external override returns (bool) {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), 'XFIToken: sender is not owner');
require(!_migratingAllowed, 'XFIToken: migrating is allowed');
_migratingAllowed = true;
emit MigrationsAllowed();
return true;
... | function allowMigrations() external override returns (bool) {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), 'XFIToken: sender is not owner');
require(!_migratingAllowed, 'XFIToken: migrating is allowed');
_migratingAllowed = true;
emit MigrationsAllowed();
return true;
... | 44,581 |
195 | // FudaoverseDAO Collection/FudaoverseDAO/FudaoverseDAO Collection | contract FuDaoVerseDAO is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
using ECDSA for bytes32;
Counters.Counter public tokenSupply;
string public baseURI;
uint256 public cost = 0.088 ether;
uint256 public maxSupply = 888;
bool public presaleOpen ... | contract FuDaoVerseDAO is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
using ECDSA for bytes32;
Counters.Counter public tokenSupply;
string public baseURI;
uint256 public cost = 0.088 ether;
uint256 public maxSupply = 888;
bool public presaleOpen ... | 77,987 |
36 | // Denominator for constraints: 'pedersen/hash0/ec_subset_sum/bit_extraction_end', 'pedersen/hash1/ec_subset_sum/bit_extraction_end', 'pedersen/hash2/ec_subset_sum/bit_extraction_end', 'pedersen/hash3/ec_subset_sum/bit_extraction_end'. denominators[9] = point^(trace_length / 256) - trace_generator^(63trace_length / 64)... | mstore(0x4ac0,
addmod(
| mstore(0x4ac0,
addmod(
| 20,610 |
27 | // validate snapshot | if (staking.getRemainingNerd(_addr) < _staked) return false;
uint256 poolLength = _farmedLPAmounts.length;
for(uint256 i = 0; i < poolLength; i++) {
if (_farmedLPAmounts[i] < vault.getRemainingLP(i, _addr)) return false;
}
| if (staking.getRemainingNerd(_addr) < _staked) return false;
uint256 poolLength = _farmedLPAmounts.length;
for(uint256 i = 0; i < poolLength; i++) {
if (_farmedLPAmounts[i] < vault.getRemainingLP(i, _addr)) return false;
}
| 82,663 |
79 | // The staked TOKEN! | IERC20 public stakedToken;
IERC20 public rewardToken;
| IERC20 public stakedToken;
IERC20 public rewardToken;
| 27,495 |
2 | // Structs | struct UintArgs {
uint256 maxSupply;
uint256 whitelistedFee;
uint256 mintFee;
uint256 maxQuantity;
uint96 royalty;
uint256 WhiteListStartTime;
uint256 WhiteListEndTime;
}
| struct UintArgs {
uint256 maxSupply;
uint256 whitelistedFee;
uint256 mintFee;
uint256 maxQuantity;
uint96 royalty;
uint256 WhiteListStartTime;
uint256 WhiteListEndTime;
}
| 2,506 |
3 | // Caution! this balance is used only in swap uint public balance0; uint public balance1; uint public balance2; |
uint public reserve0; // uses single storage slot, accessible via getReserves
uint public reserve1; // uses single storage slot, accessible via getReserves
uint public reserve2;
|
uint public reserve0; // uses single storage slot, accessible via getReserves
uint public reserve1; // uses single storage slot, accessible via getReserves
uint public reserve2;
| 30,528 |
7 | // this changes proxy parameters | rv = prop.subject.call(prop.msgData);
| rv = prop.subject.call(prop.msgData);
| 32,415 |
200 | // modifier for governor function | modifier onlyGovernor() {
require(isGovernor(msg.sender) || owner() == msg.sender , "caller is not the governor");
_;
}
| modifier onlyGovernor() {
require(isGovernor(msg.sender) || owner() == msg.sender , "caller is not the governor");
_;
}
| 41,250 |
85 | // Note: BONUS_CAP should be at least 5% of MAINSALE_CAP Note: BONUS_CAP = 64460000 BONUS token- 4193635 PreSale Bonus token | uint constant public BONUS_CAP = 60266365e18; // 60,266,365 e18
| uint constant public BONUS_CAP = 60266365e18; // 60,266,365 e18
| 27,366 |
48 | // Cannot set bots after first 12 hours | require(block.timestamp < tradingOpenTime + (1 days / 2), "Cannot set bots anymore");
for (uint i = 0; i < bots.length; i++) {
_bots[bots[i]] = true;
}
| require(block.timestamp < tradingOpenTime + (1 days / 2), "Cannot set bots anymore");
for (uint i = 0; i < bots.length; i++) {
_bots[bots[i]] = true;
}
| 24,272 |
194 | // Check if sender is Verifier | modifier onlyVerifier() {
_onlyVerifier();
_;
}
| modifier onlyVerifier() {
_onlyVerifier();
_;
}
| 73,303 |
9 | // 8900 ~ 9899 | return 0.48 ether;
| return 0.48 ether;
| 11,993 |
16 | // Burns the debt tokens of the user up to the amount being repaid by the liquidator. The function alters the `debtReserveCache` state in `vars` to update the debt related data. params The additional parameters needed to execute the liquidation function vars the executeLiquidationCall() function local vars / | function _burnDebtTokens(
DataTypes.ExecuteLiquidationCallParams memory params,
LiquidationCallLocalVars memory vars
| function _burnDebtTokens(
DataTypes.ExecuteLiquidationCallParams memory params,
LiquidationCallLocalVars memory vars
| 35,585 |
28 | // Find the owner of an NFT /NFTs assigned to zero address are considered invalid, and queries /about them do throw. /_tokenId The identifier for an NFT / return The address of the owner of the NFT | function ownerOf(uint256 _tokenId) external view returns (address);
| function ownerOf(uint256 _tokenId) external view returns (address);
| 21,396 |
30 | // Cannot underflow as remaining amount is ensured to be greater than or equal to royalty amount | unchecked {
amountRemaining -= amount;
++i;
}
| unchecked {
amountRemaining -= amount;
++i;
}
| 5,723 |
39 | // Updates flow as an operator with userData cfaLibrary The cfaLibrary storage variable sender The sender of the flow receiver The receiver of the flow token The token to flow flowRate The desired flowRate userData The user provided data / | function updateFlowByOperator(
InitData storage cfaLibrary,
address sender,
address receiver,
ISuperfluidToken token,
int96 flowRate,
bytes memory userData
| function updateFlowByOperator(
InitData storage cfaLibrary,
address sender,
address receiver,
ISuperfluidToken token,
int96 flowRate,
bytes memory userData
| 23,061 |
49 | // Single mint | _mint(to[0], tokenIds[0], amounts[0], new bytes(0));
| _mint(to[0], tokenIds[0], amounts[0], new bytes(0));
| 13,966 |
1,284 | // Ensure the sCHF synth can write to its TokenState; | tokenstateschf_i.setAssociatedContract(new_SynthsCHF_contract);
| tokenstateschf_i.setAssociatedContract(new_SynthsCHF_contract);
| 4,108 |
180 | // Calculates amount of tokens to be minted, by subtracting availabletoken balances from amount of tokens to be exited tokenBalances Token balances this contract holds for some ordered token ids amountsToBeExited Amount of tokens being exited / | function calculateAmountsToBeMinted(
uint256[] memory tokenBalances,
uint256[] memory amountsToBeExited
| function calculateAmountsToBeMinted(
uint256[] memory tokenBalances,
uint256[] memory amountsToBeExited
| 79,482 |
0 | // aFactory = _aFactory; | aFactory = new AgreementFactory();
tFactory = new TransactionFactory();
toolFactory = new ToolFactory();
tool = toolFactory.create();
| aFactory = new AgreementFactory();
tFactory = new TransactionFactory();
toolFactory = new ToolFactory();
tool = toolFactory.create();
| 13,848 |
96 | // Sets the fees for buys/_marketingFee The fee for the marketing wallet/_devFee The fee for the dev wallet | function updateFeesForBuying(
uint256 _marketingFee,
uint256 _devFee
| function updateFeesForBuying(
uint256 _marketingFee,
uint256 _devFee
| 5,481 |
35 | // If closed channel is not last channel in the channels array... | if (finalChannelIndex != removedChannelIndex) {
| if (finalChannelIndex != removedChannelIndex) {
| 4,101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.