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 |
|---|---|---|---|---|
6 | // Returns the subtraction of two unsigned integers, reverting with custom message onoverflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements:- Subtraction cannot overflow. / | function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
assert(b <= a/*, errorMessage*/);
uint256 c = a - b;
return c;
}
| function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
assert(b <= a/*, errorMessage*/);
uint256 c = a - b;
return c;
}
| 2,040 |
2 | // This function slices a uint/_bts some bytes/_from start position credit to https:ethereum.stackexchange.com/questions/51229/how-to-convert-bytes-to-uint-in-solidity and Nick Johnson https:ethereum.stackexchange.com/questions/4170/how-to-convert-a-uint-to-bytes-in-solidity/41774177 | function _bytesToUint256(bytes memory _bts, uint256 _from) internal pure returns (uint256) {
require(_bts.length >= _from.add(32), "slicing out of range");
uint256 convertedUint256;
uint256 startByte = _from.add(32); //first 32 bytes denote the array length
assembly {
convertedUint256 := mload(add(_bts, startByte))
}
return convertedUint256;
}
| function _bytesToUint256(bytes memory _bts, uint256 _from) internal pure returns (uint256) {
require(_bts.length >= _from.add(32), "slicing out of range");
uint256 convertedUint256;
uint256 startByte = _from.add(32); //first 32 bytes denote the array length
assembly {
convertedUint256 := mload(add(_bts, startByte))
}
return convertedUint256;
}
| 38,666 |
279 | // Make sure sire isn't pregnant, or in the middle of a siring cooldown | require(
_isReadyToHatch(sire),
"CryptoAlpaca: Sire is not yet ready to hatch"
);
| require(
_isReadyToHatch(sire),
"CryptoAlpaca: Sire is not yet ready to hatch"
);
| 39,419 |
138 | // preliminary calc newDeposit (minimum deposit rule not yet applied) | newDeposit = (oldFlowData.deposit.toInt256() + depositDelta).toUint256();
| newDeposit = (oldFlowData.deposit.toInt256() + depositDelta).toUint256();
| 6,055 |
0 | // The token being sold | IERC20 private _token;
| IERC20 private _token;
| 16,918 |
18 | // register interfaces | ERC777Helper.register(address(this));
| ERC777Helper.register(address(this));
| 5,082 |
28 | // for (uint c=0;c<len;c++){ indexSet[c] =indexSet[c+1]; } |
delete indexSet;
indexSet.push(uint(8));
|
delete indexSet;
indexSet.push(uint(8));
| 38,571 |
32 | // Allows users to sign up with their own address | function signUpUser(string memory casedUserName) public requireStake(msg.sender, minimumHydroStakeUser) {
return _userSignUp(casedUserName, msg.sender);
}
| function signUpUser(string memory casedUserName) public requireStake(msg.sender, minimumHydroStakeUser) {
return _userSignUp(casedUserName, msg.sender);
}
| 18,711 |
102 | // We can't give people infinite ETH | if(tokenTotalSupply > 0) {
| if(tokenTotalSupply > 0) {
| 46,435 |
42 | // withdraw collects due funds in a safe manner / | function withdraw(uint256 sum) public {
address withdrawer = msg.sender;
// do we have enough funds for withdrawal?
require(balances[withdrawer] >= sum);
// notify the world
Withdraw(withdrawer, sum, block.timestamp);
// update (safely)
balances[withdrawer] = balances[withdrawer].sub(sum);
withdrawer.transfer(sum);
}
| function withdraw(uint256 sum) public {
address withdrawer = msg.sender;
// do we have enough funds for withdrawal?
require(balances[withdrawer] >= sum);
// notify the world
Withdraw(withdrawer, sum, block.timestamp);
// update (safely)
balances[withdrawer] = balances[withdrawer].sub(sum);
withdrawer.transfer(sum);
}
| 36,231 |
10 | // @inheritdoc AutomationCompatibleInterface executes executePayload action on payload controller. performData array of proposal ids to execute. / | function performUpkeep(bytes calldata performData) external override {
uint40[] memory payloadIdsToExecute = abi.decode(performData, (uint40[]));
bool isActionPerformed;
// executes action on payloadIds in order from first to last
for (uint256 i = payloadIdsToExecute.length; i > 0; i--) {
uint40 payloadId = payloadIdsToExecute[i - 1];
if (_canPayloadBeExecuted(payloadId)) {
IPayloadsControllerCore(PAYLOADS_CONTROLLER).executePayload(payloadId);
isActionPerformed = true;
emit ActionSucceeded(payloadId);
}
}
if (!isActionPerformed) revert NoActionCanBePerformed();
}
| function performUpkeep(bytes calldata performData) external override {
uint40[] memory payloadIdsToExecute = abi.decode(performData, (uint40[]));
bool isActionPerformed;
// executes action on payloadIds in order from first to last
for (uint256 i = payloadIdsToExecute.length; i > 0; i--) {
uint40 payloadId = payloadIdsToExecute[i - 1];
if (_canPayloadBeExecuted(payloadId)) {
IPayloadsControllerCore(PAYLOADS_CONTROLLER).executePayload(payloadId);
isActionPerformed = true;
emit ActionSucceeded(payloadId);
}
}
if (!isActionPerformed) revert NoActionCanBePerformed();
}
| 32,015 |
7 | // Treasury fee take on all rewards amount claimed/_fee New fee to set | function setFee(uint256 _fee) external onlyOwner {
require(_fee < 20e16, "Too high"); // Max 20%
fee = _fee;
}
| function setFee(uint256 _fee) external onlyOwner {
require(_fee < 20e16, "Too high"); // Max 20%
fee = _fee;
}
| 24,776 |
3 | // Throws if called by any account other than the owner of a tokenId./ | modifier onlyOwnerOf(uint tokenId) {
require(exists(tokenId), "Token doesn't exist.");
require(ownerOf(tokenId) == msg.sender, "Caller is not the token owner");
_;
}
| modifier onlyOwnerOf(uint tokenId) {
require(exists(tokenId), "Token doesn't exist.");
require(ownerOf(tokenId) == msg.sender, "Caller is not the token owner");
_;
}
| 35,094 |
78 | // Allows a caller to sweep multiple handlers in one transaction / | function multiHandlerSweep(address[] memory handlers, IERC20 tokenContract) public {
| function multiHandlerSweep(address[] memory handlers, IERC20 tokenContract) public {
| 18,988 |
0 | // Arguments used to initialize the party. | struct PartyOptions {
PartyGovernance.GovernanceOpts governance;
ProposalStorage.ProposalEngineOpts proposalEngine;
string name;
string symbol;
uint256 customizationPresetId;
}
| struct PartyOptions {
PartyGovernance.GovernanceOpts governance;
ProposalStorage.ProposalEngineOpts proposalEngine;
string name;
string symbol;
uint256 customizationPresetId;
}
| 41,466 |
2 | // Emits when the trading is enabled/disabled for the asset/trading is the boolean representing the new state of trading | event StatusChanged(bool trading);
| event StatusChanged(bool trading);
| 7,162 |
15 | // management of the repositories | function updateCaller(address _caller, bool allowed) public onlyOwner {
callers[_caller] = allowed;
}
| function updateCaller(address _caller, bool allowed) public onlyOwner {
callers[_caller] = allowed;
}
| 13,933 |
3 | // Redeeming a voucher token burns it. / | function _doRedeem(address, uint256 tokenId) internal virtual override {
_burn(tokenId);
}
| function _doRedeem(address, uint256 tokenId) internal virtual override {
_burn(tokenId);
}
| 7,759 |
44 | // Refund the sender the excess he sent | uint purchaseExcess = SafeMath.sub(msg.value, currentPrice);
| uint purchaseExcess = SafeMath.sub(msg.value, currentPrice);
| 42,589 |
213 | // 加载代币数组 | Option[] storage options = _options;
| Option[] storage options = _options;
| 66,337 |
5 | // Setters | function setOwner(address _owner) external
| function setOwner(address _owner) external
| 32,806 |
0 | // Transfers tokens from contract to a recipient/If token is 0x0000000000000000000000000000000000000001, an ETH transfer is done/_token The target token/_recipient The recipient of the transfer/_amount The amount of the transfer | function safeTransfer(
address _token,
address _recipient,
uint256 _amount
| function safeTransfer(
address _token,
address _recipient,
uint256 _amount
| 36,172 |
2 | // The factory which was used to create this collection. This is used to read common config. / | ICollectionFactory public immutable collectionFactory;
| ICollectionFactory public immutable collectionFactory;
| 38,579 |
11 | // Yield Info | uint256 public globalModulus = 10e14; // Round up 14 Decimals
uint256 public yieldRatePerToken = 5 ether / globalModulus; // 5 Zen per Day
| uint256 public globalModulus = 10e14; // Round up 14 Decimals
uint256 public yieldRatePerToken = 5 ether / globalModulus; // 5 Zen per Day
| 20,831 |
223 | // e.g. (1e201e18) / 1e18 = 1e20 e.g. (1e201e18) / 14e17 = 7.1429e19 | credits = _underlying.add(1).divPrecisely(exchangeRate);
| credits = _underlying.add(1).divPrecisely(exchangeRate);
| 5,400 |
74 | // TOKEN AND ASSET FUNCTIONS / | function nTokens() public view returns (uint) {
return assetSet.length();
}
| function nTokens() public view returns (uint) {
return assetSet.length();
}
| 7,862 |
12 | // transfer of stake share | if (_stakeShare > 0) {
_pmonToken.transferFrom(
from,
_stakeAddress,
(amount * _stakeShare) / 100
);
}
| if (_stakeShare > 0) {
_pmonToken.transferFrom(
from,
_stakeAddress,
(amount * _stakeShare) / 100
);
}
| 34,008 |
31 | // return the best offer for a token pairthe best offer is the lowest one if it's an ask,and highest one if it's a bid offer | function getBestOffer(IERC20 sell_gem, IERC20 buy_gem) public view returns(uint) {
return _best[address(sell_gem)][address(buy_gem)];
}
| function getBestOffer(IERC20 sell_gem, IERC20 buy_gem) public view returns(uint) {
return _best[address(sell_gem)][address(buy_gem)];
}
| 19,354 |
14 | // ==== PAUSE / UNPAUSE ==== | function toggle_pause() external;
| function toggle_pause() external;
| 3,774 |
15 | // Eyes SVG generator | library EyesParts1 {
/// @dev Eyes N°23 => Moon Gold
function item_1() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<linearGradient id="Moon Aka" gradientUnits="userSpaceOnUse" x1="234.5972" y1="-460.8015" x2="246.3069" y2="-460.8015" gradientTransform="matrix(1 0 0 -1 0 -270)" ><stop offset="0" style="stop-color:#FFB451" /><stop offset="0.5259" style="stop-color:#F7EC94" /><stop offset="1" style="stop-color:#FF9121" /></linearGradient><path id="Moon Aka" display="inline" fill="url(#Moon_Aka_00000152984819707226930020000004625877956111571090_)" d="M246.3,190.5c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4c-2.6-0.1-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C243.6,196.2,246.2,193.7,246.3,190.5z" /><linearGradient id="Moon Aka" gradientUnits="userSpaceOnUse" x1="157.8972" y1="-461.0056" x2="169.6069" y2="-461.0056" gradientTransform="matrix(1 0 0 -1 0 -270)" ><stop offset="0" style="stop-color:#FFB451" /><stop offset="0.5259" style="stop-color:#F7EC94" /><stop offset="1" style="stop-color:#FF9121" /></linearGradient><path id="Moon Aka" display="inline" fill="url(#Moon_Aka_00000178206716264067794300000007095126762428803473_)" d="M169.6,190.7c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4s-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C166.8,196.5,169.5,194,169.6,190.7z" />'
)
);
}
/// @dev Eyes N°21 => Pupils White-Red
function item_2() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" fill="#FFEDED" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" fill="#B50D5E" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
/// @dev Eyes N°20 => Tomoe White
function item_3() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g display="inline" ><g><path fill="#FFDAEA" d="M241.3,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#FFDAEA" d="M241.3,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C239.9,194.8,241,194.3,241.3,193.4z M239.1,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C239.1,193.3,239.1,193,239.1,192.7z" /></g><g><path fill="#FFDAEA" d="M242.5,186.6c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#FFDAEA" d="M242.5,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C244.4,187.1,243.6,186.4,242.5,186.6z M243.1,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6s0.6,0.1,0.6,0.4C243.6,188.5,243.3,188.8,243.1,188.9z" /></g><g><path fill="#FFDAEA" d="M235.5,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#FFDAEA" d="M235.2,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1C234.6,187.9,234.6,188.9,235.2,189.7z M236.8,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C236.3,187.7,236.7,187.7,236.8,187.9z" /></g></g><g display="inline" ><g><path fill="#FFDAEA" d="M165.4,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#FFDAEA" d="M165.4,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C164.1,194.8,165.1,194.4,165.4,193.4z M163.3,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C163.3,193.3,163.1,193,163.3,192.7z" /></g><g><path fill="#FFDAEA" d="M166.7,186.7c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#FFDAEA" d="M166.7,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C168.4,187.1,167.7,186.5,166.7,186.6z M167.2,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6c0.3,0,0.6,0.1,0.6,0.4C167.7,188.6,167.5,188.8,167.2,188.9z" /></g><g><path fill="#FFDAEA" d="M159.6,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#FFDAEA" d="M159.4,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1S158.7,189,159.4,189.7z M160.9,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C160.4,187.8,160.7,187.8,160.9,187.9z" /></g></g>'
)
);
}
/// @dev Eyes N°18 => Tomoe Red
function item_4() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g display="inline" ><g><path fill="#E31466" d="M241.3,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#E31466" d="M241.3,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C239.9,194.8,241,194.3,241.3,193.4z M239.1,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C239.1,193.3,239.1,193,239.1,192.7z" /></g><g><path fill="#E31466" d="M242.5,186.6c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#E31466" d="M242.5,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C244.4,187.1,243.6,186.4,242.5,186.6z M243.1,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6s0.6,0.1,0.6,0.4C243.6,188.5,243.3,188.8,243.1,188.9z" /></g><g><path fill="#E31466" d="M235.5,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#E31466" d="M235.2,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1C234.6,187.9,234.6,188.9,235.2,189.7z M236.8,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C236.3,187.7,236.7,187.7,236.8,187.9z" /></g></g><g display="inline" ><g><path fill="#E31466" d="M165.4,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#E31466" d="M165.4,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C164.1,194.8,165.1,194.4,165.4,193.4z M163.3,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C163.3,193.3,163.1,193,163.3,192.7z" /></g><g><path fill="#E31466" d="M166.7,186.7c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#E31466" d="M166.7,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C168.4,187.1,167.7,186.5,166.7,186.6z M167.2,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6c0.3,0,0.6,0.1,0.6,0.4C167.7,188.6,167.5,188.8,167.2,188.9z" /></g><g><path fill="#E31466" d="M159.6,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#E31466" d="M159.4,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1S158.7,189,159.4,189.7z M160.9,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C160.4,187.8,160.7,187.8,160.9,187.9z" /></g></g>'
)
);
}
/// @dev Eyes N°16 => Shine
function item_5() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path display="inline" fill="#FFFFFF" stroke="#000000" stroke-width="0.5" stroke-miterlimit="10" d="M164.1,182.5c1.4,7,1.4,6.9,8.3,8.3c-7,1.4-6.9,1.4-8.3,8.3c-1.4-7-1.4-6.9-8.3-8.3C162.8,189.4,162.7,189.5,164.1,182.5z" /><path display="inline" fill="#FFFFFF" stroke="#000000" stroke-width="0.5" stroke-miterlimit="10" d="M238.7,182.3c1.4,7,1.4,6.9,8.3,8.3c-7,1.4-6.9,1.4-8.3,8.3c-1.4-7-1.4-6.9-8.3-8.3C237.4,189.2,237.3,189.2,238.7,182.3z" />'
)
);
}
/// @dev Eyes N°12 => Stitch Eyes
function item_6() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g id="Strip"> <path d="M231.3,188.2s1-3.2,2.6-.9a30.48,30.48,0,0,1-.6,9.2s-.9,2-1.5-.5C231.3,193.3,232.3,193,231.3,188.2Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M239.4,187.7s1-3.1,2.5-.9a28.56,28.56,0,0,1-.6,8.9s-.9,1.9-1.4-.5S240.5,192.4,239.4,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M245.9,187.7s.9-2.7,2.2-.8a26.25,26.25,0,0,1-.5,7.7s-.8,1.7-1.1-.4S246.9,191.8,245.9,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M251.4,187.4s.8-2.4,2-.7a21.16,21.16,0,0,1-.5,6.9s-.7,1.5-1-.4C251.4,191.2,252.1,191,251.4,187.4Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> </g> <g id="Strip-2" > <path d="M173.2,187.9s-1-3.1-2.5-.9a27.9,27.9,0,0,0,.6,8.8s.9,1.9,1.4-.5S172.2,192.5,173.2,187.9Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M165.4,187.7s-1-3.1-2.5-.9a28.56,28.56,0,0,0,.6,8.9s.9,1.9,1.4-.5S164.4,192.4,165.4,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M158.9,187.7s-.9-2.7-2.2-.8a26.25,26.25,0,0,0,.5,7.7s.8,1.7,1.1-.4C158.9,192,158.1,191.8,158.9,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M153.4,187.4s-.8-2.4-2-.7a21.16,21.16,0,0,0,.5,6.9s.7,1.5,1-.4C153.4,191.2,152.6,191,153.4,187.4Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> </g>'
)
);
}
/// @dev Eyes N°11 => Globes
function item_7() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse fill="#FFFFFF" cx="244.6" cy="184.5" rx="4.1" ry="0.9" /><ellipse fill="#FFFFFF" cx="154.6" cy="184.5" rx="4.1" ry="0.9" />'
)
);
}
/// @dev Eyes N°8 => Akuma Eye
function item_8() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path display="inline" fill="#FFFFFF" d="M246.5,192h-13c-0.7,0-1.3-0.5-1.3-1.3l0,0c0-0.7,0.5-1.3,1.3-1.3h13c0.7,0,1.3,0.5,1.3,1.3l0,0C247.8,191.3,247.1,192,246.5,192z" /><path display="inline" fill="#FFFFFF" d="M169.9,192h-13c-0.7,0-1.3-0.5-1.3-1.3l0,0c0-0.7,0.5-1.3,1.3-1.3h13c0.7,0,1.3,0.5,1.3,1.3l0,0C171.1,191.3,170.5,192,169.9,192z" />'
)
);
}
/// @dev Eyes N°19 => Pupils Kuro
function item_9() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
/// @dev Eyes N°4 => Spiral
function item_10() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g display="inline" ><path fill="#FFFFFF" d="M238.1,191.2c0.2-0.8,0.6-1.8,1.4-2.4c0.4-0.3,0.9-0.5,1.4-0.4s0.9,0.4,1.3,0.8c0.5,0.8,0.6,1.9,0.6,2.8c0,0.9-0.4,2-1.1,2.7s-1.8,1.1-2.8,1s-1.9-0.7-2.6-1.3c-0.7-0.5-1.5-1.3-2-2.1s-0.8-1.9-0.7-2.9s0.5-2,1.1-2.7s1.5-1.4,2.3-1.8c1.8-0.8,3.8-1,5.5-0.6c0.9,0.2,1.9,0.5,2.6,1.1c0.7,0.6,1.3,1.6,1.4,2.5c0.3,1.9-0.3,3.9-1.5,5.1c1-1.5,1.5-3.3,1-5c-0.2-0.8-0.6-1.6-1.4-2.1c-0.6-0.5-1.5-0.8-2.3-0.9c-1.7-0.2-3.5,0-5,0.7s-2.8,2.1-2.9,3.6c-0.2,1.6,0.9,3.1,2.3,4.2c0.7,0.5,1.4,1,2.2,1.1c0.7,0.1,1.6-0.2,2.2-0.7s0.9-1.4,1-2.2s0-1.8-0.4-2.4c-0.2-0.3-0.5-0.6-0.8-0.7c-0.4-0.1-0.8,0-1.1,0.2C238.9,189.6,238.4,190.4,238.1,191.2z" /></g><g display="inline" ><path fill="#FFFFFF" d="M161.7,189.8c0.7-0.4,1.7-0.8,2.6-0.7c0.4,0,0.9,0.3,1.3,0.7c0.3,0.4,0.3,0.9,0.2,1.5c-0.2,0.9-0.8,1.8-1.6,2.4c-0.7,0.6-1.7,1.1-2.7,1c-1,0-2.1-0.4-2.7-1.3c-0.7-0.8-0.8-1.9-1-2.7c-0.1-0.9-0.1-1.9,0.1-2.9c0.2-0.9,0.7-1.9,1.6-2.5c0.8-0.6,1.8-1,2.8-1c0.9-0.1,2,0.1,2.8,0.4c1.8,0.6,3.3,1.9,4.4,3.4c0.5,0.7,0.9,1.7,1,2.7c0.1,0.9-0.2,2-0.8,2.7c-1.1,1.6-2.9,2.5-4.7,2.6c1.8-0.3,3.4-1.4,4.3-2.8c0.4-0.7,0.6-1.6,0.5-2.4c-0.1-0.8-0.5-1.6-1-2.3c-1-1.4-2.5-2.5-4.1-3s-3.4-0.5-4.7,0.5s-1.6,2.8-1.4,4.5c0.1,0.8,0.2,1.7,0.7,2.3c0.4,0.6,1.3,0.9,2,1c0.8,0,1.6-0.2,2.3-0.8c0.6-0.5,1.3-1.3,1.5-2c0.1-0.4,0.1-0.8-0.1-1.1c-0.2-0.3-0.5-0.6-0.9-0.6C163.3,189.1,162.5,189.4,161.7,189.8z" /></g>'
)
);
}
/// @dev Eyes N°3 => Pupils Red
function item_11() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" fill="#E31466" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" fill="#E31466" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
/// @dev Eyes N°2 => Moon
function item_12() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path id="Moon Aka" display="inline" fill="#FFEDED" d="M246.3,190.5c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4c-2.6-0.1-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C243.6,196.2,246.2,193.7,246.3,190.5z" /><path id="Moon Aka" display="inline" fill="#FFEDED" d="M169.6,190.7c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4s-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C166.8,196.5,169.5,194,169.6,190.7z" />'
)
);
}
/// @dev Eyes N°1 => Kitsune Eye
function item_13() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path display="inline" fill="#FFFFFF" d="M238.6,181c0,0-4.7,7.9,0,18.7C238.6,199.6,243.2,191.2,238.6,181z" /><path display="inline" fill="#FFFFFF" d="M165.3,181c0,0-4.7,7.9,0,18.7C165.3,199.6,169.9,191.2,165.3,181z" />'
)
);
}
/// @dev Eyes N°17 => shock
function item_14() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<circle fill="#FFFFFF" cx="239.5" cy="190.8" r="1.4"/> <circle fill="#FFFFFF" cx="164.4" cy="191.3" r="1.4"/>'
)
);
}
/// @dev Eyes N°7 => Pupils Pure
function item_15() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" fill="#FFEDED" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" fill="#FFEDED" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
string internal constant eyes =
'<g id="No_Fill"> <g> <path stroke="#000000" stroke-miterlimit="10" d="M219.1,197.3c0,0,3.1-22.5,37.9-15.5C257.1,181.7,261,208.8,219.1,197.3z"/> <g> <path d="M227.3,182.1c-1,0.5-1.9,1.3-2.7,2s-1.6,1.6-2.3,2.3c-0.7,0.8-1.5,1.7-2.1,2.5l-1,1.4c-0.3,0.4-0.6,0.9-1,1.4 c0.2-0.5,0.4-1,0.6-1.6c0.2-0.5,0.5-1,0.8-1.6c0.6-0.9,1.3-2,2.1-2.8s1.7-1.7,2.6-2.3C225,182.7,226.1,182.2,227.3,182.1z"/> </g> <g> <path d="M245.4,200.9c1.3-0.2,2.5-0.5,3.6-1s2.2-1,3.2-1.8c1-0.7,1.9-1.6,2.7-2.5s1.6-2,2.3-3c-0.3,1.3-0.8,2.5-1.7,3.5 c-0.7,1-1.7,2.1-2.8,2.8c-1,0.7-2.3,1.4-3.5,1.7C248,201,246.7,201.2,245.4,200.9z"/> </g> </g> <g> <path stroke="#000000" stroke-miterlimit="10" d="M183.9,197.3c0,0-3.1-22.5-37.9-15.5C146,181.7,142,208.8,183.9,197.3z"/> <g> <path d="M175.8,182.1c1,0.5,1.9,1.3,2.7,2s1.6,1.6,2.3,2.3c0.7,0.8,1.5,1.7,2.1,2.5l1,1.4c0.3,0.4,0.6,0.9,1,1.4 c-0.2-0.5-0.4-1-0.6-1.6c-0.2-0.5-0.5-1-0.8-1.6c-0.6-0.9-1.3-2-2.1-2.8s-1.7-1.7-2.6-2.3 C178.1,182.7,176.9,182.2,175.8,182.1z"/> </g> <g> <path d="M157.6,200.9c-1.3-0.2-2.5-0.5-3.6-1s-2.2-1-3.2-1.8c-1-0.7-1.9-1.6-2.7-2.5s-1.6-2-2.3-3c0.3,1.3,0.8,2.5,1.7,3.5 c0.7,1,1.7,2.1,2.8,2.8c1,0.7,2.3,1.4,3.5,1.7C155,201,156.5,201.2,157.6,200.9z"/> </g> </g> </g> <g id="Shadow" opacity="0.43"> <path opacity="0.5" enable-background="new " d="M218.3,191.6c0,0,4.6-10.8,19.9-13.6c0,0-12.2,0-16.1,2.8 C218.9,183.8,218.3,191.6,218.3,191.6z"/> </g> <g id="Shadow_00000029025467326919416900000002242143269665406345_" opacity="0.43"> <path opacity="0.5" enable-background="new " d="M184.9,191.3c0,0-4.8-10.6-20.1-13.4c0,0,12.4-0.2,16.3,2.6 C184.4,183.6,184.9,191.3,184.9,191.3z"/> </g>';
//string internal constant eyes = '<g display="inline" ><ellipse fill="#FFFFFF" cx="235.4" cy="190.9" rx="13.9" ry="16.4" /><path d="M221.3,190.9c0,4,1.1,8.1,3.5,11.4c1.2,1.7,2.8,3.1,4.6,4.1s3.8,1.6,5.9,1.6s4.1-0.6,5.8-1.7c1.8-1,3.3-2.4,4.6-4c2.4-3.2,3.7-7.2,3.8-11.2s-1.1-8.2-3.6-11.5c-1.2-1.7-2.9-3-4.7-4s-3.8-1.6-5.9-1.6s-4.2,0.5-5.9,1.6c-1.8,1-3.3,2.4-4.6,4.1C222.3,182.9,221.3,186.8,221.3,190.9z M221.4,190.9c0-2,0.3-4,1-5.8c0.6-1.9,1.7-3.5,2.9-5.1c2.4-3,6-5,10-5c3.9,0,7.4,2,9.9,5.1c2.4,3,3.6,6.9,3.7,10.8c0.1,3.8-1.1,8-3.5,11c-2.4,3.1-6.2,5.1-10.1,5c-3.8,0-7.5-2.1-10-5.1C223,198.8,221.4,194.8,221.4,190.9z" /></g><g display="inline" ><ellipse fill="#FFFFFF" cx="165.8" cy="191.2" rx="13.9" ry="16.4" /><path d="M179.5,191.2c0,4-1.1,8.1-3.5,11.4c-1.2,1.7-2.8,3.1-4.6,4.1s-3.8,1.6-5.9,1.6c-2.1,0-4.1-0.6-5.8-1.7c-1.8-1-3.3-2.4-4.6-4c-2.4-3.2-3.7-7.2-3.8-11.2s1.1-8.2,3.6-11.5c1.2-1.7,2.9-3,4.7-4s3.8-1.6,5.9-1.6c2.1,0,4.2,0.5,5.9,1.6c1.8,1,3.3,2.4,4.6,4.1C178.5,183.2,179.5,187.2,179.5,191.2z M179.5,191.2c0-2-0.3-4-1-5.8c-0.6-1.9-1.7-3.5-2.9-5.1c-2.4-3-6-5-10-5c-3.9,0-7.4,2-9.9,5.1c-2.4,3-3.6,6.9-3.7,10.8c-0.1,3.8,1.1,8,3.5,11c2.4,3.1,6.2,5.1,10.1,5c3.8,0,7.5-2.1,10-5.1C178.3,199.2,179.5,195.1,179.5,191.2z" /></g>';
}
| library EyesParts1 {
/// @dev Eyes N°23 => Moon Gold
function item_1() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<linearGradient id="Moon Aka" gradientUnits="userSpaceOnUse" x1="234.5972" y1="-460.8015" x2="246.3069" y2="-460.8015" gradientTransform="matrix(1 0 0 -1 0 -270)" ><stop offset="0" style="stop-color:#FFB451" /><stop offset="0.5259" style="stop-color:#F7EC94" /><stop offset="1" style="stop-color:#FF9121" /></linearGradient><path id="Moon Aka" display="inline" fill="url(#Moon_Aka_00000152984819707226930020000004625877956111571090_)" d="M246.3,190.5c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4c-2.6-0.1-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C243.6,196.2,246.2,193.7,246.3,190.5z" /><linearGradient id="Moon Aka" gradientUnits="userSpaceOnUse" x1="157.8972" y1="-461.0056" x2="169.6069" y2="-461.0056" gradientTransform="matrix(1 0 0 -1 0 -270)" ><stop offset="0" style="stop-color:#FFB451" /><stop offset="0.5259" style="stop-color:#F7EC94" /><stop offset="1" style="stop-color:#FF9121" /></linearGradient><path id="Moon Aka" display="inline" fill="url(#Moon_Aka_00000178206716264067794300000007095126762428803473_)" d="M169.6,190.7c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4s-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C166.8,196.5,169.5,194,169.6,190.7z" />'
)
);
}
/// @dev Eyes N°21 => Pupils White-Red
function item_2() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" fill="#FFEDED" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" fill="#B50D5E" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
/// @dev Eyes N°20 => Tomoe White
function item_3() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g display="inline" ><g><path fill="#FFDAEA" d="M241.3,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#FFDAEA" d="M241.3,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C239.9,194.8,241,194.3,241.3,193.4z M239.1,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C239.1,193.3,239.1,193,239.1,192.7z" /></g><g><path fill="#FFDAEA" d="M242.5,186.6c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#FFDAEA" d="M242.5,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C244.4,187.1,243.6,186.4,242.5,186.6z M243.1,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6s0.6,0.1,0.6,0.4C243.6,188.5,243.3,188.8,243.1,188.9z" /></g><g><path fill="#FFDAEA" d="M235.5,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#FFDAEA" d="M235.2,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1C234.6,187.9,234.6,188.9,235.2,189.7z M236.8,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C236.3,187.7,236.7,187.7,236.8,187.9z" /></g></g><g display="inline" ><g><path fill="#FFDAEA" d="M165.4,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#FFDAEA" d="M165.4,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C164.1,194.8,165.1,194.4,165.4,193.4z M163.3,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C163.3,193.3,163.1,193,163.3,192.7z" /></g><g><path fill="#FFDAEA" d="M166.7,186.7c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#FFDAEA" d="M166.7,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C168.4,187.1,167.7,186.5,166.7,186.6z M167.2,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6c0.3,0,0.6,0.1,0.6,0.4C167.7,188.6,167.5,188.8,167.2,188.9z" /></g><g><path fill="#FFDAEA" d="M159.6,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#FFDAEA" d="M159.4,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1S158.7,189,159.4,189.7z M160.9,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C160.4,187.8,160.7,187.8,160.9,187.9z" /></g></g>'
)
);
}
/// @dev Eyes N°18 => Tomoe Red
function item_4() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g display="inline" ><g><path fill="#E31466" d="M241.3,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#E31466" d="M241.3,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C239.9,194.8,241,194.3,241.3,193.4z M239.1,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C239.1,193.3,239.1,193,239.1,192.7z" /></g><g><path fill="#E31466" d="M242.5,186.6c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#E31466" d="M242.5,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C244.4,187.1,243.6,186.4,242.5,186.6z M243.1,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6s0.6,0.1,0.6,0.4C243.6,188.5,243.3,188.8,243.1,188.9z" /></g><g><path fill="#E31466" d="M235.5,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#E31466" d="M235.2,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1C234.6,187.9,234.6,188.9,235.2,189.7z M236.8,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C236.3,187.7,236.7,187.7,236.8,187.9z" /></g></g><g display="inline" ><g><path fill="#E31466" d="M165.4,193.3c0,0-0.3,2-3.2,3.2c0,0,1-0.9,1.1-2.1" /><path fill="#E31466" d="M165.4,193.4c0.3-0.9-0.2-1.9-1-2.2c-0.9-0.3-1.9,0.2-2.2,1c-0.3,0.9,0.2,1.9,1,2.2C164.1,194.8,165.1,194.4,165.4,193.4z M163.3,192.7c0.1-0.3,0.4-0.4,0.7-0.4c0.3,0.1,0.4,0.4,0.4,0.7c-0.1,0.3-0.4,0.4-0.7,0.4C163.3,193.3,163.1,193,163.3,192.7z" /></g><g><path fill="#E31466" d="M166.7,186.7c0,0,1.9-0.7,4.4,1.3c0,0-1.3-0.4-2.4,0" /><path fill="#E31466" d="M166.7,186.6c-0.9,0.1-1.6,1-1.4,2c0.1,0.9,1,1.6,2,1.4c0.9-0.1,1.6-1,1.4-2C168.4,187.1,167.7,186.5,166.7,186.6z M167.2,188.9c-0.3,0-0.6-0.1-0.6-0.4c0-0.3,0.1-0.6,0.4-0.6c0.3,0,0.6,0.1,0.6,0.4C167.7,188.6,167.5,188.8,167.2,188.9z" /></g><g><path fill="#E31466" d="M159.6,189.7c0,0-1.8-1-1.7-4.3c0,0,0.4,1.3,1.5,1.9" /><path fill="#E31466" d="M159.4,189.7c0.7,0.6,1.8,0.6,2.4-0.1c0.6-0.7,0.6-1.8-0.1-2.4c-0.7-0.6-1.8-0.6-2.4,0.1S158.7,189,159.4,189.7z M160.9,187.9c0.2,0.2,0.2,0.5,0.1,0.8c-0.2,0.2-0.5,0.2-0.8,0.1c-0.2-0.2-0.2-0.5-0.1-0.8C160.4,187.8,160.7,187.8,160.9,187.9z" /></g></g>'
)
);
}
/// @dev Eyes N°16 => Shine
function item_5() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path display="inline" fill="#FFFFFF" stroke="#000000" stroke-width="0.5" stroke-miterlimit="10" d="M164.1,182.5c1.4,7,1.4,6.9,8.3,8.3c-7,1.4-6.9,1.4-8.3,8.3c-1.4-7-1.4-6.9-8.3-8.3C162.8,189.4,162.7,189.5,164.1,182.5z" /><path display="inline" fill="#FFFFFF" stroke="#000000" stroke-width="0.5" stroke-miterlimit="10" d="M238.7,182.3c1.4,7,1.4,6.9,8.3,8.3c-7,1.4-6.9,1.4-8.3,8.3c-1.4-7-1.4-6.9-8.3-8.3C237.4,189.2,237.3,189.2,238.7,182.3z" />'
)
);
}
/// @dev Eyes N°12 => Stitch Eyes
function item_6() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g id="Strip"> <path d="M231.3,188.2s1-3.2,2.6-.9a30.48,30.48,0,0,1-.6,9.2s-.9,2-1.5-.5C231.3,193.3,232.3,193,231.3,188.2Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M239.4,187.7s1-3.1,2.5-.9a28.56,28.56,0,0,1-.6,8.9s-.9,1.9-1.4-.5S240.5,192.4,239.4,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M245.9,187.7s.9-2.7,2.2-.8a26.25,26.25,0,0,1-.5,7.7s-.8,1.7-1.1-.4S246.9,191.8,245.9,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M251.4,187.4s.8-2.4,2-.7a21.16,21.16,0,0,1-.5,6.9s-.7,1.5-1-.4C251.4,191.2,252.1,191,251.4,187.4Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> </g> <g id="Strip-2" > <path d="M173.2,187.9s-1-3.1-2.5-.9a27.9,27.9,0,0,0,.6,8.8s.9,1.9,1.4-.5S172.2,192.5,173.2,187.9Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M165.4,187.7s-1-3.1-2.5-.9a28.56,28.56,0,0,0,.6,8.9s.9,1.9,1.4-.5S164.4,192.4,165.4,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M158.9,187.7s-.9-2.7-2.2-.8a26.25,26.25,0,0,0,.5,7.7s.8,1.7,1.1-.4C158.9,192,158.1,191.8,158.9,187.7Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> <path d="M153.4,187.4s-.8-2.4-2-.7a21.16,21.16,0,0,0,.5,6.9s.7,1.5,1-.4C153.4,191.2,152.6,191,153.4,187.4Z" transform="translate(-0.4)" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width="0.75"/> </g>'
)
);
}
/// @dev Eyes N°11 => Globes
function item_7() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse fill="#FFFFFF" cx="244.6" cy="184.5" rx="4.1" ry="0.9" /><ellipse fill="#FFFFFF" cx="154.6" cy="184.5" rx="4.1" ry="0.9" />'
)
);
}
/// @dev Eyes N°8 => Akuma Eye
function item_8() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path display="inline" fill="#FFFFFF" d="M246.5,192h-13c-0.7,0-1.3-0.5-1.3-1.3l0,0c0-0.7,0.5-1.3,1.3-1.3h13c0.7,0,1.3,0.5,1.3,1.3l0,0C247.8,191.3,247.1,192,246.5,192z" /><path display="inline" fill="#FFFFFF" d="M169.9,192h-13c-0.7,0-1.3-0.5-1.3-1.3l0,0c0-0.7,0.5-1.3,1.3-1.3h13c0.7,0,1.3,0.5,1.3,1.3l0,0C171.1,191.3,170.5,192,169.9,192z" />'
)
);
}
/// @dev Eyes N°19 => Pupils Kuro
function item_9() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
/// @dev Eyes N°4 => Spiral
function item_10() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<g display="inline" ><path fill="#FFFFFF" d="M238.1,191.2c0.2-0.8,0.6-1.8,1.4-2.4c0.4-0.3,0.9-0.5,1.4-0.4s0.9,0.4,1.3,0.8c0.5,0.8,0.6,1.9,0.6,2.8c0,0.9-0.4,2-1.1,2.7s-1.8,1.1-2.8,1s-1.9-0.7-2.6-1.3c-0.7-0.5-1.5-1.3-2-2.1s-0.8-1.9-0.7-2.9s0.5-2,1.1-2.7s1.5-1.4,2.3-1.8c1.8-0.8,3.8-1,5.5-0.6c0.9,0.2,1.9,0.5,2.6,1.1c0.7,0.6,1.3,1.6,1.4,2.5c0.3,1.9-0.3,3.9-1.5,5.1c1-1.5,1.5-3.3,1-5c-0.2-0.8-0.6-1.6-1.4-2.1c-0.6-0.5-1.5-0.8-2.3-0.9c-1.7-0.2-3.5,0-5,0.7s-2.8,2.1-2.9,3.6c-0.2,1.6,0.9,3.1,2.3,4.2c0.7,0.5,1.4,1,2.2,1.1c0.7,0.1,1.6-0.2,2.2-0.7s0.9-1.4,1-2.2s0-1.8-0.4-2.4c-0.2-0.3-0.5-0.6-0.8-0.7c-0.4-0.1-0.8,0-1.1,0.2C238.9,189.6,238.4,190.4,238.1,191.2z" /></g><g display="inline" ><path fill="#FFFFFF" d="M161.7,189.8c0.7-0.4,1.7-0.8,2.6-0.7c0.4,0,0.9,0.3,1.3,0.7c0.3,0.4,0.3,0.9,0.2,1.5c-0.2,0.9-0.8,1.8-1.6,2.4c-0.7,0.6-1.7,1.1-2.7,1c-1,0-2.1-0.4-2.7-1.3c-0.7-0.8-0.8-1.9-1-2.7c-0.1-0.9-0.1-1.9,0.1-2.9c0.2-0.9,0.7-1.9,1.6-2.5c0.8-0.6,1.8-1,2.8-1c0.9-0.1,2,0.1,2.8,0.4c1.8,0.6,3.3,1.9,4.4,3.4c0.5,0.7,0.9,1.7,1,2.7c0.1,0.9-0.2,2-0.8,2.7c-1.1,1.6-2.9,2.5-4.7,2.6c1.8-0.3,3.4-1.4,4.3-2.8c0.4-0.7,0.6-1.6,0.5-2.4c-0.1-0.8-0.5-1.6-1-2.3c-1-1.4-2.5-2.5-4.1-3s-3.4-0.5-4.7,0.5s-1.6,2.8-1.4,4.5c0.1,0.8,0.2,1.7,0.7,2.3c0.4,0.6,1.3,0.9,2,1c0.8,0,1.6-0.2,2.3-0.8c0.6-0.5,1.3-1.3,1.5-2c0.1-0.4,0.1-0.8-0.1-1.1c-0.2-0.3-0.5-0.6-0.9-0.6C163.3,189.1,162.5,189.4,161.7,189.8z" /></g>'
)
);
}
/// @dev Eyes N°3 => Pupils Red
function item_11() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" fill="#E31466" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" fill="#E31466" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
/// @dev Eyes N°2 => Moon
function item_12() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path id="Moon Aka" display="inline" fill="#FFEDED" d="M246.3,190.5c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4c-2.6-0.1-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C243.6,196.2,246.2,193.7,246.3,190.5z" /><path id="Moon Aka" display="inline" fill="#FFEDED" d="M169.6,190.7c0.1-2-0.9-3.8-2.4-4.9c0.7,0.8,1.3,1.9,1.1,3.1c-0.1,2.5-2.2,4.4-4.7,4.4s-4.6-2.1-4.5-4.6c0-1.1,0.5-2.3,1.4-3c-1.6,1-2.6,2.8-2.6,4.7c-0.1,3.2,2.5,5.9,5.7,5.9C166.8,196.5,169.5,194,169.6,190.7z" />'
)
);
}
/// @dev Eyes N°1 => Kitsune Eye
function item_13() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<path display="inline" fill="#FFFFFF" d="M238.6,181c0,0-4.7,7.9,0,18.7C238.6,199.6,243.2,191.2,238.6,181z" /><path display="inline" fill="#FFFFFF" d="M165.3,181c0,0-4.7,7.9,0,18.7C165.3,199.6,169.9,191.2,165.3,181z" />'
)
);
}
/// @dev Eyes N°17 => shock
function item_14() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<circle fill="#FFFFFF" cx="239.5" cy="190.8" r="1.4"/> <circle fill="#FFFFFF" cx="164.4" cy="191.3" r="1.4"/>'
)
);
}
/// @dev Eyes N°7 => Pupils Pure
function item_15() public pure returns (string memory) {
return
string(
abi.encodePacked(
eyes,
'<ellipse display="inline" fill="#FFEDED" cx="239.1" cy="189.9" rx="5.7" ry="7.3" /><ellipse display="inline" fill="#FFEDED" cx="164.4" cy="190.2" rx="5.7" ry="7.3" />'
)
);
}
string internal constant eyes =
'<g id="No_Fill"> <g> <path stroke="#000000" stroke-miterlimit="10" d="M219.1,197.3c0,0,3.1-22.5,37.9-15.5C257.1,181.7,261,208.8,219.1,197.3z"/> <g> <path d="M227.3,182.1c-1,0.5-1.9,1.3-2.7,2s-1.6,1.6-2.3,2.3c-0.7,0.8-1.5,1.7-2.1,2.5l-1,1.4c-0.3,0.4-0.6,0.9-1,1.4 c0.2-0.5,0.4-1,0.6-1.6c0.2-0.5,0.5-1,0.8-1.6c0.6-0.9,1.3-2,2.1-2.8s1.7-1.7,2.6-2.3C225,182.7,226.1,182.2,227.3,182.1z"/> </g> <g> <path d="M245.4,200.9c1.3-0.2,2.5-0.5,3.6-1s2.2-1,3.2-1.8c1-0.7,1.9-1.6,2.7-2.5s1.6-2,2.3-3c-0.3,1.3-0.8,2.5-1.7,3.5 c-0.7,1-1.7,2.1-2.8,2.8c-1,0.7-2.3,1.4-3.5,1.7C248,201,246.7,201.2,245.4,200.9z"/> </g> </g> <g> <path stroke="#000000" stroke-miterlimit="10" d="M183.9,197.3c0,0-3.1-22.5-37.9-15.5C146,181.7,142,208.8,183.9,197.3z"/> <g> <path d="M175.8,182.1c1,0.5,1.9,1.3,2.7,2s1.6,1.6,2.3,2.3c0.7,0.8,1.5,1.7,2.1,2.5l1,1.4c0.3,0.4,0.6,0.9,1,1.4 c-0.2-0.5-0.4-1-0.6-1.6c-0.2-0.5-0.5-1-0.8-1.6c-0.6-0.9-1.3-2-2.1-2.8s-1.7-1.7-2.6-2.3 C178.1,182.7,176.9,182.2,175.8,182.1z"/> </g> <g> <path d="M157.6,200.9c-1.3-0.2-2.5-0.5-3.6-1s-2.2-1-3.2-1.8c-1-0.7-1.9-1.6-2.7-2.5s-1.6-2-2.3-3c0.3,1.3,0.8,2.5,1.7,3.5 c0.7,1,1.7,2.1,2.8,2.8c1,0.7,2.3,1.4,3.5,1.7C155,201,156.5,201.2,157.6,200.9z"/> </g> </g> </g> <g id="Shadow" opacity="0.43"> <path opacity="0.5" enable-background="new " d="M218.3,191.6c0,0,4.6-10.8,19.9-13.6c0,0-12.2,0-16.1,2.8 C218.9,183.8,218.3,191.6,218.3,191.6z"/> </g> <g id="Shadow_00000029025467326919416900000002242143269665406345_" opacity="0.43"> <path opacity="0.5" enable-background="new " d="M184.9,191.3c0,0-4.8-10.6-20.1-13.4c0,0,12.4-0.2,16.3,2.6 C184.4,183.6,184.9,191.3,184.9,191.3z"/> </g>';
//string internal constant eyes = '<g display="inline" ><ellipse fill="#FFFFFF" cx="235.4" cy="190.9" rx="13.9" ry="16.4" /><path d="M221.3,190.9c0,4,1.1,8.1,3.5,11.4c1.2,1.7,2.8,3.1,4.6,4.1s3.8,1.6,5.9,1.6s4.1-0.6,5.8-1.7c1.8-1,3.3-2.4,4.6-4c2.4-3.2,3.7-7.2,3.8-11.2s-1.1-8.2-3.6-11.5c-1.2-1.7-2.9-3-4.7-4s-3.8-1.6-5.9-1.6s-4.2,0.5-5.9,1.6c-1.8,1-3.3,2.4-4.6,4.1C222.3,182.9,221.3,186.8,221.3,190.9z M221.4,190.9c0-2,0.3-4,1-5.8c0.6-1.9,1.7-3.5,2.9-5.1c2.4-3,6-5,10-5c3.9,0,7.4,2,9.9,5.1c2.4,3,3.6,6.9,3.7,10.8c0.1,3.8-1.1,8-3.5,11c-2.4,3.1-6.2,5.1-10.1,5c-3.8,0-7.5-2.1-10-5.1C223,198.8,221.4,194.8,221.4,190.9z" /></g><g display="inline" ><ellipse fill="#FFFFFF" cx="165.8" cy="191.2" rx="13.9" ry="16.4" /><path d="M179.5,191.2c0,4-1.1,8.1-3.5,11.4c-1.2,1.7-2.8,3.1-4.6,4.1s-3.8,1.6-5.9,1.6c-2.1,0-4.1-0.6-5.8-1.7c-1.8-1-3.3-2.4-4.6-4c-2.4-3.2-3.7-7.2-3.8-11.2s1.1-8.2,3.6-11.5c1.2-1.7,2.9-3,4.7-4s3.8-1.6,5.9-1.6c2.1,0,4.2,0.5,5.9,1.6c1.8,1,3.3,2.4,4.6,4.1C178.5,183.2,179.5,187.2,179.5,191.2z M179.5,191.2c0-2-0.3-4-1-5.8c-0.6-1.9-1.7-3.5-2.9-5.1c-2.4-3-6-5-10-5c-3.9,0-7.4,2-9.9,5.1c-2.4,3-3.6,6.9-3.7,10.8c-0.1,3.8,1.1,8,3.5,11c2.4,3.1,6.2,5.1,10.1,5c3.8,0,7.5-2.1,10-5.1C178.3,199.2,179.5,195.1,179.5,191.2z" /></g>';
}
| 18,205 |
99 | // Claim stuck Balance in Contract Token \\ | function claimTokens() public onlyOwner {
payable(_owner).transfer(address(this).balance);
}
| function claimTokens() public onlyOwner {
payable(_owner).transfer(address(this).balance);
}
| 24,243 |
88 | // Decimals override | function decimals() public pure override returns (uint8){
return DECIMALS;
}
| function decimals() public pure override returns (uint8){
return DECIMALS;
}
| 33,411 |
401 | // Get the edition number from a token id Returns `0` if it's not an edition tokenId The token id for the editionreturn editionNumber The edition number e.g. 2 of 10 / | function getEditionNumberFromTokenId(uint256 tokenId) external pure returns (uint256) {
if (tokenId >= MAX_EDITION_SIZE) return 0;
return tokenId % MAX_EDITION_SIZE;
}
| function getEditionNumberFromTokenId(uint256 tokenId) external pure returns (uint256) {
if (tokenId >= MAX_EDITION_SIZE) return 0;
return tokenId % MAX_EDITION_SIZE;
}
| 26,635 |
9 | // Save token with token standardtokenAddress Token addressstandard Standard of the token/ | function setTokenStandard(address tokenAddress, bytes32 standard) public;
| function setTokenStandard(address tokenAddress, bytes32 standard) public;
| 20,327 |
5 | // Returns the interface hash for an `interfaceName`, as defined in thecorresponding / | function interfaceHash(string calldata interfaceName) external pure returns (bytes32);
| function interfaceHash(string calldata interfaceName) external pure returns (bytes32);
| 27,998 |
68 | // to emit Trove's debt update event, to be called from trove/ _token address of token/ _newAmount new trove's debt value/ _newCollateralization new trove's collateralization value | function emitTroveDebtUpdate(
address _token,
uint256 _newAmount,
uint256 _newCollateralization,
uint256 _feePaid
| function emitTroveDebtUpdate(
address _token,
uint256 _newAmount,
uint256 _newCollateralization,
uint256 _feePaid
| 12,251 |
28 | // Update user voting status to true | disp.voted[msg.sender] = true;
| disp.voted[msg.sender] = true;
| 49,783 |
21 | // Cast a with a reason Emits a {VoteCast} event. / | function castVoteWithReason(
| function castVoteWithReason(
| 20,519 |
103 | // - COMPOUND - // | function balanceToCompound(ICompoundBridge cToken) external {
IERC20 underlying = IERC20(ICompoundBridge(cToken).underlying()); // sanity check for `underlying` token
cToken.mint(underlying.safeBalanceOfSelf());
}
| function balanceToCompound(ICompoundBridge cToken) external {
IERC20 underlying = IERC20(ICompoundBridge(cToken).underlying()); // sanity check for `underlying` token
cToken.mint(underlying.safeBalanceOfSelf());
}
| 24,020 |
26 | // function for Defender Victory | function defenderVictory(address _attacker, address _defender, uint256 _attackerId, uint256 _defenderId, bool critDefend, uint256 _random, uint256 _powerDiff) public {
// calculates 25% of what the Prize would have been for Attacker
uint256 _prize = getPrizeAmount(_random) * 25 / 100;
// updates Defender Wins
KennelFighter(_defender).updateWins(_defenderId);
// adds Passive winnings
KennelFighter(_defender).addPassiveWinnings(_defenderId, _prize);
KennelFighter(_defender).gainExp(_defenderId, _powerDiff * 20 / 100);
// update Attacker Loss
KennelFighter(_attacker).updateLoss(_attackerId);
// update Attacker Last Attacked
KennelFighter(_attacker).updateLastFought(_attackerId);
// Sends The winning Fighters Owner the BNB!
payable(KennelFighter(_defender).ownerOf(_defenderId)).transfer(_prize);
// 50/50 Chance of winning with Critical Defense getting an Armor upgrade!
if(critDefend && _random % 2 == 1){
KennelFighter(_defender).upgradeMaxArmor(_defenderId);
}
}
| function defenderVictory(address _attacker, address _defender, uint256 _attackerId, uint256 _defenderId, bool critDefend, uint256 _random, uint256 _powerDiff) public {
// calculates 25% of what the Prize would have been for Attacker
uint256 _prize = getPrizeAmount(_random) * 25 / 100;
// updates Defender Wins
KennelFighter(_defender).updateWins(_defenderId);
// adds Passive winnings
KennelFighter(_defender).addPassiveWinnings(_defenderId, _prize);
KennelFighter(_defender).gainExp(_defenderId, _powerDiff * 20 / 100);
// update Attacker Loss
KennelFighter(_attacker).updateLoss(_attackerId);
// update Attacker Last Attacked
KennelFighter(_attacker).updateLastFought(_attackerId);
// Sends The winning Fighters Owner the BNB!
payable(KennelFighter(_defender).ownerOf(_defenderId)).transfer(_prize);
// 50/50 Chance of winning with Critical Defense getting an Armor upgrade!
if(critDefend && _random % 2 == 1){
KennelFighter(_defender).upgradeMaxArmor(_defenderId);
}
}
| 24,429 |
74 | // Calculate the public input hash (a SHA256 hash of several values) | uint256 publicInputHash = genProcessMessagesPublicInputHash(
_poll,
_currentMessageBatchIndex,
_messageRoot,
numSignUps,
_currentSbCommitment,
_newSbCommitment
);
| uint256 publicInputHash = genProcessMessagesPublicInputHash(
_poll,
_currentMessageBatchIndex,
_messageRoot,
numSignUps,
_currentSbCommitment,
_newSbCommitment
);
| 35,312 |
4 | // Emits when a configurator is upgraded | event NewConfigurator(address indexed newConfigurator);
| event NewConfigurator(address indexed newConfigurator);
| 20,220 |
186 | // Mint the fee | token.mint(feeRecipient, absoluteFee);
emit LogMint(_recipient, receivedAmount, nextN, signedMessageHash);
nextN += 1;
| token.mint(feeRecipient, absoluteFee);
emit LogMint(_recipient, receivedAmount, nextN, signedMessageHash);
nextN += 1;
| 14,518 |
8 | // Change Super Admin of the contract to a new account (`newSuperAdmin`).Can only be called by the current super admin. / | function changeSuperAdmin(address newSuperAdmin) public onlySuperAdmin {
require(
newSuperAdmin != address(0),
"Super Admin: new super admin is the zero address"
);
emit SuperAdminChanged(superAdmin, newSuperAdmin);
superAdmin = newSuperAdmin;
}
| function changeSuperAdmin(address newSuperAdmin) public onlySuperAdmin {
require(
newSuperAdmin != address(0),
"Super Admin: new super admin is the zero address"
);
emit SuperAdminChanged(superAdmin, newSuperAdmin);
superAdmin = newSuperAdmin;
}
| 56,073 |
110 | // if total position size less than IGNORABLE_DIGIT_FOR_SHUTDOWN, treat it as 0 positions due to rounding error | if (totalPositionSize.toUint() > IGNORABLE_DIGIT_FOR_SHUTDOWN) {
settlementPrice = positionNotionalValue.abs().divD(totalPositionSize.abs());
}
| if (totalPositionSize.toUint() > IGNORABLE_DIGIT_FOR_SHUTDOWN) {
settlementPrice = positionNotionalValue.abs().divD(totalPositionSize.abs());
}
| 16,263 |
36 | // reduce address balance and Token total supply | function addressburn(address _of, uint256 _value) onlyOwner public {
require(_value > 0, INVALID_TOKEN_VALUES);
require(_value <= balances[_of], NOT_ENOUGH_TOKENS);
balances[_of] = balances[_of].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit AddressBurn(_of, _value);
emit Transfer(_of, address(0), _value);
}
| function addressburn(address _of, uint256 _value) onlyOwner public {
require(_value > 0, INVALID_TOKEN_VALUES);
require(_value <= balances[_of], NOT_ENOUGH_TOKENS);
balances[_of] = balances[_of].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit AddressBurn(_of, _value);
emit Transfer(_of, address(0), _value);
}
| 42,738 |
102 | // solhint-enable var-name-mixedcase // Initializes the domain separator and parameter caches. The meaning of `name` and `version` is specified in - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.- `version`: the current major version of the signing domain. NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smartcontract upgrade]. / | constructor(string memory name, string memory version) internal {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
bytes32 typeHash = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
| constructor(string memory name, string memory version) internal {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
bytes32 typeHash = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
| 29,669 |
30 | // amount should be greater than 0 | require(
_amounts[i] > 0,
"addRecipients: vesting amount cannot be 0"
);
| require(
_amounts[i] > 0,
"addRecipients: vesting amount cannot be 0"
);
| 13,067 |
163 | // The number to divide an amount by to get the size/for that amount | uint denominator;
| uint denominator;
| 47,942 |
16 | // ____________________________________________________________________________________________________________________-->LOCK MINTING (function) setMintingCompleteForeverCannotBeUndoneAllow project owner to set minting completeEnter confirmation value to confirm that you are closing minting. --------------------------------------------------------------------------------------------------------------------- confirmationValue_Confirmation value---------------------------------------------------------------------------------------------------------------------_____________________________________________________________________________________________________________________ / | function setMintingCompleteForeverCannotBeUndone(
| function setMintingCompleteForeverCannotBeUndone(
| 37,005 |
1 | // change the owner of the contract/_newOwner the address of the new owner of the contract. | function changeOwner(address _newOwner)
onlyOwner
| function changeOwner(address _newOwner)
onlyOwner
| 51,270 |
101 | // Returns the balance of the payment plugin contract for a token (or ETH). | function _balance(address token) private view returns(uint) {
if(token == ZERO) {
return address(this).balance;
} else {
return IERC20(token).balanceOf(address(this));
}
}
| function _balance(address token) private view returns(uint) {
if(token == ZERO) {
return address(this).balance;
} else {
return IERC20(token).balanceOf(address(this));
}
}
| 11,712 |
7 | // Marketing | periodsElapsed = (currentTime - lastMarketingRewardTime) / (12 * ONE_MONTH);
if (periodsElapsed > 0) {
lastMarketingRewardTime += periodsElapsed * 12 * ONE_MONTH;
releaseTokens(marketing, 4500000 * 10**18 * periodsElapsed);
}
| periodsElapsed = (currentTime - lastMarketingRewardTime) / (12 * ONE_MONTH);
if (periodsElapsed > 0) {
lastMarketingRewardTime += periodsElapsed * 12 * ONE_MONTH;
releaseTokens(marketing, 4500000 * 10**18 * periodsElapsed);
}
| 4,149 |
1 | // Interface for depositing into & withdrawing from SushiBar. | interface ISushiBar {
function balanceOf(address account) external view returns (uint256);
function enter(uint256 amount) external;
function leave(uint256 share) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
| interface ISushiBar {
function balanceOf(address account) external view returns (uint256);
function enter(uint256 amount) external;
function leave(uint256 share) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
| 43,667 |
27 | // Anyone can mint paying the total/_tokenId The session to mint | function mint(uint256 _tokenId)
external
payable
isFinalized(_tokenId)
| function mint(uint256 _tokenId)
external
payable
isFinalized(_tokenId)
| 27,572 |
3 | // The largest token id for genesis and force tokens | uint256 public constant MAX_TOKEN_ID = 100;
| uint256 public constant MAX_TOKEN_ID = 100;
| 22,090 |
10 | // Modifier that requires the "ContractOwner" account to be the function caller/ | modifier requireContractOwner()
| modifier requireContractOwner()
| 2,859 |
14 | // transfer _value from msg.sender to receiver Both sender and receiver pays a transaction fees The transaction fees will be transferred into GGCPool and GGEPool/ | function transfer(address _to, uint256 _value)
public
notNull(_to)
returns (bool success)
| function transfer(address _to, uint256 _value)
public
notNull(_to)
returns (bool success)
| 8,421 |
28 | // VIP List //get balance/ | function getBalance(address _tokenAddress) onlyOwner public {
address _receiverAddress = getReceiverAddress();
if (_tokenAddress == address(0)) {
require(_receiverAddress.send(address(this).balance));
return;
}
StandardToken token = StandardToken(_tokenAddress);
uint256 balance = token.balanceOf(this);
token.transfer(_receiverAddress, balance);
emit LogGetToken(_tokenAddress, _receiverAddress, balance);
}
| function getBalance(address _tokenAddress) onlyOwner public {
address _receiverAddress = getReceiverAddress();
if (_tokenAddress == address(0)) {
require(_receiverAddress.send(address(this).balance));
return;
}
StandardToken token = StandardToken(_tokenAddress);
uint256 balance = token.balanceOf(this);
token.transfer(_receiverAddress, balance);
emit LogGetToken(_tokenAddress, _receiverAddress, balance);
}
| 71,747 |
8 | // A list of special token IDs that are one of ones This array is used to store the token IDs of special one of one tokens / | uint256[] public oneOfOnes = [1021, 2002, 2023, 3000, 3011, 3025, 4507, 4512, 4519, 4525];
| uint256[] public oneOfOnes = [1021, 2002, 2023, 3000, 3011, 3025, 4507, 4512, 4519, 4525];
| 1,760 |
169 | // Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens amount The number of tokens that are approved (-1 means infinite)return Whether or not the approval succeeded / | function approve(address spender, uint256 amount) external returns (bool) {
address src = msg.sender;
transferAllowances[src][spender] = amount;
emit Approval(src, spender, amount);
return true;
}
| function approve(address spender, uint256 amount) external returns (bool) {
address src = msg.sender;
transferAllowances[src][spender] = amount;
emit Approval(src, spender, amount);
return true;
}
| 4,834 |
173 | // Calculate the number of shares to issue for a given deposit/This is based on the realized value of underlying assets between SettV1_1 & associated Strategy | function _deposit(uint256 _amount) internal {
uint256 _pool = balance();
uint256 _before = token.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), _amount);
uint256 _after = token.balanceOf(address(this));
_amount = _after.sub(_before); // Additional check for deflationary tokens
uint256 shares = 0;
if (totalSupply() == 0) {
shares = _amount;
} else {
shares = (_amount.mul(totalSupply())).div(_pool);
}
_mint(msg.sender, shares);
}
| function _deposit(uint256 _amount) internal {
uint256 _pool = balance();
uint256 _before = token.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), _amount);
uint256 _after = token.balanceOf(address(this));
_amount = _after.sub(_before); // Additional check for deflationary tokens
uint256 shares = 0;
if (totalSupply() == 0) {
shares = _amount;
} else {
shares = (_amount.mul(totalSupply())).div(_pool);
}
_mint(msg.sender, shares);
}
| 30,223 |
98 | // This is for math purposes | uint256 swappedFees = totalFees - liquidityFee/2 - stakingFee;
| uint256 swappedFees = totalFees - liquidityFee/2 - stakingFee;
| 49,071 |
36 | // Copy deposit to the new address | userDeposits[to].push(depositData);
uint256 amount = depositData.amount;
| userDeposits[to].push(depositData);
uint256 amount = depositData.amount;
| 39,313 |
25 | // Function to change the implementation address, which can be called only by the owner newImplementation New address of the implementation / | function setImplementation(address newImplementation) external onlyOwner {
implementation = newImplementation;
emit ImplementationChanged(newImplementation);
}
| function setImplementation(address newImplementation) external onlyOwner {
implementation = newImplementation;
emit ImplementationChanged(newImplementation);
}
| 27,414 |
10 | // Unpause the contract functions / | function unpauseContract() external onlyOwner {
_unpause();
}
| function unpauseContract() external onlyOwner {
_unpause();
}
| 25,679 |
266 | // Pokes the weightedTimestamp of a given user and checks if it entitles themto a better timeMultiplier. If not, it simply reverts as there is nothing to update. _account Address of user that should be updated / | function _reviewWeightedTimestamp(address _account) internal updateReward(_account) {
require(_account != address(0), "Invalid address");
// 1. Get current balance
(Balance memory oldBalance, uint256 oldScaledBalance) = _prepareOldBalance(_account);
// 2. Set weighted timestamp, if it changes
uint8 newTimeMultiplier = _timeMultiplier(oldBalance.weightedTimestamp);
require(newTimeMultiplier != oldBalance.timeMultiplier, "Nothing worth poking here");
_balances[_account].timeMultiplier = newTimeMultiplier;
// 3. Update scaled balance
_settleScaledBalance(_account, oldScaledBalance);
}
| function _reviewWeightedTimestamp(address _account) internal updateReward(_account) {
require(_account != address(0), "Invalid address");
// 1. Get current balance
(Balance memory oldBalance, uint256 oldScaledBalance) = _prepareOldBalance(_account);
// 2. Set weighted timestamp, if it changes
uint8 newTimeMultiplier = _timeMultiplier(oldBalance.weightedTimestamp);
require(newTimeMultiplier != oldBalance.timeMultiplier, "Nothing worth poking here");
_balances[_account].timeMultiplier = newTimeMultiplier;
// 3. Update scaled balance
_settleScaledBalance(_account, oldScaledBalance);
}
| 23,809 |
343 | // eg. MIC - USDT - and bridgeFor(MIC) = USDT | sushiOut = _convertStep(
bridge0,
token1,
_swap(token0, bridge0, amount0, address(this)),
amount1
);
| sushiOut = _convertStep(
bridge0,
token1,
_swap(token0, bridge0, amount0, address(this)),
amount1
);
| 66,184 |
92 | // Governance functions / |
function migrateGuardians(address[] calldata guardiansToMigrate, IGuardiansRegistration previousContract) external /* onlyInitializationAdmin */;
|
function migrateGuardians(address[] calldata guardiansToMigrate, IGuardiansRegistration previousContract) external /* onlyInitializationAdmin */;
| 2,524 |
103 | // Calculates the nToken transfer. | function _calculateCollateralNTokenTransfer(
BalanceState memory balanceState,
LiquidationFactors memory factors,
int256 collateralAssetRemaining,
int256 maxNTokenLiquidation
| function _calculateCollateralNTokenTransfer(
BalanceState memory balanceState,
LiquidationFactors memory factors,
int256 collateralAssetRemaining,
int256 maxNTokenLiquidation
| 61,846 |
52 | // Adjust the randomness | seed >>= 16;
| seed >>= 16;
| 16,993 |
26 | // sender is transferring its full purchase amount of bonds | if(ABDKMathQuad.cmp(purchases[sender][issuedBond].purchasedIssueAmount, ABDKMathQuad.fromUInt(tokens))==0){
purchases[receiver][issuedBond] = issues[sender][issuedBond];
delete purchases[sender][issuedBond];
if(Token(issuedBond).transferToken(sender, receiver, tokens)){
emit Transfer(sender, receiver, tokens);
return true;
}
| if(ABDKMathQuad.cmp(purchases[sender][issuedBond].purchasedIssueAmount, ABDKMathQuad.fromUInt(tokens))==0){
purchases[receiver][issuedBond] = issues[sender][issuedBond];
delete purchases[sender][issuedBond];
if(Token(issuedBond).transferToken(sender, receiver, tokens)){
emit Transfer(sender, receiver, tokens);
return true;
}
| 26,082 |
34 | // Use to add the new default restriction for all token holder _allowedTokens Amount of tokens allowed to be traded for all token holder. _startTime Unix timestamp at which restriction get into effect _rollingPeriodInDays Rolling period in days (Minimum value should be 1 day) _endTime Unix timestamp at which restriction effects will gets end. _restrictionType Whether it will be `Fixed` (fixed no. of tokens allowed to transact)or `Percentage` (tokens are calculated as per the totalSupply in the fly). / | function addDefaultRestriction(
uint256 _allowedTokens,
uint256 _startTime,
uint256 _rollingPeriodInDays,
uint256 _endTime,
RestrictionType _restrictionType
)
external
withPerm(ADMIN)
| function addDefaultRestriction(
uint256 _allowedTokens,
uint256 _startTime,
uint256 _rollingPeriodInDays,
uint256 _endTime,
RestrictionType _restrictionType
)
external
withPerm(ADMIN)
| 51,751 |
28 | // saving to array | tokenOnSell[_tokenId] = true;
tokensForSale[_tokenId].sellerAddr = msg.sender;
tokensForSale[_tokenId].price = price;
tokensForSale[_tokenId].auction = false;
tokensForSale[_tokenId].holland = false;
| tokenOnSell[_tokenId] = true;
tokensForSale[_tokenId].sellerAddr = msg.sender;
tokensForSale[_tokenId].price = price;
tokensForSale[_tokenId].auction = false;
tokensForSale[_tokenId].holland = false;
| 32,066 |
39 | // common, rare, unique ids considered in range on 1-111 | uint256 public constant rareMinId = 101;
uint256 public constant uniqueId = 111;
uint256 public minNFTId = 223;
uint256 public maxNFTId = 444;
uint256 public commonLimit = 3200 * 10**18;
uint256 public rareLimit = 16500 * 10**18;
uint256 public uniqueLimit = 30000 * 10**18;
| uint256 public constant rareMinId = 101;
uint256 public constant uniqueId = 111;
uint256 public minNFTId = 223;
uint256 public maxNFTId = 444;
uint256 public commonLimit = 3200 * 10**18;
uint256 public rareLimit = 16500 * 10**18;
uint256 public uniqueLimit = 30000 * 10**18;
| 24,298 |
43 | // YGGDRASH Token Contract. info@yggdrash.io This contract is the updated version that fixes the unlocking bug.This source code is audited by external auditors. / | contract YeedToken is ERC20, Lockable {
string public constant name = "YGGDRASH";
string public constant symbol = "YEED";
uint8 public constant decimals = 18;
/**
* @dev If this flag is true, admin can use enableTokenTranfer(), emergencyTransfer().
*/
bool public adminMode;
using SafeMath for uint256;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _approvals;
uint256 internal _supply;
event TokenBurned(address burnAddress, uint256 amountOfTokens);
event SetTokenTransfer(bool transfer);
event SetAdminMode(bool adminMode);
event EmergencyTransfer(address indexed from, address indexed to, uint256 value);
modifier isAdminMode {
require(adminMode);
_;
}
constructor(uint256 initial_balance)
public
{
require(initial_balance != 0);
_supply = initial_balance;
_balances[msg.sender] = initial_balance;
emit Transfer(address(0), msg.sender, initial_balance);
}
function totalSupply()
public
view
returns (uint256) {
return _supply;
}
function balanceOf(address who)
public
view
returns (uint256) {
return _balances[who];
}
function transfer(address to, uint256 value)
public
isTokenTransfer
checkLock
returns (bool) {
require(to != address(0));
require(_balances[msg.sender] >= value);
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
function allowance(address owner, address spender)
public
view
returns (uint256) {
return _approvals[owner][spender];
}
function transferFrom(address from, address to, uint256 value)
public
isTokenTransfer
checkLock
returns (bool success) {
require(!lockAddress[from]);
require(_balances[from] >= value);
require(_approvals[from][msg.sender] >= value);
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
_approvals[from][msg.sender] = _approvals[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value)
public
checkLock
returns (bool) {
_approvals[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint256 _addedValue)
public
checkLock
returns (bool) {
_approvals[msg.sender][_spender] = (
_approvals[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, _approvals[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint256 _subtractedValue)
public
checkLock
returns (bool) {
uint256 oldValue = _approvals[msg.sender][_spender];
if (_subtractedValue > oldValue) {
_approvals[msg.sender][_spender] = 0;
} else {
_approvals[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, _approvals[msg.sender][_spender]);
return true;
}
/**
* @dev Burn tokens can only use by owner
*/
function burnTokens(uint256 tokensAmount)
public
isAdminMode
isOwner
{
require(_balances[msg.sender] >= tokensAmount);
_balances[msg.sender] = _balances[msg.sender].sub(tokensAmount);
_supply = _supply.sub(tokensAmount);
emit TokenBurned(msg.sender, tokensAmount);
}
/**
* @dev Set the tokenTransfer flag.
* If true,
* - unregistered lockAddress can transfer()
* - registered lockAddress can not transfer()
* If false,
* - registered unlockAddress & unregistered lockAddress
* - can transfer(), unregistered unlockAddress can not transfer()
*/
function setTokenTransfer(bool _tokenTransfer)
external
isAdminMode
isOwner
{
tokenTransfer = _tokenTransfer;
emit SetTokenTransfer(tokenTransfer);
}
function setAdminMode(bool _adminMode)
public
isOwner
{
adminMode = _adminMode;
emit SetAdminMode(adminMode);
}
/**
* @dev In emergency situation,
* admin can use emergencyTransfer() for protecting user's token.
*/
function emergencyTransfer(address emergencyAddress)
public
isAdminMode
isOwner
returns (bool success) {
require(emergencyAddress != owner);
_balances[owner] = _balances[owner].add(_balances[emergencyAddress]);
emit Transfer(emergencyAddress, owner, _balances[emergencyAddress]);
emit EmergencyTransfer(emergencyAddress, owner, _balances[emergencyAddress]);
_balances[emergencyAddress] = 0;
return true;
}
} | contract YeedToken is ERC20, Lockable {
string public constant name = "YGGDRASH";
string public constant symbol = "YEED";
uint8 public constant decimals = 18;
/**
* @dev If this flag is true, admin can use enableTokenTranfer(), emergencyTransfer().
*/
bool public adminMode;
using SafeMath for uint256;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _approvals;
uint256 internal _supply;
event TokenBurned(address burnAddress, uint256 amountOfTokens);
event SetTokenTransfer(bool transfer);
event SetAdminMode(bool adminMode);
event EmergencyTransfer(address indexed from, address indexed to, uint256 value);
modifier isAdminMode {
require(adminMode);
_;
}
constructor(uint256 initial_balance)
public
{
require(initial_balance != 0);
_supply = initial_balance;
_balances[msg.sender] = initial_balance;
emit Transfer(address(0), msg.sender, initial_balance);
}
function totalSupply()
public
view
returns (uint256) {
return _supply;
}
function balanceOf(address who)
public
view
returns (uint256) {
return _balances[who];
}
function transfer(address to, uint256 value)
public
isTokenTransfer
checkLock
returns (bool) {
require(to != address(0));
require(_balances[msg.sender] >= value);
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
function allowance(address owner, address spender)
public
view
returns (uint256) {
return _approvals[owner][spender];
}
function transferFrom(address from, address to, uint256 value)
public
isTokenTransfer
checkLock
returns (bool success) {
require(!lockAddress[from]);
require(_balances[from] >= value);
require(_approvals[from][msg.sender] >= value);
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
_approvals[from][msg.sender] = _approvals[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value)
public
checkLock
returns (bool) {
_approvals[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint256 _addedValue)
public
checkLock
returns (bool) {
_approvals[msg.sender][_spender] = (
_approvals[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, _approvals[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint256 _subtractedValue)
public
checkLock
returns (bool) {
uint256 oldValue = _approvals[msg.sender][_spender];
if (_subtractedValue > oldValue) {
_approvals[msg.sender][_spender] = 0;
} else {
_approvals[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, _approvals[msg.sender][_spender]);
return true;
}
/**
* @dev Burn tokens can only use by owner
*/
function burnTokens(uint256 tokensAmount)
public
isAdminMode
isOwner
{
require(_balances[msg.sender] >= tokensAmount);
_balances[msg.sender] = _balances[msg.sender].sub(tokensAmount);
_supply = _supply.sub(tokensAmount);
emit TokenBurned(msg.sender, tokensAmount);
}
/**
* @dev Set the tokenTransfer flag.
* If true,
* - unregistered lockAddress can transfer()
* - registered lockAddress can not transfer()
* If false,
* - registered unlockAddress & unregistered lockAddress
* - can transfer(), unregistered unlockAddress can not transfer()
*/
function setTokenTransfer(bool _tokenTransfer)
external
isAdminMode
isOwner
{
tokenTransfer = _tokenTransfer;
emit SetTokenTransfer(tokenTransfer);
}
function setAdminMode(bool _adminMode)
public
isOwner
{
adminMode = _adminMode;
emit SetAdminMode(adminMode);
}
/**
* @dev In emergency situation,
* admin can use emergencyTransfer() for protecting user's token.
*/
function emergencyTransfer(address emergencyAddress)
public
isAdminMode
isOwner
returns (bool success) {
require(emergencyAddress != owner);
_balances[owner] = _balances[owner].add(_balances[emergencyAddress]);
emit Transfer(emergencyAddress, owner, _balances[emergencyAddress]);
emit EmergencyTransfer(emergencyAddress, owner, _balances[emergencyAddress]);
_balances[emergencyAddress] = 0;
return true;
}
} | 29,642 |
92 | // _backer {address} address of beneficiary return res {bool} true if transaction was successful | function contribute(address _backer) internal returns (bool res) {
| function contribute(address _backer) internal returns (bool res) {
| 32,491 |
47 | // Total amount of tokens remaining | function tokensRemaining() public view returns (uint256) {
uint256 totalCommitted = totalTokensCommitted();
if (totalCommitted >= totalTokens ) {
return 0;
} else {
return totalTokens.sub(totalCommitted);
}
}
| function tokensRemaining() public view returns (uint256) {
uint256 totalCommitted = totalTokensCommitted();
if (totalCommitted >= totalTokens ) {
return 0;
} else {
return totalTokens.sub(totalCommitted);
}
}
| 8,614 |
28 | // If the _res length is less than 68, then the transaction failed silently (without a revert message) | if (_returnData.length < 68) return "Transaction reverted silently";
assembly {
| if (_returnData.length < 68) return "Transaction reverted silently";
assembly {
| 3,793 |
3 | // Sets the KYC registry requirement group for thisclient to check kyc status for_kycRequirementGroup The new KYC group / | function _setKYCRequirementGroup(uint256 _kycRequirementGroup) internal {
uint256 oldKYCLevel = kycRequirementGroup;
kycRequirementGroup = _kycRequirementGroup;
emit KYCRequirementGroupSet(oldKYCLevel, _kycRequirementGroup);
}
| function _setKYCRequirementGroup(uint256 _kycRequirementGroup) internal {
uint256 oldKYCLevel = kycRequirementGroup;
kycRequirementGroup = _kycRequirementGroup;
emit KYCRequirementGroupSet(oldKYCLevel, _kycRequirementGroup);
}
| 24,732 |
148 | // Pull aTokens from user | _pullAToken(
collateralAsset,
collateralReserveData.aTokenAddress,
msg.sender,
amounts[0],
permitSignature
);
| _pullAToken(
collateralAsset,
collateralReserveData.aTokenAddress,
msg.sender,
amounts[0],
permitSignature
);
| 39,432 |
0 | // Interface for Issuance Escrow.Defines additional methods used by Instrument Manager. / | contract IssuanceEscrowInterface is EscrowBaseInterface {
/**
* @dev Transfers the ownership of ETH in this escrow.
* @param source The account where the tokens are from.
* @param dest The account where the tokens are transferred to.
* @param amount The amount to trasfer.
*/
function transfer(address source, address dest, uint256 amount) public;
/**
* @dev Transfers the ownership of ERC20 tokens in this escrow.
* @param source The account where the ERC20 tokens are from.
* @param dest The account where the ERC20 tokens are transferred to.
* @param token The ERC20 tokens to transfer.
* @param amount The amount to trasfer.
*/
function transferToken(
address source,
address dest,
address token,
uint256 amount
) public;
}
| contract IssuanceEscrowInterface is EscrowBaseInterface {
/**
* @dev Transfers the ownership of ETH in this escrow.
* @param source The account where the tokens are from.
* @param dest The account where the tokens are transferred to.
* @param amount The amount to trasfer.
*/
function transfer(address source, address dest, uint256 amount) public;
/**
* @dev Transfers the ownership of ERC20 tokens in this escrow.
* @param source The account where the ERC20 tokens are from.
* @param dest The account where the ERC20 tokens are transferred to.
* @param token The ERC20 tokens to transfer.
* @param amount The amount to trasfer.
*/
function transferToken(
address source,
address dest,
address token,
uint256 amount
) public;
}
| 22,400 |
7 | // Unregister the address of a Contract contract approved/_contract The address of the Contract contract to be unregistered. | function removeContract(address _contract) external {
_isOwner();
LibAllowList.removeAllowedContract(_contract);
emit ContractRemoved(_contract);
}
| function removeContract(address _contract) external {
_isOwner();
LibAllowList.removeAllowedContract(_contract);
emit ContractRemoved(_contract);
}
| 17,711 |
46 | // MAX_SUPPLY = maximum integer < (sqrt(4TOTAL_GONS + 1) - 1) / 2 | uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1
uint256 private _epoch;
uint256 private _totalSupply;
uint256 private _gonsPerFragment;
mapping(address => uint256) private _gonBalances;
| uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1
uint256 private _epoch;
uint256 private _totalSupply;
uint256 private _gonsPerFragment;
mapping(address => uint256) private _gonBalances;
| 7,198 |
7 | // Sets the receiver of CP Fee Requirements:- the caller must have the `DEFAULT_ADMIN_ROLE`. / | function setCpFeeAddress(address _address) public {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "CarbonPathAdmin: must have admin role");
require(_address != address(0), "CarbonPathAdmin: zero address");
cpFeeAddress = _address;
}
| function setCpFeeAddress(address _address) public {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "CarbonPathAdmin: must have admin role");
require(_address != address(0), "CarbonPathAdmin: zero address");
cpFeeAddress = _address;
}
| 19,535 |
15 | // function _getExtraMultipliers(uint256[5] memory components) internal pure returns (Item memory) | // {
// if (components[3] > 0) {
// return Item(2, 2, 2, 2, 2);
// }
// if (components[2] > 0) {
// return Item(1, 1, 1, 1, 1);
// }
// return Item(0, 0, 0, 0, 0);
// }
| // {
// if (components[3] > 0) {
// return Item(2, 2, 2, 2, 2);
// }
// if (components[2] > 0) {
// return Item(1, 1, 1, 1, 1);
// }
// return Item(0, 0, 0, 0, 0);
// }
| 27,227 |
23 | // Allows to update to new ENS base node. _baseNode The new ENS base node to use. / | function updateBaseNode(bytes32 _baseNode) external onlyOwner {
require(baseNode != _baseNode, "Err: New node should be different");
baseNode = _baseNode;
emit BaseNodeUpdated(baseNode);
}
| function updateBaseNode(bytes32 _baseNode) external onlyOwner {
require(baseNode != _baseNode, "Err: New node should be different");
baseNode = _baseNode;
emit BaseNodeUpdated(baseNode);
}
| 15,117 |
3 | // set a new duration for the TWAP window | function setDuration(uint32 _duration) external;
| function setDuration(uint32 _duration) external;
| 37,868 |
88 | // Allows the Owner to allow or prohibit Signer from calling distributePack()./setPause must be called before Signer can call distributePack() | function setPause(bool _pause) external onlyOwner {
pause = _pause;
}
| function setPause(bool _pause) external onlyOwner {
pause = _pause;
}
| 37,457 |
15 | // Function accepts user`s contributed ether and logs contributioncontributor Contributor wallet address./ | function processContribution(address contributor) external payable;
| function processContribution(address contributor) external payable;
| 80,297 |
3 | // If either the numerator or the denominator are > `maxValue`, re-scale them by `maxValue` to prevent overflows in future operations. | if (numerator > maxValue || denominator > maxValue) {
uint256 rescaleBase = numerator >= denominator ? numerator : denominator;
rescaleBase = rescaleBase.safeDiv(maxValue);
scaledNumerator = numerator.safeDiv(rescaleBase);
scaledDenominator = denominator.safeDiv(rescaleBase);
} else {
| if (numerator > maxValue || denominator > maxValue) {
uint256 rescaleBase = numerator >= denominator ? numerator : denominator;
rescaleBase = rescaleBase.safeDiv(maxValue);
scaledNumerator = numerator.safeDiv(rescaleBase);
scaledDenominator = denominator.safeDiv(rescaleBase);
} else {
| 31,795 |
12 | // Remove an existing contract _contractName Name of the contract that will be removed / | function removeContract(string _contractName) external;
| function removeContract(string _contractName) external;
| 67,798 |
1,642 | // 822 | entry "autolocalized" : ENG_ADJECTIVE
| entry "autolocalized" : ENG_ADJECTIVE
| 17,434 |
1 | // Has the user stake all of their shares/userAddress User address | function stake(address userAddress)
public
override
{
address delegate = delegates[userAddress];
if (delegate == address(0))
{
delegate = userAddress;
}
| function stake(address userAddress)
public
override
{
address delegate = delegates[userAddress];
if (delegate == address(0))
{
delegate = userAddress;
}
| 8,856 |
4 | // owner set etherwow contract address new etherwow address / | function ownerSetEtherwowAddress(address newEtherwowAddress) public
onlyOwner
| function ownerSetEtherwowAddress(address newEtherwowAddress) public
onlyOwner
| 20,980 |
11 | // Copy remaining bytes | unchecked {
uint256 mask = (256 ** (32 - len)) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
| unchecked {
uint256 mask = (256 ** (32 - len)) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
| 5,912 |
46 | // Initializes the contract setting the deployer as the initial owner./ | constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
| constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
| 2,072 |
87 | // check if the transmuter holds more funds than plantableThreshold | uint256 bal = IERC20Burnable(token).balanceOf(address(this));
uint256 marginVal = plantableThreshold.mul(plantableMargin).div(100);
if (bal > plantableThreshold.add(marginVal)) {
uint256 plantAmt = bal - plantableThreshold;
| uint256 bal = IERC20Burnable(token).balanceOf(address(this));
uint256 marginVal = plantableThreshold.mul(plantableMargin).div(100);
if (bal > plantableThreshold.add(marginVal)) {
uint256 plantAmt = bal - plantableThreshold;
| 41,652 |
14 | // Queries the total rewards accrued by a delegation from a specific address to a given validator./delegatorAddress The address of the delegator/validatorAddress The address of the validator/ return rewards The total rewards accrued by a delegation. | function delegationRewards(
address delegatorAddress,
string memory validatorAddress
)
external
view
returns (
DecCoin[] calldata rewards
);
| function delegationRewards(
address delegatorAddress,
string memory validatorAddress
)
external
view
returns (
DecCoin[] calldata rewards
);
| 32,014 |
96 | // Allows the owner to set the multisig contract. _multisigVault the multisig contract address / | function setMultisigVault(address _multisigVault) public onlyOwner {
if (_multisigVault != address(0)) {
multisigVault = _multisigVault;
}
}
| function setMultisigVault(address _multisigVault) public onlyOwner {
if (_multisigVault != address(0)) {
multisigVault = _multisigVault;
}
}
| 50,406 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.