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
7
// Address of the controller (can be a contract or EOA)
function getController() external returns (address); function getManagerPerformanceFeeBps() external returns (uint16);
function getController() external returns (address); function getManagerPerformanceFeeBps() external returns (uint16);
10,587
5
// The timestamp after which minting may occur
uint256 public mintingAllowedAfter;
uint256 public mintingAllowedAfter;
16,500
28
// if affiliate code was given & its not the same as previously stored
} else if (_affCode != plyr_[_pID].laff) {
} else if (_affCode != plyr_[_pID].laff) {
2,986
130
// oods_coefficients[108]/ mload(add(context, 0x6c20)), res += c_109(f_7(x) - f_7(g^16383z)) / (x - g^16383z).
res := add( res, mulmod(mulmod(/*(x - g^16383 * z)^(-1)*/ mload(add(denominatorsPtr, 0x8a0)),
res := add( res, mulmod(mulmod(/*(x - g^16383 * z)^(-1)*/ mload(add(denominatorsPtr, 0x8a0)),
63,394
33
// Auction RepositoryThis contracts allows auctions to be created for non-fungible tokensMoreover, it includes the basic functionalities of an auction house /
contract registryDID { // Array with all auctions Auction[] public auctions; // Mapping from auction index to user bids mapping(uint256 => Bid[]) public auctionBids; // Mapping from owner to a list of owned auctions mapping(address => uint[]) public auctionOwner; // Bid struct to hol...
contract registryDID { // Array with all auctions Auction[] public auctions; // Mapping from auction index to user bids mapping(uint256 => Bid[]) public auctionBids; // Mapping from owner to a list of owned auctions mapping(address => uint[]) public auctionOwner; // Bid struct to hol...
101
257
// ========== MUTATIVE FUNCTIONS ========== // ---------- Bidding and Refunding ---------- /
) internal { (uint256 longPrice, uint256 shortPrice) = _computePrices(longBids, shortBids, _deposited); prices = Prices(longPrice, shortPrice); emit PricesUpdated(longPrice, shortPrice); }
) internal { (uint256 longPrice, uint256 shortPrice) = _computePrices(longBids, shortBids, _deposited); prices = Prices(longPrice, shortPrice); emit PricesUpdated(longPrice, shortPrice); }
2,703
1
// to check a requirement use require(); function
Certificate.ownerName = _ownerName; Certificate.description = _description; Certificate.grade = _grade;
Certificate.ownerName = _ownerName; Certificate.description = _description; Certificate.grade = _grade;
7,626
27
// set initial tax fee(transfer) fee as 4.20% It is allow 2 digits under point
_taxFee = 420;
_taxFee = 420;
42,398
151
// Validate sent ETH amount
if (_canClaimFreeMint) { require(msg.value == price * (amountToBuy - 1), "Invalid amount of ether for amount to buy"); freeMintClaimed[msg.sender] = true; } else {
if (_canClaimFreeMint) { require(msg.value == price * (amountToBuy - 1), "Invalid amount of ether for amount to buy"); freeMintClaimed[msg.sender] = true; } else {
11,763
37
// Transfers control of the contract to a newOwner. _newOwner The address to transfer ownership to. /
function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
44,895
32
// Returns blocknumber - helps with tests /
function blocknumber() public view returns (uint256 _blockNumber) { return block.number; }
function blocknumber() public view returns (uint256 _blockNumber) { return block.number; }
48,614
184
// @inheritdoc IERC2981 /
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view virtual override returns (address, uint256)
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view virtual override returns (address, uint256)
9,935
55
// Checks if the account should be allowed to borrow the underlying asset of the given market cToken The market to verify the borrow against borrower The account which would borrow the asset borrowAmount The amount of underlying the account would borrowreturn 0 if the borrow is allowed, otherwise a semi-opaque error co...
function borrowAllowed(address cToken, address borrower, uint borrowAmount) external returns (uint) { // Pausing is a very serious situation - we revert to sound the alarms require(!borrowGuardianPaused[cToken], "borrow is paused"); if (!markets[cToken].isListed) { return uint(E...
function borrowAllowed(address cToken, address borrower, uint borrowAmount) external returns (uint) { // Pausing is a very serious situation - we revert to sound the alarms require(!borrowGuardianPaused[cToken], "borrow is paused"); if (!markets[cToken].isListed) { return uint(E...
37,193
445
// gets the aToken contract address for the reserve_reserve the reserve address return the address of the aToken contract/
function getReserveATokenAddress(address _reserve) public view returns (address) { CoreLibrary.ReserveData storage reserve = reserves[_reserve]; return reserve.aTokenAddress; }
function getReserveATokenAddress(address _reserve) public view returns (address) { CoreLibrary.ReserveData storage reserve = reserves[_reserve]; return reserve.aTokenAddress; }
81,145
36
// Send the fee to the developer.
require(token.transfer(fee_claimer, fee));
require(token.transfer(fee_claimer, fee));
37,562
200
// Update an external position and remove and external positions or components if necessary. The logic flows as follows:1) If component is not already added then add component and external position. 2) If component is added but no existing external position using the passed module exists then add the external position....
function editExternalPosition( ICKToken _ckToken, address _component, address _module, int256 _newUnit, bytes memory _data ) internal
function editExternalPosition( ICKToken _ckToken, address _component, address _module, int256 _newUnit, bytes memory _data ) internal
8,902
6
// /
address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
29,263
41
// get taxes
amount = _getFeeBuy(from, amount);
amount = _getFeeBuy(from, amount);
37,663
160
// Gets the protocol fee.// return protocolFee The protocol fee.
function protocolFee() external view returns (uint256 protocolFee);
function protocolFee() external view returns (uint256 protocolFee);
15,220
233
// increase price of the next token to be minted
currentPrice = currentPrice + priceIncrease * mintedTokensWithPriceIncrease;
currentPrice = currentPrice + priceIncrease * mintedTokensWithPriceIncrease;
51,221
288
// Increase admin mint counts
totalAdminMints = totalAdminMints.add(1); emit AdminGenesisMinted(_beneficiary, _msgSender(), tokenId);
totalAdminMints = totalAdminMints.add(1); emit AdminGenesisMinted(_beneficiary, _msgSender(), tokenId);
18,418
221
// Delists pool. pool Address of pool to delist.return `true` if successful. /
function removePool(address pool) external override onlyRole(Roles.CONTROLLER) returns (bool) { address lpToken = ILiquidityPool(pool).getLpToken(); bool removed = _tokenToPools.remove(lpToken); if (removed) { address vault = address(ILiquidityPool(pool).getVault()); ...
function removePool(address pool) external override onlyRole(Roles.CONTROLLER) returns (bool) { address lpToken = ILiquidityPool(pool).getLpToken(); bool removed = _tokenToPools.remove(lpToken); if (removed) { address vault = address(ILiquidityPool(pool).getVault()); ...
51,176
66
// address(uint160(owner)).transfer(amount.mul(houseFee).div(100));
36,807
19
// Сhange minimal pay
function setTokenMinEth(uint _tokenMinEth) public onlyOwner { tokenMinEth = _tokenMinEth; }
function setTokenMinEth(uint _tokenMinEth) public onlyOwner { tokenMinEth = _tokenMinEth; }
48,695
3
// msg.sender sends Ether to repay an account's borrow in a cWrappedNative market The provided Ether is applied towards the borrow balance, any excess is refunded borrower The address of the borrower account to repay on behalf of cWrappedNative_ The address of the cWrappedNative contract to repay in /
function repayBehalfExplicit(address borrower, CWrappedNative cWrappedNative_) public payable { uint256 received = msg.value; uint256 borrows = cWrappedNative_.borrowBalanceCurrent(borrower); if (received > borrows) { cWrappedNative_.repayBorrowBehalfNative.value(borrows)(borrowe...
function repayBehalfExplicit(address borrower, CWrappedNative cWrappedNative_) public payable { uint256 received = msg.value; uint256 borrows = cWrappedNative_.borrowBalanceCurrent(borrower); if (received > borrows) { cWrappedNative_.repayBorrowBehalfNative.value(borrows)(borrowe...
11,735
9
// Operator Events
event AuthorizedOperator(address indexed operator, address indexed tokenHolder); event RevokedOperator(address indexed operator, address indexed tokenHolder); event AuthorizedOperatorByPartition(bytes32 indexed partition, address indexed operator, address indexed tokenHolder); event RevokedOperatorByPar...
event AuthorizedOperator(address indexed operator, address indexed tokenHolder); event RevokedOperator(address indexed operator, address indexed tokenHolder); event AuthorizedOperatorByPartition(bytes32 indexed partition, address indexed operator, address indexed tokenHolder); event RevokedOperatorByPar...
17,126
215
// start next round
rID_++; _rID++; round_[_rID].strt = now; round_[_rID].end = now.add(rndInit_).add(rndGap_); round_[_rID].pot = 0; return(_eventData_);
rID_++; _rID++; round_[_rID].strt = now; round_[_rID].end = now.add(rndInit_).add(rndGap_); round_[_rID].pot = 0; return(_eventData_);
3,068
33
// Body10
assets[33] = [0x000112be647c82fa85f50be447c88fa89f30870014];
assets[33] = [0x000112be647c82fa85f50be447c88fa89f30870014];
5,835
27
// Total supply is current supply + added liquidity
uint256 totalSupply = eToken.totalSupplyUnderlying(); if (amount >= 0) totalSupply += uint256(amount); else totalSupply -= uint256(-amount); uint256 supplyAPY; if (totalSupply != 0) { uint32 futureUtilisationRate = uint32( (totalBorrows * (uint256(ty...
uint256 totalSupply = eToken.totalSupplyUnderlying(); if (amount >= 0) totalSupply += uint256(amount); else totalSupply -= uint256(-amount); uint256 supplyAPY; if (totalSupply != 0) { uint32 futureUtilisationRate = uint32( (totalBorrows * (uint256(ty...
32,560
44
// error found
revert(string(abi.encodePacked("Liquidation failed: ", returnMessage)));
revert(string(abi.encodePacked("Liquidation failed: ", returnMessage)));
39,817
2
// Can be any IPangolinRouter or IUniRouter ...
IPangolinRouter public immutable uniSwapLikeRouter;
IPangolinRouter public immutable uniSwapLikeRouter;
30,902
36
// Direct payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].direct_bonus > 0) { uint256 direct_bonus = users[msg.sender].direct_bonus; if(users[msg.sender].payouts + direct_bonus > max_payout) { direct_bonus = max_payout - users[msg.sender].payouts; }
if(users[msg.sender].payouts < max_payout && users[msg.sender].direct_bonus > 0) { uint256 direct_bonus = users[msg.sender].direct_bonus; if(users[msg.sender].payouts + direct_bonus > max_payout) { direct_bonus = max_payout - users[msg.sender].payouts; }
19,094
4
// transfer the balance from sender's account to another one
function transfer(address _to, uint256 _value) public;
function transfer(address _to, uint256 _value) public;
5,631
64
// Then update the balance array with the new value for the addressreceiving the tokens
uint256 previousBalanceTo = balanceOfAt(_to, block.number); require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow updateValueAtNow(balances[_to], previousBalanceTo + _amount);
uint256 previousBalanceTo = balanceOfAt(_to, block.number); require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow updateValueAtNow(balances[_to], previousBalanceTo + _amount);
36,526
6
// Proposed whitelist
address[] public proposedWhitelist;
address[] public proposedWhitelist;
2,630
56
// tokenBlocked status.
mapping(address => bool) public tokenBlockedStatus;
mapping(address => bool) public tokenBlockedStatus;
63,629
74
// Requires that the deposited amount match or exceed the minimum requirement.
require( _amount >= _term.minimum_deposit, "Deposit is below the minimum principal required for this term" );
require( _amount >= _term.minimum_deposit, "Deposit is below the minimum principal required for this term" );
44,871
32
// check if the system is not in a partiallyPaused state /
function _isNotPartiallyPaused() internal view { require(!systemPartiallyPaused, "Controller: system is partially paused"); }
function _isNotPartiallyPaused() internal view { require(!systemPartiallyPaused, "Controller: system is partially paused"); }
33,809
6
// cid => array of rewardIds used only when admin wants to withdraw
mapping(uint96 => uint96[]) public campaignToRewards;
mapping(uint96 => uint96[]) public campaignToRewards;
13,287
8
// Gets the OpenSea token URI of the given token ID. /
function tokenURI(uint tokenId) external view override returns (string memory) { string memory name = names[tokenId]; if (bytes(name).length == 0) { name = string(abi.encodePacked( baseName, " #", Strings.toString(tokenId) )); ...
function tokenURI(uint tokenId) external view override returns (string memory) { string memory name = names[tokenId]; if (bytes(name).length == 0) { name = string(abi.encodePacked( baseName, " #", Strings.toString(tokenId) )); ...
27,824
7
// To change the approve amount you first have to reduce the addresses'allowance to zero by calling `approve(spender, 0)` if it is notalready 0 to mitigate the race condition described here:https:github.com/ethereum/EIPs/issues/20issuecomment-263524729
require(value == 0 || allowed[msg.sender][spender] == 0); allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true;
require(value == 0 || allowed[msg.sender][spender] == 0); allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true;
4,560
4
// OwnableThe Ownable contract has an owner address, and provides basic authorization functions, this simplifies the implementation of "user permissions"./
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner =...
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner =...
55,569
77
// browser-solidity
OAR = OracleAddrResolverI( 0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA ); return true;
OAR = OracleAddrResolverI( 0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA ); return true;
50,501
14
// Enlisted is when the asset has been approved and added by minting admins.
Enlisted,
Enlisted,
6,623
222
// Get number of trade taker fee block number tiers
function tradeTakerFeesCount() public view returns (uint256)
function tradeTakerFeesCount() public view returns (uint256)
24,844
174
// first 32 bytes, after the length prefix
r := mload(add(sig, 32))
r := mload(add(sig, 32))
28,331
108
// Salvages a token. We should not be able to salvage CRV and husdCRV (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); }
37,651
158
// Testing values
token = new CrowdsaleToken(token_name, token_symbol, token_initial_supply, token_decimals, team_multisig, token_mintable); token.setMintAgent(address(this), true); setFundingCap(fundingCap);
token = new CrowdsaleToken(token_name, token_symbol, token_initial_supply, token_decimals, team_multisig, token_mintable); token.setMintAgent(address(this), true); setFundingCap(fundingCap);
57,302
129
// Verify market's block number equals current block number // Fail gracefully if protocol has insufficient underlying cash //We calculate the new borrower and total borrow balances, failing on overflow: accountBorrowsNew = accountBorrows + borrowAmount totalBorrowsNew = totalBorrows + borrowAmount /
vars.accountBorrows = borrowBalanceStoredInternal(borrower);
vars.accountBorrows = borrowBalanceStoredInternal(borrower);
7,286
131
// Grants `role` to `account`.
* If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(rol...
* If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(rol...
2,010
2
// CANER
_safeMint(address(0xc5E5ec38de39c632f67EbF9795CD1d7D12331799), 14); _safeMint(address(0xc5E5ec38de39c632f67EbF9795CD1d7D12331799), 15); _safeMint(address(0xc5E5ec38de39c632f67EbF9795CD1d7D12331799), 16);
_safeMint(address(0xc5E5ec38de39c632f67EbF9795CD1d7D12331799), 14); _safeMint(address(0xc5E5ec38de39c632f67EbF9795CD1d7D12331799), 15); _safeMint(address(0xc5E5ec38de39c632f67EbF9795CD1d7D12331799), 16);
24,133
13
// The groups of locked tokens
mapping (uint8 => Group) public groups;
mapping (uint8 => Group) public groups;
11,221
34
// Setting to change for existcryptoaddress_
address internal existholdingsaddress_ = 0xac1B6580a175C1f2a4e3220A24e6f65fF3AB8A03;
address internal existholdingsaddress_ = 0xac1B6580a175C1f2a4e3220A24e6f65fF3AB8A03;
44,639
106
// iOVM_BaseCrossDomainMessenger /
interface iOVM_BaseCrossDomainMessenger { /********************** * Contract Variables * **********************/ function xDomainMessageSender() external view returns (address); /******************** * Public Functions * ********************/ /** * Sends a cross domain message...
interface iOVM_BaseCrossDomainMessenger { /********************** * Contract Variables * **********************/ function xDomainMessageSender() external view returns (address); /******************** * Public Functions * ********************/ /** * Sends a cross domain message...
4,328
1
// Initializes contract with initial supply tokens to the creator of the contract
function Advanced( uint256 initialSupply, string tokenName, string tokenSymbol
function Advanced( uint256 initialSupply, string tokenName, string tokenSymbol
19,739
9
// Allocates release tokens to the specified holders. _holders Array of holders of release tokens _amounts Array of amounts of tokens to issue /
function allocate(address[] calldata _holders, uint96[] calldata _amounts) external override onlyOwner
function allocate(address[] calldata _holders, uint96[] calldata _amounts) external override onlyOwner
32,679
165
// add the block to the setup update blocks
_setupUpdateBlocks[setupIndex].push(block.number);
_setupUpdateBlocks[setupIndex].push(block.number);
55,126
7
// data The data to send over using `to.call{value: value}(data)`/ return returnData The transaction's return value.
function transact( uint8 mode, address to, uint value, bytes calldata data ) external returns (bytes memory returnData);
function transact( uint8 mode, address to, uint value, bytes calldata data ) external returns (bytes memory returnData);
9,503
31
// Send eth to tax wallets/
function sendETHToFee(uint256 amount) private { bool result = _devWallet.send(amount.mul(_taxDevPc).div(100)); result = _teamWallet.send(amount.mul(_taxTeamPc).div(100)); }
function sendETHToFee(uint256 amount) private { bool result = _devWallet.send(amount.mul(_taxDevPc).div(100)); result = _teamWallet.send(amount.mul(_taxTeamPc).div(100)); }
12,990
28
// Decodes call data used by createEVMScript method/_evmScriptCallData Encoded tuple: (address[] _rewardTokens, uint256[] _amounts) where/ _rewardTokens - addresses of ERC20 tokens (zero address for ETH) to transfer/ _amounts - corresponding amount of tokens to transfer/ return _rewardTokens Addresses of ERC20 tokens (...
function decodeEVMScriptCallData(bytes memory _evmScriptCallData) external pure returns (address[] memory _rewardTokens, uint256[] memory _amounts)
function decodeEVMScriptCallData(bytes memory _evmScriptCallData) external pure returns (address[] memory _rewardTokens, uint256[] memory _amounts)
42,501
5
// Function called by buyer to deposit payment token in the contract in exchange for Silica tokens/amountSpecified is the amount that the buyer wants to deposit in exchange for Silica tokens
function deposit(uint256 amountSpecified) external returns (uint256);
function deposit(uint256 amountSpecified) external returns (uint256);
28,452
1
// get the contract address _nameKey is the key for the contract address mapping /
function getAddress(string _nameKey) view public returns(address);
function getAddress(string _nameKey) view public returns(address);
38,429
23
// Getters
function getResolution(uint128 resolutionId) public constant returns(uint128,address, string, uint128, uint128, address[], uint128, uint128, bool){ Resolution storage resolution = resolutions[resolutionId]; return(resolutionId,resolution.bonderAddress, resolution.message, resolution.stake, resolutio...
function getResolution(uint128 resolutionId) public constant returns(uint128,address, string, uint128, uint128, address[], uint128, uint128, bool){ Resolution storage resolution = resolutions[resolutionId]; return(resolutionId,resolution.bonderAddress, resolution.message, resolution.stake, resolutio...
21,074
83
// Fields:
enum CrowdsaleStage { BT, // Bounty PS, // Pre sale TS_R1, // Token sale round 1 TS_R2, // Token sale round 2 TS_R3, // Token sale round 3 EX, // Exchange P2P_EX // P2P Exchange }
enum CrowdsaleStage { BT, // Bounty PS, // Pre sale TS_R1, // Token sale round 1 TS_R2, // Token sale round 2 TS_R3, // Token sale round 3 EX, // Exchange P2P_EX // P2P Exchange }
23,445
364
// copy the buffer in the reversed order
for(p = 0; p < result.length; p++) { // copy from the beginning of the original buffer // to the end of resulting smaller buffer result[result.length - p - 1] = buf[p]; } // construct string and return return string(result); } /** * @dev Concatenates two strings `s1` and `s2`, for example, if *...
for(p = 0; p < result.length; p++) { // copy from the beginning of the original buffer // to the end of resulting smaller buffer result[result.length - p - 1] = buf[p]; } // construct string and return return string(result); } /** * @dev Concatenates two strings `s1` and `s2`, for example, if *...
42,930
11
// ERC721 token receiver interface Interface for any contract that wants to support safeTransfers from ERC721 asset contracts. /
contract ERC721Receiver { /** * @dev Magic value to be returned upon successful reception of an NFT * Equals to `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`, * which can be also obtained as `ERC721Receiver(0).onERC721Received.selector` */ bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;...
contract ERC721Receiver { /** * @dev Magic value to be returned upon successful reception of an NFT * Equals to `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`, * which can be also obtained as `ERC721Receiver(0).onERC721Received.selector` */ bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;...
5,118
203
// The _from is going to transfer all of his tokens
if (balances[_from] <= _amount) { return true; }
if (balances[_from] <= _amount) { return true; }
23,542
83
// Remove the array if no more assets are owned to prevent pollution
if (_assetsOf[from].length == 0) { delete _assetsOf[from]; }
if (_assetsOf[from].length == 0) { delete _assetsOf[from]; }
11,853
135
// setMerchantWallet allows owner to change address of MerchantWallet._newWallet Address of new MerchantWallet contract /
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner { require(address(_newWallet) != 0x0); require(_newWallet.merchantIdHash() == merchantIdHash); merchantWallet = _newWallet; }
function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner { require(address(_newWallet) != 0x0); require(_newWallet.merchantIdHash() == merchantIdHash); merchantWallet = _newWallet; }
24,993
34
// subBalance(token, msg.sender, amount);subtracts the withdrawal amount from user balance
if (!pToken(token).redeem(amount, destinationAddress)) revert(); emit pTokenRedeemEvent(token, msg.sender, amount, destinationAddress);
if (!pToken(token).redeem(amount, destinationAddress)) revert(); emit pTokenRedeemEvent(token, msg.sender, amount, destinationAddress);
18,266
4
// UUPS (Universal Upgradeable Proxy Standard) Shared Library /
library UUPSUtils { /** * @dev Implementation slot constant. * Using https://eips.ethereum.org/EIPS/eip-1967 standard * Storage slot 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc * (obtained as bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)). */ by...
library UUPSUtils { /** * @dev Implementation slot constant. * Using https://eips.ethereum.org/EIPS/eip-1967 standard * Storage slot 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc * (obtained as bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)). */ by...
15,534
365
// The interface for the Uniswap V3 Factory/The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
interface IUniswapV3Factory { /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param ...
interface IUniswapV3Factory { /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param ...
28,374
6
// Timestamp for when staking rewards expire
uint256 public stakingEndTimestamp;
uint256 public stakingEndTimestamp;
17,753
2
// block.blockhash is deprecated
hashnum = blockhash(num);
hashnum = blockhash(num);
50,823
55
// query if the non-reentrancy guard for receive() is on return true if the guard is on. false otherwise
function isReceivingPayload() external view returns (bool);
function isReceivingPayload() external view returns (bool);
39,708
33
// Compute Evidence Hash Load chunk size and salt size
bytes4 test; // Temporarily contains salt size and chunk size
bytes4 test; // Temporarily contains salt size and chunk size
50,860
24
// 경매가 진행중인지 확인하는 internal method _auction 경매 정보
function _isOnAuction(Auction storage _auction) internal view returns (bool)
function _isOnAuction(Auction storage _auction) internal view returns (bool)
25,148
155
// Input validation: zU
require(isOnCurve(_precomputed.pointUZxCoord, _precomputed.pointUZyCoord), "Point z*U is not a valid EC point" ); require(ecmulVerify( UMBRAL_PARAMETER_U_XCOORD, // U_x
require(isOnCurve(_precomputed.pointUZxCoord, _precomputed.pointUZyCoord), "Point z*U is not a valid EC point" ); require(ecmulVerify( UMBRAL_PARAMETER_U_XCOORD, // U_x
3,924
21
// Emits {TokenOperatorSet} event /
function setTokenOperator(address nftAddress, uint256 nftId) external { PoolNFT storage nft = poolNft[ uint256(keccak256(abi.encodePacked(nftAddress, nftId))) ]; require( msg.sender == nft.originalOwner, "Caller should be original owner of the nft" ...
function setTokenOperator(address nftAddress, uint256 nftId) external { PoolNFT storage nft = poolNft[ uint256(keccak256(abi.encodePacked(nftAddress, nftId))) ]; require( msg.sender == nft.originalOwner, "Caller should be original owner of the nft" ...
5,312
5
// Creates new struct and saves in storage. We leave out the mapping type.
campaigns[campaignID] = Campaign(beneficiary, goal, 0, 0);
campaigns[campaignID] = Campaign(beneficiary, goal, 0, 0);
41,768
69
// Window start time
uint256 started_at,
uint256 started_at,
8,297
173
// Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (_mint), /
function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < currentIndex; }
function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < currentIndex; }
27,685
157
// Delegate votes from `msg.sender` to `delegatee`delegatee The address to delegate votes to/
function delegate(address delegatee) external { return _delegate(msg.sender, delegatee); }
function delegate(address delegatee) external { return _delegate(msg.sender, delegatee); }
107
89
// Function to stop minting new tokens.
* NOTE: restricting access to owner only. See {ERC20Mintable-finishMinting}. */ function _finishMinting() internal override onlyOwner { super._finishMinting(); }
* NOTE: restricting access to owner only. See {ERC20Mintable-finishMinting}. */ function _finishMinting() internal override onlyOwner { super._finishMinting(); }
13,357
12
// notarize a new record_record the record to notarize/
function notarize(bytes _record) public payable callHasNotarisationCost
function notarize(bytes _record) public payable callHasNotarisationCost
41,675
201
// withdraw the tokens from Join
IJoin(_joinAddr).exit(address(this), _amount);
IJoin(_joinAddr).exit(address(this), _amount);
19,544
257
// Get a reference to the amount of unstaked tickets.
uint256 _unlockedStakedTickets = stakedBalanceOf[_holder][_projectId] - lockedBalanceOf[_holder][_projectId];
uint256 _unlockedStakedTickets = stakedBalanceOf[_holder][_projectId] - lockedBalanceOf[_holder][_projectId];
71,337
4
// check if contract (token, exchange) is actually a smart contract and not a 'regular' address
function isAContract(address contractAddr) internal view returns (bool) { uint256 codeSize; assembly { codeSize := extcodesize(contractAddr) } // contract code size return codeSize > 0; // Might not be 100% foolproof, but reliable enough for an early return in 'view' functions }
function isAContract(address contractAddr) internal view returns (bool) { uint256 codeSize; assembly { codeSize := extcodesize(contractAddr) } // contract code size return codeSize > 0; // Might not be 100% foolproof, but reliable enough for an early return in 'view' functions }
25,540
41
// Flag marking whether the proposal has been canceled
bool canceled;
bool canceled;
8,291
510
// For easy graphing historical epoch rewards
mapping(uint => uint256) public epochRewards;
mapping(uint => uint256) public epochRewards;
34,083
90
// return The symbol of the token /
function symbol() public view override returns (string memory) { return _symbol; }
function symbol() public view override returns (string memory) { return _symbol; }
8,577
1,171
// take fee
uint dfsFee = getFee(exData.srcAmount, exData.srcAddr); exData.srcAmount = sub(exData.srcAmount, dfsFee);
uint dfsFee = getFee(exData.srcAmount, exData.srcAddr); exData.srcAmount = sub(exData.srcAmount, dfsFee);
63,380
36
// Collect founder's fee if first time
if (prizePool == 0) { collectFee();
if (prizePool == 0) { collectFee();
48,772
34
// Emitted on flashLoan()target The address of the flash loan receiver contractinitiator The address initiating the flash loanamount The amount flash borrowedpremium The flash loan fee/ Addresses for stkAAVE distribution from Aave
address public constant stkAAVE = address(0x4da27a545c0c5B758a6BA100e3a049001de870f5); address private aToken;
address public constant stkAAVE = address(0x4da27a545c0c5B758a6BA100e3a049001de870f5); address private aToken;
65,950
165
// Get minter role address/ return minter role address slither-disable-next-line external-function
function getMinter() public view returns (address) { return _minter; }
function getMinter() public view returns (address) { return _minter; }
44,571
2
// TODO: consider starting with the 3 firdt numbers [0,1,1] Set the first two numbers of the sequence [0, 1]
tokenCounter = 0; root = 19733998167332688543494136895553318319796515049857122158390636597337826955912; verifier = _verifier.Verifier(verifierAddr);
tokenCounter = 0; root = 19733998167332688543494136895553318319796515049857122158390636597337826955912; verifier = _verifier.Verifier(verifierAddr);
41,688
15
// RiscVDecoder/Felipe Argento/Contract responsible for decoding the riscv's instructionsIt applies different bitwise operations and masks to reachspecific positions and use that positions to identify thecorrect function to be executed
library RiscVDecoder { /// @notice Get the instruction's RD /// @param insn Instruction function insnRd(uint32 insn) public pure returns(uint32) { return (insn >> 7) & 0x1F; } /// @notice Get the instruction's RS1 /// @param insn Instruction function insnRs1(uint32 insn) public pure...
library RiscVDecoder { /// @notice Get the instruction's RD /// @param insn Instruction function insnRd(uint32 insn) public pure returns(uint32) { return (insn >> 7) & 0x1F; } /// @notice Get the instruction's RS1 /// @param insn Instruction function insnRs1(uint32 insn) public pure...
20,524
7
// SafeMath Math operations with safety checks that throw on error /
library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws...
library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws...
32,913
11
// if proposal passes and its an erc721 token - use NFT Extension
if (voteResult == IVoting.VotingState.PASS) { BankExtension bank = BankExtension(dao.getExtensionAddress(DaoHelper.BANK)); require( bank.isInternalToken(DaoHelper.UNITS), "UNITS token is not an internal token" ); ba...
if (voteResult == IVoting.VotingState.PASS) { BankExtension bank = BankExtension(dao.getExtensionAddress(DaoHelper.BANK)); require( bank.isInternalToken(DaoHelper.UNITS), "UNITS token is not an internal token" ); ba...
8,061
2
// Nombre total de campagnes de crowdfunding créées (0 au départ)
uint256 public numberOfCampaigns = 0;
uint256 public numberOfCampaigns = 0;
30,816