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 |
|---|---|---|---|---|
79 | // The timestamp when Reward mining ends. | uint256 public endTimestamp;
event feeAddressUpdated(address);
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
| uint256 public endTimestamp;
event feeAddressUpdated(address);
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
| 12,180 |
16 | // Back1 | assets[16] = [0x112c5f11c4ef7bdef7c4511c4514c4512c4513c4513c451445314c5710190014, 0x89e2d];
| assets[16] = [0x112c5f11c4ef7bdef7c4511c4514c4512c4513c4513c451445314c5710190014, 0x89e2d];
| 5,818 |
46 | // payee can cancel when request is not canceled yet | bool isPayeeAndNotCanceled = requestCore.getPayeeAddress(_requestId,0)==msg.sender && requestCore.getState(_requestId)!=RequestCore.State.Canceled;
require(isPayerAndCreated || isPayeeAndNotCanceled);
| bool isPayeeAndNotCanceled = requestCore.getPayeeAddress(_requestId,0)==msg.sender && requestCore.getState(_requestId)!=RequestCore.State.Canceled;
require(isPayerAndCreated || isPayeeAndNotCanceled);
| 40,087 |
36 | // remove all values / | function clear(Set storage _obj)
internal
| function clear(Set storage _obj)
internal
| 41,759 |
10 | // Returns a previous answer updated on the Oracle. _id of roundreturn price / | function getPreviousAnswer(uint80 _id) public view returns (int256) {
(uint80 roundID, int256 price, , , ) = aggregatorContract.getRoundData(_id);
require(
_id <= roundID,
"ChainlinkOracle::getPreviousAnswer: not enough history"
);
return price;
}
| function getPreviousAnswer(uint80 _id) public view returns (int256) {
(uint80 roundID, int256 price, , , ) = aggregatorContract.getRoundData(_id);
require(
_id <= roundID,
"ChainlinkOracle::getPreviousAnswer: not enough history"
);
return price;
}
| 21,153 |
4 | // our contract name. | contract SchoolTrip{
bool public tripDecider; //boolean variable that will initiate with intial default value false;
//pure keyword - function will not alter the storage and even not read storage state.
//internal keyword - Only accessible to this contract and contracts deriving from this contract.
function tripAnalyzer(uint256 studentCount, bool principleApproval, bool legalApproval) internal pure returns(bool){
/*Trip decider logic
Operators && and || adhere to the common short-circuit rules.
i.e if in an expression a(x) | | b(y) the expression a(x) evaluates to true,
the b(y) expression will not be evaluated
*/
return (studentCount >= 100 && (principleApproval || legalApproval));
}
function checkTripStatus() public returns(bool){
//...Other logical part here
return tripDecider = tripAnalyzer(100,true,false);
}
}
| contract SchoolTrip{
bool public tripDecider; //boolean variable that will initiate with intial default value false;
//pure keyword - function will not alter the storage and even not read storage state.
//internal keyword - Only accessible to this contract and contracts deriving from this contract.
function tripAnalyzer(uint256 studentCount, bool principleApproval, bool legalApproval) internal pure returns(bool){
/*Trip decider logic
Operators && and || adhere to the common short-circuit rules.
i.e if in an expression a(x) | | b(y) the expression a(x) evaluates to true,
the b(y) expression will not be evaluated
*/
return (studentCount >= 100 && (principleApproval || legalApproval));
}
function checkTripStatus() public returns(bool){
//...Other logical part here
return tripDecider = tripAnalyzer(100,true,false);
}
}
| 12,408 |
1 | // Token address => isWhitelisted or not | mapping(address => bool) public isTokenWhitelisted;
mapping(bytes32 => bool) public isTokenSymbolWhitelisted;
mapping(bytes32 => bytes32[]) public tokenPairs; // A token symbol pair made of 'FIRST' => 'SECOND'
mapping(bytes32 => address) public tokenAddressBySymbol; // Symbol => address of the token
mapping(uint256 => Order) public orderById; // Id => trade object
mapping(uint256 => uint256) public buyOrderIndexById; // Id => index inside the buyOrders array
mapping(uint256 => uint256) public sellOrderIndexById; // Id => index inside the sellOrders array
mapping(address => address) public escrowByUserAddress; // User address => escrow contract address
| mapping(address => bool) public isTokenWhitelisted;
mapping(bytes32 => bool) public isTokenSymbolWhitelisted;
mapping(bytes32 => bytes32[]) public tokenPairs; // A token symbol pair made of 'FIRST' => 'SECOND'
mapping(bytes32 => address) public tokenAddressBySymbol; // Symbol => address of the token
mapping(uint256 => Order) public orderById; // Id => trade object
mapping(uint256 => uint256) public buyOrderIndexById; // Id => index inside the buyOrders array
mapping(uint256 => uint256) public sellOrderIndexById; // Id => index inside the sellOrders array
mapping(address => address) public escrowByUserAddress; // User address => escrow contract address
| 6,571 |
5 | // Initialization methodvoteFactory Voting contract address/ | constructor (address voteFactory) public {
Nest_3_VoteFactory voteFactoryMap = Nest_3_VoteFactory(address(voteFactory));
_voteFactory = voteFactoryMap;
_offerPrice = Nest_3_OfferPrice(address(voteFactoryMap.checkAddress("nest.v3.offerPrice")));
_miningContract = Nest_3_MiningContract(address(voteFactoryMap.checkAddress("nest.v3.miningSave")));
_abonus = Nest_3_Abonus(voteFactoryMap.checkAddress("nest.v3.abonus"));
_nestToken = ERC20(voteFactoryMap.checkAddress("nest"));
_NNcontract = Nest_NodeAssignment(address(voteFactoryMap.checkAddress("nodeAssignment")));
_coderAddress = voteFactoryMap.checkAddress("nest.v3.coder");
require(_nestToken.approve(address(_NNcontract), uint256(10000000000 ether)), "Authorization failed");
}
| constructor (address voteFactory) public {
Nest_3_VoteFactory voteFactoryMap = Nest_3_VoteFactory(address(voteFactory));
_voteFactory = voteFactoryMap;
_offerPrice = Nest_3_OfferPrice(address(voteFactoryMap.checkAddress("nest.v3.offerPrice")));
_miningContract = Nest_3_MiningContract(address(voteFactoryMap.checkAddress("nest.v3.miningSave")));
_abonus = Nest_3_Abonus(voteFactoryMap.checkAddress("nest.v3.abonus"));
_nestToken = ERC20(voteFactoryMap.checkAddress("nest"));
_NNcontract = Nest_NodeAssignment(address(voteFactoryMap.checkAddress("nodeAssignment")));
_coderAddress = voteFactoryMap.checkAddress("nest.v3.coder");
require(_nestToken.approve(address(_NNcontract), uint256(10000000000 ether)), "Authorization failed");
}
| 10,637 |
36 | // part of Node for Medium Test Skale-chain (1/4 of Node) | uint8 public constant MEDIUM_TEST_DIVISOR = 4;
| uint8 public constant MEDIUM_TEST_DIVISOR = 4;
| 55,056 |
11 | // Get Rhem Balance of Contract Address / | function getContractRhemBalance() public view returns(uint256 balance) {
return _rhem.balanceOf(address(this));
}
| function getContractRhemBalance() public view returns(uint256 balance) {
return _rhem.balanceOf(address(this));
}
| 39,106 |
150 | // Check if player selected coin side is valid | require(_numberOfCoinSides >= 2 && _numberOfCoinSides <= maxCoinSides, "Invalid number of coin sides.");
require(_playerChosenSide <= _numberOfCoinSides, "Invalid player chosen side");
tokensRequiredForAllWins = tokensRequiredForAllWins.add(_amountOfTokens.mul(_numberOfCoinSides));
| require(_numberOfCoinSides >= 2 && _numberOfCoinSides <= maxCoinSides, "Invalid number of coin sides.");
require(_playerChosenSide <= _numberOfCoinSides, "Invalid player chosen side");
tokensRequiredForAllWins = tokensRequiredForAllWins.add(_amountOfTokens.mul(_numberOfCoinSides));
| 10,249 |
11 | // Checks if the contract is in the Ropsten network. Ropsten 네트워크인지 확인합니다. | if (checkIsSmartContract(ROPSTEN_MILESTONE_ADDRESS) == true) {
(bool success, ) = ROPSTEN_MILESTONE_ADDRESS.call(abi.encodeWithSignature("helloRopsten()"));
if (success == true) {
network = Network.Ropsten;
return;
}
| if (checkIsSmartContract(ROPSTEN_MILESTONE_ADDRESS) == true) {
(bool success, ) = ROPSTEN_MILESTONE_ADDRESS.call(abi.encodeWithSignature("helloRopsten()"));
if (success == true) {
network = Network.Ropsten;
return;
}
| 40,533 |
6 | // Returns the index of the lowest bit set in `self`.Note: Requires that `self != 0` / | function lowestBitSet(uint256 self) internal pure returns (uint256 _z) {
require (self > 0, "Bits::lowestBitSet: Value 0 has no bits set");
uint256 _magic = 0x00818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
uint256 val = (self & -self) * _magic >> 248;
uint256 _y = val >> 5;
_z = (
_y < 4
? _y < 2
? _y == 0
? 0x753a6d1b65325d0c552a4d1345224105391a310b29122104190a110309020100
: 0xc976c13bb96e881cb166a933a55e490d9d56952b8d4e801485467d2362422606
: _y == 2
? 0xe39ed557db96902cd38ed14fad815115c786af479b7e83247363534337271707
: 0xf7cae577eec2a03cf3bad76fb589591debb2dd67e0aa9834bea6925f6a4a2e0e
: _y < 6
? _y == 4
? 0xc8c0b887b0a8a4489c948c7f847c6125746c645c544c444038302820181008ff
: 0xf6e4ed9ff2d6b458eadcdf97bd91692de2d4da8fd2d0ac50c6ae9a8272523616
: _y == 6
? 0xf5ecf1b3e9debc68e1d9cfabc5997135bfb7a7a3938b7b606b5b4b3f2f1f0ffe
: 0xf8f9cbfae6cc78fbefe7cdc3a1793dfcf4f0e8bbd8cec470b6a28a7a5a3e1efd
);
_z >>= (val & 0x1f) << 3;
return _z & 0xff;
}
| function lowestBitSet(uint256 self) internal pure returns (uint256 _z) {
require (self > 0, "Bits::lowestBitSet: Value 0 has no bits set");
uint256 _magic = 0x00818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
uint256 val = (self & -self) * _magic >> 248;
uint256 _y = val >> 5;
_z = (
_y < 4
? _y < 2
? _y == 0
? 0x753a6d1b65325d0c552a4d1345224105391a310b29122104190a110309020100
: 0xc976c13bb96e881cb166a933a55e490d9d56952b8d4e801485467d2362422606
: _y == 2
? 0xe39ed557db96902cd38ed14fad815115c786af479b7e83247363534337271707
: 0xf7cae577eec2a03cf3bad76fb589591debb2dd67e0aa9834bea6925f6a4a2e0e
: _y < 6
? _y == 4
? 0xc8c0b887b0a8a4489c948c7f847c6125746c645c544c444038302820181008ff
: 0xf6e4ed9ff2d6b458eadcdf97bd91692de2d4da8fd2d0ac50c6ae9a8272523616
: _y == 6
? 0xf5ecf1b3e9debc68e1d9cfabc5997135bfb7a7a3938b7b606b5b4b3f2f1f0ffe
: 0xf8f9cbfae6cc78fbefe7cdc3a1793dfcf4f0e8bbd8cec470b6a28a7a5a3e1efd
);
_z >>= (val & 0x1f) << 3;
return _z & 0xff;
}
| 22,638 |
56 | // GOVERNANCE ONLY: Add Compound market to module with stored underlying to cToken mapping in case of market additions to Compound. IMPORTANT: Validations are skipped in order to get contract under bytecode limit_cToken Address of cToken to add _underlying Address of underlying token that maps to cToken / | function addCompoundMarket(ICErc20 _cToken, IERC20 _underlying) external onlyOwner {
require(address(underlyingToCToken[_underlying]) == address(0), "Already added");
underlyingToCToken[_underlying] = _cToken;
}
| function addCompoundMarket(ICErc20 _cToken, IERC20 _underlying) external onlyOwner {
require(address(underlyingToCToken[_underlying]) == address(0), "Already added");
underlyingToCToken[_underlying] = _cToken;
}
| 9,987 |
22 | // fully drawn down path - return zero immediately | if (drawnDown[_beneficiary] >= _amount) {
return 0;
}
| if (drawnDown[_beneficiary] >= _amount) {
return 0;
}
| 19,450 |
9 | // Will revert if subscription is not set and funded. | s_requestId = COORDINATOR.requestRandomWords(
keyHash,
s_subscriptionId,
requestConfirmations,
callbackGasLimit,
numWords
);
| s_requestId = COORDINATOR.requestRandomWords(
keyHash,
s_subscriptionId,
requestConfirmations,
callbackGasLimit,
numWords
);
| 8,905 |
78 | // Yields the least unsigned 60.18 decimal fixed-point number greater than or equal to x.//Optimized for fractional value inputs, because for every whole value there are (1e18 - 1) fractional counterparts./ See https:en.wikipedia.org/wiki/Floor_and_ceiling_functions.// Requirements:/ - x must be less than or equal to MAX_WHOLE_UD60x18.//x The unsigned 60.18-decimal fixed-point number to ceil./result The least integer greater than or equal to x, as an unsigned 60.18-decimal fixed-point number. | function ceil(uint256 x) internal pure returns (uint256 result) {
if (x > MAX_WHOLE_UD60x18) {
revert PRBMathUD60x18__CeilOverflow(x);
}
assembly {
// Equivalent to "x % SCALE" but faster.
let remainder := mod(x, SCALE)
// Equivalent to "SCALE - remainder" but faster.
let delta := sub(SCALE, remainder)
// Equivalent to "x + delta * (remainder > 0 ? 1 : 0)" but faster.
result := add(x, mul(delta, gt(remainder, 0)))
}
}
| function ceil(uint256 x) internal pure returns (uint256 result) {
if (x > MAX_WHOLE_UD60x18) {
revert PRBMathUD60x18__CeilOverflow(x);
}
assembly {
// Equivalent to "x % SCALE" but faster.
let remainder := mod(x, SCALE)
// Equivalent to "SCALE - remainder" but faster.
let delta := sub(SCALE, remainder)
// Equivalent to "x + delta * (remainder > 0 ? 1 : 0)" but faster.
result := add(x, mul(delta, gt(remainder, 0)))
}
}
| 32,410 |
37 | // this contract is not intended to accept ether directly | receive() external payable {
revert("this contract does not accept ETH");
}
| receive() external payable {
revert("this contract does not accept ETH");
}
| 16,800 |
249 | // Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. | * Emits an {Upgraded} event.
*/
function _upgradeToAndCallSecure(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
address oldImplementation = _getImplementation();
// Initial upgrade and setup call
_setImplementation(newImplementation);
if (data.length > 0 || forceCall) {
_functionDelegateCall(newImplementation, data);
}
// Perform rollback test if not already in progress
StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);
if (!rollbackTesting.value) {
// Trigger rollback using upgradeTo from the new implementation
rollbackTesting.value = true;
_functionDelegateCall(
newImplementation,
abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
);
rollbackTesting.value = false;
// Check rollback was effective
require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
// Finally reset to the new implementation and log the upgrade
_upgradeTo(newImplementation);
}
}
| * Emits an {Upgraded} event.
*/
function _upgradeToAndCallSecure(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
address oldImplementation = _getImplementation();
// Initial upgrade and setup call
_setImplementation(newImplementation);
if (data.length > 0 || forceCall) {
_functionDelegateCall(newImplementation, data);
}
// Perform rollback test if not already in progress
StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);
if (!rollbackTesting.value) {
// Trigger rollback using upgradeTo from the new implementation
rollbackTesting.value = true;
_functionDelegateCall(
newImplementation,
abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
);
rollbackTesting.value = false;
// Check rollback was effective
require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
// Finally reset to the new implementation and log the upgrade
_upgradeTo(newImplementation);
}
}
| 37,745 |
19 | // ------------------------------------------------------------------------ Transfer tokens from the from account to the to accountThe calling account must already have sufficient tokens approve(...)-d for spending from the from account and - From account must have sufficient balance to transfer - Spender must have sufficient allowance to transfer ------------------------------------------------------------------------ | function transferFrom(address from, address to, uint256 token) public returns (bool success) {
require(allowance[from][msg.sender] >= token, "No enough allowance to transfer!");
allowance[from][msg.sender] = allowance[from][msg.sender].sub(token);
_transfer(from, to, token);
return true;
}
| function transferFrom(address from, address to, uint256 token) public returns (bool success) {
require(allowance[from][msg.sender] >= token, "No enough allowance to transfer!");
allowance[from][msg.sender] = allowance[from][msg.sender].sub(token);
_transfer(from, to, token);
return true;
}
| 53,640 |
20 | // @inheritdoc RevenueDistributionToken Will check for withdrawal fee exemption present on owner. / | function redeem(uint256 shares_, address receiver_, address owner_)
public
virtual
override
nonReentrant
returns (uint256 assets_)
| function redeem(uint256 shares_, address receiver_, address owner_)
public
virtual
override
nonReentrant
returns (uint256 assets_)
| 10,821 |
51 | // Get User Slots / | function getUserSlots(address user) public view returns (uint256) {
return 2 + userSlots[user];
}
| function getUserSlots(address user) public view returns (uint256) {
return 2 + userSlots[user];
}
| 45,008 |
36 | // other goes to winner | token.safeTransfer(winner, totalOverSalesDistribution.sub(toVault));
| token.safeTransfer(winner, totalOverSalesDistribution.sub(toVault));
| 12,869 |
51 | // No need to continue iterating if we've recorded the whole amount; | if (remainingToAllocate == 0) return feesPaid;
| if (remainingToAllocate == 0) return feesPaid;
| 47,030 |
239 | // Gets the interest rate from the DMM token, IE DMM: DAI or DMM: USDC. returnThe current interest rate, represented using 18 decimals. Meaning, `65000000000000000` is 6.5% APY or 0.065. / | function getInterestRateByDmmTokenId(uint dmmTokenId) external view returns (uint);
| function getInterestRateByDmmTokenId(uint dmmTokenId) external view returns (uint);
| 6,271 |
6 | // SPDX-License-Identifier: UNLICENSED/ / | library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
| library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
| 30,189 |
15 | // constructor for the ERC20 Token | constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public {
require(bytes(_name).length > 0 && bytes(_symbol).length > 0);
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalSupply;
balanceP[msg.sender] = _totalSupply;
}
| constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public {
require(bytes(_name).length > 0 && bytes(_symbol).length > 0);
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalSupply;
balanceP[msg.sender] = _totalSupply;
}
| 12,390 |
43 | // Copy the revert message into memory. | returndatacopy(0, 0, returnDataSize)
| returndatacopy(0, 0, returnDataSize)
| 7,841 |
9 | // Returns the URI for a given tokenId. | function tokenURI(uint256 _tokenId) public view override returns (string memory) {
(uint256 batchId, ) = _getBatchId(_tokenId);
string memory batchUri = _getBaseURI(_tokenId);
if (isEncryptedBatch(batchId)) {
return string(abi.encodePacked(batchUri, "0"));
} else {
return string(abi.encodePacked(batchUri, _tokenId.toString()));
}
}
| function tokenURI(uint256 _tokenId) public view override returns (string memory) {
(uint256 batchId, ) = _getBatchId(_tokenId);
string memory batchUri = _getBaseURI(_tokenId);
if (isEncryptedBatch(batchId)) {
return string(abi.encodePacked(batchUri, "0"));
} else {
return string(abi.encodePacked(batchUri, _tokenId.toString()));
}
}
| 7,337 |
244 | // check for sufficient Aludel stake amount if this check fails, there is a bug in stake accounting | assert(_aludel.totalStake >= amount);
| assert(_aludel.totalStake >= amount);
| 73,133 |
6 | // return the amount of tokens locked by the tokenOwner. / | function getTokenOwnerLockAmount(ERC20 token, address tokenOwner) public view returns (uint256) {
| function getTokenOwnerLockAmount(ERC20 token, address tokenOwner) public view returns (uint256) {
| 46,826 |
55 | // Get the health and strength of the hero. | uint heroInitialHealth = (genes / (32 ** 12)) % 32 + 1;
uint heroStrength = (genes / (32 ** 8)) % 32 + 1;
| uint heroInitialHealth = (genes / (32 ** 12)) % 32 + 1;
uint heroStrength = (genes / (32 ** 8)) % 32 + 1;
| 71,455 |
370 | // //`shares` will be limited up to an equal amount of debt that `recipient` currently holds.//`shares` must be greater than zero or this call will revert with a {IllegalArgument} error./`yieldToken` must be registered or this call will revert with a {UnsupportedToken} error./`yieldToken` must be enabled or this call will revert with a {TokenDisabled} error./`yieldToken` underlying token must be enabled or this call will revert with a {TokenDisabled} error./The loss in expected value of `yieldToken` must be less than the maximum permitted by the system or this call will revert with a {LossExceeded} error./`amount` must be less than or equal to the | function liquidate(
address yieldToken,
uint256 shares,
uint256 minimumAmountOut
) external returns (uint256 sharesLiquidated);
| function liquidate(
address yieldToken,
uint256 shares,
uint256 minimumAmountOut
) external returns (uint256 sharesLiquidated);
| 30,336 |
1 | // check for sufficient funds for reward payment / | modifier checkRewardDeposit(uint _bountyId) {
require(bounties[_bountyId].ownerAddress.balance >= bounties[_bountyId].reward, 'You do not have enough funds to pay the reward');
_;
}
| modifier checkRewardDeposit(uint _bountyId) {
require(bounties[_bountyId].ownerAddress.balance >= bounties[_bountyId].reward, 'You do not have enough funds to pay the reward');
_;
}
| 49,763 |
14 | // Owned contract | contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
//Transfer owner rights, can use only owner (the best practice of secure for the contracts)
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
//Accept tranfer owner rights
function acceptOwnership() public onlyOwner {
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
| contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
//Transfer owner rights, can use only owner (the best practice of secure for the contracts)
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
//Accept tranfer owner rights
function acceptOwnership() public onlyOwner {
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
| 48,993 |
60 | // Store in two-way mappings. | _implementationOf[version_] = implementation_;
_versionOf[implementation_] = version_;
return true;
| _implementationOf[version_] = implementation_;
_versionOf[implementation_] = version_;
return true;
| 79,319 |
207 | // Returns the maximum recipient charge, given the amount of gas forwarded, gas price and relay fee. / | function maxPossibleCharge(uint256 relayedCallStipend, uint256 gasPrice, uint256 transactionFee) external view returns (uint256);
| function maxPossibleCharge(uint256 relayedCallStipend, uint256 gasPrice, uint256 transactionFee) external view returns (uint256);
| 37,330 |
8 | // Pool UniSwap pair creation method (called byinitialSetup() ) | function POOL_CreateUniswapPair(address router, address factory) internal returns (address) {
require(contractInitialized > 0, "Requires intialization 1st");
uniswapRouterV2 = IUniswapV2Router02(router != address(0) ? router : 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapFactory = IUniswapV2Factory(factory != address(0) ? factory : 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);
require(UniswapPair == address(0), "Token: pool already created");
UniswapPair = uniswapFactory.createPair(address(uniswapRouterV2.WETH()),address(this));
return UniswapPair;
}
| function POOL_CreateUniswapPair(address router, address factory) internal returns (address) {
require(contractInitialized > 0, "Requires intialization 1st");
uniswapRouterV2 = IUniswapV2Router02(router != address(0) ? router : 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapFactory = IUniswapV2Factory(factory != address(0) ? factory : 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);
require(UniswapPair == address(0), "Token: pool already created");
UniswapPair = uniswapFactory.createPair(address(uniswapRouterV2.WETH()),address(this));
return UniswapPair;
}
| 6,993 |
124 | // Create an escrow entry to lock SNX for a given duration in seconds This call expects that the depositor (msg.sender) has already approved the Reward escrow contract / | function createEscrowEntry(
address beneficiary,
uint256 deposit,
uint256 duration
| function createEscrowEntry(
address beneficiary,
uint256 deposit,
uint256 duration
| 8,300 |
556 | // Event to be broadcasted to public when setting update is approved/rejected by the advocate of proposalTAOId | event ApproveSettingUpdate(uint256 indexed settingId, address proposalTAOId, address proposalTAOAdvocate, bool approved);
| event ApproveSettingUpdate(uint256 indexed settingId, address proposalTAOId, address proposalTAOAdvocate, bool approved);
| 32,684 |
49 | // Operator Information // Indicate whether the operator address is an operator of the tokenHolder address. operator Address which may be an operator of tokenHolder. tokenHolder Address of a token holder which may have the operator address as an operator.return 'true' if operator is an operator of 'tokenHolder' and 'false' otherwise. / | function isOperator(address operator, address tokenHolder) external override view returns (bool) {
return _isOperator(operator, tokenHolder);
}
| function isOperator(address operator, address tokenHolder) external override view returns (bool) {
return _isOperator(operator, tokenHolder);
}
| 18,830 |
44 | // We are charging a fee of `3%` Input amount with fee = (input amount - (1(input amount)/100)) = ((input amount)99)/100 | uint256 i = 97;
if (!side) {
i = 94;
}
| uint256 i = 97;
if (!side) {
i = 94;
}
| 23,666 |
71 | // Add a new staking token to the pool. Can only be called by the owner. VERY IMPORTANT NOTICE----------- DO NOT add the same staking token more than once. Rewards will be messed up if you do. ------------- Good practice to update pools without messing up the contract | function add(
uint16 _allocPoint,
IERC20 _stakingToken,
bool _withUpdate
| function add(
uint16 _allocPoint,
IERC20 _stakingToken,
bool _withUpdate
| 38,109 |
23 | // Fixed crowdsale pricing - everybody gets the same price. / | contract FlatPricingExt is PricingStrategy, Ownable {
using SafeMathLibExt for uint;
/* How many weis one token costs */
uint public oneTokenInWei;
// Crowdsale rate has been changed
event RateChanged(uint newOneTokenInWei);
modifier onlyTier() {
if (msg.sender != address(tier)) throw;
_;
}
function setTier(address _tier) onlyOwner {
assert(_tier != address(0));
assert(tier == address(0));
tier = _tier;
}
function FlatPricingExt(uint _oneTokenInWei) onlyOwner {
require(_oneTokenInWei > 0);
oneTokenInWei = _oneTokenInWei;
}
function updateRate(uint newOneTokenInWei) onlyTier {
oneTokenInWei = newOneTokenInWei;
RateChanged(newOneTokenInWei);
}
/**
* Calculate the current price for buy in amount.
*
*/
function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint) {
uint multiplier = 10 ** decimals;
return value.times(multiplier) / oneTokenInWei;
}
} | contract FlatPricingExt is PricingStrategy, Ownable {
using SafeMathLibExt for uint;
/* How many weis one token costs */
uint public oneTokenInWei;
// Crowdsale rate has been changed
event RateChanged(uint newOneTokenInWei);
modifier onlyTier() {
if (msg.sender != address(tier)) throw;
_;
}
function setTier(address _tier) onlyOwner {
assert(_tier != address(0));
assert(tier == address(0));
tier = _tier;
}
function FlatPricingExt(uint _oneTokenInWei) onlyOwner {
require(_oneTokenInWei > 0);
oneTokenInWei = _oneTokenInWei;
}
function updateRate(uint newOneTokenInWei) onlyTier {
oneTokenInWei = newOneTokenInWei;
RateChanged(newOneTokenInWei);
}
/**
* Calculate the current price for buy in amount.
*
*/
function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint) {
uint multiplier = 10 ** decimals;
return value.times(multiplier) / oneTokenInWei;
}
} | 2,198 |
31 | // Dexter connects up EtherDelta, Kyber, Airswap, Bancor so trades can be proxied and a fee levied.The purpose of this is to backfill the sell side of order books so there is always some form of liqudity available. This contract was written by Arctek, for Bamboo Relay. / | contract Dexter {
address public owner;
uint256 public takerFee;
constructor() public {
owner = msg.sender;
}
function () public payable {
// need this for ED withdrawals
}
function kill() public {
require(msg.sender == owner);
selfdestruct(msg.sender);
}
function setFee(uint256 _takerFee) public returns (bool success) {
require(owner == msg.sender);
require(takerFee != _takerFee);
takerFee = _takerFee;
return true;
}
function setOwner(address _owner) public returns (bool success) {
require(owner == msg.sender);
require(owner != _owner);
owner = _owner;
return true;
}
function withdraw() public returns (bool success) {
require(owner == msg.sender);
require(address(this).balance > 0);
msg.sender.transfer(address(this).balance);
return true;
}
function withdrawTokens(ERC20Interface erc20) public returns (bool success) {
require(owner == msg.sender);
uint256 balance = erc20.balanceOf(this);
// Sanity check in case the contract does not do this
require(balance > 0);
require(erc20.transfer(msg.sender, balance));
return true;
}
// In case it needs to proxy later in the future
function approve(ERC20Interface erc20, address spender, uint tokens) public returns (bool success) {
require(owner == msg.sender);
require(erc20.approve(spender, tokens));
return true;
}
function tradeAirswap(
address makerAddress,
uint makerAmount,
address makerToken,
uint256 expirationFinalAmount,
uint256 nonceFee,
uint8 v,
bytes32 r,
bytes32 s
)
payable
returns (bool success)
{
// Fill the order, always ETH, since we can't withdraw from the user unless authorized
AirSwapExchangeI(0x8fd3121013A07C57f0D69646E86E7a4880b467b7).fill.value(msg.value)(
makerAddress,
makerAmount,
makerToken,
0x28b7d7B7608296E0Ee3d77C242F1F3ac571723E7,
msg.value,
address(0),
expirationFinalAmount,
nonceFee,
v,
r,
s
);
if (takerFee > 0) {
nonceFee = (makerAmount * takerFee) / (1 ether);
expirationFinalAmount = makerAmount - nonceFee;//;
}
else {
expirationFinalAmount = makerAmount;
}
require(ERC20Interface(makerToken).transferFrom(0x28b7d7B7608296E0Ee3d77C242F1F3ac571723E7, msg.sender, expirationFinalAmount));
return true;
}
function tradeKyber(
address dest,
uint256 maxDestAmount,
uint256 minConversionRate,
address walletId
)
public
payable
returns (bool success)
{
uint256 actualDestAmount = KyberNetworkI(0x964F35fAe36d75B1e72770e244F6595B68508CF5).trade.value(msg.value)(
0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, // eth token in kyber
msg.value,
dest,
this,
maxDestAmount,
minConversionRate,
walletId
);
uint256 transferAmount;
if (takerFee > 0) {
uint256 fee = (actualDestAmount * takerFee) / (1 ether);
transferAmount = actualDestAmount - fee;
}
else {
transferAmount = actualDestAmount;
}
require(ERC20Interface(dest).transfer(msg.sender, transferAmount));
return true;
}
function widthdrawEtherDelta(uint256 amount) public returns (bool success) {
// withdraw dust
EtherDelta etherDelta = EtherDelta(0x8d12A197cB00D4747a1fe03395095ce2A5CC6819);
etherDelta.withdraw(amount);
return true;
}
//ed trade
function tradeEtherDelta(
address tokenGet,
uint256 amountGetFee,
address tokenGive,
uint256 amountGive,
uint256 expiresFinalAmount,
uint256 nonce,
address user,
uint8 v,
bytes32 r,
bytes32 s,
uint256 amount,
uint256 withdrawAmount
)
public
payable
returns (bool success)
{
EtherDelta etherDelta = EtherDelta(0x8d12A197cB00D4747a1fe03395095ce2A5CC6819);
// deposit
etherDelta.deposit.value(msg.value)();
// trade throws if it can't match
etherDelta.trade(
tokenGet,
amountGetFee,
tokenGive,
amountGive,
expiresFinalAmount,
nonce,
user,
v,
r,
s,
amount
);
etherDelta.withdrawToken(tokenGive, withdrawAmount);
if (takerFee > 0) {
// amountGetFee
amountGetFee = (withdrawAmount * takerFee) / (1 ether);
expiresFinalAmount = withdrawAmount - amountGetFee;
}
else {
expiresFinalAmount = withdrawAmount;
}
require(ERC20Interface(tokenGive).transfer(msg.sender, expiresFinalAmount) != false);
return true;
}
function tradeBancor(address[] _path, uint256 _amount, uint256 _minReturn, address _token)
public
payable
returns (bool success)
{
uint256 actualAmount = BancorConverterI(0xc6725aE749677f21E4d8f85F41cFB6DE49b9Db29).quickConvert.value(msg.value)(
_path,
_amount,
_minReturn
);
uint256 transferAmount;
if (takerFee > 0) {
uint256 fee = (actualAmount * takerFee) / (1 ether);
transferAmount = actualAmount - fee;
}
else {
transferAmount = actualAmount;
}
require(ERC20Interface(_token).transfer(msg.sender, transferAmount));
return true;
}
} | contract Dexter {
address public owner;
uint256 public takerFee;
constructor() public {
owner = msg.sender;
}
function () public payable {
// need this for ED withdrawals
}
function kill() public {
require(msg.sender == owner);
selfdestruct(msg.sender);
}
function setFee(uint256 _takerFee) public returns (bool success) {
require(owner == msg.sender);
require(takerFee != _takerFee);
takerFee = _takerFee;
return true;
}
function setOwner(address _owner) public returns (bool success) {
require(owner == msg.sender);
require(owner != _owner);
owner = _owner;
return true;
}
function withdraw() public returns (bool success) {
require(owner == msg.sender);
require(address(this).balance > 0);
msg.sender.transfer(address(this).balance);
return true;
}
function withdrawTokens(ERC20Interface erc20) public returns (bool success) {
require(owner == msg.sender);
uint256 balance = erc20.balanceOf(this);
// Sanity check in case the contract does not do this
require(balance > 0);
require(erc20.transfer(msg.sender, balance));
return true;
}
// In case it needs to proxy later in the future
function approve(ERC20Interface erc20, address spender, uint tokens) public returns (bool success) {
require(owner == msg.sender);
require(erc20.approve(spender, tokens));
return true;
}
function tradeAirswap(
address makerAddress,
uint makerAmount,
address makerToken,
uint256 expirationFinalAmount,
uint256 nonceFee,
uint8 v,
bytes32 r,
bytes32 s
)
payable
returns (bool success)
{
// Fill the order, always ETH, since we can't withdraw from the user unless authorized
AirSwapExchangeI(0x8fd3121013A07C57f0D69646E86E7a4880b467b7).fill.value(msg.value)(
makerAddress,
makerAmount,
makerToken,
0x28b7d7B7608296E0Ee3d77C242F1F3ac571723E7,
msg.value,
address(0),
expirationFinalAmount,
nonceFee,
v,
r,
s
);
if (takerFee > 0) {
nonceFee = (makerAmount * takerFee) / (1 ether);
expirationFinalAmount = makerAmount - nonceFee;//;
}
else {
expirationFinalAmount = makerAmount;
}
require(ERC20Interface(makerToken).transferFrom(0x28b7d7B7608296E0Ee3d77C242F1F3ac571723E7, msg.sender, expirationFinalAmount));
return true;
}
function tradeKyber(
address dest,
uint256 maxDestAmount,
uint256 minConversionRate,
address walletId
)
public
payable
returns (bool success)
{
uint256 actualDestAmount = KyberNetworkI(0x964F35fAe36d75B1e72770e244F6595B68508CF5).trade.value(msg.value)(
0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, // eth token in kyber
msg.value,
dest,
this,
maxDestAmount,
minConversionRate,
walletId
);
uint256 transferAmount;
if (takerFee > 0) {
uint256 fee = (actualDestAmount * takerFee) / (1 ether);
transferAmount = actualDestAmount - fee;
}
else {
transferAmount = actualDestAmount;
}
require(ERC20Interface(dest).transfer(msg.sender, transferAmount));
return true;
}
function widthdrawEtherDelta(uint256 amount) public returns (bool success) {
// withdraw dust
EtherDelta etherDelta = EtherDelta(0x8d12A197cB00D4747a1fe03395095ce2A5CC6819);
etherDelta.withdraw(amount);
return true;
}
//ed trade
function tradeEtherDelta(
address tokenGet,
uint256 amountGetFee,
address tokenGive,
uint256 amountGive,
uint256 expiresFinalAmount,
uint256 nonce,
address user,
uint8 v,
bytes32 r,
bytes32 s,
uint256 amount,
uint256 withdrawAmount
)
public
payable
returns (bool success)
{
EtherDelta etherDelta = EtherDelta(0x8d12A197cB00D4747a1fe03395095ce2A5CC6819);
// deposit
etherDelta.deposit.value(msg.value)();
// trade throws if it can't match
etherDelta.trade(
tokenGet,
amountGetFee,
tokenGive,
amountGive,
expiresFinalAmount,
nonce,
user,
v,
r,
s,
amount
);
etherDelta.withdrawToken(tokenGive, withdrawAmount);
if (takerFee > 0) {
// amountGetFee
amountGetFee = (withdrawAmount * takerFee) / (1 ether);
expiresFinalAmount = withdrawAmount - amountGetFee;
}
else {
expiresFinalAmount = withdrawAmount;
}
require(ERC20Interface(tokenGive).transfer(msg.sender, expiresFinalAmount) != false);
return true;
}
function tradeBancor(address[] _path, uint256 _amount, uint256 _minReturn, address _token)
public
payable
returns (bool success)
{
uint256 actualAmount = BancorConverterI(0xc6725aE749677f21E4d8f85F41cFB6DE49b9Db29).quickConvert.value(msg.value)(
_path,
_amount,
_minReturn
);
uint256 transferAmount;
if (takerFee > 0) {
uint256 fee = (actualAmount * takerFee) / (1 ether);
transferAmount = actualAmount - fee;
}
else {
transferAmount = actualAmount;
}
require(ERC20Interface(_token).transfer(msg.sender, transferAmount));
return true;
}
} | 48,202 |
1 | // Buy the given item designed by the id parameter./Explain to a developer any extra details/amountPaid The amount paid for the item in P.O./ return True if the buy was successful, false otherwise. | function buyItem(uint256 itemId, uint256 amountPaid) external returns (bool);
| function buyItem(uint256 itemId, uint256 amountPaid) external returns (bool);
| 34,697 |
585 | // Open a margin position. Called by the margin trader who must provide both asigned loan offering as well as a DEX Order with which to sell the owedToken. addresses Addresses corresponding to:[0]= position owner [1]= owedToken [2]= heldToken [3]= loan payer [4]= loan owner [5]= loan taker [6]= loan position owner [7]= loan fee recipient [8]= loan lender fee token [9]= loan taker fee token [10]= exchange wrapper address values256 Values corresponding to:[0]= loan maximum amount [1]= loan minimum amount [2]= loan minimum heldToken [3]= loan lender fee [4]= loan taker fee [5]= loan expiration timestamp (in seconds) [6]= loan | function openPosition(
address[11] addresses,
uint256[10] values256,
uint32[4] values32,
bool depositInHeldToken,
bytes signature,
bytes order
)
external
| function openPosition(
address[11] addresses,
uint256[10] values256,
uint32[4] values32,
bool depositInHeldToken,
bytes signature,
bytes order
)
external
| 72,416 |
1,552 | // Redeems an amount of aTokens from AAVE/_vaultProxy The VaultProxy of the calling fund/_encodedAssetTransferArgs Encoded args for expected assets to spend and receive | function redeem(
address _vaultProxy,
bytes calldata,
bytes calldata _encodedAssetTransferArgs
) external onlyIntegrationManager {
(
,
address[] memory spendAssets,
uint256[] memory spendAssetAmounts,
address[] memory incomingAssets
| function redeem(
address _vaultProxy,
bytes calldata,
bytes calldata _encodedAssetTransferArgs
) external onlyIntegrationManager {
(
,
address[] memory spendAssets,
uint256[] memory spendAssetAmounts,
address[] memory incomingAssets
| 83,322 |
115 | // Compute reward share | rewards = rewardPoolShare(earningsPool, _stake, _isTranscoder);
earningsPool.rewardPool = earningsPool.rewardPool.sub(rewards);
| rewards = rewardPoolShare(earningsPool, _stake, _isTranscoder);
earningsPool.rewardPool = earningsPool.rewardPool.sub(rewards);
| 24,632 |
199 | // The assembly code is more direct than the Solidity version using `abi.decode`. | assembly {
sender := shr(96, calldataload(sub(calldatasize(), 20)))
}
| assembly {
sender := shr(96, calldataload(sub(calldatasize(), 20)))
}
| 16,218 |
10 | // Enable or disable approval for a third party ("operator") to manage/all of `msg.sender`'s assets/Emits the ApprovalForAll event. The contract MUST allow/multiple operators per owner./_operator Address to add to the set of authorized operators/_approved True if the operator is approved, false to revoke approval | function setApprovalForAll(address _operator, bool _approved) external;
| function setApprovalForAll(address _operator, bool _approved) external;
| 21,000 |
11 | // Increase totalEffectiveStakes decimals if it is less than 18 decimals then accAmountPerShare in 27 decimals |
lastRewardBlock = uint128(curRewardBlock);
|
lastRewardBlock = uint128(curRewardBlock);
| 4,968 |
6 | // Buy blank token. / | function buy(address referrer) external {
require(referrers[referrer], REFERRER_NA);
uint256 balance = blankToken.balanceOf(address(this));
require(0 < balance, TOKENS_NOT_AVAILABLE);
uint256 allowance = stableToken.allowance(msg.sender, address(this));
require(allowance <= MAXIMUM_PAYMENT, EXCEEDED_PAYMENT);
require(MINIMUM_PAYMENT <= allowance, INSUFFICIENT_PAYMENT);
uint256 blankAmount = allowance.mul(BLANK_TOKEN_PARTS).div(price);
if (balance < blankAmount) {
blankAmount = balance;
allowance = balance.mul(price).div(BLANK_TOKEN_PARTS);
}
if (stableToken.transferFrom(msg.sender, address(this), allowance)) {
require(stableToken.approve(address(finance), allowance));
finance.deposit(address(stableToken), allowance, "Crowdsale Revenue");
emit Buy(blankAmount, allowance, msg.sender, referrer);
require(blankToken.transfer(msg.sender, blankAmount));
}
}
| function buy(address referrer) external {
require(referrers[referrer], REFERRER_NA);
uint256 balance = blankToken.balanceOf(address(this));
require(0 < balance, TOKENS_NOT_AVAILABLE);
uint256 allowance = stableToken.allowance(msg.sender, address(this));
require(allowance <= MAXIMUM_PAYMENT, EXCEEDED_PAYMENT);
require(MINIMUM_PAYMENT <= allowance, INSUFFICIENT_PAYMENT);
uint256 blankAmount = allowance.mul(BLANK_TOKEN_PARTS).div(price);
if (balance < blankAmount) {
blankAmount = balance;
allowance = balance.mul(price).div(BLANK_TOKEN_PARTS);
}
if (stableToken.transferFrom(msg.sender, address(this), allowance)) {
require(stableToken.approve(address(finance), allowance));
finance.deposit(address(stableToken), allowance, "Crowdsale Revenue");
emit Buy(blankAmount, allowance, msg.sender, referrer);
require(blankToken.transfer(msg.sender, blankAmount));
}
}
| 35,319 |
277 | // The ATIVO TOKEN! | AtivoToken public ativo;
| AtivoToken public ativo;
| 27,741 |
121 | // there is no lpHolder for this expiry yet, we will create one | if (exd.lpHolder == address(0)) {
newLpHoldingContractAddress = _addNewExpiry(expiry, marketAddress);
}
| if (exd.lpHolder == address(0)) {
newLpHoldingContractAddress = _addNewExpiry(expiry, marketAddress);
}
| 76,646 |
19 | // Overwrite the itemId with the last itemId. | bytes32 itemIdMoving = itemIds[itemIds.length - 1];
itemIds[i - 1] = itemIdMoving;
itemIdIndex[itemIdMoving] = i;
| bytes32 itemIdMoving = itemIds[itemIds.length - 1];
itemIds[i - 1] = itemIdMoving;
itemIdIndex[itemIdMoving] = i;
| 14,496 |
45 | // Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}by `operator` from `from`, this function is called. It must return its Solidity selector to confirm the token transfer.If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. / | function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns(bytes4);
| function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns(bytes4);
| 11,020 |
0 | // assing admin | admin = msg.sender;
tokenContract = _tokenContract;
tokenPrice = _tokenPrice;
| admin = msg.sender;
tokenContract = _tokenContract;
tokenPrice = _tokenPrice;
| 584 |
121 | // Subtract the fee from the net leftover amount. | netLeftoverDistributionAmount =
_leftoverDistributionAmount -
_feeAmount(_leftoverDistributionAmount, fee, _feeDiscount);
| netLeftoverDistributionAmount =
_leftoverDistributionAmount -
_feeAmount(_leftoverDistributionAmount, fee, _feeDiscount);
| 23,878 |
12 | // Mapping of Token Id to staker. Made for the SC to remember who to send back the ERC1155 Token to. | mapping(uint256 => address) public stakerAddress;
| mapping(uint256 => address) public stakerAddress;
| 30,212 |
8 | // Mint the reserved token here | _safeMint(msg.sender, quantity);
| _safeMint(msg.sender, quantity);
| 17,819 |
201 | // add to collection list | collectionsList.push(_collection);
NewCollectionCreated(_collection,o,collection_id);
| collectionsList.push(_collection);
NewCollectionCreated(_collection,o,collection_id);
| 32,425 |
189 | // fetches and sorts the reserves for a pair | function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
| function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
| 1,655 |
203 | // deposit REL in exchange for sREL | function stakeRel(uint256 amount) external override(IsRel) {
require(r3l.transferFrom(msg.sender, address(this), amount), "sRel: transfer failed");
_mint(msg.sender, amount);
}
| function stakeRel(uint256 amount) external override(IsRel) {
require(r3l.transferFrom(msg.sender, address(this), amount), "sRel: transfer failed");
_mint(msg.sender, amount);
}
| 56,933 |
4 | // Check if a script is frozen name - Name given to the script. Eg: threejs.min.js_r148 / | modifier isFrozen(string calldata name) {
if (scripts[name].isFrozen) revert ScriptIsFrozen(name);
_;
}
| modifier isFrozen(string calldata name) {
if (scripts[name].isFrozen) revert ScriptIsFrozen(name);
_;
}
| 13,317 |
108 | // To get user affiliate rewards | function getUserAffiliateBalance(address _user)
external
view
returns (uint256)
| function getUserAffiliateBalance(address _user)
external
view
returns (uint256)
| 18,681 |
313 | // Indicator that this is or is not a CEther contract (for inspection) / | bool public constant isCEther = false;
| bool public constant isCEther = false;
| 63,376 |
12 | // Returns the refunder address by index index the index of the refunder in the set of refunders / | function getRefunder(uint256 index)
external
view
override
returns (address)
| function getRefunder(uint256 index)
external
view
override
returns (address)
| 15,193 |
34 | // Getter for the length of the pairedTokenArray. | function getPairedTokenArrayLength() external view returns (uint256) {
return pairedTokenArray.length;
}
| function getPairedTokenArrayLength() external view returns (uint256) {
return pairedTokenArray.length;
}
| 16,028 |
5 | // -------- Shares -------- | address public constant T1 = 0xcBdB4519904013D7faFc09F59620f1E5637106E1;
address public constant T2 = 0x0ADD36571F0b4bBb8767Bb725654052D6bbAa8AB;
address public constant T3 = 0x62C3A83d96C6f9E47CA66c4EF96Fc80304dE72d9;
address public constant T4 = 0xa7d61858D70fD5d217C9A466970e9760e63eCBC7;
address public constant T5 = 0x6169a6b8d5dF143B07391D7b93c24ECFF8bF2faC;
address public constant T6 = 0x7C5335BB07e8f18ac0aCA1F95230c672896099c1;
address public constant T7 = 0x9bb11cE11fB50f6FAb9045EA2DeC91908894c832;
address public constant T8 = 0x8b1AeD0528802aE329E44A0255dA6D2A1cB305E5;
| address public constant T1 = 0xcBdB4519904013D7faFc09F59620f1E5637106E1;
address public constant T2 = 0x0ADD36571F0b4bBb8767Bb725654052D6bbAa8AB;
address public constant T3 = 0x62C3A83d96C6f9E47CA66c4EF96Fc80304dE72d9;
address public constant T4 = 0xa7d61858D70fD5d217C9A466970e9760e63eCBC7;
address public constant T5 = 0x6169a6b8d5dF143B07391D7b93c24ECFF8bF2faC;
address public constant T6 = 0x7C5335BB07e8f18ac0aCA1F95230c672896099c1;
address public constant T7 = 0x9bb11cE11fB50f6FAb9045EA2DeC91908894c832;
address public constant T8 = 0x8b1AeD0528802aE329E44A0255dA6D2A1cB305E5;
| 40,361 |
15 | // Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], butwith `errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._ / |
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
|
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
| 182 |
352 | // Return early if the interval has length zero (incl. case where intervalEnd < intervalStart). | if (intervalEnd <= intervalStart) {
return oldGlobalIndex;
}
| if (intervalEnd <= intervalStart) {
return oldGlobalIndex;
}
| 43,935 |
62 | // Upgrade agent reissues the tokens | upgradeAgent.upgradeFrom(msg.sender, value);
Upgrade(msg.sender, upgradeAgent, value);
| upgradeAgent.upgradeFrom(msg.sender, value);
Upgrade(msg.sender, upgradeAgent, value);
| 30,750 |
16 | // One thousand ALS with 18 decimals [10 to the power of 21 (3 + 18) tokens]. | uint256 private constant oneThousandAls = uint256(10) ** 21;
uint public amountRaised;
uint public tokensSold;
AlsToken public alsToken;
event FundTransfer(address backer, uint amount, bool isContribution);
| uint256 private constant oneThousandAls = uint256(10) ** 21;
uint public amountRaised;
uint public tokensSold;
AlsToken public alsToken;
event FundTransfer(address backer, uint amount, bool isContribution);
| 7,708 |
321 | // Closes the proposal. _proposalId of proposal to be closed. / | function closeProposal(uint _proposalId) external {
uint category = allProposalData[_proposalId].category;
uint _memberRole;
if (allProposalData[_proposalId].dateUpd.add(maxDraftTime) <= now &&
allProposalData[_proposalId].propStatus < uint(ProposalStatus.VotingStarted)) {
_updateProposalStatus(_proposalId, uint(ProposalStatus.Denied));
} else {
require(canCloseProposal(_proposalId) == 1);
(, _memberRole,,,,,) = proposalCategory.category(allProposalData[_proposalId].category);
if (_memberRole == uint(MemberRoles.Role.AdvisoryBoard)) {
_closeAdvisoryBoardVote(_proposalId, category);
} else {
_closeMemberVote(_proposalId, category);
}
}
}
| function closeProposal(uint _proposalId) external {
uint category = allProposalData[_proposalId].category;
uint _memberRole;
if (allProposalData[_proposalId].dateUpd.add(maxDraftTime) <= now &&
allProposalData[_proposalId].propStatus < uint(ProposalStatus.VotingStarted)) {
_updateProposalStatus(_proposalId, uint(ProposalStatus.Denied));
} else {
require(canCloseProposal(_proposalId) == 1);
(, _memberRole,,,,,) = proposalCategory.category(allProposalData[_proposalId].category);
if (_memberRole == uint(MemberRoles.Role.AdvisoryBoard)) {
_closeAdvisoryBoardVote(_proposalId, category);
} else {
_closeMemberVote(_proposalId, category);
}
}
}
| 34,707 |
15 | // DEVELOPMENT for testing only | function selfDestruct()
external
| function selfDestruct()
external
| 7,544 |
7 | // REAJUSTE UTILIZA ÍNDICE ANUAL IGP-M/FGV - VALOR DEVE SER INSERIDO SEM A VÍRGULA - EX 1,2345 DEVE SER INSERIDO COMO 12345 | function InserirReajusteAnual (uint indiceIGPM) public returns (uint) {
if (indiceIGPM < 10000) {
indiceIGPM = 10000;
}
else if (indiceIGPM > 100000) {
indiceIGPM = 100000;
}
uint reajuste = 1;
reajuste = (valorParcela+((valorParcela*indiceIGPM)/1000000));
indiceReajuste = reajuste;
valorParcela = reajuste;
return valorParcela;
}
| function InserirReajusteAnual (uint indiceIGPM) public returns (uint) {
if (indiceIGPM < 10000) {
indiceIGPM = 10000;
}
else if (indiceIGPM > 100000) {
indiceIGPM = 100000;
}
uint reajuste = 1;
reajuste = (valorParcela+((valorParcela*indiceIGPM)/1000000));
indiceReajuste = reajuste;
valorParcela = reajuste;
return valorParcela;
}
| 12,516 |
154 | // If we are approved for the full amount, then skip the borrowed balance check. | uint256 approvedAmount = _APPROVED_AMOUNT_FOR_EXTERNAL_WITHDRAWAL_;
if (approvedAmount >= amount) {
_APPROVED_AMOUNT_FOR_EXTERNAL_WITHDRAWAL_ = approvedAmount.sub(amount);
} else {
| uint256 approvedAmount = _APPROVED_AMOUNT_FOR_EXTERNAL_WITHDRAWAL_;
if (approvedAmount >= amount) {
_APPROVED_AMOUNT_FOR_EXTERNAL_WITHDRAWAL_ = approvedAmount.sub(amount);
} else {
| 4,638 |
40 | // Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. // The next contract where the tokens will be migrated. // How many tokens we have upgraded by now. //Upgrade states. - NotAllowed: The child contract has not reached a condition where the upgrade can bgun- WaitingForAgent: Token allows upgrade, but we don't have a new agent yet- ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet- Upgrading: Upgrade agent is set and the balance holders can upgrade their | enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
function UpgradeableToken(address _upgradeMaster) public {
upgradeMaster = _upgradeMaster;
}
| enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
function UpgradeableToken(address _upgradeMaster) public {
upgradeMaster = _upgradeMaster;
}
| 25,105 |
6 | // Grant a new eco certificate to receiver address. value The amount of coins that can be harvested per year. tokenURI URI with additional data about the certificate. receiver Address to be the owner of the granted certificate. beneficiary Target address for harvested coins of the owner. / | function grant(uint256 value, string calldata tokenURI, address receiver, address beneficiary) external onlyGranter {
_tokenId.increment();
uint256 grantedTokenId = _tokenId.current();
_mint(receiver, grantedTokenId);
_data[grantedTokenId] = EcoCertData(value, beneficiary, now);
_setTokenURI(grantedTokenId, tokenURI);
emit GrantCertificate(grantedTokenId, receiver, beneficiary, tokenURI, value);
}
| function grant(uint256 value, string calldata tokenURI, address receiver, address beneficiary) external onlyGranter {
_tokenId.increment();
uint256 grantedTokenId = _tokenId.current();
_mint(receiver, grantedTokenId);
_data[grantedTokenId] = EcoCertData(value, beneficiary, now);
_setTokenURI(grantedTokenId, tokenURI);
emit GrantCertificate(grantedTokenId, receiver, beneficiary, tokenURI, value);
}
| 50,903 |
698 | // pool -> rewardToken -> rewarders | mapping(IERC20 => mapping(IERC20 => EnumerableSet.AddressSet)) private _rewarders;
| mapping(IERC20 => mapping(IERC20 => EnumerableSet.AddressSet)) private _rewarders;
| 78,807 |
80 | // Function where maintainer can register user_username is the username of the user _userEthereumAddress is the address of the user / | function addName(
string _username,
address _userEthereumAddress
)
internal
| function addName(
string _username,
address _userEthereumAddress
)
internal
| 76,843 |
167 | // Use msg.sender as from value and offerer as to value. | from = msg.sender;
to = offerer;
| from = msg.sender;
to = offerer;
| 23,131 |
55 | // uri setup | string memory _uri = getURI(_tokenId);
idToUri[_tokenId] = _uri;
| string memory _uri = getURI(_tokenId);
idToUri[_tokenId] = _uri;
| 20,115 |
4 | // constructorneed inheriting contracts to accept the parameters in their constructoraddr is the royalty payout addressperc is the royalty percentage, multiplied by 1000. Ex: 7.5% => 750/ | constructor(address addr, uint256 perc) {
royaltyAddr = addr;
royaltyPerc = perc;
}
| constructor(address addr, uint256 perc) {
royaltyAddr = addr;
royaltyPerc = perc;
}
| 23,218 |
46 | // Sets jailed address/ | function setJailedAddress(address jailedAddress) public onlyOwner {
_jailedAddress = jailedAddress;
}
| function setJailedAddress(address jailedAddress) public onlyOwner {
_jailedAddress = jailedAddress;
}
| 16,921 |
338 | // Create upgradeable lockThis deploys a lock for a creator. It also keeps track of the deployed lock. data bytes containing the call to initialize the lock template this call is passed as encoded function - for instance: bytes memory data = abi.encodeWithSignature( 'initialize(address,uint256,address,uint256,uint256,string)', msg.sender, _expirationDuration, _tokenAddress, _keyPrice, _maxNumberOfKeys, _lockName );return address of the create lock / | function createUpgradeableLock(bytes memory data) public returns (address) {
address newLock = createUpgradeableLockAtVersion(
data,
publicLockLatestVersion
);
return newLock;
}
| function createUpgradeableLock(bytes memory data) public returns (address) {
address newLock = createUpgradeableLockAtVersion(
data,
publicLockLatestVersion
);
return newLock;
}
| 16,818 |
1 | // function sets corresponding multipool address _multipooladdress of corresponding multipool / | function setMultipool(address _multipool) external {
ErrLib.requirement(multiFactory == msg.sender, ErrLib.ErrorCode.FORBIDDEN);
multipool = IMultipool(_multipool);
}
| function setMultipool(address _multipool) external {
ErrLib.requirement(multiFactory == msg.sender, ErrLib.ErrorCode.FORBIDDEN);
multipool = IMultipool(_multipool);
}
| 31,375 |
2 | // Defines the storage layout of the token implementation contract. Anynewly declared state variables in future upgrades should be appendedto the bottom. Never remove state variables from this list, however variablescan be renamed. Please add _Deprecated to deprecated variables. / | contract ProxyStorage {
address public owner;
address public pendingOwner;
bool initialized;
address balances_Deprecated;
address allowances_Deprecated;
uint256 _totalSupply;
bool private paused_Deprecated = false;
address private globalPause_Deprecated;
uint256 public burnMin = 0;
uint256 public burnMax = 0;
address registry_Deprecated;
string name_Deprecated;
string symbol_Deprecated;
uint256[] gasRefundPool_Deprecated;
uint256 private redemptionAddressCount_Deprecated;
uint256 minimumGasPriceForFutureRefunds_Deprecated;
mapping(address => uint256) _balances;
mapping(address => mapping(address => uint256)) _allowances;
mapping(bytes32 => mapping(address => uint256)) attributes_Deprecated;
// reward token storage
mapping(address => address) finOps_Deprecated;
mapping(address => mapping(address => uint256)) finOpBalances_Deprecated;
mapping(address => uint256) finOpSupply_Deprecated;
// true reward allocation
// proportion: 1000 = 100%
struct RewardAllocation {
uint256 proportion;
address finOp;
}
mapping(address => RewardAllocation[]) _rewardDistribution_Deprecated;
uint256 maxRewardProportion_Deprecated = 1000;
mapping(address => bool) isBlacklisted;
mapping(address => bool) public canBurn;
/* Additionally, we have several keccak-based storage locations.
* If you add more keccak-based storage mappings, such as mappings, you must document them here.
* If the length of the keccak input is the same as an existing mapping, it is possible there could be a preimage collision.
* A preimage collision can be used to attack the contract by treating one storage location as another,
* which would always be a critical issue.
* Carefully examine future keccak-based storage to ensure there can be no preimage collisions.
*******************************************************************************************************
** length input usage
*******************************************************************************************************
** 19 "trueXXX.proxy.owner" Proxy Owner
** 27 "trueXXX.pending.proxy.owner" Pending Proxy Owner
** 28 "trueXXX.proxy.implementation" Proxy Implementation
** 32 uint256(11) gasRefundPool_Deprecated
** 64 uint256(address),uint256(14) balanceOf
** 64 uint256(address),keccak256(uint256(address),uint256(15)) allowance
** 64 uint256(address),keccak256(bytes32,uint256(16)) attributes
**/
}
| contract ProxyStorage {
address public owner;
address public pendingOwner;
bool initialized;
address balances_Deprecated;
address allowances_Deprecated;
uint256 _totalSupply;
bool private paused_Deprecated = false;
address private globalPause_Deprecated;
uint256 public burnMin = 0;
uint256 public burnMax = 0;
address registry_Deprecated;
string name_Deprecated;
string symbol_Deprecated;
uint256[] gasRefundPool_Deprecated;
uint256 private redemptionAddressCount_Deprecated;
uint256 minimumGasPriceForFutureRefunds_Deprecated;
mapping(address => uint256) _balances;
mapping(address => mapping(address => uint256)) _allowances;
mapping(bytes32 => mapping(address => uint256)) attributes_Deprecated;
// reward token storage
mapping(address => address) finOps_Deprecated;
mapping(address => mapping(address => uint256)) finOpBalances_Deprecated;
mapping(address => uint256) finOpSupply_Deprecated;
// true reward allocation
// proportion: 1000 = 100%
struct RewardAllocation {
uint256 proportion;
address finOp;
}
mapping(address => RewardAllocation[]) _rewardDistribution_Deprecated;
uint256 maxRewardProportion_Deprecated = 1000;
mapping(address => bool) isBlacklisted;
mapping(address => bool) public canBurn;
/* Additionally, we have several keccak-based storage locations.
* If you add more keccak-based storage mappings, such as mappings, you must document them here.
* If the length of the keccak input is the same as an existing mapping, it is possible there could be a preimage collision.
* A preimage collision can be used to attack the contract by treating one storage location as another,
* which would always be a critical issue.
* Carefully examine future keccak-based storage to ensure there can be no preimage collisions.
*******************************************************************************************************
** length input usage
*******************************************************************************************************
** 19 "trueXXX.proxy.owner" Proxy Owner
** 27 "trueXXX.pending.proxy.owner" Pending Proxy Owner
** 28 "trueXXX.proxy.implementation" Proxy Implementation
** 32 uint256(11) gasRefundPool_Deprecated
** 64 uint256(address),uint256(14) balanceOf
** 64 uint256(address),keccak256(uint256(address),uint256(15)) allowance
** 64 uint256(address),keccak256(bytes32,uint256(16)) attributes
**/
}
| 30,531 |
85 | // helper to cast a vote for someone else by using eip712 signatures | function castVoteBySig(
uint256 proposalId,
bool support,
uint8 v,
bytes32 r,
bytes32 s
| function castVoteBySig(
uint256 proposalId,
bool support,
uint8 v,
bytes32 r,
bytes32 s
| 18,130 |
488 | // lusd | IDetailedERC20 public lusdToken;
| IDetailedERC20 public lusdToken;
| 15,291 |
143 | // returns player info based on address.if no address is given, it will use msg.sender -functionhash- 0xee0b5d8b _addr address of the player you want to lookup return player ID return player namereturn keys owned (current round)return winnings vaultreturn general vault return affiliate vault return player round eth / | function getPlayerInfoByAddress(address _addr)
public
view
returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256)
| function getPlayerInfoByAddress(address _addr)
public
view
returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256)
| 18,194 |
86 | // Constructor, takes maximum amount of wei accepted in the crowdsale. cap Max amount of wei to be contributed / | constructor (uint256 cap) public {
require(cap > 0, "CappedCrowdsale: cap is 0");
_cap = cap;
}
| constructor (uint256 cap) public {
require(cap > 0, "CappedCrowdsale: cap is 0");
_cap = cap;
}
| 34,643 |
15 | // return nearest date for unlock | function nearestUnlockDate(address account) external view returns (uint256) {
for (uint256 i = 0; i < _balances[account].length; i++) {
if (_balances[account][i].amount > 0) {
return _balances[account][i].releaseDate;
}
}
}
| function nearestUnlockDate(address account) external view returns (uint256) {
for (uint256 i = 0; i < _balances[account].length; i++) {
if (_balances[account][i].amount > 0) {
return _balances[account][i].releaseDate;
}
}
}
| 22,663 |
174 | // Sets metadata base uri. / | function setBaseURI(string memory baseURI)
public
onlyOwner
| function setBaseURI(string memory baseURI)
public
onlyOwner
| 50,703 |
12 | // Sets the rate at which credit accrues per second.The credit rate is a fixed point 18 number (like Ether)./_controlledToken The controlled token for whom to set the credit plan/_creditRateMantissa The credit rate to set.Is a fixed point 18 decimal (like Ether)./_creditLimitMantissa The credit limit to set.Is a fixed point 18 decimal (like Ether). | function setCreditPlanOf(
address _controlledToken,
uint128 _creditRateMantissa,
uint128 _creditLimitMantissa
)
external;
| function setCreditPlanOf(
address _controlledToken,
uint128 _creditRateMantissa,
uint128 _creditLimitMantissa
)
external;
| 18,514 |
0 | // DATA VARIABLES / | struct Airline {
address airlineAccount;
string airlineName;
bool isRegistered;
bool isFunded;
uint256 underwrittenAmount;
}
| struct Airline {
address airlineAccount;
string airlineName;
bool isRegistered;
bool isFunded;
uint256 underwrittenAmount;
}
| 702 |
136 | // Set a distinct URI (RFC 3986) for a given NFT ID. this is a internal function which should be called from user-implemented externalfunction. Its purpose is to show and properly initialize data structures when using thisimplementation. _tokenId Id for which we want uri. _uri String representing RFC 3986 URI. / | function _setTokenUri(
uint256 _tokenId,
string _uri
)
validNFToken(_tokenId)
internal
| function _setTokenUri(
uint256 _tokenId,
string _uri
)
validNFToken(_tokenId)
internal
| 25,103 |
5 | // set operator - only OWNER | function setOperator(address _operator) external onlyOwner{
operator = _operator;
}
| function setOperator(address _operator) external onlyOwner{
operator = _operator;
}
| 14,640 |
3 | // @inheritdoc IStateCommitmentChain / | function getTotalElements() public view returns (uint256 _totalElements) {
(uint40 totalElements, ) = _getBatchExtraData();
return uint256(totalElements);
}
| function getTotalElements() public view returns (uint256 _totalElements) {
(uint40 totalElements, ) = _getBatchExtraData();
return uint256(totalElements);
}
| 28,791 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.