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 |
|---|---|---|---|---|
223 | // Transfers all `want` from this Strategy to `_newStrategy`.This may only be called by the Vault.The new Strategy's Vault must be the same as this Strategy's Vault. The migration process should be carefully performed to make sure allthe assets are migrated to the new address, which should have neverinteracted with the... | function migrate(address _newStrategy) external {
require(msg.sender == address(vault));
require(BaseStrategy(_newStrategy).vault() == vault);
prepareMigration(_newStrategy);
want.safeTransfer(_newStrategy, want.balanceOf(address(this)));
}
| function migrate(address _newStrategy) external {
require(msg.sender == address(vault));
require(BaseStrategy(_newStrategy).vault() == vault);
prepareMigration(_newStrategy);
want.safeTransfer(_newStrategy, want.balanceOf(address(this)));
}
| 911 |
38 | // For the first 1000 blocks, give 20 BOOGIE per block to all other pools that have staked LP tokens | boogieReward = multiplier * SOFT_LAUNCH_BOOGIE_PER_BLOCK;
| boogieReward = multiplier * SOFT_LAUNCH_BOOGIE_PER_BLOCK;
| 26,837 |
317 | // returns current active claim index by policybook and claimer | function claimIndex(address claimer, address policyBookAddress)
external
view
returns (uint256);
| function claimIndex(address claimer, address policyBookAddress)
external
view
returns (uint256);
| 40,099 |
23 | // Returns the amount of want supplied to all lending pools / | function balanceOfPools() public view returns (uint256 poolBalance) {
uint256 nrOfPools = usedPools.length();
for (uint256 index = 0; index < nrOfPools; index++) {
poolBalance += wantSuppliedToPool(usedPools.at(index));
}
}
| function balanceOfPools() public view returns (uint256 poolBalance) {
uint256 nrOfPools = usedPools.length();
for (uint256 index = 0; index < nrOfPools; index++) {
poolBalance += wantSuppliedToPool(usedPools.at(index));
}
}
| 17,148 |
324 | // Return amount after fee | return amountAfterFee;
| return amountAfterFee;
| 2,361 |
14 | // Pop the stack and append the value. | treeIndex = tree.stack[tree.stack.length - 1];
tree.stack.length--;
tree.nodes[treeIndex] = _value;
| treeIndex = tree.stack[tree.stack.length - 1];
tree.stack.length--;
tree.nodes[treeIndex] = _value;
| 16,791 |
26 | // ERC223 | function transfer(address to, uint256 value, bytes data) external returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
| function transfer(address to, uint256 value, bytes data) external returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
| 59,457 |
65 | // Called by a guardian when ready to join the committee, typically after syncing is complete or after being voted out | function readyForCommittee() external;
| function readyForCommittee() external;
| 24,116 |
10 | // Number of candidates. NOTE Candidates IDs sequience starts at 1. | uint8 public candidates;
| uint8 public candidates;
| 40,171 |
11 | // The manager of this contract | address public immutable manager;
| address public immutable manager;
| 40,251 |
24 | // Delegates execution to an implementation contract.It returns to the external caller whatever the implementation returnsor forwards reverts. / | function () external payable {
// delegate all other functions to current implementation
(bool success, ) = implementation.delegatecall(msg.data);
assembly {
let free_mem_ptr := mload(0x40)
returndatacopy(free_mem_ptr, 0, returndatasize)
switch suc... | function () external payable {
// delegate all other functions to current implementation
(bool success, ) = implementation.delegatecall(msg.data);
assembly {
let free_mem_ptr := mload(0x40)
returndatacopy(free_mem_ptr, 0, returndatasize)
switch suc... | 37,081 |
22 | // Send any other balance to the tenant as a refund | selfdestruct(tenant);
| selfdestruct(tenant);
| 47,267 |
47 | // Record & update state variables/ Tracks total tokens pending to be minted - this includes presale tokens | tokensToMint = tokensToMint.add(_tokenAmount);
| tokensToMint = tokensToMint.add(_tokenAmount);
| 13,141 |
11 | // require(tipsy123.balanceOf(address(this)) > 1, "No tokens");40e27 is my start balance | require(tipsy123.balanceOf(address(this)) >= 39e27, "Balance, huh?");
| require(tipsy123.balanceOf(address(this)) >= 39e27, "Balance, huh?");
| 22,629 |
111 | // Sets the contract URI. uri The new contract URI. / | function setContractURI(string calldata uri) external override onlyOwner {
_contractURI = uri;
emit ContractURISet(uri);
}
| function setContractURI(string calldata uri) external override onlyOwner {
_contractURI = uri;
emit ContractURISet(uri);
}
| 17,404 |
23 | // Hardcode the Palace's approval so that users don't have to waste gas approving | if (_msgSender() != address(palace))
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
| if (_msgSender() != address(palace))
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
| 23,140 |
8 | // Buys the specified amount of SRX with the given reserve tokens, provided they are sufficient. / | function buy(uint amount) payable public returns (bool) {
uint tenderAmount = calculateTenderAmount(amount);
require(msg.value >= tenderAmount, "Insufficient value provided to buy target amount.");
_buy(tenderAmount);
if (msg.value > tenderAmount) {
uint refund = msg.valu... | function buy(uint amount) payable public returns (bool) {
uint tenderAmount = calculateTenderAmount(amount);
require(msg.value >= tenderAmount, "Insufficient value provided to buy target amount.");
_buy(tenderAmount);
if (msg.value > tenderAmount) {
uint refund = msg.valu... | 39,956 |
27 | // Writes a bytes20 to the buffer. Resizes if doing so would exceed thecapacity of the buffer.buf The buffer to append to.off The offset to write at.data The data to append. return The original buffer, for chaining./ | function writeBytes20(buffer memory buf, uint off, bytes20 data) internal pure returns (buffer memory) {
return write(buf, off, bytes32(data), 20);
}
| function writeBytes20(buffer memory buf, uint off, bytes20 data) internal pure returns (buffer memory) {
return write(buf, off, bytes32(data), 20);
}
| 21,905 |
5 | // Decimals of the underlying token | uint8 internal _underlyingDecimals;
| uint8 internal _underlyingDecimals;
| 5,072 |
38 | // getter to determine if address is in whitelist/ | function operator(address _operator) public view returns (bool) {
return hasRole(_operator, ROLE_OPERATOR);
}
| function operator(address _operator) public view returns (bool) {
return hasRole(_operator, ROLE_OPERATOR);
}
| 38,704 |
15 | // Constructor taking resqueAccountHash: keccak256(address resqueAccount); authorityAccount: address of authorityAccount that will set data for withdrawing to Emergency account kwHash: keccak256("your keyword phrase"); photoHshs: array of keccak256(keccak256(data_of_yourphoto.pdf)) - hashes of photo files taken for thi... | function NYX(bytes32 resqueAccountHash, address authorityAccount, bytes32 kwHash, bytes32[10] photoHshs) {
owner = msg.sender;
resqueHash = resqueAccountHash;
authority = authorityAccount;
keywordHash = kwHash;
// save photo hashes as state forever
uint8 x = 0;
... | function NYX(bytes32 resqueAccountHash, address authorityAccount, bytes32 kwHash, bytes32[10] photoHshs) {
owner = msg.sender;
resqueHash = resqueAccountHash;
authority = authorityAccount;
keywordHash = kwHash;
// save photo hashes as state forever
uint8 x = 0;
... | 32,814 |
18 | // Create a new task in this project modifier onlyGC _title bytes: the sha3 hash of the task titile _cost uint: the number of pusd tokens required to escrow this contract _sc address: the subcontractor being invited (OPTIONAL, send address(0) if none)return _index uint: the index of the newly created task within the pr... | function createTask(bytes memory _title, uint256 _cost, address _sc) public virtual returns (uint256 _index);
| function createTask(bytes memory _title, uint256 _cost, address _sc) public virtual returns (uint256 _index);
| 39,752 |
1 | // Event emitted to notify about the magic values necessary for interfacing with this contract. names An array of names for the magic values used by the contract. values An array of values for the magic values used by the contract. / | event MagicValues(bytes32[] names, bytes32[] values);
| event MagicValues(bytes32[] names, bytes32[] values);
| 41,432 |
517 | // Create a new order | last_order_id_twamm = TWAMM.getNextOrderID();
{
if (fpi_sell_amt > 0) {
| last_order_id_twamm = TWAMM.getNextOrderID();
{
if (fpi_sell_amt > 0) {
| 73,602 |
6 | // Returns the content hash associated with an ENS node.Note that this resource type is not standardized, and will likely changein future to a resource type based on multihash. _node The ENS node to query.return The associated content hash. / | function content(bytes32 _node) public view returns (bytes32 ret) {
ret = hashes[_node];
}
| function content(bytes32 _node) public view returns (bytes32 ret) {
ret = hashes[_node];
}
| 35,814 |
137 | // Default values | storageTokenInfo.borrowLTV = 60; //6e7; // 60%
tokens.push(_token);
emit TokenAdded(_token);
| storageTokenInfo.borrowLTV = 60; //6e7; // 60%
tokens.push(_token);
emit TokenAdded(_token);
| 15,062 |
133 | // Init Lottery. | function initLottery(uint16 numTickets, uint ticketPrice, uint8 ownerCut) onlyOwner public {
require(ownerCut < 100);
// Prevent Owner to create a new lottery if current is not finished
if (lotteryId > 0) {
require(lotteries[lotteryId].winner != address(0));
}
... | function initLottery(uint16 numTickets, uint ticketPrice, uint8 ownerCut) onlyOwner public {
require(ownerCut < 100);
// Prevent Owner to create a new lottery if current is not finished
if (lotteryId > 0) {
require(lotteries[lotteryId].winner != address(0));
}
... | 29,440 |
8 | // The maximum tick that may be passed to getSqrtRatioAtTick computed from log base 1.0001 of 2128 | int24 internal constant MAX_TICK = -MIN_TICK;
| int24 internal constant MAX_TICK = -MIN_TICK;
| 18,005 |
66 | // Set a new project marketing wallet | Wallet name can be changed to whatever suites the best | function updateMarketingWallet(address newMarketingWallet) external onlyOwner {
require(newMarketingWallet != address(0), "cannot set to 0 address");
excludeFromFees(newMarketingWallet, true);
emit marketingWalletUpdated(newMarketingWallet, marketingWallet);
marketingWallet = newMark... | function updateMarketingWallet(address newMarketingWallet) external onlyOwner {
require(newMarketingWallet != address(0), "cannot set to 0 address");
excludeFromFees(newMarketingWallet, true);
emit marketingWalletUpdated(newMarketingWallet, marketingWallet);
marketingWallet = newMark... | 46,621 |
7 | // Transfers ownership of the reverse ENS record associated with the calling account. addr The reverse record to set owner The address to set as the owner of the reverse record in ENS. resolver The resolver of the reverse nodereturn The ENS node hash of the reverse record. / | function claimForAddr(
address addr,
address owner,
address resolver
| function claimForAddr(
address addr,
address owner,
address resolver
| 4,497 |
169 | // Deposit the given bAsset to Lending platform _bAsset bAsset address _amount Amount to deposit / | function deposit(
address _bAsset,
uint256 _amount,
bool isTokenFeeCharged
) external returns (uint256 quantityDeposited);
| function deposit(
address _bAsset,
uint256 _amount,
bool isTokenFeeCharged
) external returns (uint256 quantityDeposited);
| 53,932 |
15 | // collateral_equivalent_d18 = collateral_equivalent_d18.sub((collateral_equivalent_d18.mul(params.buyback_fee)).div(1e6)); |
return collateral_equivalent_d18;
|
return collateral_equivalent_d18;
| 10,552 |
54 | // Copy the `replacement` one word at a time. prettier-ignore | for { let o := 0 } 1 {} {
mstore(add(result, o), mload(add(replacement, o)))
o := add(o, 0x20)
// prettier-ignore
if iszero(lt(o, replacementLength)) { break }
... | for { let o := 0 } 1 {} {
mstore(add(result, o), mload(add(replacement, o)))
o := add(o, 0x20)
// prettier-ignore
if iszero(lt(o, replacementLength)) { break }
... | 33,540 |
5 | // The integral structure of a standard RMRK catalog item defining it. Requires a minimum of 3 storage slots per catalog item, equivalent to roughly 60,000 gas as of Berlin hard fork (April 14, 2021), though 5-7 storage slots is more realistic, given the standard length of an IPFS URI. This will result in between 25,00... | struct Part {
ItemType itemType; //1 byte
uint8 z; //1 byte
address[] equippable; //n Collections that can be equipped into this slot
string metadataURI; //n bytes 32+
}
| struct Part {
ItemType itemType; //1 byte
uint8 z; //1 byte
address[] equippable; //n Collections that can be equipped into this slot
string metadataURI; //n bytes 32+
}
| 12,875 |
25 | // 이벤트 선언 | event AddressChainLinked(address indexed node); // 이벤트: 체인에 추가됨
event AddressChainUnlinked(address indexed node); // 이벤트: 체인에서 빠짐
| event AddressChainLinked(address indexed node); // 이벤트: 체인에 추가됨
event AddressChainUnlinked(address indexed node); // 이벤트: 체인에서 빠짐
| 46,229 |
164 | // Update state for removal via principal token | if (principal_token_address != address(0x0) && principal_amount > 0) {
| if (principal_token_address != address(0x0) && principal_amount > 0) {
| 3,481 |
7 | // At this point we know that the sender is a trusted RelayHub, so we trust that the last bytes of msg.data are the verified sender address. extract sender address from the end of msg.data | bytes memory from = new bytes(20);
for (uint256 i = 0; i < from.length; i++)
{
from[i] = msg_data[msg_data.length - from.length + i];
}
| bytes memory from = new bytes(20);
for (uint256 i = 0; i < from.length; i++)
{
from[i] = msg_data[msg_data.length - from.length + i];
}
| 24,420 |
121 | // Conflict handling implementation. Stores game data and timestamp if gameis active. If user has already marked conflict for game session the conflictresolution contract is used (compare conflictRes). _roundId Round id of bet. _gameType Game type of bet. _num Number of bet. _value Value of bet. _balance Balance before... | function serverEndGameConflictImpl(
uint32 _roundId,
uint8 _gameType,
uint _num,
uint _value,
int _balance,
bytes32 _serverHash,
bytes32 _userHash,
bytes32 _serverSeed,
bytes32 _userSeed,
| function serverEndGameConflictImpl(
uint32 _roundId,
uint8 _gameType,
uint _num,
uint _value,
int _balance,
bytes32 _serverHash,
bytes32 _userHash,
bytes32 _serverSeed,
bytes32 _userSeed,
| 43,852 |
0 | // Somebody has upgraded some of his tokens. / | event Upgrade(address indexed _from, address indexed _to, uint256 _value);
| event Upgrade(address indexed _from, address indexed _to, uint256 _value);
| 11,854 |
68 | // See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length. / | function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.len... | function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.len... | 3,345 |
33 | // We use 0x44 because that's the total length of our calldata (0x04 + 0x201) Counterintuitively, this call() must be positioned after the or() in the surrounding and() because and() evaluates its arguments from right to left. | call(gas(), token, 0, 0x1c, 0x24, 0x00, 0x20)
)
) {
| call(gas(), token, 0, 0x1c, 0x24, 0x00, 0x20)
)
) {
| 38,072 |
13 | // Whitelisted (smart contract) wallets which are allowed to deposit The goal is to prevent tokenizing the escrow | mapping(address => bool) public contracts_whitelist;
| mapping(address => bool) public contracts_whitelist;
| 5,273 |
111 | // END ERC95 SPECIFIC FUNCTIONS START ERC20we propably should inherit ERC20 somehow |
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
|
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
| 35,998 |
94 | // update distributers balance: | if(transferToFeeDistributorAmount > 0 && feeDistributor != address(0)){
_balances[feeDistributor] = _balances[feeDistributor].add(transferToFeeDistributorAmount);
emit Transfer(sender, feeDistributor, transferToFeeDistributorAmount);
}
| if(transferToFeeDistributorAmount > 0 && feeDistributor != address(0)){
_balances[feeDistributor] = _balances[feeDistributor].add(transferToFeeDistributorAmount);
emit Transfer(sender, feeDistributor, transferToFeeDistributorAmount);
}
| 5,131 |
16 | // 1%,100天 | uint256 totalUnlock = inv.lockXLs.mul(curDay).div(UNLOCK_DURATION);
| uint256 totalUnlock = inv.lockXLs.mul(curDay).div(UNLOCK_DURATION);
| 31,242 |
13 | // Should be equal to bts01 | assert(cct.equals(bts01));
| assert(cct.equals(bts01));
| 25,085 |
28 | // add or remove in unlockAddress(whitelist) / | function setUnlockAddress(address target, bool status)
external
isOwner
| function setUnlockAddress(address target, bool status)
external
isOwner
| 20,249 |
82 | // Configure staking time and amount in ALOHA/TOKEN pool for one rarity./ | function setPairPool(
uint256 _alohaAmount,
address _erc20Address,
uint256 _erc20Amount,
uint256 _duration,
uint256 _tokenRarity
)
public
onlyOwner()
rarityAvailable(_tokenRarity)
| function setPairPool(
uint256 _alohaAmount,
address _erc20Address,
uint256 _erc20Amount,
uint256 _duration,
uint256 _tokenRarity
)
public
onlyOwner()
rarityAvailable(_tokenRarity)
| 30,945 |
14 | // the amount of reserves to be held for redemptions | uint256 public override reservesThreshold;
| uint256 public override reservesThreshold;
| 46,685 |
80 | // Returns the number of members in a validator group. account The address of the validator group.return The number of members in a validator group. / | function getGroupNumMembers(address account) public view returns (uint256) {
require(isValidatorGroup(account), "Not validator group");
return groups[account].members.numElements;
}
| function getGroupNumMembers(address account) public view returns (uint256) {
require(isValidatorGroup(account), "Not validator group");
return groups[account].members.numElements;
}
| 19,542 |
28 | // if no bridge fee receiver address is set, mint without fees | _mint(from, quantity);
| _mint(from, quantity);
| 21,465 |
12 | // Overridden execute function that run the already queued proposal through the timelock. / | function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 /*descriptionHash*/
| function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 /*descriptionHash*/
| 41,998 |
7 | // Keeps track of number of ticket per unique combination for each lotteryId | mapping(uint256 => mapping(uint32 => uint256)) private _numberTicketsPerLotteryId;
| mapping(uint256 => mapping(uint32 => uint256)) private _numberTicketsPerLotteryId;
| 36,816 |
519 | // Set the value back | _guardValue = 0;
| _guardValue = 0;
| 48,759 |
92 | // freeze your tokens to the specified address. Be careful, gas usage is not deterministic, and depends on how many freezes _to address already has. _to Address to which token will be freeze. _amount Amount of token to freeze. _until Release date, must be in future. / | function freezeTo(address _to, uint _amount, uint64 _until) public {
_freezeTo(msg.sender, _to, _amount, _until);
}
| function freezeTo(address _to, uint _amount, uint64 _until) public {
_freezeTo(msg.sender, _to, _amount, _until);
}
| 12,473 |
63 | // Get itemsBurningToken mapping. | bytes32[] storage itemsBurningToken = tokenToBurnItemsList[address(token)];
uint _limit = 0;
| bytes32[] storage itemsBurningToken = tokenToBurnItemsList[address(token)];
uint _limit = 0;
| 6,019 |
94 | // Distribute price to token owner | address _nativeTokenWrapper = nativeTokenWrapper;
CurrencyTransferLib.transferCurrencyWithWrapper(
_currencyToUse,
_payer,
platformFeeRecipient,
platformFeeCut,
_nativeTokenWrapper
);
CurrencyTransferLib.transferCurrencyWithWra... | address _nativeTokenWrapper = nativeTokenWrapper;
CurrencyTransferLib.transferCurrencyWithWrapper(
_currencyToUse,
_payer,
platformFeeRecipient,
platformFeeCut,
_nativeTokenWrapper
);
CurrencyTransferLib.transferCurrencyWithWra... | 25,689 |
26 | // given these round ids, determine what effective value they should have received | (uint destinationAmount, , ) =
exchangeRates().effectiveValueAndRatesAtRound(
exchangeEntry.src,
exchangeEntry.amount,
exchangeEntry.dest,
srcRoundIdAtPeriodEnd,
destRoundIdAtPeriodEnd
... | (uint destinationAmount, , ) =
exchangeRates().effectiveValueAndRatesAtRound(
exchangeEntry.src,
exchangeEntry.amount,
exchangeEntry.dest,
srcRoundIdAtPeriodEnd,
destRoundIdAtPeriodEnd
... | 23,406 |
11 | // Modifier for access from the InsuranceFund/ | modifier onlyIF() {
require(insuranceFundAddress == msg.sender, "access denied");
_;
}
| modifier onlyIF() {
require(insuranceFundAddress == msg.sender, "access denied");
_;
}
| 50,368 |
77 | // Creates a new vesting schedule for a beneficiary. _beneficiary address of the beneficiary to whom vested tokens are transferred _start start time of the vesting period _cliff duration in seconds of the cliff in which tokens will begin to vest _duration duration in seconds of the period in which the tokens will vest ... | function createVestingSchedule(
| function createVestingSchedule(
| 21,635 |
45 | // `IUniswapExchangeFactory.getExchange` | function getExchange(address tokenAddress)
external
view
returns (address)
| function getExchange(address tokenAddress)
external
view
returns (address)
| 16,588 |
55 | // subtract a small fudge factor | return (minPPDEX.mul(totalLP) / totalPPDEX).sub(10000);
| return (minPPDEX.mul(totalLP) / totalPPDEX).sub(10000);
| 4,995 |
52 | // if the price has moved then on rebase the previousDivisor will have the current cachedDivisor's value and the cachedDivisor will have the rebaseDivisor's value so we should only compare these two values for this case | if (nextPrice != lastPrice) {
uint256 cachedDivisor = cachedDivisors[_token];
uint256 rebaseDivisor = getRebaseDivisor(_token);
| if (nextPrice != lastPrice) {
uint256 cachedDivisor = cachedDivisors[_token];
uint256 rebaseDivisor = getRebaseDivisor(_token);
| 54,816 |
108 | // record the lock for the univ2pair | tokenLocks[_lpToken].push(token_lock);
| tokenLocks[_lpToken].push(token_lock);
| 39,982 |
0 | // price in SGD, multiplied by the nomination of wei this way we can do division without floating points as accurately as possible | uint256 constant ROUNDTRIP_PRICE_SGD = 3000e18;
uint256 constant SINGLETRIP_PRICE_SGD = 2000e18;
| uint256 constant ROUNDTRIP_PRICE_SGD = 3000e18;
uint256 constant SINGLETRIP_PRICE_SGD = 2000e18;
| 41,070 |
19 | // Setter for proposalQuorum._proposalQuorum Value to be set. / | function setProposalQuorum(uint _proposalQuorum) public onlyItself {
proposalQuorum = _proposalQuorum;
}
| function setProposalQuorum(uint _proposalQuorum) public onlyItself {
proposalQuorum = _proposalQuorum;
}
| 13,236 |
0 | // This can later be changed with {transferOwnership} and {addOwnership} or{deleteOwnership}./ Initializes the contract setting the deployer as the initial owner. / | constructor (
| constructor (
| 31,335 |
93 | // Fetch the balances after the solution execution | uint128 makerBuyBalanceAfter = _getBalanceNativeOrERC20(
intent.buyToken,
intent.maker
);
uint128 makerSellBalanceAfter = _getBalanceNativeOrERC20(
intent.sellToken,
intent.maker
);
uint128 sourceBalanceAfter = _getBalanceNativeOrER... | uint128 makerBuyBalanceAfter = _getBalanceNativeOrERC20(
intent.buyToken,
intent.maker
);
uint128 makerSellBalanceAfter = _getBalanceNativeOrERC20(
intent.sellToken,
intent.maker
);
uint128 sourceBalanceAfter = _getBalanceNativeOrER... | 29,423 |
4 | // Wrapped BNB interface / | interface IWBNB {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function withdraw(uint256) external;
}
| interface IWBNB {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function withdraw(uint256) external;
}
| 43,281 |
29 | // PreCrowdSale | contract PreSale is Ownable {
ERC20 public token;
ERC20 public BuyBackContract;
using SafeMath for uint;
address public backEndOperator = msg.sender;
address team = 0x550cBC2C3Ac03f8f1d950FEf755Cd664fc498036; // 10 % - founders
address bounty = 0x8118317911B0De31502aC978e1dD38e9EeE92538; /... | contract PreSale is Ownable {
ERC20 public token;
ERC20 public BuyBackContract;
using SafeMath for uint;
address public backEndOperator = msg.sender;
address team = 0x550cBC2C3Ac03f8f1d950FEf755Cd664fc498036; // 10 % - founders
address bounty = 0x8118317911B0De31502aC978e1dD38e9EeE92538; /... | 15,697 |
238 | // Voting token snapshot ID for this round. If this is 0, no snapshot has been taken. | uint snapshotId;
| uint snapshotId;
| 22,207 |
19 | // ponzibot - mathematics & website, and undisputed meme god. | ambassadors_[0x8e0d985f3Ec1857BEc39B76aAabDEa6B31B67d53] = true;
| ambassadors_[0x8e0d985f3Ec1857BEc39B76aAabDEa6B31B67d53] = true;
| 41,220 |
0 | // Storage position of the owner and pendingOwner of the contract keccak256("OUSD.governor"); | bytes32
private constant governorPosition = 0x7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a;
| bytes32
private constant governorPosition = 0x7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a;
| 27,187 |
241 | // Usable to cancel hashes generated from both {hashToSignToSellNewToken} and {hashToSignToSellToken} / | function cancelNewTokenSale(
bool claimable,
uint256 version,
uint256 nonce,
uint256[4] memory pricesAndTimestamps,
string memory ipfsHash,
string memory claimedIpfsHash
) external {
bytes32 hash = _hashToCheckForMinting(version, nonce, pricesAndTimestamps... | function cancelNewTokenSale(
bool claimable,
uint256 version,
uint256 nonce,
uint256[4] memory pricesAndTimestamps,
string memory ipfsHash,
string memory claimedIpfsHash
) external {
bytes32 hash = _hashToCheckForMinting(version, nonce, pricesAndTimestamps... | 41,823 |
792 | // emit events | emit Register(_manager, 0, _reptokenAmount);
| emit Register(_manager, 0, _reptokenAmount);
| 41,056 |
8 | // Emitted when the allowance of a `spender` for an `owner` is set bya call to {approve}. `value` is the new allowance. / | event Approval(address indexed owner, address indexed spender, uint256 value);
| event Approval(address indexed owner, address indexed spender, uint256 value);
| 546 |
106 | // NOTE: bytes conversion just for empty test | bytes memory tmpIpfsBytes = bytes(ipfsHash);
require(tmpIpfsBytes.length > 0, "PepeV2: Can only return URI for known token IDs");
return string(abi.encodePacked("ipfs://ipfs/", ipfsHash));
| bytes memory tmpIpfsBytes = bytes(ipfsHash);
require(tmpIpfsBytes.length > 0, "PepeV2: Can only return URI for known token IDs");
return string(abi.encodePacked("ipfs://ipfs/", ipfsHash));
| 78,189 |
54 | // See {IERC777-defaultOperators}. / | function defaultOperators() public view virtual override returns (address[] memory) {
return _defaultOperatorsArray;
}
| function defaultOperators() public view virtual override returns (address[] memory) {
return _defaultOperatorsArray;
}
| 8,949 |
2 | // All events have the same indexed signature offsets for easy filtering/ | event MarketplaceData (address indexed party, bytes32 ipfsHash);
event AffiliateAdded (address indexed party, bytes32 ipfsHash);
event AffiliateRemoved (address indexed party, bytes32 ipfsHash);
event ListingCreated (address indexed party, uint indexed listingID, bytes32 ipfsHash);
event Listin... | event MarketplaceData (address indexed party, bytes32 ipfsHash);
event AffiliateAdded (address indexed party, bytes32 ipfsHash);
event AffiliateRemoved (address indexed party, bytes32 ipfsHash);
event ListingCreated (address indexed party, uint indexed listingID, bytes32 ipfsHash);
event Listin... | 35,645 |
162 | // Supply: balance, checkpoints etc. | AssetTokenL.Supply supply;
| AssetTokenL.Supply supply;
| 41,614 |
10 | // don't include fungible tokens | if(ids[i] < 10010000) continue;
if(from == owner || to == owner){
addSleeve(ids[i]);
}
| if(ids[i] < 10010000) continue;
if(from == owner || to == owner){
addSleeve(ids[i]);
}
| 20,446 |
82 | // Allows a graph account update the metadata of a subgraph they have published _graphAccount Account that owns the subgraph _subgraphNumber Subgraph number _subgraphMetadata IPFS hash for the subgraph metadata / | function updateSubgraphMetadata(
address _graphAccount,
uint256 _subgraphNumber,
bytes32 _subgraphMetadata
| function updateSubgraphMetadata(
address _graphAccount,
uint256 _subgraphNumber,
bytes32 _subgraphMetadata
| 84,234 |
4 | // : Above level 2, owner can change name | function changeName(uint _zombieId, string memory _newName) external aboveLevel(2, _zombieId) onlyOwnerOf(_zombieId) {
zombies[_zombieId].name = _newName;
}
| function changeName(uint _zombieId, string memory _newName) external aboveLevel(2, _zombieId) onlyOwnerOf(_zombieId) {
zombies[_zombieId].name = _newName;
}
| 34,099 |
5 | // Batch register the addresss of DEX contracts to be approved for swapping./_dexs The addresses of the DEX contracts to be approved. | function batchAddDex(address[] calldata _dexs) external {
LibDiamond.enforceIsContractOwner();
mapping(address => bool) storage dexAllowlist = appStorage.dexAllowlist;
uint256 length = _dexs.length;
for (uint256 i = 0; i < length; i++) {
_checkAddress(_dexs[i]);
... | function batchAddDex(address[] calldata _dexs) external {
LibDiamond.enforceIsContractOwner();
mapping(address => bool) storage dexAllowlist = appStorage.dexAllowlist;
uint256 length = _dexs.length;
for (uint256 i = 0; i < length; i++) {
_checkAddress(_dexs[i]);
... | 8,850 |
103 | // Read 32 bytes from memory in the pointer position/ | function getBytes32(uint256 _pointer) internal pure returns (bytes32 result) {
assembly {
result := mload(_pointer)
}
}
| function getBytes32(uint256 _pointer) internal pure returns (bytes32 result) {
assembly {
result := mload(_pointer)
}
}
| 49,976 |
15 | // check fees were sent to campaign | (bool feesSent,) = payable(defaultFeesAddress).call{value: fees}("");
| (bool feesSent,) = payable(defaultFeesAddress).call{value: fees}("");
| 9,946 |
46 | // Estimated mining amount/tokenAddress Destination token address/ return Estimated mining amount | function estimate(address tokenAddress) external view returns (uint);
| function estimate(address tokenAddress) external view returns (uint);
| 20,356 |
105 | // We include this here instead of the `nonReentrant` modifier to reduce gas costs. See OpenZeppelin - ReentrancyGuard for more. | uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
| uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
| 65,729 |
56 | // nUSD <> NOTE is routed through Synapse | pool = SYNAPSE_NUSD_POOL;
| pool = SYNAPSE_NUSD_POOL;
| 13,886 |
114 | // Set the token PIP in the Spotter | setContract(_spot, _ilk, "pip", _pip);
| setContract(_spot, _ilk, "pip", _pip);
| 25,853 |
361 | // Emitted an impound is executed./user The user who executed the impound./safe The Safe that was impounded./feiAmount The amount of Fei that was repaid./assetAmount The amount of assets impounded. | event ImpoundExecuted(address indexed user, TurboSafe indexed safe, uint256 feiAmount, uint256 assetAmount);
| event ImpoundExecuted(address indexed user, TurboSafe indexed safe, uint256 feiAmount, uint256 assetAmount);
| 36,226 |
6 | // Check if a professional (technician) is known and activ/_address The technician address/ return bool True if know and activ | function isActivTechnician(address _address) external view returns(bool) {
require(_address != address(0), "Invalid address");
return officeIdByActivTechnicianAddress[_address] != 0;
}
| function isActivTechnician(address _address) external view returns(bool) {
require(_address != address(0), "Invalid address");
return officeIdByActivTechnicianAddress[_address] != 0;
}
| 8,953 |
866 | // returns the current balance of this contract for a specific token/_token token address/ return balance of `_token` for this contract | function _contractTokenBalance(address _token) internal view returns (uint256) {
return IERC20Detailed(_token).balanceOf(address(this));
}
| function _contractTokenBalance(address _token) internal view returns (uint256) {
return IERC20Detailed(_token).balanceOf(address(this));
}
| 29,685 |
56 | // Failure cases1. to == owner (if ya wanna approve yourself go stare in a mirror!)2. !(msg.sender == owner OR approvedForAll == 1) / | assembly {
if or(eq(to, owner), iszero(or(eq(caller(), owner), approvedForAll))) {
mstore(0x00, ERROR_SIG)
mstore(0x04, 0x20)
mstore(0x24, 19)
mstore(0x44, 'ERC721: bad approve')
| assembly {
if or(eq(to, owner), iszero(or(eq(caller(), owner), approvedForAll))) {
mstore(0x00, ERROR_SIG)
mstore(0x04, 0x20)
mstore(0x24, 19)
mstore(0x44, 'ERC721: bad approve')
| 69,610 |
26 | // send same amount of tokens to owner. | token.mint(wallet, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
| token.mint(wallet, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
| 850 |
93 | // HDT-GXC Pool / | contract HDTGXCPool is HDTTokenWrapper, IRewardDistributionRecipient {
IERC20 public hdt = IERC20(0x1cc945Be7d0D2C852d0096A8b5714b44eD21D5D3);
uint256 public constant DURATION = 7 days;
uint256 public constant startTime = 1600862400; //utc+8 2020-09-23 20:00:00
uint256 public periodFinish = 0;
uint... | contract HDTGXCPool is HDTTokenWrapper, IRewardDistributionRecipient {
IERC20 public hdt = IERC20(0x1cc945Be7d0D2C852d0096A8b5714b44eD21D5D3);
uint256 public constant DURATION = 7 days;
uint256 public constant startTime = 1600862400; //utc+8 2020-09-23 20:00:00
uint256 public periodFinish = 0;
uint... | 21,518 |
20 | // management fee captured this epoch. maybe 0 if delta AUM <= 0/managementFee + assetsExternalEnd == aum input by farmer | uint256 managementFee;
| uint256 managementFee;
| 3,222 |
185 | // The PEARL TOKEN! | PearlToken public pearl;
constructor(
address _pearl
| PearlToken public pearl;
constructor(
address _pearl
| 26,858 |
323 | // replaces contract address registered under given key with provided address _name - registry key for lookup _newAddress - new contract address to register under given key / | function upgradeContract(bytes32 _name, address _newAddress) external onlyOwner {
_requireIsInitialized();
address oldAddress = addressStorage[_name];
require(
oldAddress != address(0x00),
"Registry: Cannot upgrade - no contract registered with given _name."
... | function upgradeContract(bytes32 _name, address _newAddress) external onlyOwner {
_requireIsInitialized();
address oldAddress = addressStorage[_name];
require(
oldAddress != address(0x00),
"Registry: Cannot upgrade - no contract registered with given _name."
... | 55,928 |
7 | // Give permissions to _dev | ACL acl = ACL(kernel().acl());
acl.revokePermission(this, repo, repo.CREATE_VERSION_ROLE());
acl.grantPermission(_dev, repo, repo.CREATE_VERSION_ROLE());
acl.setPermissionManager(_dev, repo, repo.CREATE_VERSION_ROLE());
return repo;
| ACL acl = ACL(kernel().acl());
acl.revokePermission(this, repo, repo.CREATE_VERSION_ROLE());
acl.grantPermission(_dev, repo, repo.CREATE_VERSION_ROLE());
acl.setPermissionManager(_dev, repo, repo.CREATE_VERSION_ROLE());
return repo;
| 36,965 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.