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 |
|---|---|---|---|---|
20 | // OwnedUpgradeabilityStorage This is the storage necessary to perform upgradeable contracts.This means, required state variables for upgradeability purpose and eternal storage per se. / | contract OwnedUpgradeabilityStorage is UpgradeabilityOwnerStorage, UpgradeabilityStorage, EternalStorage {}
// File: contracts/SafeMath.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*... | contract OwnedUpgradeabilityStorage is UpgradeabilityOwnerStorage, UpgradeabilityStorage, EternalStorage {}
// File: contracts/SafeMath.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*... | 18,231 |
38 | // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol/ Standard ERC20 tokenImplementation of the basic standard token. / | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | 78,075 |
165 | // Triggered whenever someone stakes tokens | event Staked(
address indexed user,
uint256 amount
);
| event Staked(
address indexed user,
uint256 amount
);
| 24,361 |
21 | // PUBLIC METHODS / | function feePercentageInfo() public override view returns (uint256, address) {
return (_feePercentage, IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).getMVDWalletAddress());
}
| function feePercentageInfo() public override view returns (uint256, address) {
return (_feePercentage, IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).getMVDWalletAddress());
}
| 36,636 |
76 | // Emitted when a round ends. / | event RoundEnded(
uint indexed maxExpiryTimestamp,
uint pricePerToken,
uint totalQuoteAmountReserved,
uint tokensBurnableForRound
);
| event RoundEnded(
uint indexed maxExpiryTimestamp,
uint pricePerToken,
uint totalQuoteAmountReserved,
uint tokensBurnableForRound
);
| 42,330 |
12 | // Overrides the supportsInterface function in three base contracts./ Explicitly points to ERC165Storage to reference _supportsInterfaces mapping./ interfaceId The interfaceId to check support for. | function supportsInterface(bytes4 interfaceId)
public
view
override(ERC165Storage, ERC2981, ERC721Enumerable)
returns (bool)
| function supportsInterface(bytes4 interfaceId)
public
view
override(ERC165Storage, ERC2981, ERC721Enumerable)
returns (bool)
| 29,275 |
11 | // Transferable Mapping from TokenId => bool | mapping(uint256 => bool) private isTransferableMapping;
mapping(uint256 => bool) private isAllowListRequiredMapping;
/*///////////////////////////////////////////////////////////////
Events
| mapping(uint256 => bool) private isTransferableMapping;
mapping(uint256 => bool) private isAllowListRequiredMapping;
/*///////////////////////////////////////////////////////////////
Events
| 22,254 |
23 | // BasicCoin, ECR20 tokens that all belong to the owner for sending around | contract BasicCoin is Owned, Token {
// this is as basic as can be, only the associated balance & allowances
struct Account {
uint balance;
mapping (address => uint) allowanceOf;
}
// the balance should be available
modifier when_owns(address _owner, uint _amount) {
if (accounts[_owner].balance <... | contract BasicCoin is Owned, Token {
// this is as basic as can be, only the associated balance & allowances
struct Account {
uint balance;
mapping (address => uint) allowanceOf;
}
// the balance should be available
modifier when_owns(address _owner, uint _amount) {
if (accounts[_owner].balance <... | 4,036 |
108 | // Update token balance in storage | balances[_j] = y;
balances[_i] = _balances[_i];
uint256 fee = swapFee;
if (fee > 0) {
dy = dy.sub(dy.mul(fee).div(feeDenominator));
}
| balances[_j] = y;
balances[_i] = _balances[_i];
uint256 fee = swapFee;
if (fee > 0) {
dy = dy.sub(dy.mul(fee).div(feeDenominator));
}
| 65,525 |
6 | // This payable function is used to receive amount which will be given to the token holders as dividend This function can be run by anyone transferring the native currency into the contract. This private function is used to distribute PLS dividend among the token holders / | receive() external payable {
// this function can only be run after mint process is complete
// and ownership has been revoked
if (owner() != address(0)) {
revert HasAdmin(owner());
}
uint256 amount = msg.value;
uint256 supply = totalSupply();
if (... | receive() external payable {
// this function can only be run after mint process is complete
// and ownership has been revoked
if (owner() != address(0)) {
revert HasAdmin(owner());
}
uint256 amount = msg.value;
uint256 supply = totalSupply();
if (... | 10,639 |
60 | // this tracks the match outcome, and is assigned to reduce gas costs | uint8 winningTeam = winner[i];
require(winningTeam < 3);
| uint8 winningTeam = winner[i];
require(winningTeam < 3);
| 11,001 |
56 | // users could create staking-reward model with this contract at single mode / | contract SimpleStaking is Ownable {
using SafeMath for uint;
uint constant doubleScale = 10 ** 36;
// stake token
IERC20 public stakeToken;
// reward token
IERC20 public rewardToken;
// the number of reward token distribution for each block
uint public rewardSpeed;
// user depos... | contract SimpleStaking is Ownable {
using SafeMath for uint;
uint constant doubleScale = 10 ** 36;
// stake token
IERC20 public stakeToken;
// reward token
IERC20 public rewardToken;
// the number of reward token distribution for each block
uint public rewardSpeed;
// user depos... | 28,697 |
217 | // take liquidity fee, keep a half token halfLiquidityToken = totalAmount(liquidityFee/2totalFee) | uint256 tokensToAddLiquidityWith = contractTokenBalance.div(totalFees.mul(2)).mul(liquidityFee);
| uint256 tokensToAddLiquidityWith = contractTokenBalance.div(totalFees.mul(2)).mul(liquidityFee);
| 19,312 |
20 | // replace the players character by the last one | if (nchars > i + 1) {
playerBalance += characters[ids[i]].value;
removed[count] = ids[i];
count++;
nchars--;
replaceCharacter(i, nchars);
}
| if (nchars > i + 1) {
playerBalance += characters[ids[i]].value;
removed[count] = ids[i];
count++;
nchars--;
replaceCharacter(i, nchars);
}
| 49,275 |
61 | // Pauses or unpauses execution of ERC-20 transactions. paused Pauses ERC-20 transactions if this is true. / | function setTokenPaused(bool paused) external onlyOwner {
tokenPaused = paused;
emit LogTokenPaused(paused);
}
| function setTokenPaused(bool paused) external onlyOwner {
tokenPaused = paused;
emit LogTokenPaused(paused);
}
| 11,120 |
48 | // Freeze token transfers.May only be called by smart contract owner. / | function freezeTransfers () public {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
Freeze ();
}
}
| function freezeTransfers () public {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
Freeze ();
}
}
| 73,743 |
671 | // computes the nearest integer to a given quotient without overflowing or underflowing. / | function roundDiv(uint256 _n, uint256 _d) internal pure returns (uint256) {
return _n / _d + (_n % _d) / (_d - _d / 2);
}
| function roundDiv(uint256 _n, uint256 _d) internal pure returns (uint256) {
return _n / _d + (_n % _d) / (_d - _d / 2);
}
| 51,649 |
30 | // MSJ: Function to verify address is registered | function isAirlineRegistered(address airline) external view returns(bool)
| function isAirlineRegistered(address airline) external view returns(bool)
| 21,256 |
35 | // trading token0 for token1 | require(balance0 > _reserve0, 'TP08');
uint256 amount0In = balance0 - _reserve0;
emit Swap(msg.sender, amount0In, 0, 0, amount1Out, to);
uint256 fee0 = amount0In.mul(swapFee).div(PRECISION);
uint256 balance0After = balance0.sub(fee0);
uint256 bal... | require(balance0 > _reserve0, 'TP08');
uint256 amount0In = balance0 - _reserve0;
emit Swap(msg.sender, amount0In, 0, 0, amount1Out, to);
uint256 fee0 = amount0In.mul(swapFee).div(PRECISION);
uint256 balance0After = balance0.sub(fee0);
uint256 bal... | 57,668 |
37 | // ERC20 // Issues tokens to allowlisted investors to Investor address to issue tokens to amount Amount of tokens to issue | * @dev - Emits {Transfer} event
*
* Can only be called:
* - by transfer agents
* - AFTER token has launched
* - when token is active and cap table is unlocked (via `_beforeTokenTransfer` hook)
*/
function mint(address to, uint256 amount)
public
onlyAfterLaunch
onlyTransferAgent
is... | * @dev - Emits {Transfer} event
*
* Can only be called:
* - by transfer agents
* - AFTER token has launched
* - when token is active and cap table is unlocked (via `_beforeTokenTransfer` hook)
*/
function mint(address to, uint256 amount)
public
onlyAfterLaunch
onlyTransferAgent
is... | 14,471 |
78 | // Solidity already throws when dividing by 0. | return a / b;
| return a / b;
| 816 |
17 | // report stakes the same amount so inital stake amount should be 2x now | tracker.internalContribute (_reporter, this, initialStakeAmount);
totalStakeAmount+=initialStakeAmount; //double take amount
emit Success(3, arbitrateAddr);
return true;
| tracker.internalContribute (_reporter, this, initialStakeAmount);
totalStakeAmount+=initialStakeAmount; //double take amount
emit Success(3, arbitrateAddr);
return true;
| 32,200 |
165 | // Update the swap router.Can only be called by the current operator. / | function updateuniSwapRouter(address _router) public onlyOperator {
uniSwapRouter = IUniswapV2Router02(_router);
uniSwapPair = IUniswapV2Factory(uniSwapRouter.factory()).getPair(address(this), uniSwapRouter.WETH());
require(uniSwapPair != address(0), "updateTokenSwapRouter: Invalid pair addr... | function updateuniSwapRouter(address _router) public onlyOperator {
uniSwapRouter = IUniswapV2Router02(_router);
uniSwapPair = IUniswapV2Factory(uniSwapRouter.factory()).getPair(address(this), uniSwapRouter.WETH());
require(uniSwapPair != address(0), "updateTokenSwapRouter: Invalid pair addr... | 23,988 |
3 | // Reverts if `n` does not fit in a `uint96`. | function toUint96(uint256 n) internal pure returns (uint96) {
if (n > type(uint96).max) revert UnsafeCast(n);
return uint96(n);
}
| function toUint96(uint256 n) internal pure returns (uint96) {
if (n > type(uint96).max) revert UnsafeCast(n);
return uint96(n);
}
| 33,935 |
140 | // Match complementary orders that have a profitable spread./Each order is filled at their respective price point, and/the matcher receives a profit denominated in the left maker asset./leftOrders Set of orders with the same maker / taker asset./rightOrders Set of orders to match against `leftOrders`/leftSignatures Pro... | function batchMatchOrders(
LibOrder.Order[] memory leftOrders,
LibOrder.Order[] memory rightOrders,
bytes[] memory leftSignatures,
bytes[] memory rightSignatures
)
public
payable
returns (LibFillResults.BatchMatchedFillResults memory batchMatchedFillResult... | function batchMatchOrders(
LibOrder.Order[] memory leftOrders,
LibOrder.Order[] memory rightOrders,
bytes[] memory leftSignatures,
bytes[] memory rightSignatures
)
public
payable
returns (LibFillResults.BatchMatchedFillResults memory batchMatchedFillResult... | 44,355 |
78 | // Decrease the total amount that's been paid out to maintain invariance. | totalPayouts -= payoutDiff;
| totalPayouts -= payoutDiff;
| 60,010 |
28 | // push a request to the land owner | // function requstToLandOwner(uint id) public {
// require(_LandRegistry[_msgSender()].land[id].isAvailable);
// _LandRegistry[_msgSender()].land[id].requester=msg.sender;
// _LandRegistry[_msgSender()].land[id].isAvailable=false;
// _LandRegistry[_msgSender()].land[id].requestStatus... | // function requstToLandOwner(uint id) public {
// require(_LandRegistry[_msgSender()].land[id].isAvailable);
// _LandRegistry[_msgSender()].land[id].requester=msg.sender;
// _LandRegistry[_msgSender()].land[id].isAvailable=false;
// _LandRegistry[_msgSender()].land[id].requestStatus... | 47,519 |
108 | // 減資数量が対象アドレスのロック数量を上回っている場合はエラー | if (lockedOf(_locked_address, _target_address) < _amount) revert();
| if (lockedOf(_locked_address, _target_address) < _amount) revert();
| 45,193 |
13 | // Give buyer | token = ERC20(idToOffer[_id].offeredContract);
token.transfer(msg.sender, idToOffer[_id].offeredAmount);
idToOffer[_id].buyer = msg.sender;
idToOffer[_id].status = 1;
| token = ERC20(idToOffer[_id].offeredContract);
token.transfer(msg.sender, idToOffer[_id].offeredAmount);
idToOffer[_id].buyer = msg.sender;
idToOffer[_id].status = 1;
| 16,599 |
69 | // Function to be called by top level contract to prevent being initialized.Useful for freezing base contracts when they're used behind proxies./ | function petrify() internal onlyInit {
initializedAt(PETRIFIED_BLOCK);
}
| function petrify() internal onlyInit {
initializedAt(PETRIFIED_BLOCK);
}
| 9,780 |
255 | // enforce that maxValue is greater than or equal to minValue | require(leverMaxValues[k] >= leverMinValues[k], "Max val must >= min");
| require(leverMaxValues[k] >= leverMinValues[k], "Max val must >= min");
| 28,439 |
469 | // collateral_equivalent_d18 = collateral_equivalent_d18.sub((collateral_equivalent_d18.mul(params.buyback_fee)).div(1e6)); |
return (
collateral_equivalent_d18
);
|
return (
collateral_equivalent_d18
);
| 31,211 |
3 | // Human 0.1 standard. Just an arbitrary versioning scheme. | string public constant version = 'H0.1';
uint constant public TOKEN_COST_PER_SWEEPSTAKES = 1;
function PryzeToken(
uint256 _initialAmount
| string public constant version = 'H0.1';
uint constant public TOKEN_COST_PER_SWEEPSTAKES = 1;
function PryzeToken(
uint256 _initialAmount
| 121 |
107 | // Reorg all tokens array | uint256 tokenIndex = allTokensIndex[_tokenId];
uint256 lastTokenIndex = allTokens.length.sub(1);
uint256 lastToken = allTokens[lastTokenIndex];
allTokens[tokenIndex] = lastToken;
allTokens[lastTokenIndex] = 0;
allTokens.length--;
allTokensIndex[_tokenId] = 0;
allTokensIndex[lastToken] ... | uint256 tokenIndex = allTokensIndex[_tokenId];
uint256 lastTokenIndex = allTokens.length.sub(1);
uint256 lastToken = allTokens[lastTokenIndex];
allTokens[tokenIndex] = lastToken;
allTokens[lastTokenIndex] = 0;
allTokens.length--;
allTokensIndex[_tokenId] = 0;
allTokensIndex[lastToken] ... | 39,980 |
69 | // Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call:- if using `revokeRole`, it is the admin role bearer- if using `renounceRole`, it is the role bearer (i.e. `account`) / | event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
| event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
| 2,068 |
12 | // If already abandoned throw an error // Work out a refund per share per share // Enum all accounts and send them refund // Calculate how much goes to this shareholder // Allocate appropriate amount of fund to them // Audit the abandonment / There should be no money left, but withdraw just incase for manual resolution | uint256 remainder = this.balance.sub(totalAbandoned);
if (remainder > 0)
if (!msg.sender.send(remainder))
| uint256 remainder = this.balance.sub(totalAbandoned);
if (remainder > 0)
if (!msg.sender.send(remainder))
| 31,983 |
4 | // beneficiary Receives all the money (when finalizing Round1 & Round2) | 0x9a1Fc7173086412A10dE27A9d1d543af3AB68262,
| 0x9a1Fc7173086412A10dE27A9d1d543af3AB68262,
| 27,727 |
0 | // Store internals // Store Events / | struct Customer {
address adr;
bytes32 name;
uint256 balance;
Cart cart;
}
| struct Customer {
address adr;
bytes32 name;
uint256 balance;
Cart cart;
}
| 6,440 |
2 | // Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
uint256 c = a - b;
return c;
}
| function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
uint256 c = a - b;
return c;
}
| 48,545 |
4 | // Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by theimplementation. It is used to validate that the this implementation remains valid after an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risksbrickin... | function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SECONDARY_SLOT;
}
| function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SECONDARY_SLOT;
}
| 33,963 |
118 | // If 1inch return 0, check from Bancor network for ensure this is not a Bancor pool | uint256 oneInchResult = getValueViaOneInch(_from, _to, _amount);
if(oneInchResult > 0)
return oneInchResult;
| uint256 oneInchResult = getValueViaOneInch(_from, _to, _amount);
if(oneInchResult > 0)
return oneInchResult;
| 15,021 |
87 | // Returns true if the caller is the current registryAdmin. / | function isRegistryAdmin() public view returns (bool) {
return _msgSender() == _registryAdmin;
}
| function isRegistryAdmin() public view returns (bool) {
return _msgSender() == _registryAdmin;
}
| 32,607 |
5 | // Sets the address of the ERC20 precompiled contract for GLMR Sets the address of the ERC20 precompiled contract for GLMR _glmr The new GLMR contract address / | function setGLMR(IERC20 _glmr) external onlyOwner {
glmr = _glmr;
}
| function setGLMR(IERC20 _glmr) external onlyOwner {
glmr = _glmr;
}
| 23,195 |
19 | // revert if too late | require(
lockTime + lockWindow >= block.timestamp,
"the lock window has expired"
);
| require(
lockTime + lockWindow >= block.timestamp,
"the lock window has expired"
);
| 18,946 |
130 | // actually retrieve the code, this needs assembly | extcodecopy(_addr, add(outCode, 0x20), 0, size)
| extcodecopy(_addr, add(outCode, 0x20), 0, size)
| 26,160 |
27 | // OrderedSet of active token contracts | RankedAddressSet.Set private _rankedContracts;
| RankedAddressSet.Set private _rankedContracts;
| 8,198 |
4 | // StorageV2 | struct Market {
/// @notice Whether or not this market is listed
bool isListed;
/**
* @notice Multiplier representing the most one can borrow against their collateral in this market.
* For instance, 0.9 to allow borrowing 90% of collateral value.
* Must be betwe... | struct Market {
/// @notice Whether or not this market is listed
bool isListed;
/**
* @notice Multiplier representing the most one can borrow against their collateral in this market.
* For instance, 0.9 to allow borrowing 90% of collateral value.
* Must be betwe... | 15,008 |
46 | // Clones a contract, pulled from Convex Booster. Not specific to Convex vaults./implementation The address of the implementation to clone/ return result The address of the newly cloned contract | function _clone(address implementation) internal returns (address result) {
bytes20 implementationBytes = bytes20(implementation);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clo... | function _clone(address implementation) internal returns (address result) {
bytes20 implementationBytes = bytes20(implementation);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clo... | 21,641 |
497 | // no Auctions for 1 dynasty | validatorAuction[validatorId].startEpoch = _currentEpoch;
_logger.logStaked(signer, signerPubkey, validatorId, _currentEpoch, amount, newTotalStaked);
NFTCounter = validatorId.add(1);
return validatorId;
| validatorAuction[validatorId].startEpoch = _currentEpoch;
_logger.logStaked(signer, signerPubkey, validatorId, _currentEpoch, amount, newTotalStaked);
NFTCounter = validatorId.add(1);
return validatorId;
| 45,689 |
8 | // See {IIdentityRegistry-deleteIdentity}. / | function deleteIdentity(address _userAddress) external override onlyAgent {
IIdentity oldIdentity = identity(_userAddress);
_tokenIdentityStorage.removeIdentityFromStorage(_userAddress);
emit IdentityRemoved(_userAddress, oldIdentity);
}
| function deleteIdentity(address _userAddress) external override onlyAgent {
IIdentity oldIdentity = identity(_userAddress);
_tokenIdentityStorage.removeIdentityFromStorage(_userAddress);
emit IdentityRemoved(_userAddress, oldIdentity);
}
| 7,399 |
0 | // MAIN TOKEN PROPERTIES | string private constant NAME = "Maka";
string private constant SYMBOL = "MAKA";
uint8 private constant DECIMALS = 9;
uint8 private _liquidityFee; //% of each transaction that will be added as liquidity
uint8 private _rewardFee; //% of each transaction that will be used for BNB reward pool
uint8 private _additiona... | string private constant NAME = "Maka";
string private constant SYMBOL = "MAKA";
uint8 private constant DECIMALS = 9;
uint8 private _liquidityFee; //% of each transaction that will be added as liquidity
uint8 private _rewardFee; //% of each transaction that will be used for BNB reward pool
uint8 private _additiona... | 24,428 |
63 | // check for no remaining blocks to be mined must wait for `randomNumbers[_requestor].waitTime` to be excceeded | if (_remainingBlocks(_requestor) == 0) {
| if (_remainingBlocks(_requestor) == 0) {
| 35,683 |
7 | // "This is the distribution contract for holders of the GSG-Official (GSGO) Token." | GSGO_Official_LoyaltyPlan = address(0x727395b95C90DEab2F220Ce42615d9dD0F44e187);
dev1 = address(0x88F2E544359525833f606FB6c63826E143132E7b);
dev2 = address(0x7cF196415CDD1eF08ca2358a8282D33Ba089B9f3);
currentId = 0;
day = now;
| GSGO_Official_LoyaltyPlan = address(0x727395b95C90DEab2F220Ce42615d9dD0F44e187);
dev1 = address(0x88F2E544359525833f606FB6c63826E143132E7b);
dev2 = address(0x7cF196415CDD1eF08ca2358a8282D33Ba089B9f3);
currentId = 0;
day = now;
| 24,609 |
15 | // Get all claims for protocol `_protocol` and nonce `_nonce` _protocol address: contract address of the protocol that COVER supports _nonce uint256: nonce of the protocolreturn all claims for protocol and nonce / | function getAllClaimsByNonce(address _protocol, uint256 _nonce)
external
view
override
returns (Claim[] memory)
| function getAllClaimsByNonce(address _protocol, uint256 _nonce)
external
view
override
returns (Claim[] memory)
| 34,698 |
11 | // refund | if (remainingEth > 0) {
(done, ) = address(msg.sender).call{value: remainingEth}("");
}
| if (remainingEth > 0) {
(done, ) = address(msg.sender).call{value: remainingEth}("");
}
| 23,379 |
103 | // send amount | if(!_withdrawalSigner.send(_withdrawalAmount)) {
emit LogError(version, "WITHDRAWAL_VOUCHER_ETH_TRANSFER_FAILED");
return;
}
| if(!_withdrawalSigner.send(_withdrawalAmount)) {
emit LogError(version, "WITHDRAWAL_VOUCHER_ETH_TRANSFER_FAILED");
return;
}
| 44,128 |
73 | // Sets the needed variables for the market _feeRate : The percentage for the fee i.e 20 _creatorVault : The vault for fee to go to _curveLibrary : Math module. _collateralToken : The ERC20 collateral tokem/ | constructor(
uint256 _feeRate,
address _creatorVault,
address _curveLibrary,
address _collateralToken
)
public
| constructor(
uint256 _feeRate,
address _creatorVault,
address _curveLibrary,
address _collateralToken
)
public
| 4,957 |
123 | // Hence, curr will not underflow. |
while (true) {
curr--;
ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
|
while (true) {
curr--;
ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
| 26,010 |
8 | // All token supply with 90% being auctioned | uint256 expectedInitialSupply = 11111112000000000000000000;
| uint256 expectedInitialSupply = 11111112000000000000000000;
| 49,683 |
8 | // Note - caller must have increased xFUND allowance for this contract first. Fee is transferred from msg.sender to this contract. The VORCoordinator.requestRandomness function will then transfer from this contract to itself. This contract's owner must have increased the VORCoordnator's allowance for this contract. | xFUND.transferFrom(msg.sender, address(this), _fee);
requestId = requestRandomness(_keyHash, _fee, _seed);
emit StartingDistribute(nextDistributionId, requestId, msg.sender, _ipfs, _sourceCount, _destCount, _dataType, _seed, _keyHash, _fee);
requestIdToAddress[requestId] = msg.sender;
... | xFUND.transferFrom(msg.sender, address(this), _fee);
requestId = requestRandomness(_keyHash, _fee, _seed);
emit StartingDistribute(nextDistributionId, requestId, msg.sender, _ipfs, _sourceCount, _destCount, _dataType, _seed, _keyHash, _fee);
requestIdToAddress[requestId] = msg.sender;
... | 35,543 |
2 | // only Governors | function changeMarketApproval(address _market) external;
function addArtist(address _newArtist) external;
function removeArtist(address _oldArtist) external;
function addAffiliate(address _newAffiliate) external;
function removeAffiliate(address _oldAffiliate) external;
| function changeMarketApproval(address _market) external;
function addArtist(address _newArtist) external;
function removeArtist(address _oldArtist) external;
function addAffiliate(address _newAffiliate) external;
function removeAffiliate(address _oldAffiliate) external;
| 25,300 |
26 | // Returns the number of tokens in ``owner``'s account. / | function balanceOf(address owner) external view returns (uint256 balance);
| function balanceOf(address owner) external view returns (uint256 balance);
| 2,620 |
174 | // Returns the downcasted uint64 from uint256, reverting onoverflow (when the input is greater than largest uint64). Counterpart to Solidity's `uint64` operator. Requirements: - input must fit into 64 bits / | function toUint64(uint256 value) internal pure returns (uint64) {
require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
return uint64(value);
}
| function toUint64(uint256 value) internal pure returns (uint64) {
require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
return uint64(value);
}
| 14,335 |
33 | // last time the senior interest has been updated | uint public lastUpdateSeniorInterest;
Fixed27 public maxSeniorRatio;
Fixed27 public minSeniorRatio;
uint public maxReserve;
TrancheLike_2 public seniorTranche;
TrancheLike_2 public juniorTranche;
NAVFeedLike_2 public navFeed;
| uint public lastUpdateSeniorInterest;
Fixed27 public maxSeniorRatio;
Fixed27 public minSeniorRatio;
uint public maxReserve;
TrancheLike_2 public seniorTranche;
TrancheLike_2 public juniorTranche;
NAVFeedLike_2 public navFeed;
| 41,584 |
5 | // Set the minter address, can only be called by the owner (governance) _minter The address of the minter _seedAmount The amount of tokens to seed the minter with / | function setMinter(address _minter, uint256 _seedAmount) external;
function burn(uint256 _amount) external;
function mint(address _account, uint _amount) external;
| function setMinter(address _minter, uint256 _seedAmount) external;
function burn(uint256 _amount) external;
function mint(address _account, uint _amount) external;
| 11,750 |
40 | // Finish minting / | function finishMinting() public onlyOwner returns (bool) {
mintingFinished = true;
endSaleTime = now;
startRebuyTime = endSaleTime + (180 * 1 days);
MintFinished();
return true;
}
| function finishMinting() public onlyOwner returns (bool) {
mintingFinished = true;
endSaleTime = now;
startRebuyTime = endSaleTime + (180 * 1 days);
MintFinished();
return true;
}
| 1,567 |
14 | // ========== CONSTRUCTOR ========== // Sets the immutable values_stakingToken SPOOL token _voSpool Spool voting token (voSPOOL) _voSpoolRewards voSPOOL rewards contract _rewardDistributor reward distributor contract _spoolOwner Spool DAO owner contract / | constructor(
IERC20 _stakingToken,
IVoSPOOL _voSpool,
IVoSpoolRewards _voSpoolRewards,
IRewardDistributor _rewardDistributor,
ISpoolOwner _spoolOwner
) SpoolOwnable(_spoolOwner) {
stakingToken = _stakingToken;
| constructor(
IERC20 _stakingToken,
IVoSPOOL _voSpool,
IVoSpoolRewards _voSpoolRewards,
IRewardDistributor _rewardDistributor,
ISpoolOwner _spoolOwner
) SpoolOwnable(_spoolOwner) {
stakingToken = _stakingToken;
| 52,087 |
37 | // the root key holder has permission, so bind it | IKeyVault(keyVault).soulbind(keyHolder, keyId, amount);
| IKeyVault(keyVault).soulbind(keyHolder, keyId, amount);
| 15,634 |
2 | // Mints `amount` eTokens to `user`, only the LendingPool Contract can call this function. user The address receiving the minted tokens amount The amount of tokens getting minted / | function mint(
address user,
uint256 amount
| function mint(
address user,
uint256 amount
| 17,183 |
305 | // Sets the `name()` record for the reverse FNS record associated withthe calling account. First updates the resolver to the default reverseresolver if necessary. name The name to set for this address.return The FNS node hash of the reverse record. / | function setName(string memory name) public override returns (bytes32) {
return
setNameForAddr(
msg.sender,
msg.sender,
address(defaultResolver),
name
);
}
| function setName(string memory name) public override returns (bytes32) {
return
setNameForAddr(
msg.sender,
msg.sender,
address(defaultResolver),
name
);
}
| 28,874 |
210 | // Removes countries restriction in batch. Identities from those countries will again be authorised to manipulate Tokens linked to this Compliance._countries Countries to be unrestricted, should be expressed by following numeric ISO 3166-1 standard Only the owner of the Compliance smart contract can call this function ... | function batchUnrestrictCountries(uint16[] calldata _countries) external onlyOwner {
for (uint i = 0; i < _countries.length; i++) {
_restrictedCountries[_countries[i]] = false;
emit RemovedRestrictedCountry(_countries[i]);
}
}
| function batchUnrestrictCountries(uint16[] calldata _countries) external onlyOwner {
for (uint i = 0; i < _countries.length; i++) {
_restrictedCountries[_countries[i]] = false;
emit RemovedRestrictedCountry(_countries[i]);
}
}
| 86,822 |
18 | // Orders the contract by its available liquidity self The slice to operate on.return The contract with possbile maximum return / | function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) {
if (self._len == 0) {
return 0;
}
uint word;
uint length;
uint divisor = 2 ** 248;
// Load the rune into the MSBs of b
assembly { word:= mload(mload(add(self... | function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) {
if (self._len == 0) {
return 0;
}
uint word;
uint length;
uint divisor = 2 ** 248;
// Load the rune into the MSBs of b
assembly { word:= mload(mload(add(self... | 14,719 |
126 | // Update ice reward for all the active pools. Be careful of gas spending! | function massUpdatePools() public {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
PoolInfo memory pool = poolInfo[pid];
if (pool.allocPoint != 0) {
updatePool(pid);
}
}
}
| function massUpdatePools() public {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
PoolInfo memory pool = poolInfo[pid];
if (pool.allocPoint != 0) {
updatePool(pid);
}
}
}
| 13,524 |
76 | // bool public isPaused = true; | string private _baseURL = "";
mapping(address => uint) private _walletMintedCount;
constructor()
| string private _baseURL = "";
mapping(address => uint) private _walletMintedCount;
constructor()
| 5,513 |
89 | // the y-vault corresponding to the underlying asset | address public yVault;
| address public yVault;
| 49,901 |
6 | // Information about rewards | struct RewardInfo {
uint256 totalReceived; // Amount of tokens received as reward
uint256 totalReceivedFlow; // How much the above was worth in flow
}
| struct RewardInfo {
uint256 totalReceived; // Amount of tokens received as reward
uint256 totalReceivedFlow; // How much the above was worth in flow
}
| 15,369 |
24 | // Base64/Brecht Devos - <[email protected]>/Provides functions for encoding/decoding base64 | library Base64 {
string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
hex"00000000000000000000003e00000... | library Base64 {
string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
hex"00000000000000000000003e00000... | 13,826 |
0 | // MAJz Token Smart ContractSymbol: MAZName: MAJz Total Supply: 560 000 000Decimals: 18 Almar Blockchain Technology // Ownership Contract for authorization Controland 0x0 Validation/ | contract Ownership {
address public _owner;
modifier onlyOwner() { require(msg.sender == _owner); _; }
modifier validDestination( address to ) { require(to != address(0x0)); _; }
}
| contract Ownership {
address public _owner;
modifier onlyOwner() { require(msg.sender == _owner); _; }
modifier validDestination( address to ) { require(to != address(0x0)); _; }
}
| 28,466 |
38 | // Remove the balance of AVT associated with a staker. staker the address of the staker node the index of the node / | function removeStaker(address staker, uint8 node)
external
onlyOwner
| function removeStaker(address staker, uint8 node)
external
onlyOwner
| 36,228 |
126 | // A function used in case of strategy failure, possibly due to bug in theplatform our strategy is using, governance can stop using it quick | function emergencyStopStrategy() external onlyGovernance {
depositsOpen = false;
if(currentStrategy != StabilizeStrategy(address(0))){
currentStrategy.exit(); // Pulls all the tokens and accessory tokens from the strategy
}
currentStrategy = StabilizeStrategy(address(0))... | function emergencyStopStrategy() external onlyGovernance {
depositsOpen = false;
if(currentStrategy != StabilizeStrategy(address(0))){
currentStrategy.exit(); // Pulls all the tokens and accessory tokens from the strategy
}
currentStrategy = StabilizeStrategy(address(0))... | 37,651 |
128 | // 设置兑换最小额最大额 / | function setExchangeAmount(uint256 minAmount,uint256 maxAmount) public onlyOwner{
_minExAmount=minAmount;
_maxExAmount=maxAmount;
}
| function setExchangeAmount(uint256 minAmount,uint256 maxAmount) public onlyOwner{
_minExAmount=minAmount;
_maxExAmount=maxAmount;
}
| 12,832 |
29 | // wallet that is allowed to distribute tokens on behalf of the app store | address public APP_STORE;
| address public APP_STORE;
| 18,638 |
143 | // If txAwareHash from the meta-transaction is non-zero, we must verify it matches the hash signed by the respective signers. | require(
txAwareHash == 0 || txAwareHash == _txAwareHash,
"TX_INNER_HASH_MISMATCH"
);
| require(
txAwareHash == 0 || txAwareHash == _txAwareHash,
"TX_INNER_HASH_MISMATCH"
);
| 54,089 |
16 | // Anything else is illegal (We do not return false because the signature may actually be valid, just not in a format that we currently support. In this case returning false may lead the caller to incorrectly believe that the signature was invalid.) | revert("SignatureValidator#isValidSignature: unsupported signature");
| revert("SignatureValidator#isValidSignature: unsupported signature");
| 16,158 |
174 | // Ensures the result has not been reported yet | modifier resultNotIncluded(uint256 _id) {
require(requests[_id].result.length == 0, "Result already included");
_;
}
| modifier resultNotIncluded(uint256 _id) {
require(requests[_id].result.length == 0, "Result already included");
_;
}
| 59,841 |
26 | // Calculates the total repayment value expected at the end of the loan's term. This computation assumes that interest is paid per amortization period.params SimpleInterestParams. The parameters that define the simple interest loan.return uint The total repayment value expected at the end of the loan's term. / | function calculateTotalPrincipalPlusInterest(
SimpleInterestParams params
)
internal
returns (uint _principalPlusInterest)
| function calculateTotalPrincipalPlusInterest(
SimpleInterestParams params
)
internal
returns (uint _principalPlusInterest)
| 31,425 |
17 | // ------------------------------------------------------------------------ Get the token balance for account tokenOwner ------------------------------------------------------------------------ | function balanceOf(address tokenOwner) public view returns (uint256 balance) {
return balances[tokenOwner];
}
| function balanceOf(address tokenOwner) public view returns (uint256 balance) {
return balances[tokenOwner];
}
| 31,919 |
304 | // Does not overflow because the denominator cannot be zero at this stage in the function. | uint256 lpotdod = denominator & (~denominator + 1);
assembly {
| uint256 lpotdod = denominator & (~denominator + 1);
assembly {
| 69,370 |
41 | // INTERNAL AND PRIVATE FUNCTIONS------------------------------------------------------- | function _unstake(uint256 id, bool isWithoutPenalty) internal nonReentrant {
address staker = _msgSender();
uint256 today = _currentDay();
_rewriteTodayVars();
require(userStakes[staker].ids.length > 0, "Error: you haven't stakes");
require(userStakes[staker].indexes[id] != 0... | function _unstake(uint256 id, bool isWithoutPenalty) internal nonReentrant {
address staker = _msgSender();
uint256 today = _currentDay();
_rewriteTodayVars();
require(userStakes[staker].ids.length > 0, "Error: you haven't stakes");
require(userStakes[staker].indexes[id] != 0... | 55,290 |
3 | // Called when MBC mint. | event Mint(address _to, uint256 _value);
| event Mint(address _to, uint256 _value);
| 45,080 |
8 | // Define a function 'renounceRetailer' to renounce this role | function renounceRetailer() public {
_removeRetailer(msg.sender);
}
| function renounceRetailer() public {
_removeRetailer(msg.sender);
}
| 37,094 |
8 | // The net amount each address has contributed to the sustaining of this purpose after redistribution. | mapping(address => uint256) netSustainments;
| mapping(address => uint256) netSustainments;
| 20,907 |
29 | // get 1 sdcp=x eth | function fetchPrice() internal view returns (uint) {
(uint reserve0, uint reserve1,) = IUniswapV2Pair(v2Pair).getReserves();
require(reserve0 > 0 && reserve1 > 0, 'E/INSUFFICIENT_LIQUIDITY');
uint oneSdcp = 10 ** uint(sdcpDec);
if(IUniswapV2Pair(v2Pair).token0() == sdcpToken) {
re... | function fetchPrice() internal view returns (uint) {
(uint reserve0, uint reserve1,) = IUniswapV2Pair(v2Pair).getReserves();
require(reserve0 > 0 && reserve1 > 0, 'E/INSUFFICIENT_LIQUIDITY');
uint oneSdcp = 10 ** uint(sdcpDec);
if(IUniswapV2Pair(v2Pair).token0() == sdcpToken) {
re... | 62,154 |
50 | // Get the base token id | uint256 baseTokenId = _tokenId % 100;
| uint256 baseTokenId = _tokenId % 100;
| 14,767 |
54 | // Set pendingAnchor = Nothing Pending anchor is only used once. | if (pendingAnchors[asset] != 0) {
pendingAnchors[asset] = 0;
}
| if (pendingAnchors[asset] != 0) {
pendingAnchors[asset] = 0;
}
| 45,968 |
185 | // Calculate partner's share | uint256 partnerShare = fee.mul(partnerSharePercent).div(10000);
| uint256 partnerShare = fee.mul(partnerSharePercent).div(10000);
| 27,010 |
160 | // returns the address of the LendingPoolParametersProvider proxy return the address of the Lending pool parameters provider proxy/ | function getLendingPoolParametersProvider() public view returns (address) {
return getAddress(LENDING_POOL_PARAMETERS_PROVIDER);
}
| function getLendingPoolParametersProvider() public view returns (address) {
return getAddress(LENDING_POOL_PARAMETERS_PROVIDER);
}
| 18,510 |
4 | // emitted when tokens are dispensed to an account on this domainemitted both when fast liquidity is provided, and when thetransfer ultimately settles originAndNonce Domain where the transfer originated and the unique identifier for the message from origin to destination, combined in a single field ((origin << 32) & no... | event Receive(
| event Receive(
| 22,341 |
10 | // ], "name": "approve", "outputs": [ | // {
// "name": "success",
// "type": "bool"
// }
| // {
// "name": "success",
// "type": "bool"
// }
| 15,057 |
123 | // get list of loan pools in the system. Ordering is not guaranteed/start start index/count number of pools to return/ return loanPoolsList array of loan pools | function getLoanPoolsList(uint256 start, uint256 count)
external
view
returns (address[] memory loanPoolsList);
| function getLoanPoolsList(uint256 start, uint256 count)
external
view
returns (address[] memory loanPoolsList);
| 45,378 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.