Unnamed: 0 int64 0 7.36k | comments stringlengths 3 35.2k | code_string stringlengths 1 527k | code stringlengths 1 527k | __index_level_0__ int64 0 88.6k |
|---|---|---|---|---|
7 | // 'requestedUser' is an array to store the address of users requesting for tokens.Inorder to not get in a out of gas exceptionof dynamic arrays size we are given a limited amount of user for registration fixed to 10. / |
address[10] public requestedUser;
|
address[10] public requestedUser;
| 28,914 |
55 | // If not tagged with a front end, the depositor gets a 100% cut of what their deposit earned. Otherwise, their cut of the deposit's earnings is equal to the kickbackRate, set by the front end through which they made their deposit./ | uint kickbackRate = frontEndTag == address(0) ? DECIMAL_PRECISION : frontEnds[frontEndTag].kickbackRate;
Snapshots memory snapshots = depositSnapshots[_depositor];
uint LQTYGain = kickbackRate.mul(_getLQTYGainFromSnapshots(initialDeposit, snapshots)).div(DECIMAL_PRECISION);
return LQTYGain;
| uint kickbackRate = frontEndTag == address(0) ? DECIMAL_PRECISION : frontEnds[frontEndTag].kickbackRate;
Snapshots memory snapshots = depositSnapshots[_depositor];
uint LQTYGain = kickbackRate.mul(_getLQTYGainFromSnapshots(initialDeposit, snapshots)).div(DECIMAL_PRECISION);
return LQTYGain;
| 29,815 |
87 | // incase of change Ninja | require(newNinja != address(0), "Ninja Token address invalid");
token = IERC20(newNinja);
| require(newNinja != address(0), "Ninja Token address invalid");
token = IERC20(newNinja);
| 17,123 |
1 | // set the rate | function setRate(uint256 newTaxRate) external onlyOwner {
require(newTaxRate <= 30, "Tax rate must be less than or equal to 30");
tax = newTaxRate;
}
| function setRate(uint256 newTaxRate) external onlyOwner {
require(newTaxRate <= 30, "Tax rate must be less than or equal to 30");
tax = newTaxRate;
}
| 34,791 |
5 | // Returns number of admings. return Number of admings./ | function numOfAdmins() view public returns(uint){
return admins.length;
}
| function numOfAdmins() view public returns(uint){
return admins.length;
}
| 20,273 |
80 | // Minimum tokens expected to sell | uint256 public goal;
| uint256 public goal;
| 27,966 |
172 | // ERC1155Inventory, burnable version. The function `uri(uint256)` needs to be implemented by a child contract, for example with the help of `BaseMetadataURI`. / | abstract contract ERC1155InventoryBurnable is IERC1155InventoryBurnable, ERC1155Inventory {
using ERC1155InventoryIdentifiersLib for uint256;
//======================================================= ERC165 ========================================================//
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC1155InventoryBurnable).interfaceId || super.supportsInterface(interfaceId);
}
//============================================== ERC1155InventoryBurnable ===============================================//
/// @inheritdoc IERC1155InventoryBurnable
function burnFrom(
address from,
uint256 id,
uint256 value
) public virtual override {
address sender = _msgSender();
require(_isOperatable(from, sender), "Inventory: non-approved sender");
if (id.isFungibleToken()) {
_burnFungible(from, id, value);
} else if (id.isNonFungibleToken()) {
_burnNFT(from, id, value, false);
} else {
revert("Inventory: not a token id");
}
emit TransferSingle(sender, from, address(0), id, value);
}
/// @inheritdoc IERC1155InventoryBurnable
function batchBurnFrom(
address from,
uint256[] memory ids,
uint256[] memory values
) public virtual override {
uint256 length = ids.length;
require(length == values.length, "Inventory: inconsistent arrays");
address sender = _msgSender();
require(_isOperatable(from, sender), "Inventory: non-approved sender");
uint256 nfCollectionId;
uint256 nfCollectionCount;
for (uint256 i; i != length; ++i) {
uint256 id = ids[i];
uint256 value = values[i];
if (id.isFungibleToken()) {
_burnFungible(from, id, value);
} else if (id.isNonFungibleToken()) {
_burnNFT(from, id, value, true);
uint256 nextCollectionId = id.getNonFungibleCollection();
if (nfCollectionId == 0) {
nfCollectionId = nextCollectionId;
nfCollectionCount = 1;
} else {
if (nextCollectionId != nfCollectionId) {
_balances[nfCollectionId][from] -= nfCollectionCount;
_supplies[nfCollectionId] -= nfCollectionCount;
nfCollectionId = nextCollectionId;
nfCollectionCount = 1;
} else {
++nfCollectionCount;
}
}
} else {
revert("Inventory: not a token id");
}
}
if (nfCollectionId != 0) {
_balances[nfCollectionId][from] -= nfCollectionCount;
_supplies[nfCollectionId] -= nfCollectionCount;
}
emit TransferBatch(sender, from, address(0), ids, values);
}
//============================================== Helper Internal Functions ==============================================//
function _burnFungible(
address from,
uint256 id,
uint256 value
) internal {
require(value != 0, "Inventory: zero value");
uint256 balance = _balances[id][from];
require(balance >= value, "Inventory: not enough balance");
_balances[id][from] = balance - value;
// Cannot underflow
_supplies[id] -= value;
}
function _burnNFT(
address from,
uint256 id,
uint256 value,
bool isBatch
) internal {
require(value == 1, "Inventory: wrong NFT value");
require(from == address(uint160(_owners[id])), "Inventory: non-owned NFT");
_owners[id] = _BURNT_NFT_OWNER;
if (!isBatch) {
uint256 collectionId = id.getNonFungibleCollection();
// cannot underflow as balance is confirmed through ownership
--_balances[collectionId][from];
// Cannot underflow
--_supplies[collectionId];
}
}
}
| abstract contract ERC1155InventoryBurnable is IERC1155InventoryBurnable, ERC1155Inventory {
using ERC1155InventoryIdentifiersLib for uint256;
//======================================================= ERC165 ========================================================//
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC1155InventoryBurnable).interfaceId || super.supportsInterface(interfaceId);
}
//============================================== ERC1155InventoryBurnable ===============================================//
/// @inheritdoc IERC1155InventoryBurnable
function burnFrom(
address from,
uint256 id,
uint256 value
) public virtual override {
address sender = _msgSender();
require(_isOperatable(from, sender), "Inventory: non-approved sender");
if (id.isFungibleToken()) {
_burnFungible(from, id, value);
} else if (id.isNonFungibleToken()) {
_burnNFT(from, id, value, false);
} else {
revert("Inventory: not a token id");
}
emit TransferSingle(sender, from, address(0), id, value);
}
/// @inheritdoc IERC1155InventoryBurnable
function batchBurnFrom(
address from,
uint256[] memory ids,
uint256[] memory values
) public virtual override {
uint256 length = ids.length;
require(length == values.length, "Inventory: inconsistent arrays");
address sender = _msgSender();
require(_isOperatable(from, sender), "Inventory: non-approved sender");
uint256 nfCollectionId;
uint256 nfCollectionCount;
for (uint256 i; i != length; ++i) {
uint256 id = ids[i];
uint256 value = values[i];
if (id.isFungibleToken()) {
_burnFungible(from, id, value);
} else if (id.isNonFungibleToken()) {
_burnNFT(from, id, value, true);
uint256 nextCollectionId = id.getNonFungibleCollection();
if (nfCollectionId == 0) {
nfCollectionId = nextCollectionId;
nfCollectionCount = 1;
} else {
if (nextCollectionId != nfCollectionId) {
_balances[nfCollectionId][from] -= nfCollectionCount;
_supplies[nfCollectionId] -= nfCollectionCount;
nfCollectionId = nextCollectionId;
nfCollectionCount = 1;
} else {
++nfCollectionCount;
}
}
} else {
revert("Inventory: not a token id");
}
}
if (nfCollectionId != 0) {
_balances[nfCollectionId][from] -= nfCollectionCount;
_supplies[nfCollectionId] -= nfCollectionCount;
}
emit TransferBatch(sender, from, address(0), ids, values);
}
//============================================== Helper Internal Functions ==============================================//
function _burnFungible(
address from,
uint256 id,
uint256 value
) internal {
require(value != 0, "Inventory: zero value");
uint256 balance = _balances[id][from];
require(balance >= value, "Inventory: not enough balance");
_balances[id][from] = balance - value;
// Cannot underflow
_supplies[id] -= value;
}
function _burnNFT(
address from,
uint256 id,
uint256 value,
bool isBatch
) internal {
require(value == 1, "Inventory: wrong NFT value");
require(from == address(uint160(_owners[id])), "Inventory: non-owned NFT");
_owners[id] = _BURNT_NFT_OWNER;
if (!isBatch) {
uint256 collectionId = id.getNonFungibleCollection();
// cannot underflow as balance is confirmed through ownership
--_balances[collectionId][from];
// Cannot underflow
--_supplies[collectionId];
}
}
}
| 34,268 |
57 | // Revoke the approvals for a token. The provided `approve` function is not sufficientfor this protocol, as it does not allow an approved address to revoke it's own approval. / | function revokeApproval(uint256 tokenId) external override nonReentrant {
require(
msg.sender == getApproved(tokenId),
"Media: caller not approved address"
);
_approve(address(0), tokenId);
}
| function revokeApproval(uint256 tokenId) external override nonReentrant {
require(
msg.sender == getApproved(tokenId),
"Media: caller not approved address"
);
_approve(address(0), tokenId);
}
| 45,511 |
90 | // Mints 1 Wantan Mee to contract creator for initial pool setup | _mint(msg.sender, 100 ether);
| _mint(msg.sender, 100 ether);
| 20,743 |
41 | // Send tokens to buyer | purchasableTokens = purchasableTokens.sub(tokens);
balances[owner] = balances[owner].sub(tokens);
balances[addr] = balances[addr].add(tokens);
Transfer(owner, addr, tokens);
| purchasableTokens = purchasableTokens.sub(tokens);
balances[owner] = balances[owner].sub(tokens);
balances[addr] = balances[addr].add(tokens);
Transfer(owner, addr, tokens);
| 37,765 |
271 | // Helper to make usage of the `CREATE2` EVM opcode easier and safer.`CREATE2` can be used to compute in advance the address where a smartcontract will be deployed, which allows for interesting new mechanisms knownas 'counterfactual interactions'. information. / | library Create2 {
/**
* @dev Deploys a contract using `CREATE2`. The address where the contract
* will be deployed can be known in advance via {computeAddress}. Note that
* a contract cannot be deployed twice using the same salt.
*/
function deploy(bytes32 salt, bytes memory bytecode) internal returns (address payable) {
address payable addr;
// solhint-disable-next-line no-inline-assembly
assembly {
addr := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
}
require(addr != address(0), "CREATE2_FAILED");
return addr;
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the `bytecode`
* or `salt` will result in a new destination address.
*/
function computeAddress(bytes32 salt, bytes memory bytecode) internal view returns (address) {
return computeAddress(salt, bytecode, address(this));
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
* `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
*/
function computeAddress(bytes32 salt, bytes memory bytecodeHash, address deployer) internal pure returns (address) {
bytes32 bytecodeHashHash = keccak256(bytecodeHash);
bytes32 _data = keccak256(
abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHashHash)
);
return address(bytes20(_data << 96));
}
}
| library Create2 {
/**
* @dev Deploys a contract using `CREATE2`. The address where the contract
* will be deployed can be known in advance via {computeAddress}. Note that
* a contract cannot be deployed twice using the same salt.
*/
function deploy(bytes32 salt, bytes memory bytecode) internal returns (address payable) {
address payable addr;
// solhint-disable-next-line no-inline-assembly
assembly {
addr := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
}
require(addr != address(0), "CREATE2_FAILED");
return addr;
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the `bytecode`
* or `salt` will result in a new destination address.
*/
function computeAddress(bytes32 salt, bytes memory bytecode) internal view returns (address) {
return computeAddress(salt, bytecode, address(this));
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
* `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
*/
function computeAddress(bytes32 salt, bytes memory bytecodeHash, address deployer) internal pure returns (address) {
bytes32 bytecodeHashHash = keccak256(bytecodeHash);
bytes32 _data = keccak256(
abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHashHash)
);
return address(bytes20(_data << 96));
}
}
| 42,739 |
102 | // Returns whether an account is excluded from reward./ | function isExcludedFromReward(address account) external view returns (bool) {
return _isExcludedFromReward[account];
}
| function isExcludedFromReward(address account) external view returns (bool) {
return _isExcludedFromReward[account];
}
| 25,210 |
47 | // Function to change the ACO pools strategy.Only can be called by a pool admin. strategy Address of the strategy to be set. acoPools Array of ACO pools addresses. / | function setStrategyOnAcoPool(address strategy, address[] calldata acoPools) onlyPoolAdmin external virtual {
_setStrategyOnAcoPool(strategy, acoPools);
}
| function setStrategyOnAcoPool(address strategy, address[] calldata acoPools) onlyPoolAdmin external virtual {
_setStrategyOnAcoPool(strategy, acoPools);
}
| 36,342 |
18 | // IERC20? | interface IImx {
function balanceOf(address account) external view returns (uint);
function transfer(address dst, uint rawAmount) external returns (bool);
}
| interface IImx {
function balanceOf(address account) external view returns (uint);
function transfer(address dst, uint rawAmount) external returns (bool);
}
| 28,275 |
6 | // @todo replace with erc1155 token implementation | contract Token is IToken {
mapping(uint256 => address) public tokens;
mapping(uint256 => uint256) public goals;
// sample function called from dao after voting funding session
function mintCampaign(
address _to,
uint256 _tokenId,
bytes32, /*_campaignHash*/
uint256 _goal,
uint256, /*_startDate*/
uint256, /*_endDate*/
string memory /*_cid*/
) public override {
// @todo mint token using voteId
tokens[_tokenId] = _to;
goals[_tokenId] = _goal;
}
function getBeneficiary(uint256 _tokenId) public view override returns (address beneficiary) {
beneficiary = tokens[_tokenId];
}
function getGoalAmount(uint256 _tokenId) public view override returns (uint256) {
return goals[_tokenId];
}
function exists(uint256 _tokenId) external view override returns (bool) {
return tokens[_tokenId] != address(0);
}
}
| contract Token is IToken {
mapping(uint256 => address) public tokens;
mapping(uint256 => uint256) public goals;
// sample function called from dao after voting funding session
function mintCampaign(
address _to,
uint256 _tokenId,
bytes32, /*_campaignHash*/
uint256 _goal,
uint256, /*_startDate*/
uint256, /*_endDate*/
string memory /*_cid*/
) public override {
// @todo mint token using voteId
tokens[_tokenId] = _to;
goals[_tokenId] = _goal;
}
function getBeneficiary(uint256 _tokenId) public view override returns (address beneficiary) {
beneficiary = tokens[_tokenId];
}
function getGoalAmount(uint256 _tokenId) public view override returns (uint256) {
return goals[_tokenId];
}
function exists(uint256 _tokenId) external view override returns (bool) {
return tokens[_tokenId] != address(0);
}
}
| 16,430 |
5,282 | // 2643 | entry "equidimensionally" : ENG_ADVERB
| entry "equidimensionally" : ENG_ADVERB
| 23,479 |
1 | // pool data view functions | function getA() external view returns (uint256);
function getToken(uint8 index) external view returns (IERC20);
function getTokenIndex(address tokenAddress) external view returns (uint8);
function getTokenBalance(uint8 index) external view returns (uint256);
function getVirtualPrice() external view returns (uint256);
| function getA() external view returns (uint256);
function getToken(uint8 index) external view returns (IERC20);
function getTokenIndex(address tokenAddress) external view returns (uint8);
function getTokenBalance(uint8 index) external view returns (uint256);
function getVirtualPrice() external view returns (uint256);
| 24,732 |
22 | // ERC20 stuff |
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
event Approval(address indexed _owner, address indexed _spender, uint256 _amount);
|
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
event Approval(address indexed _owner, address indexed _spender, uint256 _amount);
| 15,675 |
79 | // Create store user information (db) addr user address code user invite Code rCode recommend code / | function _registerUser(address addr, string memory code, string memory rCode)
internal
| function _registerUser(address addr, string memory code, string memory rCode)
internal
| 7,373 |
1 | // _msgData() is an internal view function that returns the calldata of the message. This function is used to access the calldata of the message. / | function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
| function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
| 33,999 |
32 | // Terminate an auction prematurely. id ID of the auction to settle/terminate / | function terminateAuctionPrematurely(uint256 id) external {
require(contractEnabled == 0, "BurningSurplusAuctionHouse/contract-still-enabled");
require(bids[id].highBidder != address(0), "BurningSurplusAuctionHouse/high-bidder-not-set");
protocolToken.move(address(this), bids[id].highBidder, bids[id].bidAmount);
emit TerminateAuctionPrematurely(id, msg.sender, bids[id].highBidder, bids[id].bidAmount);
delete bids[id];
}
| function terminateAuctionPrematurely(uint256 id) external {
require(contractEnabled == 0, "BurningSurplusAuctionHouse/contract-still-enabled");
require(bids[id].highBidder != address(0), "BurningSurplusAuctionHouse/high-bidder-not-set");
protocolToken.move(address(this), bids[id].highBidder, bids[id].bidAmount);
emit TerminateAuctionPrematurely(id, msg.sender, bids[id].highBidder, bids[id].bidAmount);
delete bids[id];
}
| 8,233 |
348 | // add multiples of the week | for (uint256 i = fromWeek+1; i < toWeek; i++) {
rewards = rewards.add(_rewardsFromPoints(weeklyRewardsPerSecond[i],
SECONDS_PER_WEEK,
weeklyWeightPoints[i].genesisWtPoints))
.add(weeklyBonusPerSecond[address(genesisStaking)][i].mul(SECONDS_PER_WEEK));
}
| for (uint256 i = fromWeek+1; i < toWeek; i++) {
rewards = rewards.add(_rewardsFromPoints(weeklyRewardsPerSecond[i],
SECONDS_PER_WEEK,
weeklyWeightPoints[i].genesisWtPoints))
.add(weeklyBonusPerSecond[address(genesisStaking)][i].mul(SECONDS_PER_WEEK));
}
| 10,716 |
7 | // Ensure we have an hour of data, assuming Uniswap interaction every 10 seconds | _UNI_POOL.increaseObservationCardinalityNext(360);
| _UNI_POOL.increaseObservationCardinalityNext(360);
| 70,860 |
3 | // Modifier throws if called by any account other than the pendingOwner. / | modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
| modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
| 34,109 |
93 | // calculateFraction allows us to better handle the Solidity ugliness of not having decimals as a native type /_numerator is the top part of the fraction we are calculating/_denominator is the bottom part of the fraction we are calculating/_precision tells the function how many significant digits to calculate out to/ return quotient returns the result of our fraction calculation | function calculateFraction(uint _numerator, uint _denominator, uint _precision) pure private returns(uint quotient)
| function calculateFraction(uint _numerator, uint _denominator, uint _precision) pure private returns(uint quotient)
| 41,340 |
197 | // Withdraw without caring about rewards. EMERGENCY ONLY. | function emergencyWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
require(
pool.lock == false ||
(pool.lock && medal.totalSupply() >= halfPeriod)
);
UserInfo storage user = userInfo[_pid][msg.sender];
pool.lpToken.safeTransfer(address(msg.sender), user.amount);
emit EmergencyWithdraw(msg.sender, _pid, user.amount);
user.amount = 0;
user.rewardDebt = 0;
}
| function emergencyWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
require(
pool.lock == false ||
(pool.lock && medal.totalSupply() >= halfPeriod)
);
UserInfo storage user = userInfo[_pid][msg.sender];
pool.lpToken.safeTransfer(address(msg.sender), user.amount);
emit EmergencyWithdraw(msg.sender, _pid, user.amount);
user.amount = 0;
user.rewardDebt = 0;
}
| 385 |
222 | // min. number of active validators for BFT to work properly is 4 | if (actNumOfValidators >= 4) {
uint256 minRequiredSignaturesCount = ((2 * actNumOfValidators) / 3) + 1;
require(involvedSignaturesCount >= minRequiredSignaturesCount, "Invalid statistics data: Not enough signatures provided (2/3 + 1 cond)");
}
| if (actNumOfValidators >= 4) {
uint256 minRequiredSignaturesCount = ((2 * actNumOfValidators) / 3) + 1;
require(involvedSignaturesCount >= minRequiredSignaturesCount, "Invalid statistics data: Not enough signatures provided (2/3 + 1 cond)");
}
| 18,631 |
8 | // Returns the current length of the token list./ return The current token list length. | function tokenlistLength() public view virtual returns (uint256) {
return _tokenlistLengthCheckpoints.latest();
}
| function tokenlistLength() public view virtual returns (uint256) {
return _tokenlistLengthCheckpoints.latest();
}
| 27,844 |
43 | // Implement main ERC20 functions / | abstract contract MainContract is Deflationary {
using SafeMath for uint256;
constructor (string memory name, string memory symbol) {
_name = name;
_symbol = symbol;
}
function transfer(address recipient, uint256 amount) external override returns (bool){
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) public virtual override not0(spender) returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address receiver, uint256 amount) external override not0(sender) not0(receiver) returns (bool){
require(_allowances[sender][msg.sender] >= amount);
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount);
_transfer(sender, receiver, amount);
return true;
}
function _transfer(address sender, address receiver, uint256 amount) internal not0(sender) not0(receiver) burnHook(sender, receiver, amount) {
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[receiver] = _balances[receiver].add(amount);
emit Transfer(sender, receiver, amount);
}
function _mint(address payable account, uint256 amount) internal {
require(!_minted);
uint256 amountActual = amount*(10**_decimals);
_totalSupply = _totalSupply.add(amountActual);
_balances[account] = _balances[account].add(amountActual);
emit Transfer(address(0), account, amountActual);
}
}
| abstract contract MainContract is Deflationary {
using SafeMath for uint256;
constructor (string memory name, string memory symbol) {
_name = name;
_symbol = symbol;
}
function transfer(address recipient, uint256 amount) external override returns (bool){
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) public virtual override not0(spender) returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address receiver, uint256 amount) external override not0(sender) not0(receiver) returns (bool){
require(_allowances[sender][msg.sender] >= amount);
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount);
_transfer(sender, receiver, amount);
return true;
}
function _transfer(address sender, address receiver, uint256 amount) internal not0(sender) not0(receiver) burnHook(sender, receiver, amount) {
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[receiver] = _balances[receiver].add(amount);
emit Transfer(sender, receiver, amount);
}
function _mint(address payable account, uint256 amount) internal {
require(!_minted);
uint256 amountActual = amount*(10**_decimals);
_totalSupply = _totalSupply.add(amountActual);
_balances[account] = _balances[account].add(amountActual);
emit Transfer(address(0), account, amountActual);
}
}
| 14,744 |
248 | // called when user wants to withdraw tokens back to root chain Should burn user's tokens. This transaction will be verified when exiting on root chain amount amount of tokens to withdraw / | function withdraw(uint256 amount) external virtual {
_burn(_msgSender(), amount);
}
| function withdraw(uint256 amount) external virtual {
_burn(_msgSender(), amount);
}
| 8,919 |
24 | // Interactions | successes = new bool[](calls.length);
results = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(calls[i]);
require(success || !revertOnFail, _getRevertMsg(result));
successes[i] = success;
results[i] = result;
}
| successes = new bool[](calls.length);
results = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(calls[i]);
require(success || !revertOnFail, _getRevertMsg(result));
successes[i] = success;
results[i] = result;
}
| 5,778 |
395 | // Get the bveCVX here | _exchange(
address(cvxToken),
address(bveCVX),
cvxToDistribute,
minbveCVXOut,
0,
true
);
uint256 bveCVXAmount = bveCVX.balanceOf(address(this));
| _exchange(
address(cvxToken),
address(bveCVX),
cvxToDistribute,
minbveCVXOut,
0,
true
);
uint256 bveCVXAmount = bveCVX.balanceOf(address(this));
| 8,312 |
19 | // Withdraw ERC20 token to owner | function withdrawToken(address _tokenContract) external onlyOwner {
IERC20 tokenContract = IERC20(_tokenContract);
// needs to execute `approve()` on the token contract to allow itself the transfer
uint256 balance = IERC20(_tokenContract).balanceOf(address(this));
tokenContract.approve(address(this), balance);
tokenContract.transferFrom(address(this), owner(), balance);
emit Withdrawn(owner(), balance);
}
| function withdrawToken(address _tokenContract) external onlyOwner {
IERC20 tokenContract = IERC20(_tokenContract);
// needs to execute `approve()` on the token contract to allow itself the transfer
uint256 balance = IERC20(_tokenContract).balanceOf(address(this));
tokenContract.approve(address(this), balance);
tokenContract.transferFrom(address(this), owner(), balance);
emit Withdrawn(owner(), balance);
}
| 28,499 |
57 | // parses the passed in action arguments to get the arguments for an redeem action _args general action arguments structurereturn arguments for a redeem action / | function _parseRedeemArgs(ActionArgs memory _args) internal pure returns (RedeemArgs memory) {
require(_args.actionType == ActionType.Redeem, "Actions: can only parse arguments for redeem actions");
require(_args.secondAddress != address(0), "Actions: cannot redeem to an invalid account");
return RedeemArgs({receiver: _args.secondAddress, otoken: _args.asset, amount: _args.amount});
}
| function _parseRedeemArgs(ActionArgs memory _args) internal pure returns (RedeemArgs memory) {
require(_args.actionType == ActionType.Redeem, "Actions: can only parse arguments for redeem actions");
require(_args.secondAddress != address(0), "Actions: cannot redeem to an invalid account");
return RedeemArgs({receiver: _args.secondAddress, otoken: _args.asset, amount: _args.amount});
}
| 31,335 |
194 | // transfer tokens or wrap ETH | if (fromToken == ETH_ADDRESS) {
require(msg.value == amount, "Slingshot: incorrect ETH value");
WETH.deposit{value: amount}();
| if (fromToken == ETH_ADDRESS) {
require(msg.value == amount, "Slingshot: incorrect ETH value");
WETH.deposit{value: amount}();
| 75,459 |
73 | // setup temp var for player eth | uint256 _eth;
| uint256 _eth;
| 7,637 |
2 | // Withdraw specified amount/A configurable percentage of DRC is burnt on withdrawal | function _withdraw(uint256 amount) internal override nonReentrant updateReward(msg.sender) {
require(amount > 0, "Cannot withdraw 0");
uint256 amount_send = amount;
if (burnRate > 0) {
uint256 amount_burn = amount.mul(burnRate).div(1000);
amount_send = amount.sub(amount_burn);
require(amount == amount_send.add(amount_burn), "Burn value invalid");
DraculaToken(address(stakingToken)).burn(amount_burn);
}
totalStaked = totalStaked.sub(amount);
stakedBalances[msg.sender] = stakedBalances[msg.sender].sub(amount);
stakingToken.safeTransfer(msg.sender, amount_send);
emit Withdrawn(msg.sender, amount_send);
}
| function _withdraw(uint256 amount) internal override nonReentrant updateReward(msg.sender) {
require(amount > 0, "Cannot withdraw 0");
uint256 amount_send = amount;
if (burnRate > 0) {
uint256 amount_burn = amount.mul(burnRate).div(1000);
amount_send = amount.sub(amount_burn);
require(amount == amount_send.add(amount_burn), "Burn value invalid");
DraculaToken(address(stakingToken)).burn(amount_burn);
}
totalStaked = totalStaked.sub(amount);
stakedBalances[msg.sender] = stakedBalances[msg.sender].sub(amount);
stakingToken.safeTransfer(msg.sender, amount_send);
emit Withdrawn(msg.sender, amount_send);
}
| 44,919 |
159 | // Address of the RewardEscrow contract / | address public rewardEscrow;
| address public rewardEscrow;
| 42,324 |
392 | // query the balance of given token held by given address account address to query id token to queryreturn token balance / | function balanceOf(address account, uint256 id)
external
view
returns (uint256);
| function balanceOf(address account, uint256 id)
external
view
returns (uint256);
| 22,833 |
73 | // preventing overflow on the totalSupply | if (totalSupply + _amount < totalSupply) revert();
| if (totalSupply + _amount < totalSupply) revert();
| 22,716 |
30 | // Constructor adds owner to undeletable list | function Owner() public {
// Owner creation
ownerAddressMap[ msg.sender ] = true;
ownerAddressNumberMap[ msg.sender ] = ownerCountInt;
ownerListMap[ ownerCountInt ] = msg.sender;
ownerCountInt++;
}
| function Owner() public {
// Owner creation
ownerAddressMap[ msg.sender ] = true;
ownerAddressNumberMap[ msg.sender ] = ownerCountInt;
ownerListMap[ ownerCountInt ] = msg.sender;
ownerCountInt++;
}
| 6,541 |
5 | // Protect owner by overriding renounceOwnership | function renounceOwnership() public virtual override {
revert("Cant renounce");
}
| function renounceOwnership() public virtual override {
revert("Cant renounce");
}
| 1,959 |
87 | // RoundsManager Manages round progression and other blockchain time related operations of the Livepeer protocol / | contract RoundsManager is ManagerProxyTarget, IRoundsManager {
using SafeMath for uint256;
// Round length in blocks
uint256 public roundLength;
// Lock period of a round as a % of round length
// Transcoders cannot join the transcoder pool or change their rates during the lock period at the end of a round
// The lock period provides delegators time to review transcoder information without changes
// # of blocks in the lock period = (roundLength * roundLockAmount) / PERC_DIVISOR
uint256 public roundLockAmount;
// Last initialized round. After first round, this is the last round during which initializeRound() was called
uint256 public lastInitializedRound;
// Round in which roundLength was last updated
uint256 public lastRoundLengthUpdateRound;
// Start block of the round in which roundLength was last updated
uint256 public lastRoundLengthUpdateStartBlock;
/**
* @dev RoundsManager constructor. Only invokes constructor of base Manager contract with provided Controller address
* @param _controller Address of Controller that this contract will be registered with
*/
function RoundsManager(address _controller) public Manager(_controller) {}
/**
* @dev Set round length. Only callable by the controller owner
* @param _roundLength Round length in blocks
*/
function setRoundLength(uint256 _roundLength) external onlyControllerOwner {
// Round length cannot be 0
require(_roundLength > 0);
if (roundLength == 0) {
// If first time initializing roundLength, set roundLength before
// lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
roundLength = _roundLength;
lastRoundLengthUpdateRound = currentRound();
lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
} else {
// If updating roundLength, set roundLength after
// lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
lastRoundLengthUpdateRound = currentRound();
lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
roundLength = _roundLength;
}
ParameterUpdate("roundLength");
}
/**
* @dev Set round lock amount. Only callable by the controller owner
* @param _roundLockAmount Round lock amount as a % of the number of blocks in a round
*/
function setRoundLockAmount(uint256 _roundLockAmount) external onlyControllerOwner {
// Must be a valid percentage
require(MathUtils.validPerc(_roundLockAmount));
roundLockAmount = _roundLockAmount;
ParameterUpdate("roundLockAmount");
}
/**
* @dev Initialize the current round. Called once at the start of any round
*/
function initializeRound() external whenSystemNotPaused {
uint256 currRound = currentRound();
// Check if already called for the current round
require(lastInitializedRound < currRound);
// Set current round as initialized
lastInitializedRound = currRound;
// Set active transcoders for the round
bondingManager().setActiveTranscoders();
// Set mintable rewards for the round
minter().setCurrentRewardTokens();
NewRound(currRound);
}
/**
* @dev Return current block number
*/
function blockNum() public view returns (uint256) {
return block.number;
}
/**
* @dev Return blockhash for a block
*/
function blockHash(uint256 _block) public view returns (bytes32) {
uint256 currentBlock = blockNum();
// Can only retrieve past block hashes
require(_block < currentBlock);
// Can only retrieve hashes for last 256 blocks
require(currentBlock < 256 || _block >= currentBlock - 256);
return block.blockhash(_block);
}
/**
* @dev Return current round
*/
function currentRound() public view returns (uint256) {
// Compute # of rounds since roundLength was last updated
uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
// Current round = round that roundLength was last updated + # of rounds since roundLength was last updated
return lastRoundLengthUpdateRound.add(roundsSinceUpdate);
}
/**
* @dev Return start block of current round
*/
function currentRoundStartBlock() public view returns (uint256) {
// Compute # of rounds since roundLength was last updated
uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
// Current round start block = start block of round that roundLength was last updated + (# of rounds since roundLenght was last updated * roundLength)
return lastRoundLengthUpdateStartBlock.add(roundsSinceUpdate.mul(roundLength));
}
/**
* @dev Check if current round is initialized
*/
function currentRoundInitialized() public view returns (bool) {
return lastInitializedRound == currentRound();
}
/**
* @dev Check if we are in the lock period of the current round
*/
function currentRoundLocked() public view returns (bool) {
uint256 lockedBlocks = MathUtils.percOf(roundLength, roundLockAmount);
return blockNum().sub(currentRoundStartBlock()) >= roundLength.sub(lockedBlocks);
}
/**
* @dev Return BondingManager interface
*/
function bondingManager() internal view returns (IBondingManager) {
return IBondingManager(controller.getContract(keccak256("BondingManager")));
}
/**
* @dev Return Minter interface
*/
function minter() internal view returns (IMinter) {
return IMinter(controller.getContract(keccak256("Minter")));
}
} | contract RoundsManager is ManagerProxyTarget, IRoundsManager {
using SafeMath for uint256;
// Round length in blocks
uint256 public roundLength;
// Lock period of a round as a % of round length
// Transcoders cannot join the transcoder pool or change their rates during the lock period at the end of a round
// The lock period provides delegators time to review transcoder information without changes
// # of blocks in the lock period = (roundLength * roundLockAmount) / PERC_DIVISOR
uint256 public roundLockAmount;
// Last initialized round. After first round, this is the last round during which initializeRound() was called
uint256 public lastInitializedRound;
// Round in which roundLength was last updated
uint256 public lastRoundLengthUpdateRound;
// Start block of the round in which roundLength was last updated
uint256 public lastRoundLengthUpdateStartBlock;
/**
* @dev RoundsManager constructor. Only invokes constructor of base Manager contract with provided Controller address
* @param _controller Address of Controller that this contract will be registered with
*/
function RoundsManager(address _controller) public Manager(_controller) {}
/**
* @dev Set round length. Only callable by the controller owner
* @param _roundLength Round length in blocks
*/
function setRoundLength(uint256 _roundLength) external onlyControllerOwner {
// Round length cannot be 0
require(_roundLength > 0);
if (roundLength == 0) {
// If first time initializing roundLength, set roundLength before
// lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
roundLength = _roundLength;
lastRoundLengthUpdateRound = currentRound();
lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
} else {
// If updating roundLength, set roundLength after
// lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
lastRoundLengthUpdateRound = currentRound();
lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
roundLength = _roundLength;
}
ParameterUpdate("roundLength");
}
/**
* @dev Set round lock amount. Only callable by the controller owner
* @param _roundLockAmount Round lock amount as a % of the number of blocks in a round
*/
function setRoundLockAmount(uint256 _roundLockAmount) external onlyControllerOwner {
// Must be a valid percentage
require(MathUtils.validPerc(_roundLockAmount));
roundLockAmount = _roundLockAmount;
ParameterUpdate("roundLockAmount");
}
/**
* @dev Initialize the current round. Called once at the start of any round
*/
function initializeRound() external whenSystemNotPaused {
uint256 currRound = currentRound();
// Check if already called for the current round
require(lastInitializedRound < currRound);
// Set current round as initialized
lastInitializedRound = currRound;
// Set active transcoders for the round
bondingManager().setActiveTranscoders();
// Set mintable rewards for the round
minter().setCurrentRewardTokens();
NewRound(currRound);
}
/**
* @dev Return current block number
*/
function blockNum() public view returns (uint256) {
return block.number;
}
/**
* @dev Return blockhash for a block
*/
function blockHash(uint256 _block) public view returns (bytes32) {
uint256 currentBlock = blockNum();
// Can only retrieve past block hashes
require(_block < currentBlock);
// Can only retrieve hashes for last 256 blocks
require(currentBlock < 256 || _block >= currentBlock - 256);
return block.blockhash(_block);
}
/**
* @dev Return current round
*/
function currentRound() public view returns (uint256) {
// Compute # of rounds since roundLength was last updated
uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
// Current round = round that roundLength was last updated + # of rounds since roundLength was last updated
return lastRoundLengthUpdateRound.add(roundsSinceUpdate);
}
/**
* @dev Return start block of current round
*/
function currentRoundStartBlock() public view returns (uint256) {
// Compute # of rounds since roundLength was last updated
uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
// Current round start block = start block of round that roundLength was last updated + (# of rounds since roundLenght was last updated * roundLength)
return lastRoundLengthUpdateStartBlock.add(roundsSinceUpdate.mul(roundLength));
}
/**
* @dev Check if current round is initialized
*/
function currentRoundInitialized() public view returns (bool) {
return lastInitializedRound == currentRound();
}
/**
* @dev Check if we are in the lock period of the current round
*/
function currentRoundLocked() public view returns (bool) {
uint256 lockedBlocks = MathUtils.percOf(roundLength, roundLockAmount);
return blockNum().sub(currentRoundStartBlock()) >= roundLength.sub(lockedBlocks);
}
/**
* @dev Return BondingManager interface
*/
function bondingManager() internal view returns (IBondingManager) {
return IBondingManager(controller.getContract(keccak256("BondingManager")));
}
/**
* @dev Return Minter interface
*/
function minter() internal view returns (IMinter) {
return IMinter(controller.getContract(keccak256("Minter")));
}
} | 11,564 |
10 | // Ownable The Ownable contract has an owner address, and provides basic authorization controlfunctions, this simplifies the implementation of "user permissions". / | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
**/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
**/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
**/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
| contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
**/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
**/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
**/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
| 268 |
9 | // Allows anyone to deposit the total amount of `want` tokens in this contract into Convex | function deposit() public override {
CVX_BOOSTER.depositAll(CVX_PETH_PID, true);
}
| function deposit() public override {
CVX_BOOSTER.depositAll(CVX_PETH_PID, true);
}
| 18,201 |
8 | // The cumulative revenue (in ESD) earned by the house because of a given bot's hard work. Any time this value crosses a multiple of 100000, the house's take rate will be halved. NOTE: This advantage is non-transferrable. Bots are encouraged to keep their address constant | mapping(address => uint) private houseTakes;
event SetOffer(address indexed user, uint offer);
| mapping(address => uint) private houseTakes;
event SetOffer(address indexed user, uint offer);
| 17,029 |
191 | // incase any issues arise with claiming - though they shoulnd't - owner can mint up to mint max to then send to relevant addy of user | function safetyBackdoor() onlyOwner public {
require(totalSupply()+_mintNr < ABS_MAX, "max reached");
_safeMint(msg.sender, totalSupply());
}
| function safetyBackdoor() onlyOwner public {
require(totalSupply()+_mintNr < ABS_MAX, "max reached");
_safeMint(msg.sender, totalSupply());
}
| 27,129 |
49 | // Calculate rewards for round / | function _calculateRewards(uint256 epoch) internal {
require(rewardRate.add(treasuryRate) == TOTAL_RATE, "rewardRate and treasuryRate must add up to TOTAL_RATE");
require(rounds[epoch].rewardBaseCalAmount == 0 && rounds[epoch].rewardAmount == 0, "Rewards calculated");
Round storage round = rounds[epoch];
uint256 rewardBaseCalAmount;
uint256 rewardAmount;
// Bull wins
if (round.closePrice > round.lockPrice) {
rewardBaseCalAmount = round.bullAmount;
rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
}
// Bear wins
else if (round.closePrice < round.lockPrice) {
rewardBaseCalAmount = round.bearAmount;
rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
}
// House wins
else {
rewardBaseCalAmount = 0;
rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
if(rewardAmount > 0) {
bonusSharePool.predictionBet(address(0x0), 0, rewardAmount);
}
}
round.rewardBaseCalAmount = rewardBaseCalAmount;
round.rewardAmount = rewardAmount;
emit RewardsCalculated(epoch, rewardBaseCalAmount, rewardAmount, 0);
}
| function _calculateRewards(uint256 epoch) internal {
require(rewardRate.add(treasuryRate) == TOTAL_RATE, "rewardRate and treasuryRate must add up to TOTAL_RATE");
require(rounds[epoch].rewardBaseCalAmount == 0 && rounds[epoch].rewardAmount == 0, "Rewards calculated");
Round storage round = rounds[epoch];
uint256 rewardBaseCalAmount;
uint256 rewardAmount;
// Bull wins
if (round.closePrice > round.lockPrice) {
rewardBaseCalAmount = round.bullAmount;
rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
}
// Bear wins
else if (round.closePrice < round.lockPrice) {
rewardBaseCalAmount = round.bearAmount;
rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
}
// House wins
else {
rewardBaseCalAmount = 0;
rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
if(rewardAmount > 0) {
bonusSharePool.predictionBet(address(0x0), 0, rewardAmount);
}
}
round.rewardBaseCalAmount = rewardBaseCalAmount;
round.rewardAmount = rewardAmount;
emit RewardsCalculated(epoch, rewardBaseCalAmount, rewardAmount, 0);
}
| 10,603 |
38 | // See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address.- the caller must have a balance of at least `amount`. / | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| 13,132 |
116 | // Transfer tax rate in basis points. (default 8%) | uint16 private transferTaxRate = 800;
| uint16 private transferTaxRate = 800;
| 29,289 |
301 | // Put a monster up for auction./Does some ownership trickery to create auctions in one tx. | function createSaleAuction(
uint256 _monsterId,
uint256 _startingPrice,
uint256 _endingPrice,
uint256 _duration
)
external
whenNotPaused
| function createSaleAuction(
uint256 _monsterId,
uint256 _startingPrice,
uint256 _endingPrice,
uint256 _duration
)
external
whenNotPaused
| 41,063 |
64 | // solhint-disable const-name-snakecase | address internal constant cDAI = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643;
address internal constant cUSDC = 0x39AA39c021dfbaE8faC545936693aC917d5E7563;
address internal constant cUSDT = 0xf650C3d88D12dB855b8bf7D11Be6C55A4e07dCC9;
| address internal constant cDAI = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643;
address internal constant cUSDC = 0x39AA39c021dfbaE8faC545936693aC917d5E7563;
address internal constant cUSDT = 0xf650C3d88D12dB855b8bf7D11Be6C55A4e07dCC9;
| 32,404 |
14 | // Get the key of the perpetual liquidityPool The address of the liquidity pool which the perpetual belongs to perpetualIndex The index of the perpetual in the liquidity poolreturn bytes32 The key of the perpetual / | function _getPerpetualKey(address liquidityPool, uint256 perpetualIndex)
internal
pure
returns (bytes32)
| function _getPerpetualKey(address liquidityPool, uint256 perpetualIndex)
internal
pure
returns (bytes32)
| 45,743 |
80 | // Update storage data | _borrow.delegatee = _newDelegatee;
| _borrow.delegatee = _newDelegatee;
| 21,333 |
50 | // ----------- Minter only state changing api ----------- |
function mint(address account, uint256 amount) external;
|
function mint(address account, uint256 amount) external;
| 5,771 |
44 | // sending the listing fee to wallet | wallet.transfer(_item.listingPrice);
| wallet.transfer(_item.listingPrice);
| 25,428 |
10 | // Profile. | id = dataTypes.push(DataType({
name: "Profile",
reward: 0,
times: 1,
time: 0,
state: true,
toCount: false
})) - 1;
| id = dataTypes.push(DataType({
name: "Profile",
reward: 0,
times: 1,
time: 0,
state: true,
toCount: false
})) - 1;
| 49,300 |
114 | // Require at least one ticket to create a raffle | require(minimumTickets > 0, "must set at least one raffle ticket");
| require(minimumTickets > 0, "must set at least one raffle ticket");
| 34,817 |
281 | // Calculate DVD for recipient | returnedDVD = totalDVD.sub(taxedDVD);
| returnedDVD = totalDVD.sub(taxedDVD);
| 44,838 |
165 | // Get validator total staked./validatorId validator id. | function validatorStake(uint256 validatorId)
external
view
returns (uint256);
| function validatorStake(uint256 validatorId)
external
view
returns (uint256);
| 5,970 |
13 | // Transfer given number of tokens from message sender to given recipient._to address to transfer tokens to the owner of _value number of tokens to transfer to the owner of given addressreturn true if tokens were transferred successfully, false otherwiseaccounts [_to] + _value > accounts [_to] for overflow checkwhich is already in safeMath / | function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
| function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
| 11,412 |
95 | // Returns external asset dependency for project `_projectId` at index `_index`. / | function projectExternalAssetDependencyByIndex(
uint256 _projectId,
uint256 _index
| function projectExternalAssetDependencyByIndex(
uint256 _projectId,
uint256 _index
| 11,222 |
28 | // require(isEqual(CToken(cEther).symbol(), "cETH"), "invalid cEther address"); | cEther = _cEther;
| cEther = _cEther;
| 21,364 |
83 | // Constructs the Basis ERC-20 contract. / | constructor() public ERC20('BASIS', 'BASIS') {
// Mints 1 Basis to contract creator for initial Uniswap oracle deployment.
// Will be burned after oracle deployment
_mint(msg.sender, 1 * 10**18);
}
| constructor() public ERC20('BASIS', 'BASIS') {
// Mints 1 Basis to contract creator for initial Uniswap oracle deployment.
// Will be burned after oracle deployment
_mint(msg.sender, 1 * 10**18);
}
| 2,845 |
96 | // no cheating! | _referredBy != _customerAddress &&
| _referredBy != _customerAddress &&
| 11,773 |
72 | // Stores the data for the roll (spin) | struct rollData {
uint win;
uint loss;
uint jp;
}
| struct rollData {
uint win;
uint loss;
uint jp;
}
| 82,319 |
249 | // get the current price to mint | function mintCost() public view returns(uint256) {
State saleState_ = saleState();
if (saleState_ == State.NoSale || saleState_ == State.Presale) {
return mintCostPresale;
}
else {
return mintCostPublicSale;
}
}
| function mintCost() public view returns(uint256) {
State saleState_ = saleState();
if (saleState_ == State.NoSale || saleState_ == State.Presale) {
return mintCostPresale;
}
else {
return mintCostPublicSale;
}
}
| 57,278 |
12 | // Disallow withdraw if tokens haven't been bought yet. | if (!bought_tokens) throw;
| if (!bought_tokens) throw;
| 36,678 |
35 | // enforce max bundle lifetime | if(block.timestamp > bundle.createdAt + lifetime) {
| if(block.timestamp > bundle.createdAt + lifetime) {
| 35,833 |
22 | // pay a part of the collateral to the auction's winner. loanId The loan id. collateral The bid of winner. buyer The winner account. / | function liquidated(uint256 loanId, uint256 collateral, address buyer)
external
onlyLiquidator
checkLoanStates(loanId, LoanStates.UNDER_LIQUIDATION)
returns (bool)
| function liquidated(uint256 loanId, uint256 collateral, address buyer)
external
onlyLiquidator
checkLoanStates(loanId, LoanStates.UNDER_LIQUIDATION)
returns (bool)
| 29,815 |
51 | // update the beneficiary balance to number of tokens sent | balances[_beneficiary] = balances[_beneficiary].add(_tokens);
| balances[_beneficiary] = balances[_beneficiary].add(_tokens);
| 51,745 |
0 | // STRUCTURES // Data of an address / | struct StreetAddress {
bytes32 addressId;
string streetName;
string postcode;
string houseNumber;
string boxNumber;
string latitude;
string longitude;
}
| struct StreetAddress {
bytes32 addressId;
string streetName;
string postcode;
string houseNumber;
string boxNumber;
string latitude;
string longitude;
}
| 42,043 |
2,646 | // 1325 | entry "practively" : ENG_ADVERB
| entry "practively" : ENG_ADVERB
| 22,161 |
120 | // can later be changed with {transferOwnership}./ ZOOM: Initializes the contract setting the deployer as the initial owner. / | function initializeOwner() internal initializer {
_owner = msg.sender;
emit OwnershipTransferCompleted(address(0), _owner);
}
| function initializeOwner() internal initializer {
_owner = msg.sender;
emit OwnershipTransferCompleted(address(0), _owner);
}
| 4,704 |
74 | // Tuple opertations | uint8 internal constant OP_TGET = 0x50;
uint8 internal constant OP_TSET = 0x51;
uint8 internal constant OP_TLEN = 0x52;
uint8 internal constant OP_XGET = 0x53;
uint8 internal constant OP_XSET = 0x54;
| uint8 internal constant OP_TGET = 0x50;
uint8 internal constant OP_TSET = 0x51;
uint8 internal constant OP_TLEN = 0x52;
uint8 internal constant OP_XGET = 0x53;
uint8 internal constant OP_XSET = 0x54;
| 626 |
257 | // Check if the user has deposit for a token _account address of the user _index index of the tokenreturn true if the user has positive deposit balance for the token / | function isUserHasDeposits(address _account, uint8 _index) public view returns (bool) {
Account storage account = accounts[_account];
return account.depositBitmap.isBitSet(_index);
}
| function isUserHasDeposits(address _account, uint8 _index) public view returns (bool) {
Account storage account = accounts[_account];
return account.depositBitmap.isBitSet(_index);
}
| 54,501 |
106 | // Store bonuses in a fixed array, so that it can be seen in a blockchain explorer | uint public constant MAX_BONUS = 10;
Bonus[10] public timeBonus;
Bonus[10] public amountBonus;
| uint public constant MAX_BONUS = 10;
Bonus[10] public timeBonus;
Bonus[10] public amountBonus;
| 12,770 |
74 | // Refund exceeding fee. | if (msg.value > reviveFee) {
msg.sender.transfer(msg.value - reviveFee);
}
| if (msg.value > reviveFee) {
msg.sender.transfer(msg.value - reviveFee);
}
| 82,852 |
53 | // 入金时间 至 难度调整时间 | earnedAmount = d
.Amount
.mul(
DIFFICULTIES[d.Difficulty].EndedAt.sub(d.DepositedAt).div(
1 seconds
)
)
.mul(d.Difficulty).div(1e8);
| earnedAmount = d
.Amount
.mul(
DIFFICULTIES[d.Difficulty].EndedAt.sub(d.DepositedAt).div(
1 seconds
)
)
.mul(d.Difficulty).div(1e8);
| 16,789 |
322 | // Self destruct implementation contract / | function destructContract(address payable newContract) external onlyAdmin {
// slither-disable-next-line suicidal
selfdestruct(newContract);
}
| function destructContract(address payable newContract) external onlyAdmin {
// slither-disable-next-line suicidal
selfdestruct(newContract);
}
| 56,011 |
67 | // Validates that `_addrToCheck` owns and has approved markeplace to transfer the appropriate amount of currency | function validateERC20BalAndAllowance(
address _addrToCheck,
address _currency,
uint256 _currencyAmountToCheckAgainst
) internal view {
require(
IERC20Upgradeable(_currency).balanceOf(_addrToCheck) >= _currencyAmountToCheckAgainst &&
IERC20Upgradeable(_currency).allowance(_addrToCheck, address(this)) >= _currencyAmountToCheckAgainst,
"!BAL20"
);
| function validateERC20BalAndAllowance(
address _addrToCheck,
address _currency,
uint256 _currencyAmountToCheckAgainst
) internal view {
require(
IERC20Upgradeable(_currency).balanceOf(_addrToCheck) >= _currencyAmountToCheckAgainst &&
IERC20Upgradeable(_currency).allowance(_addrToCheck, address(this)) >= _currencyAmountToCheckAgainst,
"!BAL20"
);
| 33,692 |
50 | // ======== INTERNAL VIEW ======== //calculate current market price of quote token in base token see marketPrice() for explanation of price computation uses info from storage because data has been updated before call (vs marketPrice()) _id market IDreturnprice for market in OHM decimals / | function _marketPrice(uint256 _id) internal view returns (uint256) {
return (terms[_id].controlVariable * _debtRatio(_id)) / (10**metadata[_id].quoteDecimals);
}
| function _marketPrice(uint256 _id) internal view returns (uint256) {
return (terms[_id].controlVariable * _debtRatio(_id)) / (10**metadata[_id].quoteDecimals);
}
| 15,451 |
42 | // Kill contract (freezes deposits)/ return True if contract killing is successful | function kill() external govOnly returns (bool) {
killed = true;
return true;
}
| function kill() external govOnly returns (bool) {
killed = true;
return true;
}
| 36,620 |
7 | // List must not already contain node | require(!contains(_id), "SortedTroves: List already contains the node");
| require(!contains(_id), "SortedTroves: List already contains the node");
| 1,099 |
37 | // Possible states that the job may be in | enum JobState {
Pending, // Enrollment has closed and job is about to start
Canceled,
Enrolling,
Queued,
PrematureCompletion,
Completed,
InProgress,
Paid
}
| enum JobState {
Pending, // Enrollment has closed and job is about to start
Canceled,
Enrolling,
Queued,
PrematureCompletion,
Completed,
InProgress,
Paid
}
| 35,175 |
57 | // calculate the token withdraw ratio based on current supply | uint256 withdrawEther = SafeMath.mul(_amountTokens, currentTotalBankroll) / currentSupplyOfTokens;
| uint256 withdrawEther = SafeMath.mul(_amountTokens, currentTotalBankroll) / currentSupplyOfTokens;
| 46,170 |
57 | // INCXToken This is a standard ERC20 token / | contract INCXToken is BurnableToken, PausableToken, MintableToken {
string public constant name = "INCX Coin";
string public constant symbol = "INCX";
uint64 public constant decimals = 18;
uint256 public constant maxLimit = 1000000000 * 10**uint(decimals);
function INCXToken()
public
MintableToken(maxLimit)
{
}
}
| contract INCXToken is BurnableToken, PausableToken, MintableToken {
string public constant name = "INCX Coin";
string public constant symbol = "INCX";
uint64 public constant decimals = 18;
uint256 public constant maxLimit = 1000000000 * 10**uint(decimals);
function INCXToken()
public
MintableToken(maxLimit)
{
}
}
| 21,648 |
11 | // Checks if the account should be allowed to mint tokens in the given market cToken The market to verify the mint against minter The account which would get the minted tokens mintAmount The amount of underlying being supplied to the market in exchange for tokensreturn 0 if the mint is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol) / | function mintAllowed(address cToken, address minter, uint mintAmount) external returns (uint) {
require(!qsConfig.isBlocked(minter), "Minter not allowed");
// Pausing is a very serious situation - we revert to sound the alarms
require(!mintGuardianPaused[cToken], "mint is paused");
// Shh - currently unused
minter;
mintAmount;
if (!markets[cToken].isListed) {
return uint(Error.MARKET_NOT_LISTED);
}
// Keep the flywheel moving
updateCompSupplyIndex(cToken);
distributeSupplierComp(cToken, minter, false);
return uint(Error.NO_ERROR);
}
| function mintAllowed(address cToken, address minter, uint mintAmount) external returns (uint) {
require(!qsConfig.isBlocked(minter), "Minter not allowed");
// Pausing is a very serious situation - we revert to sound the alarms
require(!mintGuardianPaused[cToken], "mint is paused");
// Shh - currently unused
minter;
mintAmount;
if (!markets[cToken].isListed) {
return uint(Error.MARKET_NOT_LISTED);
}
// Keep the flywheel moving
updateCompSupplyIndex(cToken);
distributeSupplierComp(cToken, minter, false);
return uint(Error.NO_ERROR);
}
| 27,356 |
270 | // now change the gif | uint256 currNounce = newTamag.getAndIncrementNounce(tamagId);
bytes32 hashInSignature = prefixed(keccak256(abi.encodePacked(currNounce,"_",tamagId,"_",equipId,"_",slot,"_",tokenURI)));
address signer = ecrecover(hashInSignature, v, r, s);
require(signer == signerAddress, "Msg needs to be signed by valid signer!");
newTamag.managerSetTokenURI(tamagId, tokenURI);
| uint256 currNounce = newTamag.getAndIncrementNounce(tamagId);
bytes32 hashInSignature = prefixed(keccak256(abi.encodePacked(currNounce,"_",tamagId,"_",equipId,"_",slot,"_",tokenURI)));
address signer = ecrecover(hashInSignature, v, r, s);
require(signer == signerAddress, "Msg needs to be signed by valid signer!");
newTamag.managerSetTokenURI(tamagId, tokenURI);
| 26,765 |
7 | // Add or remove a module./Treat modules as you would Ladle upgrades. Modules have unrestricted access to the Ladle/ storage, and can wreak havoc easily./ Modules must not do any changes to any vault (owner, seriesId, ilkId) because of vault caching./ Modules must not be contracts that can self-destruct because of `moduleCall`./ Modules can't use `msg.value` because of `batch`. | function addModule(address module, bool set)
external;
| function addModule(address module, bool set)
external;
| 28,412 |
8 | // batch mint a token. Can only be called by a registered extension.Returns tokenId minted / | function mintExtensionBatch(address to, string[] calldata uris) external returns (uint256[] memory);
| function mintExtensionBatch(address to, string[] calldata uris) external returns (uint256[] memory);
| 13,321 |
576 | // Emit NewBorrowCapGuardian(OldBorrowCapGuardian, NewBorrowCapGuardian) | emit NewBorrowCapGuardian(oldBorrowCapGuardian, newBorrowCapGuardian);
| emit NewBorrowCapGuardian(oldBorrowCapGuardian, newBorrowCapGuardian);
| 6,395 |
7 | // record the deployment of the contract to prevent redeploys. | _deployed[deploymentAddress] = true;
| _deployed[deploymentAddress] = true;
| 12,749 |
242 | // Set address of RebaseHooks contract which provides hooks for rebaseso things like AMMs can be synced with updated balances. _address Address of RebaseHooks contract / | function setRebaseHooksAddr(address _address) external onlyGovernor {
rebaseHooksAddr = _address;
}
| function setRebaseHooksAddr(address _address) external onlyGovernor {
rebaseHooksAddr = _address;
}
| 10,861 |
72 | // Get amount of token2 to pay to acquire the token1. index Index of the Swaps request. / | function getPrice(uint256 index) public view returns(uint256) {
Trade storage trade = _trades[index];
address tokenAddress1 = trade.userTradeData1.tokenAddress;
uint256 tokenValue1 = trade.userTradeData1.tokenValue;
bytes32 tokenId1 = trade.userTradeData1.tokenId;
address tokenAddress2 = trade.userTradeData2.tokenAddress;
uint256 tokenValue2 = trade.userTradeData2.tokenValue;
bytes32 tokenId2 = trade.userTradeData2.tokenId;
require(!(_priceOwnership[tokenAddress1][tokenAddress2] && _priceOwnership[tokenAddress2][tokenAddress1]), Errors.SW_COMPETITION_ON_PRICE_OWNERSHIP);
if(_variablePriceStartDate[tokenAddress1] == 0 || block.timestamp < _variablePriceStartDate[tokenAddress1]) {
return tokenValue2;
}
if(_priceOwnership[tokenAddress1][tokenAddress2] || _priceOwnership[tokenAddress2][tokenAddress1]) {
if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][tokenId2] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][tokenId2]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][tokenId1] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][tokenId1]);
} else if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][ALL_PARTITIONS] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][ALL_PARTITIONS]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][tokenId1] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][tokenId1]);
} else if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][tokenId2] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][tokenId2]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][ALL_PARTITIONS] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][ALL_PARTITIONS]);
} else if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][ALL_PARTITIONS] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][ALL_PARTITIONS]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][ALL_PARTITIONS] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][ALL_PARTITIONS]);
} else {
return tokenValue2;
}
} else {
return tokenValue2;
}
}
| function getPrice(uint256 index) public view returns(uint256) {
Trade storage trade = _trades[index];
address tokenAddress1 = trade.userTradeData1.tokenAddress;
uint256 tokenValue1 = trade.userTradeData1.tokenValue;
bytes32 tokenId1 = trade.userTradeData1.tokenId;
address tokenAddress2 = trade.userTradeData2.tokenAddress;
uint256 tokenValue2 = trade.userTradeData2.tokenValue;
bytes32 tokenId2 = trade.userTradeData2.tokenId;
require(!(_priceOwnership[tokenAddress1][tokenAddress2] && _priceOwnership[tokenAddress2][tokenAddress1]), Errors.SW_COMPETITION_ON_PRICE_OWNERSHIP);
if(_variablePriceStartDate[tokenAddress1] == 0 || block.timestamp < _variablePriceStartDate[tokenAddress1]) {
return tokenValue2;
}
if(_priceOwnership[tokenAddress1][tokenAddress2] || _priceOwnership[tokenAddress2][tokenAddress1]) {
if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][tokenId2] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][tokenId2]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][tokenId1] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][tokenId1]);
} else if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][ALL_PARTITIONS] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][tokenId1][ALL_PARTITIONS]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][tokenId1] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][tokenId1]);
} else if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][tokenId2] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][tokenId2]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][ALL_PARTITIONS] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][tokenId2][ALL_PARTITIONS]);
} else if(_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][ALL_PARTITIONS] != 0) {
return tokenValue1 * (_tokenUnitPricesByPartition[tokenAddress1][tokenAddress2][ALL_PARTITIONS][ALL_PARTITIONS]);
} else if(_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][ALL_PARTITIONS] != 0) {
return tokenValue1 / (_tokenUnitPricesByPartition[tokenAddress2][tokenAddress1][ALL_PARTITIONS][ALL_PARTITIONS]);
} else {
return tokenValue2;
}
} else {
return tokenValue2;
}
}
| 51,043 |
23 | // A handy alias for later | bytes memory points = solution.points;
assembly {
| bytes memory points = solution.points;
assembly {
| 84,741 |
98 | // If the caller is not the stored owner. | if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {
| if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {
| 14,268 |
5 | // name starts with _ because it is private variable | contestantsCount++;
contestants[contestantsCount] = Contestant(contestantsCount,_name,0);
| contestantsCount++;
contestants[contestantsCount] = Contestant(contestantsCount,_name,0);
| 51,778 |
1 | // Emitted when a contract is created operation The operation used to create a contract contractAddress The created contract address value The value sent to the created contract address / | event ContractCreated(
uint256 indexed operation,
address indexed contractAddress,
uint256 indexed value
);
| event ContractCreated(
uint256 indexed operation,
address indexed contractAddress,
uint256 indexed value
);
| 47,925 |
82 | // Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used toe.g. set automatic allowances for certain subsystems, etc. | * Emits an {Approval} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
| * Emits an {Approval} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
| 16,077 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.